diff --git a/src/basic_api.cc b/src/basic_api.cc index f41bbcc..527f256 100644 --- a/src/basic_api.cc +++ b/src/basic_api.cc @@ -26,10 +26,9 @@ namespace pEp { throw invalid_argument("address needed"); if (ident.username() == "") throw invalid_argument("username needed"); - if (!(ident.user_id() == "" || ident.user_id() == PEP_OWN_USERID)) - throw invalid_argument("user_id must be empty or '" PEP_OWN_USERID "'"); - ident.user_id(PEP_OWN_USERID); + if (ident.user_id() == "") + ident.user_id(ident.address()); PEP_STATUS status = myself(adapter.session(), ident); _throw_status(status); diff --git a/src/message_api.cc b/src/message_api.cc index c88bd63..f49ec7d 100644 --- a/src/message_api.cc +++ b/src/message_api.cc @@ -2,6 +2,7 @@ // see LICENSE.txt #include "message_api.hh" +#include "basic_api.hh" #include #include #include @@ -18,6 +19,9 @@ namespace pEp { if (_from.username() == "") throw invalid_argument("encrypt_message: src.from_.username empty"); + if (_from.user_id() == "") + src.from().user_id(_from.address()); + stringlist_t *_extra = to_stringlist(extra); PEP_enc_format _enc_format = (PEP_enc_format) enc_format; PEP_encrypt_flags_t _flags = (PEP_encrypt_flags_t) flags; @@ -55,13 +59,9 @@ namespace pEp { int rating = (int) _rating; int flags = (int) _flags; - string sync_status = flags & PEP_decrypt_flag_ignore ? - "MESSAGE_IGNORE" : - flags & PEP_decrypt_flag_consume ? - "MESSAGE_CONSUME" : ""; Message dst = _dst ? Message(_dst) : Message(src); - return boost::python::make_tuple(dst, keylist, rating, sync_status, flags); + return boost::python::make_tuple(dst, keylist, rating, flags); } int _color(int rating) diff --git a/src/pEpmodule.cc b/src/pEpmodule.cc index a5b45a2..b4d755c 100644 --- a/src/pEpmodule.cc +++ b/src/pEpmodule.cc @@ -258,8 +258,7 @@ BOOST_PYTHON_MODULE(pEp) " msg the decrypted p≡p message\n" " keys a list of keys being used\n" " rating the rating of the message as integer\n" - " consumed boolean denoting message is consumed by sync\n" - " flags flags set while decryption (reserved)\n" + " flags flags set while decryption\n" ) .add_property("outgoing_rating", &Message::outgoing_rating, "rating outgoing message will have") .add_property("outgoing_color", &Message::outgoing_color, "color outgoing message will have")