diff options
Diffstat (limited to 'protocols/WhatsApp/src/appsync.cpp')
-rw-r--r-- | protocols/WhatsApp/src/appsync.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/protocols/WhatsApp/src/appsync.cpp b/protocols/WhatsApp/src/appsync.cpp index 8ab4416fc3..f976c580b6 100644 --- a/protocols/WhatsApp/src/appsync.cpp +++ b/protocols/WhatsApp/src/appsync.cpp @@ -273,6 +273,16 @@ void WhatsAppProto::ProcessHistorySync(const Wa__HistorySync *pSync) CMStringA szMessageText(GetMessageText(pMessage->message->message)); if (!szMessageText.IsEmpty()) { auto *key = pMessage->message->key; + + PROTORECVEVENT pre = {}; + pre.timestamp = pMessage->message->messagetimestamp; + pre.szMessage = szMessageText.GetBuffer(); + pre.szMsgId = key->id; + pre.flags = PREF_CREATEREAD; + if (key->fromme) + pre.flags |= PREF_SENT; + ProtoChainRecvMsg(pUser->hContact, &pre); + if (pUser->bIsGroupChat) { GCEVENT gce = {m_szModuleName, 0, GC_EVENT_MESSAGE}; gce.dwFlags = GCEF_UTF8; @@ -283,16 +293,6 @@ void WhatsAppProto::ProcessHistorySync(const Wa__HistorySync *pSync) gce.time = pMessage->message->messagetimestamp; Chat_Event(&gce); } - else { - PROTORECVEVENT pre = {}; - pre.timestamp = pMessage->message->messagetimestamp; - pre.szMessage = szMessageText.GetBuffer(); - pre.szMsgId = key->id; - pre.flags = PREF_CREATEREAD; - if (key->fromme) - pre.flags |= PREF_SENT; - ProtoChainRecvMsg(pUser->hContact, &pre); - } } } } |