fixing bug when message unencrypted sync
authorVolker Birk <vb@pep.foundation>
Tue, 30 Oct 2018 13:58:30 +0100
branchsync
changeset 3113ca28ce71717b
parent 3109 ebacf4a1cfd7
child 3114 1c6a65b92334
fixing bug when message unencrypted
src/message_api.c
     1.1 --- a/src/message_api.c	Fri Oct 26 11:35:07 2018 +0200
     1.2 +++ b/src/message_api.c	Tue Oct 30 13:58:30 2018 +0100
     1.3 @@ -3715,8 +3715,10 @@
     1.4  {
     1.5      PEP_STATUS status = _decrypt_message(session, src, dst, keylist, rating, flags, NULL);
     1.6  
     1.7 -    if (session->inject_sync_event && *dst && (*dst)->attachments) {
     1.8 -        for (bloblist_t *bl = (*dst)->attachments; bl ; bl = bl->next) {
     1.9 +    message *msg = *dst ? *dst : src;
    1.10 +
    1.11 +    if (session->inject_sync_event && msg && msg->attachments) {
    1.12 +        for (bloblist_t *bl = msg->attachments; bl ; bl = bl->next) {
    1.13              if (bl->mime_type && strcasecmp(bl->mime_type, "application/pEp.sync") == 0)
    1.14                  signal_Sync_message(session, *rating, bl->value, bl->size);
    1.15          }