Browse Source

JSON-135: Add mime_encode_message() and mime_decode_message() to the JSON API. Bump server version to 0.18.2

JSON-134
Roker 2 years ago
parent
commit
0406240de9
3 changed files with 22 additions and 1 deletions
  1. +6
    -0
      server/ev_server.cc
  2. +14
    -0
      server/pEp-types.cc
  3. +2
    -1
      server/server_version.cc

+ 6
- 0
server/ev_server.cc View File

@ -91,6 +91,12 @@ const FunctionMap functions = {
FP( "identity_rating" , new Func<PEP_STATUS, In_Pep_Session, In<pEp_identity*>, Out<PEP_rating>>( &identity_rating) ),
FP( "get_key_rating_for_user", new Func<PEP_STATUS, In_Pep_Session, In<c_string>, In<c_string>, Out<PEP_rating>>( &get_key_rating_for_user) ),
// from mime.h
FP( "MIME handling API", new Separator),
FP( "mime_encode_message", new Func<PEP_STATUS, In<const message*>, In<bool>, Out<char*>>( &mime_encode_message )),
FP( "mime_decode_message", new Func<PEP_STATUS, In<c_string>, InLength<>, Out<message*>> ( &mime_decode_message )),
// from pEpEngine.h
FP( "pEp Engine Core API", new Separator),
// FP( "log_event", new Func<PEP_STATUS, In_Pep_Session, In<c_string>, In<c_string>, In<c_string>, In<c_string>>( &log_event) ),
FP( "get_trustwords", new Func<PEP_STATUS, In_Pep_Session, In<const pEp_identity*>, In<const pEp_identity*>, In<Language>, Out<char*>, Out<size_t>, In<bool>>( &get_trustwords) ),


+ 14
- 0
server/pEp-types.cc View File

@ -55,6 +55,12 @@ In<message*>::~In()
free_message(value);
}
template<>
In<const message*>::~In()
{
free_message(const_cast<message*>(value));
}
template<>
In<stringlist_t*, ParamFlag::Default>::~In()
{
@ -230,6 +236,12 @@ message* from_json<message*>(const js::Value& v)
return msg.release();
}
template<>
const message* from_json<const message*>(const js::Value& v)
{
return const_cast<const message*>( from_json<message*>(v) );
}
template<>
pEp_identity* from_json<pEp_identity*>(const js::Value& v)
@ -711,6 +723,8 @@ js::Value Type2String<PEP_SESSION>::get() { return "Session"; }
template<>
js::Value Type2String<_message*>::get() { return "Message"; }
template<>
js::Value Type2String<const _message*>::get() { return "Message"; }
template<>
js::Value Type2String<const timestamp*>::get() { return "Timestamp"; }


+ 2
- 1
server/server_version.cc View File

@ -96,7 +96,8 @@ const ServerVersion& server_version()
//static const ServerVersion sv(0,16,1); // JSON-120: add support for key_reset_identity(), key_reset_user(), and key_reset_all_own_keys()
//static const ServerVersion sv(0,17,0); // kick out getGpgEnvironment(). It was Enigmail-only (JSON-18) and breaks architecture. Kick-out hotfixer un-feature.
//static const ServerVersion sv(0,18,0); // JSON-127: 'src' in encrypt_message() is InOut.
static const ServerVersion sv(0,18,1); // JSON-130: some data members in pEp_identity added
//static const ServerVersion sv(0,18,1); // JSON-130: some data members in pEp_identity added
static const ServerVersion sv(0,18,2); // JSON-135: Add mime_encode_message() and mime_decode_message() to the JSON API
return sv;
}


Loading…
Cancel
Save