summaryrefslogtreecommitdiff
path: root/protocols/WhatsAppWeb
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-04-22 20:01:09 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-04-22 20:01:09 +0300
commit72656f183105508a65d952e8960bd2c2971ca1d5 (patch)
treedf463c75b6bd57bce0335be27cb4a8eaacd9d641 /protocols/WhatsAppWeb
parent9720e70692d2130ee7f4eddf3fecdd9ce07c2e67 (diff)
WhatsApp:
- fix for duplicate group chat contacts; - fix for dropping contact on exit
Diffstat (limited to 'protocols/WhatsAppWeb')
-rw-r--r--protocols/WhatsAppWeb/src/proto.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/protocols/WhatsAppWeb/src/proto.cpp b/protocols/WhatsAppWeb/src/proto.cpp
index 52d959fcf7..73fc4dc921 100644
--- a/protocols/WhatsAppWeb/src/proto.cpp
+++ b/protocols/WhatsAppWeb/src/proto.cpp
@@ -96,7 +96,7 @@ void WhatsAppProto::OnModulesLoaded()
{
// initialize contacts cache
for (auto &cc : AccContacts()) {
- CMStringA szId(getMStringA(cc, DBKEY_ID));
+ CMStringA szId(getMStringA(cc, isChatRoom(cc) ? "ChatRoomID" : DBKEY_ID));
if (!szId.IsEmpty())
m_arUsers.insert(new WAUser(cc, szId));
}
@@ -161,6 +161,9 @@ int WhatsAppProto::SetStatus(int new_status)
}
if (m_iDesiredStatus == ID_STATUS_OFFLINE) {
+ if (m_hServerConn != nullptr)
+ Netlib_Shutdown(m_hServerConn);
+
m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE;
ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus);
}