summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--protocols/WhatsApp/src/chat.cpp14
-rw-r--r--protocols/WhatsApp/src/proto.cpp1
-rw-r--r--protocols/WhatsApp/src/proto.h1
-rw-r--r--protocols/WhatsApp/src/version.h2
4 files changed, 17 insertions, 1 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)
diff --git a/protocols/WhatsApp/src/proto.cpp b/protocols/WhatsApp/src/proto.cpp
index b09c81fc68..aa09bbac80 100644
--- a/protocols/WhatsApp/src/proto.cpp
+++ b/protocols/WhatsApp/src/proto.cpp
@@ -28,6 +28,7 @@ WhatsAppProto::WhatsAppProto(const char* proto_name, const TCHAR* username) :
CreateProtoService(PS_GETMYAVATART, &WhatsAppProto::GetMyAvatar);
CreateProtoService(PS_SETMYAVATART, &WhatsAppProto::SetMyAvatar);
+ HookProtoEvent(ME_DB_CONTACT_DELETED, &WhatsAppProto::OnDeleteChat);
HookProtoEvent(ME_OPT_INITIALISE, &WhatsAppProto::OnOptionsInit);
HookProtoEvent(ME_CLIST_PREBUILDSTATUSMENU, &WhatsAppProto::OnBuildStatusMenu);
diff --git a/protocols/WhatsApp/src/proto.h b/protocols/WhatsApp/src/proto.h
index 4c1b936840..224527e800 100644
--- a/protocols/WhatsApp/src/proto.h
+++ b/protocols/WhatsApp/src/proto.h
@@ -136,6 +136,7 @@ public:
WAChatInfo* SafeGetChat(const std::string &jid);
int __cdecl onGroupChatEvent(WPARAM, LPARAM);
+ int __cdecl OnDeleteChat(WPARAM, LPARAM);
int __cdecl OnChatMenu(WPARAM, LPARAM);
INT_PTR __cdecl OnCreateGroup(WPARAM, LPARAM);
diff --git a/protocols/WhatsApp/src/version.h b/protocols/WhatsApp/src/version.h
index 3475fe9955..0e30475e31 100644
--- a/protocols/WhatsApp/src/version.h
+++ b/protocols/WhatsApp/src/version.h
@@ -1,7 +1,7 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 1
#define __RELEASE_NUM 2
-#define __BUILD_NUM 8
+#define __BUILD_NUM 9
#include <stdver.h>