diff options
author | George Hazan <george.hazan@gmail.com> | 2015-02-06 23:24:18 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-02-06 23:24:18 +0000 |
commit | 8c6ce1ceb218db86d059372e18277c16b1ab20cb (patch) | |
tree | 466013d863813f5262dbf13d29bd22c75a22c9b6 /src/modules | |
parent | da825236d558418c8a5a7137cd7e6e3a7312d159 (diff) |
there's no need to display Join/Leave menu items, if protocol has no PS_JOINCHAT/PS_LEAVECHAT services
git-svn-id: http://svn.miranda-ng.org/main/trunk@12027 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/chat/clist.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/modules/chat/clist.cpp b/src/modules/chat/clist.cpp index f96179e84b..c19670efa0 100644 --- a/src/modules/chat/clist.cpp +++ b/src/modules/chat/clist.cpp @@ -177,12 +177,19 @@ int PrebuildContactMenu(WPARAM hContact, LPARAM) if (CallProtoService(szProto, PS_GETSTATUS, 0, 0) != ID_STATUS_OFFLINE) {
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_NAME;
- if (db_get_w(hContact, szProto, "Status", 0) == ID_STATUS_OFFLINE)
- mi.pszName = LPGEN("&Join chat");
- else
- mi.pszName = LPGEN("&Open chat window");
+ if (db_get_w(hContact, szProto, "Status", 0) == ID_STATUS_OFFLINE) {
+ if (ProtoServiceExists(szProto, PS_JOINCHAT)) {
+ bEnabled = true;
+ mi.pszName = LPGEN("&Join chat");
+ }
+ }
+ else {
+ if (ProtoServiceExists(szProto, PS_LEAVECHAT)) {
+ bEnabled = true;
+ mi.pszName = LPGEN("&Open chat window");
+ }
+ }
Menu_ModifyItem(hJoinMenuItem, &mi);
- bEnabled = true;
}
}
}
|