From 0808c12185e6f6ce6ed366f57888d2cd4d55d5ab Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 20 Nov 2022 20:05:04 +0300 Subject: we shall send ack even if a message is already processed --- protocols/WhatsApp/src/message.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/protocols/WhatsApp/src/message.cpp b/protocols/WhatsApp/src/message.cpp index eb221e9700..41b5cf92a6 100644 --- a/protocols/WhatsApp/src/message.cpp +++ b/protocols/WhatsApp/src/message.cpp @@ -21,14 +21,14 @@ void WhatsAppProto::OnReceiveMessage(const WANode &node) return; } + SendAck(node); + MEVENT hEvent = db_event_getById(m_szModuleName, msgId); if (hEvent) { debugLogA("this message is already processed: %s", msgId); return; } - SendAck(node); - WAMSG type; WAJid jid(msgFrom); CMStringA szAuthor, szChatId; @@ -367,8 +367,11 @@ int WhatsAppProto::SendTextMessage(const char *jid, const char *pszMsg) auto *pTask = new WASendTask(jid); // basic message + Wa__Message__ExtendedTextMessage extMessage; + extMessage.text = (char *)pszMsg; + Wa__Message body; - body.conversation = (char*)pszMsg; + body.extendedtextmessage = &extMessage; if (toJid.isGroup()) { MBinBuffer encodedMsg(proto::Serialize(&body)); -- cgit v1.2.3