IOSAD-103 merge in sync IOSAD-103
authorDirk Zimmermann <dirk@pep-project.org>
Tue, 30 Oct 2018 14:56:17 +0100
branchIOSAD-103
changeset 311651bd81c53007
parent 3110 15c4e7f303dd
parent 3115 81a666c4a59f
child 3119 f4d996c27258
IOSAD-103 merge in sync
     1.1 --- a/build-windows/generate_code.cmd	Mon Oct 29 11:16:46 2018 +0100
     1.2 +++ b/build-windows/generate_code.cmd	Tue Oct 30 14:56:17 2018 +0100
     1.3 @@ -1,6 +1,8 @@
     1.4  pushd .
     1.5  cd %1\sync
     1.6  
     1.7 +if not exist generated mkdir generated
     1.8 +
     1.9  python "%YML_PATH%\yml2proc" -E utf-8 -y gen_actions.ysl2 sync.fsm
    1.10  python "%YML_PATH%\yml2proc" -E utf-8 -y gen_statemachine.ysl2 sync.fsm
    1.11  python "%YML_PATH%\yml2proc" -E utf-8 -y gen_codec.ysl2 sync.fsm
     2.1 --- a/src/message_api.c	Mon Oct 29 11:16:46 2018 +0100
     2.2 +++ b/src/message_api.c	Tue Oct 30 14:56:17 2018 +0100
     2.3 @@ -3713,10 +3713,22 @@
     2.4          PEP_decrypt_flags_t *flags
     2.5      )
     2.6  {
     2.7 +    assert(session);
     2.8 +    assert(src);
     2.9 +    assert(dst);
    2.10 +    assert(keylist);
    2.11 +    assert(rating);
    2.12 +    assert(flags);
    2.13 +
    2.14 +    if (!(session && src && dst && keylist && rating && flags))
    2.15 +        return PEP_ILLEGAL_VALUE;
    2.16 +
    2.17      PEP_STATUS status = _decrypt_message(session, src, dst, keylist, rating, flags, NULL);
    2.18  
    2.19 -    if (session->inject_sync_event && *dst && (*dst)->attachments) {
    2.20 -        for (bloblist_t *bl = (*dst)->attachments; bl ; bl = bl->next) {
    2.21 +    message *msg = *dst ? *dst : src;
    2.22 +
    2.23 +    if (session->inject_sync_event && msg && msg->attachments) {
    2.24 +        for (bloblist_t *bl = msg->attachments; bl ; bl = bl->next) {
    2.25              if (bl->mime_type && strcasecmp(bl->mime_type, "application/pEp.sync") == 0)
    2.26                  signal_Sync_message(session, *rating, bl->value, bl->size);
    2.27          }