From 8c6ce1ceb218db86d059372e18277c16b1ab20cb Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 6 Feb 2015 23:24:18 +0000 Subject: 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 --- src/modules/chat/clist.cpp | 17 ++++++++++++----- 1 file 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; } } } -- cgit v1.2.3