From dbb1f345ffde5dd13046fbfc5b2fa7643029a5c8 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 1 Oct 2022 16:38:49 +0300 Subject: unneeded code removed --- protocols/WhatsAppWeb/src/proto.h | 1 - protocols/WhatsAppWeb/src/server.cpp | 24 ++++++------------------ 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/protocols/WhatsAppWeb/src/proto.h b/protocols/WhatsAppWeb/src/proto.h index 80ce03dba7..72ac5bede9 100644 --- a/protocols/WhatsAppWeb/src/proto.h +++ b/protocols/WhatsAppWeb/src/proto.h @@ -213,7 +213,6 @@ class WhatsAppProto : public PROTO // binary packets void ProcessBinaryPacket(const void *pData, size_t cbLen); - void ProcessBinaryNode(const WANode &node); /// Avatars //////////////////////////////////////////////////////////////////////////// CMStringW GetAvatarFileName(MCONTACT hContact); diff --git a/protocols/WhatsAppWeb/src/server.cpp b/protocols/WhatsAppWeb/src/server.cpp index 7be1f40713..3dedd162fb 100644 --- a/protocols/WhatsAppWeb/src/server.cpp +++ b/protocols/WhatsAppWeb/src/server.cpp @@ -205,7 +205,12 @@ void WhatsAppProto::ProcessBinaryPacket(const void *pData, size_t cbDataLen) pNode->print(szText); debugLogA("Got binary node:\n%s", szText.c_str()); - ProcessBinaryNode(*pNode); + auto pHandler = FindPersistentHandler(*pNode); + if (pHandler) + (this->*pHandler)(*pNode); + else + debugLogA("cannot handle incoming message"); + delete pNode; } else { @@ -220,23 +225,6 @@ void WhatsAppProto::ProcessBinaryPacket(const void *pData, size_t cbDataLen) } } -void WhatsAppProto::ProcessBinaryNode(const WANode &node) -{ - if (m_arPacketQueue.getCount()) { - WARequest req = m_arPacketQueue[0]; - m_arPacketQueue.remove(0); - - (this->*req.pHandler)(node); - return; - } - - auto pHandler = FindPersistentHandler(node); - if (pHandler) - (this->*pHandler)(node); - else - debugLogA("cannot handle incoming message"); -} - ///////////////////////////////////////////////////////////////////////////////////////// void WhatsAppProto::OnLoggedIn() -- cgit v1.2.3