diff options
author | George Hazan <george.hazan@gmail.com> | 2013-04-05 16:54:27 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-04-05 16:54:27 +0000 |
commit | b665a90f50f09435aef5bc3b5b9da710e4558690 (patch) | |
tree | 3053606dcddc1b15f73e7af1fb2507afbf20f052 /plugins/TabSRMM/src/mim.cpp | |
parent | 6c01981a8452577f3751298c7cdbe59b3ae81d51 (diff) |
various menu items quirks, simplifications & optimization
git-svn-id: http://svn.miranda-ng.org/main/trunk@4319 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TabSRMM/src/mim.cpp')
-rw-r--r-- | plugins/TabSRMM/src/mim.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp index 4deb632c9f..cc067fd278 100644 --- a/plugins/TabSRMM/src/mim.cpp +++ b/plugins/TabSRMM/src/mim.cpp @@ -647,20 +647,19 @@ int CMimAPI::ProtoAck(WPARAM wParam, LPARAM lParam) int CMimAPI::PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
{
HANDLE hContact = (HANDLE)wParam;
- if ( hContact ) {
- CLISTMENUITEM clmi = { sizeof(clmi) };
- clmi.flags = CMIM_FLAGS | CMIF_DEFAULT | CMIF_HIDDEN;
-
- char *szProto = GetContactProto(hContact);
- if ( szProto ) {
- // leave this menu item hidden for chats
- if ( !M->GetByte(hContact, szProto, "ChatRoom", 0 ))
- if ( CallProtoService( szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND )
- clmi.flags &= ~CMIF_HIDDEN;
- }
-
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)PluginConfig.m_hMenuItem, (LPARAM)&clmi);
+ if (hContact == NULL)
+ return NULL;
+
+ bool bEnabled = false;
+ char *szProto = GetContactProto(hContact);
+ if (szProto) {
+ // leave this menu item hidden for chats
+ if ( !M->GetByte(hContact, szProto, "ChatRoom", 0 ))
+ if ( CallProtoService( szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND )
+ bEnabled = true;
}
+
+ Menu_ShowItem(PluginConfig.m_hMenuItem, bEnabled);
return 0;
}
|