summaryrefslogtreecommitdiff
path: root/protocols/WhatsApp/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2025-05-02 17:22:39 +0300
committerGeorge Hazan <george.hazan@gmail.com>2025-05-02 17:22:39 +0300
commit4b848ca78f303353e07b8b9ee49cfc7797304a5d (patch)
tree5c2270c82e622c63134c13ced0a46fff799e258e /protocols/WhatsApp/src
parent5502d680c3b327630d5d8b5b1b1a37893b9a4a7d (diff)
WhatsApp: prevent protocol from being disconnected if there was a phone call handled by another device
Diffstat (limited to 'protocols/WhatsApp/src')
-rw-r--r--protocols/WhatsApp/src/iq.cpp8
-rw-r--r--protocols/WhatsApp/src/proto.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/protocols/WhatsApp/src/iq.cpp b/protocols/WhatsApp/src/iq.cpp
index 4584bd59de..aa37ad20d9 100644
--- a/protocols/WhatsApp/src/iq.cpp
+++ b/protocols/WhatsApp/src/iq.cpp
@@ -490,6 +490,13 @@ void WhatsAppProto::OnReceiveInfo(const WANode &node)
/////////////////////////////////////////////////////////////////////////////////////////
+void WhatsAppProto::OnReceiveCall(const WANode &node)
+{
+ SendAck(node);
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
void WhatsAppProto::ProcessReceipt(MCONTACT hContact, const char *msgId, bool bRead)
{
MEVENT hEvent = db_event_getById(m_szModuleName, msgId);
@@ -557,6 +564,7 @@ void WhatsAppProto::InitPersistentHandlers()
m_arPersistent.insert(new WAPersistentHandler("ack", 0, 0, 0, &WhatsAppProto::OnReceiveAck));
m_arPersistent.insert(new WAPersistentHandler("ib", 0, 0, 0, &WhatsAppProto::OnReceiveInfo));
+ m_arPersistent.insert(new WAPersistentHandler("call", 0, 0, 0, &WhatsAppProto::OnReceiveCall));
m_arPersistent.insert(new WAPersistentHandler("failure", 0, 0, 0, &WhatsAppProto::OnReceiveFailure));
m_arPersistent.insert(new WAPersistentHandler("message", 0, 0, 0, &WhatsAppProto::OnReceiveMessage));
m_arPersistent.insert(new WAPersistentHandler("receipt", 0, 0, 0, &WhatsAppProto::OnReceiveReceipt));
diff --git a/protocols/WhatsApp/src/proto.h b/protocols/WhatsApp/src/proto.h
index 44b4d6de92..ff2179f84f 100644
--- a/protocols/WhatsApp/src/proto.h
+++ b/protocols/WhatsApp/src/proto.h
@@ -422,6 +422,7 @@ class WhatsAppProto : public PROTO<WhatsAppProto>
void OnNotifyEncrypt(const WANode &node);
void OnNotifyPicture(const WANode &node);
void OnReceiveAck(const WANode &node);
+ void OnReceiveCall(const WANode &node);
void OnReceiveChatState(const WANode &node);
void OnReceiveFailure(const WANode &node);
void OnReceiveInfo(const WANode &node);