summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-11-20 20:05:04 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-11-20 20:05:04 +0300
commit0808c12185e6f6ce6ed366f57888d2cd4d55d5ab (patch)
treec14771b00159a352900c099733f892253496f763
parent6515f53752df7b3f754879ff6c7dc1e224185587 (diff)
we shall send ack even if a message is already processed
-rw-r--r--protocols/WhatsApp/src/message.cpp9
1 files 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));