Browse Source

new server version 0.16.0: kick-out Enigmail 2.0 compat, remove MIME_*() functions, deliverHandshakeResult() changes parameter types.

JSON-107-01
Roker 3 years ago
parent
commit
32482cfb62
3 changed files with 18 additions and 28 deletions
  1. +3
    -20
      server/ev_server.cc
  2. +13
    -0
      server/pep-types.cc
  3. +2
    -8
      server/server_version.cc

+ 3
- 20
server/ev_server.cc View File

@ -75,38 +75,21 @@ using In_Pep_Session = In<PEP_SESSION, ParamFlag::NoInput>;
// these are the pEp functions that are callable by the client
const FunctionMap functions = {
// from message_api.h
FP( "Message API", new Separator ),
FP( "MIME_encrypt_message", new Func<PEP_STATUS, In_Pep_Session, In<c_string>, InLength<>, In<stringlist_t*>,
Out<char*>, In<PEP_enc_format>, In<PEP_encrypt_flags_t>>( &MIME_encrypt_message ) ),
FP( "MIME_encrypt_message_for_self", new Func<PEP_STATUS, In_Pep_Session,
In<pEp_identity*>, In<c_string>, InLength<>, In<stringlist_t*>,
Out<char*>, In<PEP_enc_format>, In<PEP_encrypt_flags_t>>( &MIME_encrypt_message_for_self ) ),
#ifdef ENIGMAIL_2_0_COMPAT
FP( "MIME_decrypt_message", new Func<PEP_STATUS, In_Pep_Session, In<c_string>, InLength<>,
Out<char*>, Out<stringlist_t*>, Out<PEP_rating>, Out<PEP_decrypt_flags_t>>( &MIME_decrypt_message_20 ) ),
#else
FP( "MIME_decrypt_message", new Func<PEP_STATUS, In_Pep_Session, In<c_string>, InLength<>,
Out<char*>, InOutP<stringlist_t*>, Out<PEP_rating>, InOutP<PEP_decrypt_flags_t>, Out<c_string>>( &MIME_decrypt_message ) ),
#endif
FP( "startKeySync", new Func<void, In<JsonAdapter*,ParamFlag::NoInput>>( &JsonAdapter::startSync) ),
FP( "stopKeySync", new Func<void, In<JsonAdapter*,ParamFlag::NoInput>>( &JsonAdapter::stopSync ) ),
FP( "startKeyserverLookup", new Func<void>( &JsonAdapter::startKeyserverLookup) ),
FP( "stopKeyserverLookup", new Func<void>( &JsonAdapter::stopKeyserverLookup ) ),
// from message_api.h
FP( "Message API", new Separator ),
FP( "encrypt_message", new Func<PEP_STATUS, In_Pep_Session, In<message*>, In<stringlist_t*>, Out<message*>, In<PEP_enc_format>, In<PEP_encrypt_flags_t>>( &encrypt_message ) ),
FP( "encrypt_message_and_add_priv_key", new Func<PEP_STATUS, In_Pep_Session,
In<message*>, Out<message*>, In<c_string>, In<PEP_enc_format>, In<PEP_encrypt_flags_t>>( &encrypt_message_and_add_priv_key) ),
FP( "encrypt_message_for_self", new Func<PEP_STATUS, In_Pep_Session,
In<pEp_identity*>, In<message*>, In<stringlist_t*>, Out<message*>, In<PEP_enc_format>, In<PEP_encrypt_flags_t>>( &encrypt_message_for_self ) ),
#ifdef ENIGMAIL_2_0_COMPAT
FP( "decrypt_message", new Func<PEP_STATUS, In_Pep_Session, In<message*>, Out<message*>, Out<stringlist_t*>, Out<PEP_rating>, Out<PEP_decrypt_flags_t>>( &decrypt_message ) ),
#else
FP( "decrypt_message", new Func<PEP_STATUS, In_Pep_Session, InOut<message*>, Out<message*>, InOutP<stringlist_t*>, Out<PEP_rating>, InOutP<PEP_decrypt_flags_t>>( &decrypt_message ) ),
#endif
FP( "outgoing_message_rating", new Func<PEP_STATUS, In_Pep_Session, In<message*>, Out<PEP_rating>>( &outgoing_message_rating ) ),
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) ),
@ -168,7 +151,7 @@ const FunctionMap functions = {
FP( "Event Listener & Results", new Separator ),
FP( "registerEventListener" , new Func<void, In<JsonAdapter*,ParamFlag::NoInput>, In<std::string>, In<unsigned>, In<std::string>> ( &JsonAdapter::registerEventListener) ),
FP( "unregisterEventListener", new Func<void, In<JsonAdapter*,ParamFlag::NoInput>, In<std::string>, In<unsigned>, In<std::string>> ( &JsonAdapter::unregisterEventListener) ),
FP( "deliverHandshakeResult" , new Func<PEP_STATUS, In_Pep_Session, In<pEp_identity*>, In<sync_handshake_result>> (&deliverHandshakeResult) ),
FP( "deliverHandshakeResult" , new Func<PEP_STATUS, In_Pep_Session, In<sync_handshake_result>, In<const identity_list*> > (&deliverHandshakeResult) ),
// my own example function that does something useful. :-)
FP( "Other", new Separator ),


+ 13
- 0
server/pep-types.cc View File

@ -89,6 +89,12 @@ Out<identity_list*>::~Out()
free_identity_list(value);
}
template<>
In<const identity_list*>::~In()
{
free_identity_list(const_cast<identity_list*>(value));
}
template<>
In<PEP_enc_format>::~In()
@ -357,6 +363,11 @@ identity_list* from_json<identity_list*>(const js::Value& v)
return il.release();
}
template<>
const identity_list* from_json<const identity_list*>(const js::Value& v)
{
return from_json<identity_list*>(v);
}
template<>
_bloblist_t* from_json<_bloblist_t*>(const js::Value& v)
@ -681,6 +692,8 @@ js::Value Type2String<const pEp_identity*>::get() { return "Identity"; }
template<>
js::Value Type2String<identity_list*>::get() { return "IdentityList"; }
template<>
js::Value Type2String<const identity_list*>::get() { return "IdentityList"; }
template<>
js::Value Type2String<_stringlist_t*>::get() { return "StringList"; }


