summaryrefslogtreecommitdiff
path: root/protocols/WhatsApp/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-02-01 08:49:11 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-02-01 08:49:11 +0000
commite1b171840899382e773c89b21e0510e9eddd95b0 (patch)
treec6775a84b90d41b8f8ac19b662d28eb65d484dd3 /protocols/WhatsApp/src
parent5d99a5875b9968bc684ec1c051372296d3fadec2 (diff)
same fix for WhatsAppProto - not to create main menu copies
git-svn-id: http://svn.miranda-ng.org/main/trunk@16205 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/WhatsApp/src')
-rw-r--r--protocols/WhatsApp/src/proto.cpp8
-rw-r--r--protocols/WhatsApp/src/proto.h1
-rw-r--r--protocols/WhatsApp/src/theme.cpp7
-rw-r--r--protocols/WhatsApp/src/version.h2
4 files changed, 15 insertions, 3 deletions
diff --git a/protocols/WhatsApp/src/proto.cpp b/protocols/WhatsApp/src/proto.cpp
index b4cb2bf683..75ff99c887 100644
--- a/protocols/WhatsApp/src/proto.cpp
+++ b/protocols/WhatsApp/src/proto.cpp
@@ -67,7 +67,12 @@ WhatsAppProto::~WhatsAppProto()
int WhatsAppProto::OnEvent(PROTOEVENTTYPE evType, WPARAM wParam, LPARAM lParam)
{
- if (evType == EV_PROTO_ONLOAD) {
+ switch (evType) {
+ case EV_PROTO_ONMENU:
+ InitMenu();
+ break;
+
+ case EV_PROTO_ONLOAD:
// Register group chat
GCREGISTER gcr = { sizeof(gcr) };
gcr.dwFlags = GC_TYPNOTIF | GC_CHANMGR;
@@ -78,6 +83,7 @@ int WhatsAppProto::OnEvent(PROTOEVENTTYPE evType, WPARAM wParam, LPARAM lParam)
HookProtoEvent(ME_GC_EVENT, &WhatsAppProto::onGroupChatEvent);
HookProtoEvent(ME_GC_BUILDMENU, &WhatsAppProto::OnChatMenu);
HookProtoEvent(ME_USERINFO_INITIALISE, &WhatsAppProto::OnUserInfo);
+ break;
}
return TRUE;
}
diff --git a/protocols/WhatsApp/src/proto.h b/protocols/WhatsApp/src/proto.h
index 83c2824ae6..8abf895347 100644
--- a/protocols/WhatsApp/src/proto.h
+++ b/protocols/WhatsApp/src/proto.h
@@ -143,6 +143,7 @@ private:
// Private data //////////////////////////////////////////////////////////////////////
+ void InitMenu();
HGENMENU m_hMenuCreateGroup;
HANDLE update_loop_lock_;
diff --git a/protocols/WhatsApp/src/theme.cpp b/protocols/WhatsApp/src/theme.cpp
index d3a2cbd434..9f743c4362 100644
--- a/protocols/WhatsApp/src/theme.cpp
+++ b/protocols/WhatsApp/src/theme.cpp
@@ -45,7 +45,7 @@ static WhatsAppProto* GetInstanceByHContact(MCONTACT hContact)
return 0;
}
-int WhatsAppProto::OnBuildStatusMenu(WPARAM wParam, LPARAM lParam)
+void WhatsAppProto::InitMenu()
{
CMenuItem mi;
mi.flags = (isOnline() ? 0 : CMIF_GRAYED);
@@ -57,6 +57,11 @@ int WhatsAppProto::OnBuildStatusMenu(WPARAM wParam, LPARAM lParam)
mi.name.a = LPGEN("Create group");
mi.hIcolibItem = GetIconHandle("createGroup");
m_hMenuCreateGroup = Menu_AddProtoMenuItem(&mi, m_szModuleName);
+}
+
+int WhatsAppProto::OnBuildStatusMenu(WPARAM wParam, LPARAM lParam)
+{
+ ToggleStatusMenuItems(isOnline());
return 0;
}
diff --git a/protocols/WhatsApp/src/version.h b/protocols/WhatsApp/src/version.h
index 44f541c457..23e35487a7 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 3
-#define __BUILD_NUM 2
+#define __BUILD_NUM 3
#include <stdver.h>