summaryrefslogtreecommitdiff
path: root/protocols/WhatsApp/src/chat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/WhatsApp/src/chat.cpp')
-rw-r--r--protocols/WhatsApp/src/chat.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/protocols/WhatsApp/src/chat.cpp b/protocols/WhatsApp/src/chat.cpp
index 16a3da88e3..8c5d83c7bb 100644
--- a/protocols/WhatsApp/src/chat.cpp
+++ b/protocols/WhatsApp/src/chat.cpp
@@ -261,6 +261,20 @@ void WhatsAppProto::KickChatUser(WAChatInfo *pInfo, const TCHAR *ptszJid)
}
/////////////////////////////////////////////////////////////////////////////////////////
+// Leave groupchat emulator for contact's deletion
+
+int WhatsAppProto::OnDeleteChat(WPARAM hContact, LPARAM lParam)
+{
+ if (isChatRoom(hContact) && isOnline()) {
+ ptrT tszID(getTStringA(hContact, WHATSAPP_KEY_ID));
+ if (tszID)
+ m_pConnection->sendJoinLeaveGroup(_T2A(tszID), false);
+ }
+
+ return 0;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
// handler to customize chat menus
int WhatsAppProto::OnChatMenu(WPARAM wParam, LPARAM lParam)