Browse Source

ENGINE-139: uses decrypt flags instead of return value for DISCARDED and CONSUMED sync message, thus avoiding undue exceptions

master
Edouard Tisserant 9 years ago
parent
commit
460a69ad59
  1. 7
      src/message_api.cc
  2. 4
      src/pEpmodule.cc

7
src/message_api.cc

@ -51,9 +51,10 @@ namespace pEp {
int rating = (int) _rating;
int flags = (int) _flags;
string sync_status = status == PEP_MESSAGE_CONSUMED ? "MESSAGE_CONSUMED" :
status == PEP_MESSAGE_DISCARDED ? "MESSAGE_DISCARDED" :
"";
string sync_status = flags & PEP_decrypt_flag_discarded ?
"MESSAGE_DISCARDED" :
flags & PEP_decrypt_flag_consumed ?
"MESSAGE_CONSUMED" : "";
Message dst = _dst ? Message(_dst) : Message(src);
return boost::python::make_tuple(dst, keylist, rating, sync_status, flags);

4
src/pEpmodule.cc

@ -32,10 +32,6 @@ namespace pEp {
return;
if (status >= 0x400 && status <= 0x4ff)
return;
if (status == PEP_MESSAGE_CONSUMED)
return;
if (status == PEP_MESSAGE_DISCARDED)
return;
if (status == PEP_OUT_OF_MEMORY)
throw bad_alloc();
if (status == PEP_ILLEGAL_VALUE)

Loading…
Cancel
Save