From b7718450b0856447bb7098f73d674fbd54c16e2d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 9 Feb 2023 18:22:05 +0300 Subject: database support for new protocols --- protocols/WhatsApp/src/appsync.cpp | 15 ++------------- protocols/WhatsApp/src/message.cpp | 12 ++---------- 2 files changed, 4 insertions(+), 23 deletions(-) (limited to 'protocols/WhatsApp') diff --git a/protocols/WhatsApp/src/appsync.cpp b/protocols/WhatsApp/src/appsync.cpp index 3d812be370..cc9b4c03c6 100644 --- a/protocols/WhatsApp/src/appsync.cpp +++ b/protocols/WhatsApp/src/appsync.cpp @@ -281,20 +281,9 @@ void WhatsAppProto::ProcessHistorySync(const Wa__HistorySync *pSync) pre.flags = PREF_CREATEREAD; if (key->fromme) pre.flags |= PREF_SENT; + if (pUser->bIsGroupChat) + pre.szUserId = key->participant; ProtoChainRecvMsg(pUser->hContact, &pre); - - if (pUser->bIsGroupChat) { - if (pChat->name) - setUString(pUser->hContact, "Nick", pChat->name); - - GCEVENT gce = { pUser->si, GC_EVENT_MESSAGE }; - gce.dwFlags = GCEF_UTF8; - gce.pszUID.a = key->participant; - gce.bIsMe = key->fromme; - gce.pszText.a = szMessageText.GetBuffer(); - gce.time = pMessage->message->messagetimestamp; - Chat_Event(&gce); - } } } } diff --git a/protocols/WhatsApp/src/message.cpp b/protocols/WhatsApp/src/message.cpp index c0efdd3ea1..93420d8f33 100644 --- a/protocols/WhatsApp/src/message.cpp +++ b/protocols/WhatsApp/src/message.cpp @@ -220,17 +220,9 @@ void WhatsAppProto::ProcessMessage(WAMSG type, const Wa__WebMessageInfo &msg) pre.flags |= PREF_CREATEREAD; if (key->fromme) pre.flags |= PREF_SENT; + if (pUser->bIsGroupChat) + pre.szUserId = participant; ProtoChainRecvMsg(pUser->hContact, &pre); - - if (pUser->bIsGroupChat) { - GCEVENT gce = { pUser->si, GC_EVENT_MESSAGE }; - gce.dwFlags = GCEF_UTF8; - gce.pszUID.a = participant; - gce.bIsMe = key->fromme; - gce.pszText.a = szMessageText.GetBuffer(); - gce.time = timestamp; - Chat_Event(&gce); - } } // translate statuses into status messages else if (type.bOtherStatus || type.bDirectStatus || type.bPeerBroadcast || type.bOtherBroadcast) { -- cgit v1.2.3