+ 2
- 8
server/server_version.cc View File

@ -87,17 +87,11 @@ const ServerVersion& server_version()
//const ServerVersion sv(0,15,0); // JSON-92: API CHANGE.
//const ServerVersion sv(0,15,1); // JSON-92 again: Change "keylist" in (MIME_)decrypt_message() from Out to InOutP. Is a compatible API change for JSON/JavaScript due to the handling of output parameters. :-)
#ifdef ENIGMAIL_2_0_COMPAT
//const ServerVersion sv(0,14,1); // JSON-97 : make MIME_decrypt_message() API-compatible with pre-JSON-92's changes for Enigmail 2.0
//static const ServerVersion sv(0,14,3); // JSON-110: add encrypt_message_and_add_priv_key()
//static const ServerVersion sv(0,14,4); // JSON-117: add trust_own_key()
static const ServerVersion sv(0,14,5); // JSON-119: add get_key_rating_for_user()
#else
//const ServerVersion sv(0,15,2); // JSON-93 InLength<> is a compatible API change, because length parameter is still there but ignored. :-)
//static const ServerVersion sv(0,15,3); // JSON-110: add encrypt_message_and_add_priv_key()
//static const ServerVersion sv(0,15,4); // JSON-117: add trust_own_key()
static const ServerVersion sv(0,15,5); // JSON-119: add get_key_rating_for_user()
#endif // ENIGMAIL_2_0_COMPAT
//static const ServerVersion sv(0,15,5); // JSON-119: add get_key_rating_for_user()
static const ServerVersion sv(0,16,0); // Kick-out Enigmail 2.0 compat, remove MIME_*() methods, deliverHandshakeResult() changes parameter types
return sv;
}


Loading…
Cancel
Save