summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-22 20:38:56 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-22 20:38:56 +0000
commit88790eed4ffd9ca555c8f9b73cb014a93b57a34f (patch)
treeb3e5bfe096005a9cac4bc14fdfbe5f6f5acad98a /protocols
parent9ecc2aa50e2183e2c4a11861ca6dede7d2151139 (diff)
Menu_ModifyItem unbound from CLISTMENUITEM structure
git-svn-id: http://svn.miranda-ng.org/main/trunk@14334 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/AimOscar/src/proto.cpp8
-rw-r--r--protocols/AimOscar/src/theme.cpp54
-rw-r--r--protocols/FacebookRM/src/theme.cpp10
-rw-r--r--protocols/Gadu-Gadu/src/gg.cpp11
-rw-r--r--protocols/Gadu-Gadu/src/gg_proto.cpp8
-rw-r--r--protocols/Gadu-Gadu/src/links.cpp11
-rw-r--r--protocols/IRCG/src/commandmonitor.cpp16
-rw-r--r--protocols/IRCG/src/ircproto.cpp8
-rw-r--r--protocols/IRCG/src/options.cpp6
-rw-r--r--protocols/IcqOscarJ/src/icq_menu.cpp7
-rw-r--r--protocols/IcqOscarJ/src/icq_xstatus.cpp10
-rw-r--r--protocols/JabberG/src/jabber_menu.cpp113
-rw-r--r--protocols/JabberG/src/jabber_proto.cpp8
-rw-r--r--protocols/JabberG/src/jabber_xstatus.cpp12
-rw-r--r--protocols/MRA/src/Mra_functions.cpp5
-rw-r--r--protocols/MSN/src/msn_commands.cpp2
-rw-r--r--protocols/MSN/src/msn_menu.cpp16
-rw-r--r--protocols/MSN/src/msn_proto.cpp8
-rw-r--r--protocols/MSN/src/msn_proto.h2
-rw-r--r--protocols/Sametime/src/conference.cpp16
-rw-r--r--protocols/Sametime/src/sametime_proto.cpp1
-rw-r--r--protocols/Sametime/src/sametime_proto.h4
-rw-r--r--protocols/Tlen/src/tlen.cpp5
-rw-r--r--protocols/Tlen/src/tlen_iqid.cpp6
-rw-r--r--protocols/Tlen/src/tlen_svc.cpp6
-rw-r--r--protocols/Tlen/src/tlen_thread.cpp6
-rw-r--r--protocols/WhatsApp/src/proto.h3
-rw-r--r--protocols/WhatsApp/src/theme.cpp8
-rw-r--r--protocols/Yahoo/src/proto.cpp8
29 files changed, 123 insertions, 255 deletions
diff --git a/protocols/AimOscar/src/proto.cpp b/protocols/AimOscar/src/proto.cpp
index 6083632b48..6097af60cb 100644
--- a/protocols/AimOscar/src/proto.cpp
+++ b/protocols/AimOscar/src/proto.cpp
@@ -704,12 +704,8 @@ int __cdecl CAimProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM l
break;
case EV_PROTO_ONRENAME:
- if (hMenuRoot) {
- CLISTMENUITEM clmi = { 0 };
- clmi.flags = CMIM_NAME | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
- clmi.ptszName = m_tszUserName;
- Menu_ModifyItem(hMenuRoot, &clmi);
- }
+ if (hMenuRoot)
+ Menu_ModifyItem(hMenuRoot, m_tszUserName);
break;
case EV_PROTO_ONCONTACTDELETED:
diff --git a/protocols/AimOscar/src/theme.cpp b/protocols/AimOscar/src/theme.cpp
index c8b6ab7fd0..fbfaa67627 100644
--- a/protocols/AimOscar/src/theme.cpp
+++ b/protocols/AimOscar/src/theme.cpp
@@ -179,37 +179,31 @@ int CAimProto::OnPreBuildContactMenu(WPARAM hContact, LPARAM)
Menu_ShowItem(hHTMLAwayContextMenuItem, getWord(hContact, AIM_KEY_ST, ID_STATUS_OFFLINE) == ID_STATUS_AWAY && !bIsChatRoom);
Menu_ShowItem(hAddToServerListContextMenuItem, !getBuddyId(hContact, 1) && state != 0 && !bIsChatRoom);
- DBVARIANT dbv;
- if (!getString(hContact, AIM_KEY_SN, &dbv)) {
- CLISTMENUITEM mi = { 0 };
- mi.flags = CMIM_NAME | CMIM_FLAGS;
- switch(pd_mode) {
- case 1:
- mi.pszName = LPGEN("&Block");
- break;
-
- case 2:
- mi.pszName = LPGEN("&Unblock");
- break;
-
- case 3:
- mi.pszName = (char*)(allow_list.find_id(dbv.pszVal) ? LPGEN("&Block") : LPGEN("&Unblock"));
- break;
-
- case 4:
- mi.pszName = (char*)(block_list.find_id(dbv.pszVal) ? LPGEN("&Unblock") : LPGEN("&Block"));
- break;
-
- default:
- mi.pszName = LPGEN("&Block");
- mi.flags |= CMIF_HIDDEN;
- break;
- }
-
- Menu_ModifyItem(hBlockContextMenuItem, &mi);
- db_free(&dbv);
+ ptrA id(getStringA(hContact, AIM_KEY_SN));
+ if (id == NULL)
+ return 0;
+
+ switch (pd_mode) {
+ case 1:
+ Menu_ModifyItem(hBlockContextMenuItem, LPGENT("&Block"));
+ break;
+
+ case 2:
+ Menu_ModifyItem(hBlockContextMenuItem, LPGENT("&Unblock"));
+ break;
+
+ case 3:
+ Menu_ModifyItem(hBlockContextMenuItem, allow_list.find_id(id) ? LPGENT("&Block") : LPGENT("&Unblock"));
+ break;
+
+ case 4:
+ Menu_ModifyItem(hBlockContextMenuItem, block_list.find_id(id) ? LPGENT("&Unblock") : LPGENT("&Block"));
+ break;
+
+ default:
+ Menu_ShowItem(hBlockContextMenuItem, false);
+ break;
}
-
return 0;
}
diff --git a/protocols/FacebookRM/src/theme.cpp b/protocols/FacebookRM/src/theme.cpp
index efd24e16dc..7d7c05cdcf 100644
--- a/protocols/FacebookRM/src/theme.cpp
+++ b/protocols/FacebookRM/src/theme.cpp
@@ -293,10 +293,8 @@ int FacebookProto::OnBuildStatusMenu(WPARAM, LPARAM)
void FacebookProto::ToggleStatusMenuItems(BOOL bEnable)
{
- CLISTMENUITEM clmi = { 0 };
- clmi.flags = CMIM_FLAGS | ((bEnable) ? 0 : CMIF_GRAYED);
-
- Menu_ModifyItem(m_hMenuRoot, &clmi);
- Menu_ModifyItem(m_hStatusMind, &clmi);
- Menu_ModifyItem(m_hMenuServicesRoot, &clmi);
+ int flags = (bEnable) ? 0 : CMIF_GRAYED;
+ Menu_ModifyItem(m_hMenuRoot, NULL, INVALID_HANDLE_VALUE, flags);
+ Menu_ModifyItem(m_hStatusMind, NULL, INVALID_HANDLE_VALUE, flags);
+ Menu_ModifyItem(m_hMenuServicesRoot, NULL, INVALID_HANDLE_VALUE, flags);
}
diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp
index a70b5a6710..ffeb1ecc65 100644
--- a/protocols/Gadu-Gadu/src/gg.cpp
+++ b/protocols/Gadu-Gadu/src/gg.cpp
@@ -212,13 +212,10 @@ static int gg_prebuildcontactmenu(WPARAM hContact, LPARAM lParam)
if (gg == NULL)
return 0;
- CLISTMENUITEM mi = { 0 };
- mi.flags = CMIM_NAME | CMIM_FLAGS | CMIF_TCHAR;
- if ( gg->getDword(hContact, GG_KEY_UIN, 0) == gg->getByte(GG_KEY_UIN, 0) ||
- gg->isChatRoom(hContact) || db_get_b(hContact, "CList", "NotOnList", 0))
- mi.flags |= CMIF_HIDDEN;
- mi.ptszName = gg->getByte(hContact, GG_KEY_BLOCK, 0) ? LPGENT("&Unblock") : LPGENT("&Block");
- Menu_ModifyItem(gg->hBlockMenuItem, &mi);
+ if (gg->getDword(hContact, GG_KEY_UIN, 0) == gg->getByte(GG_KEY_UIN, 0) || gg->isChatRoom(hContact) || db_get_b(hContact, "CList", "NotOnList", 0))
+ Menu_ShowItem(gg->hBlockMenuItem, false);
+ else
+ Menu_ModifyItem(gg->hBlockMenuItem, gg->getByte(hContact, GG_KEY_BLOCK, 0) ? LPGENT("&Unblock") : LPGENT("&Block"));
return 0;
}
diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp
index ec5cf9c603..99f7c478e6 100644
--- a/protocols/Gadu-Gadu/src/gg_proto.cpp
+++ b/protocols/Gadu-Gadu/src/gg_proto.cpp
@@ -764,12 +764,8 @@ int GGPROTO::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam)
break;
case EV_PROTO_ONRENAME:
- if (hMenuRoot) {
- CLISTMENUITEM mi = { 0 };
- mi.flags = CMIM_NAME | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
- mi.ptszName = m_tszUserName;
- Menu_ModifyItem(hMenuRoot, &mi);
- }
+ if (hMenuRoot)
+ Menu_ModifyItem(hMenuRoot, m_tszUserName);
break;
case EV_PROTO_ONCONTACTDELETED:
diff --git a/protocols/Gadu-Gadu/src/links.cpp b/protocols/Gadu-Gadu/src/links.cpp
index eb1f590f35..a915416a63 100644
--- a/protocols/Gadu-Gadu/src/links.cpp
+++ b/protocols/Gadu-Gadu/src/links.cpp
@@ -63,18 +63,11 @@ static INT_PTR gg_parselink(WPARAM wParam, LPARAM lParam)
for (int i=0; i < g_Instances.getCount(); i++) {
gg = g_Instances[i];
- CLISTMENUITEM mi = { 0 };
- mi.flags = CMIM_FLAGS;
if (gg->m_iStatus > ID_STATUS_OFFLINE) {
++items;
- mi.flags |= CMIM_ICON;
- mi.hIcon = Skin_LoadProtoIcon(gg->m_szModuleName, gg->m_iStatus);
+ Menu_ModifyItem(gg->hInstanceMenuItem, NULL, Skin_LoadProtoIcon(gg->m_szModuleName, gg->m_iStatus));
}
- else mi.flags |= CMIF_HIDDEN;
-
- Menu_ModifyItem(gg->hInstanceMenuItem, &mi);
- if (mi.hIcon)
- IcoLib_ReleaseIcon(mi.hIcon);
+ else Menu_ShowItem(gg->hInstanceMenuItem, false);
}
if (items > 1) {
diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp
index f9e373e44b..4567f48602 100644
--- a/protocols/IRCG/src/commandmonitor.cpp
+++ b/protocols/IRCG/src/commandmonitor.cpp
@@ -2298,11 +2298,9 @@ void CIrcProto::OnIrcDisconnected()
memcpy(m_nick, m_pNick, sizeof(m_nick));
setTString("Nick", m_pNick);
- CLISTMENUITEM mi = { 0 };
- mi.flags = CMIM_FLAGS | CMIF_GRAYED;
- Menu_ModifyItem(hMenuJoin, &mi);
- Menu_ModifyItem(hMenuList, &mi);
- Menu_ModifyItem(hMenuNick, &mi);
+ Menu_ModifyItem(hMenuJoin, NULL, INVALID_HANDLE_VALUE, CMIF_GRAYED);
+ Menu_ModifyItem(hMenuList, NULL, INVALID_HANDLE_VALUE, CMIF_GRAYED);
+ Menu_ModifyItem(hMenuNick, NULL, INVALID_HANDLE_VALUE, CMIF_GRAYED);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -2329,11 +2327,9 @@ bool CIrcProto::DoOnConnect(const CIrcMessage*)
bPerformDone = true;
nickflag = true;
- CLISTMENUITEM mi = { 0 };
- mi.flags = CMIM_FLAGS;
- Menu_ModifyItem(hMenuJoin, &mi);
- Menu_ModifyItem(hMenuList, &mi);
- Menu_ModifyItem(hMenuNick, &mi);
+ Menu_ModifyItem(hMenuJoin, NULL, INVALID_HANDLE_VALUE, 0);
+ Menu_ModifyItem(hMenuList, NULL, INVALID_HANDLE_VALUE, 0);
+ Menu_ModifyItem(hMenuNick, NULL, INVALID_HANDLE_VALUE, 0);
int Temp = m_iStatus;
m_iStatus = ID_STATUS_ONLINE;
diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp
index 378aee6063..89cb66953b 100644
--- a/protocols/IRCG/src/ircproto.cpp
+++ b/protocols/IRCG/src/ircproto.cpp
@@ -840,12 +840,8 @@ int __cdecl CIrcProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM l
break;
case EV_PROTO_ONRENAME:
- if (hMenuRoot) {
- CLISTMENUITEM mi = { 0 };
- mi.flags = CMIM_NAME | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
- mi.ptszName = m_tszUserName;
- Menu_ModifyItem(hMenuRoot, &mi);
- }
+ if (hMenuRoot)
+ Menu_ModifyItem(hMenuRoot, m_tszUserName);
break;
case EV_PROTO_ONCONTACTDELETED:
diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp
index d8296b0fec..f741aa9525 100644
--- a/protocols/IRCG/src/options.cpp
+++ b/protocols/IRCG/src/options.cpp
@@ -730,11 +730,7 @@ void CConnectPrefsDlg::OnApply()
m_proto->m_oldStyleModes = m_oldStyle.GetState();
m_proto->m_useServer = m_useServer.GetState();
- CLISTMENUITEM mi = { 0 };
- mi.flags = CMIM_FLAGS;
- if (!m_proto->m_useServer)
- mi.flags |= CMIF_GRAYED;
- Menu_ModifyItem(m_proto->hMenuServer, &mi);
+ Menu_ModifyItem(m_proto->hMenuServer, NULL, INVALID_HANDLE_VALUE, (m_proto->m_useServer) ? 0 : CMIF_GRAYED);
m_proto->m_joinOnInvite = m_autoJoin.GetState();
m_proto->m_hideServerWindow = !m_showServer.GetState();
diff --git a/protocols/IcqOscarJ/src/icq_menu.cpp b/protocols/IcqOscarJ/src/icq_menu.cpp
index 7ada6453fc..94a0a3ca57 100644
--- a/protocols/IcqOscarJ/src/icq_menu.cpp
+++ b/protocols/IcqOscarJ/src/icq_menu.cpp
@@ -204,13 +204,10 @@ int CIcqProto::OnPreBuildContactMenu(WPARAM hContact, LPARAM)
Menu_ShowItem(g_hContactMenuItems[ICMI_XSTATUS_DETAILS], m_bHideXStatusUI ? 0 : bXStatus != 0);
if (bXStatus && !m_bHideXStatusUI) {
- CLISTMENUITEM clmi = { 0 };
- clmi.flags = CMIM_ICON;
if (bXStatus > 0 && bXStatus <= XSTATUS_COUNT)
- clmi.hIcon = getXStatusIcon(bXStatus, LR_SHARED);
+ Menu_ModifyItem(g_hContactMenuItems[ICMI_XSTATUS_DETAILS], NULL, getXStatusIcon(bXStatus, LR_SHARED));
else
- clmi.hIcon = Skin_LoadIcon(SKINICON_OTHER_SMALLDOT);
- Menu_ModifyItem(g_hContactMenuItems[ICMI_XSTATUS_DETAILS], &clmi);
+ Menu_ModifyItem(g_hContactMenuItems[ICMI_XSTATUS_DETAILS], NULL, Skin_LoadIcon(SKINICON_OTHER_SMALLDOT));
}
return 0;
diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp
index a82e72e5dd..75b7dbcd1b 100644
--- a/protocols/IcqOscarJ/src/icq_xstatus.cpp
+++ b/protocols/IcqOscarJ/src/icq_xstatus.cpp
@@ -780,14 +780,10 @@ void CIcqProto::setXStatusEx(BYTE bXStatus, BYTE bQuiet)
BYTE bOldXStatus = getByte(DBSETTING_XSTATUS_ID, 0);
if (!m_bHideXStatusUI) {
- CLISTMENUITEM mi = { 0 };
- if (bOldXStatus <= XSTATUS_COUNT) {
- mi.flags = CMIM_FLAGS;
- Menu_ModifyItem(hXStatusItems[bOldXStatus], &mi);
- }
+ if (bOldXStatus <= XSTATUS_COUNT)
+ Menu_ModifyItem(hXStatusItems[bOldXStatus], NULL, INVALID_HANDLE_VALUE, 0);
- mi.flags = CMIM_FLAGS | CMIF_CHECKED;
- Menu_ModifyItem(hXStatusItems[bXStatus], &mi);
+ Menu_ModifyItem(hXStatusItems[bXStatus], NULL, INVALID_HANDLE_VALUE, CMIF_CHECKED);
}
if (bXStatus) {
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp
index 7282a96457..32bccd1ad0 100644
--- a/protocols/JabberG/src/jabber_menu.cpp
+++ b/protocols/JabberG/src/jabber_menu.cpp
@@ -79,7 +79,7 @@ static CJabberProto* JabberGetInstanceByHContact(MCONTACT hContact)
if (szProto == NULL)
return NULL;
- for (int i=0; i < g_Instances.getCount(); i++)
+ for (int i = 0; i < g_Instances.getCount(); i++)
if (!mir_strcmp(szProto, g_Instances[i]->m_szModuleName))
return g_Instances[i];
@@ -287,15 +287,15 @@ void g_MenuInit(void)
g_hMenuDirectPresence[0] = Menu_AddContactMenuItem(&mi);
mi.flags |= CMIF_ROOTHANDLE | CMIF_TCHAR;
- for (int i=0; i < _countof(PresenceModeArray); i++) {
+ for (int i = 0; i < _countof(PresenceModeArray); i++) {
char buf[] = "Jabber/DirectPresenceX";
- buf[_countof(buf)-2] = '0' + i;
+ buf[_countof(buf) - 2] = '0' + i;
mi.pszService = buf;
mi.ptszName = pcli->pfnGetStatusModeDescription(PresenceModeArray[i].mode, 0);
mi.position = -1999901000;
mi.hParentMenu = g_hMenuDirectPresence[0];
mi.icolibItem = Skin_LoadIcon(PresenceModeArray[i].icon);
- g_hMenuDirectPresence[i+1] = Menu_AddContactMenuItem(&mi);
+ g_hMenuDirectPresence[i + 1] = Menu_AddContactMenuItem(&mi);
CreateServiceFunctionParam(mi.pszService, JabberMenuHandleDirectPresence, PresenceModeArray[i].mode);
}
@@ -350,17 +350,13 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM)
if (hContact == NULL)
return 0;
- bool bIsChatRoom = isChatRoom(hContact);
+ bool bIsChatRoom = isChatRoom(hContact);
bool bIsTransport = getBool(hContact, "IsTransport", false);
if ((bIsChatRoom == GCW_CHATROOM) || bIsChatRoom == 0) {
- if ( ptrT( getTStringA(hContact, bIsChatRoom?(char*)"ChatRoomID":(char*)"jid")) != NULL) {
+ if (ptrT(getTStringA(hContact, bIsChatRoom ? (char*)"ChatRoomID" : (char*)"jid")) != NULL) {
Menu_ShowItem(g_hMenuConvert, TRUE);
-
- CLISTMENUITEM clmi = { 0 };
- clmi.pszName = bIsChatRoom ? (char *)LPGEN("&Convert to Contact") : (char *)LPGEN("&Convert to Chat Room");
- clmi.flags = CMIM_NAME | CMIM_FLAGS;
- Menu_ModifyItem(g_hMenuConvert, &clmi);
+ Menu_ModifyItem(g_hMenuConvert, bIsChatRoom ? LPGENT("&Convert to Contact") : LPGENT("&Convert to Chat Room"));
}
}
@@ -368,15 +364,11 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM)
return 0;
Menu_ShowItem(g_hMenuDirectPresence[0], TRUE);
- for (int i=0; i < _countof(PresenceModeArray); i++) {
- CLISTMENUITEM clmi = { 0 };
- clmi.flags = CMIM_ICON | CMIM_FLAGS;
- clmi.hIcon = (HICON)Skin_LoadProtoIcon(m_szModuleName, PresenceModeArray[i].mode);
- Menu_ModifyItem(g_hMenuDirectPresence[i+1], &clmi);
- }
+ for (int i = 0; i < _countof(PresenceModeArray); i++)
+ Menu_ModifyItem(g_hMenuDirectPresence[i + 1], NULL, Skin_LoadProtoIcon(m_szModuleName, PresenceModeArray[i].mode));
if (bIsChatRoom) {
- ptrT roomid( getTStringA(hContact, "ChatRoomID"));
+ ptrT roomid(getTStringA(hContact, "ChatRoomID"));
if (roomid != NULL) {
Menu_ShowItem(g_hMenuRosterAdd, FALSE);
@@ -394,7 +386,7 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM)
Menu_ShowItem(g_hMenuRefresh, TRUE);
}
- ptrT jid( getTStringA(hContact, "jid"));
+ ptrT jid(getTStringA(hContact, "jid"));
if (jid == NULL)
return 0;
@@ -403,7 +395,7 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM)
if (item == NULL)
return 0;
- BOOL bCtrlPressed = (GetKeyState(VK_CONTROL)&0x8000) != 0;
+ bool bCtrlPressed = (GetKeyState(VK_CONTROL) & 0x8000) != 0;
Menu_ShowItem(g_hMenuRequestAuth, item->subscription == SUB_FROM || item->subscription == SUB_NONE || bCtrlPressed);
Menu_ShowItem(g_hMenuGrantAuth, bCtrlPressed);
Menu_ShowItem(g_hMenuRevokeAuth, item->subscription == SUB_FROM || item->subscription == SUB_BOTH || bCtrlPressed);
@@ -414,17 +406,9 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM)
return 0;
Menu_ShowItem(g_hMenuResourcesRoot, TRUE);
-
- CLISTMENUITEM mi = { 0 };
- mi.flags = CMIM_ICON | CMIM_FLAGS;
- mi.icolibItem = m_hProtoIcon;
- Menu_ModifyItem(g_hMenuResourcesRoot, &mi);
-
- mi.flags = CMIM_ICON | CMIM_FLAGS | ((item->resourceMode == RSMODE_LASTSEEN) ? CMIF_CHECKED : 0);
- Menu_ModifyItem(g_hMenuResourcesActive, &mi);
-
- mi.flags = CMIM_FLAGS | ((item->resourceMode == RSMODE_SERVER) ? CMIF_CHECKED : 0);
- Menu_ModifyItem(g_hMenuResourcesServer, &mi);
+ Menu_ModifyItem(g_hMenuResourcesRoot, NULL, m_hProtoIcon);
+ Menu_ModifyItem(g_hMenuResourcesActive, NULL, m_hProtoIcon, (item->resourceMode == RSMODE_LASTSEEN) ? CMIF_CHECKED : 0);
+ Menu_ModifyItem(g_hMenuResourcesServer, NULL, m_hProtoIcon, (item->resourceMode == RSMODE_SERVER) ? CMIF_CHECKED : 0);
int nMenuResourceItemsNew = m_nMenuResourceItems;
if (m_nMenuResourceItems < item->arResources.getCount()) {
@@ -432,11 +416,12 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM)
nMenuResourceItemsNew = item->arResources.getCount();
}
- char text[ 256 ];
+ char text[256];
mir_strcpy(text, m_szModuleName);
size_t nModuleNameLength = mir_strlen(text);
char* tDest = text + nModuleNameLength;
+ CLISTMENUITEM mi = { 0 };
mi.flags = CMIF_CHILDPOPUP;
mi.position = 0;
mi.icolibItem = NULL;
@@ -444,10 +429,10 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM)
mi.pszContactOwner = m_szModuleName;
CMString szTmp;
- for (int i=0; i < nMenuResourceItemsNew; i++) {
+ for (int i = 0; i < nMenuResourceItemsNew; i++) {
mir_snprintf(tDest, _countof(text) - nModuleNameLength, "/UseResource_%d", i);
if (i >= m_nMenuResourceItems) {
- CreateProtoServiceParam(tDest, &CJabberProto::OnMenuHandleResource, MENUITEM_RESOURCES+i);
+ CreateProtoServiceParam(tDest, &CJabberProto::OnMenuHandleResource, MENUITEM_RESOURCES + i);
mi.pszName = "";
mi.position = i;
mi.hParentMenu = g_hMenuResourcesRoot;
@@ -455,19 +440,19 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM)
}
if (i < item->arResources.getCount()) {
pResourceStatus r(item->arResources[i]);
- CLISTMENUITEM clmi = { 0 };
- clmi.flags = CMIM_NAME | CMIM_FLAGS | CMIF_CHILDPOPUP | CMIF_TCHAR;
+
+ int flags = 0;
+ HICON hIcon = (HICON)INVALID_HANDLE_VALUE;
if (item->resourceMode == RSMODE_MANUAL && item->m_pManualResource == r)
- clmi.flags |= CMIF_CHECKED;
+ flags |= CMIF_CHECKED;
+
if (ServiceExists(MS_FP_GETCLIENTICONT)) {
- clmi.flags |= CMIM_ICON;
FormatMirVer(r, szTmp);
- clmi.hIcon = Finger_GetClientIcon(szTmp, 0);
+ hIcon = Finger_GetClientIcon(szTmp, 0);
}
szTmp.Format(_T("%s [%s, %d]"), r->m_tszResourceName, pcli->pfnGetStatusModeDescription(r->m_iStatus, 0), r->m_iPriority);
- clmi.ptszName = szTmp.GetBuffer();
- Menu_ModifyItem(m_phMenuResourceItems[i], &clmi);
- DestroyIcon(clmi.hIcon);
+ Menu_ModifyItem(m_phMenuResourceItems[i], szTmp, hIcon, flags);
+ DestroyIcon(hIcon);
}
else Menu_ShowItem(m_phMenuResourceItems[i], FALSE);
}
@@ -602,7 +587,7 @@ INT_PTR __cdecl CJabberProto::OnMenuBookmarkAdd(WPARAM hContact, LPARAM)
void CJabberProto::MenuInit()
{
char text[200];
- strncpy(text, m_szModuleName, sizeof(text)-1);
+ strncpy(text, m_szModuleName, sizeof(text) - 1);
char* tDest = text + mir_strlen(text);
CLISTMENUITEM mi = { 0 };
@@ -797,11 +782,7 @@ void CJabberProto::UpdatePriorityMenu(short priority)
TCHAR szName[128];
mir_sntprintf(szName, TranslateT("Resource priority [%d]"), (int)priority);
-
- CLISTMENUITEM mi = { 0 };
- mi.flags = CMIF_TCHAR | CMIM_NAME | CMIF_KEEPUNTRANSLATED;
- mi.ptszName = szName;
- Menu_ModifyItem(m_hMenuPriorityRoot, &mi);
+ Menu_ModifyItem(m_hMenuPriorityRoot, szName);
m_priorityMenuVal = priority;
m_priorityMenuValSet = true;
@@ -903,7 +884,7 @@ int g_OnToolbarInit(WPARAM, LPARAM)
void CJabberProto::GlobalMenuUninit()
{
if (m_phMenuResourceItems) {
- for (int i=0; i < m_nMenuResourceItems; i++)
+ for (int i = 0; i < m_nMenuResourceItems; i++)
CallService(MO_REMOVEMENUITEM, (WPARAM)m_phMenuResourceItems[i], 0);
mir_free(m_phMenuResourceItems);
m_phMenuResourceItems = NULL;
@@ -923,20 +904,17 @@ void CJabberProto::EnableMenuItems(BOOL bEnable)
void CJabberProto::CheckMenuItems()
{
- CLISTMENUITEM clmi = { 0 };
- clmi.flags = CMIM_FLAGS;
- if (!m_menuItemsStatus)
- clmi.flags |= CMIF_GRAYED;
+ int flags = (m_menuItemsStatus) ? 0 : CMIF_GRAYED;
- Menu_ModifyItem(m_hMenuChangePassword, &clmi);
- Menu_ModifyItem(m_hMenuGroupchat, &clmi);
+ Menu_ModifyItem(m_hMenuChangePassword, NULL, INVALID_HANDLE_VALUE, flags);
+ Menu_ModifyItem(m_hMenuGroupchat, NULL, INVALID_HANDLE_VALUE, flags);
- Menu_ModifyItem(m_hMenuPrivacyLists, &clmi);
- Menu_ModifyItem(m_hMenuRosterControl, &clmi);
- Menu_ModifyItem(m_hMenuServiceDiscovery, &clmi);
- Menu_ModifyItem(m_hMenuSDMyTransports, &clmi);
- Menu_ModifyItem(m_hMenuSDTransports, &clmi);
- Menu_ModifyItem(m_hMenuSDConferences, &clmi);
+ Menu_ModifyItem(m_hMenuPrivacyLists, NULL, INVALID_HANDLE_VALUE, flags);
+ Menu_ModifyItem(m_hMenuRosterControl, NULL, INVALID_HANDLE_VALUE, flags);
+ Menu_ModifyItem(m_hMenuServiceDiscovery, NULL, INVALID_HANDLE_VALUE, flags);
+ Menu_ModifyItem(m_hMenuSDMyTransports, NULL, INVALID_HANDLE_VALUE, flags);
+ Menu_ModifyItem(m_hMenuSDTransports, NULL, INVALID_HANDLE_VALUE, flags);
+ Menu_ModifyItem(m_hMenuSDConferences, NULL, INVALID_HANDLE_VALUE, flags);
bool bEnabled = m_ThreadInfo && (m_ThreadInfo->jabberServerCaps & JABBER_CAPS_PRIVATE_STORAGE);
Menu_ShowItem(m_hMenuNotes, bEnabled);
@@ -946,7 +924,7 @@ void CJabberProto::CheckMenuItems()
Menu_ShowItem(m_hMenuPriorityRoot, m_menuItemsStatus != 0);
- for (int i=0; i < m_pepServices.getCount(); i++)
+ for (int i = 0; i < m_pepServices.getCount(); i++)
Menu_ShowItem(m_pepServices[i].GetMenu(), m_bPepSupported);
JabberUpdateDialogs(m_menuItemsStatus);
@@ -1151,22 +1129,15 @@ CJabberProto* JabberChooseInstance(bool bIsLink)
if (g_Instances[i]->m_options.ProcessXMPPLinks)
return g_Instances[i];
- CLISTMENUITEM clmi = { 0 };
-
int nItems = 0, lastItemId = 0;
for (int i = 0; i < g_Instances.getCount(); i++) {
- clmi.flags = CMIM_FLAGS;
-
CJabberProto *ppro = g_Instances[i];
if (ppro->m_iStatus != ID_STATUS_OFFLINE && ppro->m_iStatus != ID_STATUS_CONNECTING) {
++nItems;
lastItemId = i + 1;
- clmi.flags |= CMIM_ICON;
- clmi.hIcon = Skin_LoadProtoIcon(ppro->m_szModuleName, ppro->m_iStatus);
+ Menu_ModifyItem(ppro->m_hChooseMenuItem, NULL, Skin_LoadProtoIcon(ppro->m_szModuleName, ppro->m_iStatus));
}
- else clmi.flags |= CMIF_HIDDEN;
-
- Menu_ModifyItem(ppro->m_hChooseMenuItem, &clmi);
+ else Menu_ShowItem(ppro->m_hChooseMenuItem, false);
}
if (nItems > 1) {
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index 2d4c9fd1f8..1eb5bbfb1e 100644
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -1319,12 +1319,8 @@ int __cdecl CJabberProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARA
break;
case EV_PROTO_ONRENAME:
- if (m_hMenuRoot) {
- CLISTMENUITEM clmi = { 0 };
- clmi.flags = CMIM_NAME | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
- clmi.ptszName = m_tszUserName;
- Menu_ModifyItem(m_hMenuRoot, &clmi);
- }
+ if (m_hMenuRoot)
+ Menu_ModifyItem(m_hMenuRoot, m_tszUserName);
break;
case EV_PROTO_ONCONTACTDELETED:
diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp
index 3ae7a9bcea..bd78e108c4 100644
--- a/protocols/JabberG/src/jabber_xstatus.cpp
+++ b/protocols/JabberG/src/jabber_xstatus.cpp
@@ -489,16 +489,10 @@ bool CPepGuiService::LaunchSetGui(BYTE bQuiet)
void CPepGuiService::UpdateMenuItem(HANDLE hIcolibIcon, TCHAR *text)
{
m_hIcolibItem = hIcolibIcon;
- if (m_szText) mir_free(m_szText);
- m_szText = text ? mir_tstrdup(text) : NULL;
-
- if (!m_hMenuItem) return;
+ replaceStrT(m_szText, text);
- CLISTMENUITEM mi = { 0 };
- mi.flags = CMIF_TCHAR | CMIM_ICON | CMIM_NAME;
- mi.icolibItem = m_hIcolibItem;
- mi.ptszName = m_szText ? m_szText : _T("<advanced status slot>");
- Menu_ModifyItem(m_hMenuItem, &mi);
+ if (m_hMenuItem)
+ Menu_ModifyItem(m_hMenuItem, m_szText ? m_szText : _T("<advanced status slot>"), m_hIcolibItem);
}
int CPepGuiService::OnMenuItemClick(WPARAM, LPARAM)
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp
index 981e58fa3d..2ee94802f0 100644
--- a/protocols/MRA/src/Mra_functions.cpp
+++ b/protocols/MRA/src/Mra_functions.cpp
@@ -1060,10 +1060,7 @@ INT_PTR CALLBACK SetXStatusDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LP
dat->ppro->mraSetStringExW(NULL, szValueName, szBuff);
dat->ppro->mraSetStringExW(NULL, DBSETTING_XSTATUSNAME, szBuff);
- CLISTMENUITEM mi = { 0 };
- mi.flags = (CMIM_NAME | CMIF_UNICODE);
- mi.ptszName = szBuff;
- Menu_ModifyItem(dat->ppro->hXStatusMenuItems[dat->dwXStatus], &mi);
+ Menu_ModifyItem(dat->ppro->hXStatusMenuItems[dat->dwXStatus], szBuff);
dat->ppro->MraSetXStatusInternal(dat->dwXStatus);
diff --git a/protocols/MSN/src/msn_commands.cpp b/protocols/MSN/src/msn_commands.cpp
index 9502935601..82532bd346 100644
--- a/protocols/MSN/src/msn_commands.cpp
+++ b/protocols/MSN/src/msn_commands.cpp
@@ -330,7 +330,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para
replaceStr(msnExternalIP, tHeader["ClientIP"]);
abchMigrated = atol(tHeader["ABCHMigrated"]);
langpref = atol(tHeader["lang_preference"]);
- emailEnabled = atol(tHeader["EmailEnabled"]);
+ emailEnabled = atol(tHeader["EmailEnabled"]) != 0;
if (!MSN_RefreshContactList()) {
ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_NOSERVER);
diff --git a/protocols/MSN/src/msn_menu.cpp b/protocols/MSN/src/msn_menu.cpp
index 90874396bc..b6897742fc 100644
--- a/protocols/MSN/src/msn_menu.cpp
+++ b/protocols/MSN/src/msn_menu.cpp
@@ -131,14 +131,10 @@ int CMsnProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM)
int listId = Lists_GetMask(szEmail);
bool noChat = !(listId & LIST_FL) || isMe || isChatRoom(hContact);
- CLISTMENUITEM mi = { 0 };
- mi.flags = CMIM_NAME;
- mi.pszName = ((listId & LIST_BL) ? LPGEN("&Unblock") : LPGEN("&Block"));
- Menu_ModifyItem(hBlockMenuItem, &mi);
+ Menu_ModifyItem(hBlockMenuItem, (listId & LIST_BL) ? LPGENT("&Unblock") : LPGENT("&Block"));
Menu_ShowItem(hBlockMenuItem, !noChat);
- mi.pszName = isMe ? LPGEN("Open &Hotmail Inbox") : LPGEN("Send &Hotmail E-mail");
- Menu_ModifyItem(hOpenInboxMenuItem, &mi);
+ Menu_ModifyItem(hOpenInboxMenuItem, isMe ? LPGENT("Open &Hotmail Inbox") : LPGENT("Send &Hotmail E-mail"));
Menu_ShowItem(hOpenInboxMenuItem, emailEnabled);
#ifdef OBSOLETE
@@ -344,14 +340,8 @@ void CMsnProto::MsnRemoveMainMenus(void)
void CMsnProto::MSN_EnableMenuItems(bool bEnable)
{
- CLISTMENUITEM mi = { 0 };
- mi.flags = CMIM_FLAGS;
- if (!bEnable)
- mi.flags |= CMIF_GRAYED;
-
for (int i = 0; i < _countof(menuItemsMain); i++)
- if (menuItemsMain[i] != NULL)
- Menu_ModifyItem(menuItemsMain[i], &mi);
+ Menu_ModifyItem(menuItemsMain[i], NULL, INVALID_HANDLE_VALUE, bEnable ? 0 : CMIF_GRAYED);
if (bEnable)
Menu_ShowItem(menuItemsMain[1], emailEnabled);
diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp
index 6dcc54d15f..8bf72194d9 100644
--- a/protocols/MSN/src/msn_proto.cpp
+++ b/protocols/MSN/src/msn_proto.cpp
@@ -1231,12 +1231,8 @@ int __cdecl CMsnProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM l
break;
case EV_PROTO_ONRENAME:
- if (mainMenuRoot) {
- CLISTMENUITEM clmi = { 0 };
- clmi.flags = CMIM_NAME | CMIF_TCHAR;
- clmi.ptszName = m_tszUserName;
- Menu_ModifyItem(mainMenuRoot, &clmi);
- }
+ if (mainMenuRoot)
+ Menu_ModifyItem(mainMenuRoot, m_tszUserName);
break;
case EV_PROTO_ONCONTACTDELETED:
diff --git a/protocols/MSN/src/msn_proto.h b/protocols/MSN/src/msn_proto.h
index abef0e03c2..5020d88ad2 100644
--- a/protocols/MSN/src/msn_proto.h
+++ b/protocols/MSN/src/msn_proto.h
@@ -171,7 +171,7 @@ struct CMsnProto : public PROTO<CMsnProto>
char* alertsoundname;
unsigned langpref;
- unsigned emailEnabled;
+ bool emailEnabled;
unsigned abchMigrated;
unsigned myFlags;
diff --git a/protocols/Sametime/src/conference.cpp b/protocols/Sametime/src/conference.cpp
index 6b2e6818c5..697a829421 100644
--- a/protocols/Sametime/src/conference.cpp
+++ b/protocols/Sametime/src/conference.cpp
@@ -438,9 +438,8 @@ int CSametimeProto::PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
{
MCONTACT hContact = (MCONTACT)wParam;
debugLog(_T("CSametimeProto::PrebuildContactMenu() hContact=[%x]"), hContact);
- CLISTMENUITEM mi = { 0 };
- mi.flags = CMIM_FLAGS | (db_get_b(hContact, m_szModuleName, "ChatRoom", 0) == 1 ? 0 : CMIF_HIDDEN);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hLeaveChatMenuItem, (LPARAM)&mi);
+
+ Menu_ShowItem(hLeaveChatMenuItem, db_get_b(hContact, m_szModuleName, "ChatRoom", 0) == 1);
// if user is already in our meeting,
bool not_present = true;
@@ -460,9 +459,8 @@ int CSametimeProto::PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
db_free(&dbv);
}
- mi.flags = CMIM_FLAGS | CMIF_NOTOFFLINE | (db_get_b(hContact, m_szModuleName, "ChatRoom", 0) == 0 && not_present ? 0 : CMIF_HIDDEN);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hCreateChatMenuItem, (LPARAM)&mi);
+ Menu_ShowItem(hCreateChatMenuItem, db_get_b(hContact, m_szModuleName, "ChatRoom", 0) == 0 && not_present);
return 0;
}
@@ -530,11 +528,3 @@ void CSametimeProto::InitConferenceMenu()
HookProtoEvent(ME_CLIST_PREBUILDCONTACTMENU, &CSametimeProto::PrebuildContactMenu);
}
-
-void CSametimeProto::DeinitConferenceMenu()
-{
- debugLog(_T("CSametimeProto::DeinitConferenceMenu()"));
- CallService(MO_REMOVEMENUITEM, (WPARAM)hLeaveChatMenuItem, 0);
- CallService(MO_REMOVEMENUITEM, (WPARAM)hCreateChatMenuItem, 0);
-}
-
diff --git a/protocols/Sametime/src/sametime_proto.cpp b/protocols/Sametime/src/sametime_proto.cpp
index 9003bfbe21..2aaab309e0 100644
--- a/protocols/Sametime/src/sametime_proto.cpp
+++ b/protocols/Sametime/src/sametime_proto.cpp
@@ -66,7 +66,6 @@ CSametimeProto::~CSametimeProto()
debugLog(_T("CSametimeProto::~CSametimeProto() start"));
DeinitSessionMenu();
- DeinitConferenceMenu();
DeinitAwayMsg();
UnregisterPopups();
diff --git a/protocols/Sametime/src/sametime_proto.h b/protocols/Sametime/src/sametime_proto.h
index b3690b29ee..4f3a249cf3 100644
--- a/protocols/Sametime/src/sametime_proto.h
+++ b/protocols/Sametime/src/sametime_proto.h
@@ -99,7 +99,6 @@ struct CSametimeProto : public PROTO<CSametimeProto>
void InitConference();
void InitConferenceMenu();
void DeinitConference();
- void DeinitConferenceMenu();
void ClearInviteQueue();
void TerminateConference(char* name);
int __cdecl GcEventHook(WPARAM wParam, LPARAM lParam);
@@ -183,8 +182,7 @@ struct CSametimeProto : public PROTO<CSametimeProto>
mwServiceConference* service_conference;
mwLoginInfo* my_login_info;
mwConference* my_conference;
- HANDLE hLeaveChatMenuItem;
- HANDLE hCreateChatMenuItem;
+ HGENMENU hLeaveChatMenuItem, hCreateChatMenuItem;
// options.cpp
SametimeOptions options;
diff --git a/protocols/Tlen/src/tlen.cpp b/protocols/Tlen/src/tlen.cpp
index c0acd7d49d..fbf6d2a30a 100644
--- a/protocols/Tlen/src/tlen.cpp
+++ b/protocols/Tlen/src/tlen.cpp
@@ -264,9 +264,7 @@ void TlenProtocol::initMenuItems()
strncpy_s(text, sizeof(text), m_szModuleName, _TRUNCATE);
char *pSvcName = text + mir_strlen(text);
- CLISTMENUITEM mi = { 0 }, clmi = { 0 };
- clmi.flags = CMIM_FLAGS | CMIF_GRAYED;
-
+ CLISTMENUITEM mi = { 0 };
mi.pszContactOwner = m_szModuleName;
mi.popupPosition = 500090000;
@@ -292,7 +290,6 @@ void TlenProtocol::initMenuItems()
mi.icolibItem = GetIconHandle(IDI_MUC);
mi.pszService = text;
hMenuMUC = Menu_AddMainMenuItem(&mi);
- Menu_ModifyItem(hMenuMUC, &clmi);
mir_strcpy(pSvcName, "/MainMenuInbox");
CreateProtoService(pSvcName, &TlenProtocol::MenuHandleInbox);
diff --git a/protocols/Tlen/src/tlen_iqid.cpp b/protocols/Tlen/src/tlen_iqid.cpp
index 71233ee979..70876b4a00 100644
--- a/protocols/Tlen/src/tlen_iqid.cpp
+++ b/protocols/Tlen/src/tlen_iqid.cpp
@@ -220,11 +220,9 @@ void TlenIqResultRoster(TlenProtocol *proto, XmlNode *iqNode)
}
}
- CLISTMENUITEM mi = { 0 };
- mi.flags = CMIM_FLAGS;
- Menu_ModifyItem(proto->hMenuMUC, &mi);
+ Menu_ModifyItem(proto->hMenuMUC, NULL, INVALID_HANDLE_VALUE, 0);
if (proto->hMenuChats != NULL)
- Menu_ModifyItem(proto->hMenuChats, &mi);
+ Menu_ModifyItem(proto->hMenuChats, NULL, INVALID_HANDLE_VALUE, 0);
proto->isOnline = TRUE;
proto->debugLogA("Status changed via THREADSTART");
diff --git a/protocols/Tlen/src/tlen_svc.cpp b/protocols/Tlen/src/tlen_svc.cpp
index 8445565213..6406889bb9 100644
--- a/protocols/Tlen/src/tlen_svc.cpp
+++ b/protocols/Tlen/src/tlen_svc.cpp
@@ -1160,11 +1160,7 @@ int TlenProtocol::OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lPara
case EV_PROTO_ONEXIT: return PreShutdown(0, 0);
case EV_PROTO_ONRENAME:
- CLISTMENUITEM mi = { 0 };
- mi.flags = CMIM_NAME | CMIF_TCHAR;
- mi.ptszName = m_tszUserName;
- Menu_ModifyItem(hMenuRoot, &mi);
- /* FIXME: Rename network user as well */
+ Menu_ModifyItem(hMenuRoot, m_tszUserName);
}
return 1;
}
diff --git a/protocols/Tlen/src/tlen_thread.cpp b/protocols/Tlen/src/tlen_thread.cpp
index 6cc8af6278..0e87420ca3 100644
--- a/protocols/Tlen/src/tlen_thread.cpp
+++ b/protocols/Tlen/src/tlen_thread.cpp
@@ -340,11 +340,9 @@ void __cdecl TlenServerThread(ThreadData *info)
info->proto->isOnline = FALSE;
info->proto->isConnected = FALSE;
- CLISTMENUITEM mi = { 0 };
- mi.flags = CMIM_FLAGS | CMIF_GRAYED;
- Menu_ModifyItem(info->proto->hMenuMUC, &mi);
+ Menu_ModifyItem(info->proto->hMenuMUC, NULL, INVALID_HANDLE_VALUE, CMIF_GRAYED);
if (info->proto->hMenuChats != NULL)
- Menu_ModifyItem(info->proto->hMenuChats, &mi);
+ Menu_ModifyItem(info->proto->hMenuChats, NULL, INVALID_HANDLE_VALUE, CMIF_GRAYED);
// Set status to offline
char *szProto = info->proto->m_szModuleName;
diff --git a/protocols/WhatsApp/src/proto.h b/protocols/WhatsApp/src/proto.h
index 2c7cf2e97e..cc6d787b7f 100644
--- a/protocols/WhatsApp/src/proto.h
+++ b/protocols/WhatsApp/src/proto.h
@@ -141,8 +141,7 @@ private:
// Private data //////////////////////////////////////////////////////////////////////
- HGENMENU m_hMenuRoot;
- HANDLE m_hMenuCreateGroup;
+ HGENMENU m_hMenuRoot, m_hMenuCreateGroup;
HANDLE update_loop_lock_;
diff --git a/protocols/WhatsApp/src/theme.cpp b/protocols/WhatsApp/src/theme.cpp
index 913d7b5aab..ac5f6ff3ff 100644
--- a/protocols/WhatsApp/src/theme.cpp
+++ b/protocols/WhatsApp/src/theme.cpp
@@ -84,9 +84,7 @@ int WhatsAppProto::OnBuildStatusMenu(WPARAM wParam, LPARAM lParam)
void WhatsAppProto::ToggleStatusMenuItems(BOOL bEnable)
{
- CLISTMENUITEM clmi = { 0 };
- clmi.flags = CMIM_FLAGS | ((bEnable) ? 0 : CMIF_GRAYED);
-
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)m_hMenuRoot, (LPARAM)&clmi);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)m_hMenuCreateGroup, (LPARAM)&clmi);
+ int flags = (bEnable) ? 0 : CMIF_GRAYED;
+ Menu_ModifyItem(m_hMenuRoot, NULL, INVALID_HANDLE_VALUE, flags);
+ Menu_ModifyItem(m_hMenuCreateGroup, NULL, INVALID_HANDLE_VALUE, flags);
}
diff --git a/protocols/Yahoo/src/proto.cpp b/protocols/Yahoo/src/proto.cpp
index 91d864b54b..2c2d9a42ea 100644
--- a/protocols/Yahoo/src/proto.cpp
+++ b/protocols/Yahoo/src/proto.cpp
@@ -639,12 +639,8 @@ int __cdecl CYahooProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM
break;
case EV_PROTO_ONRENAME:
- if (mainMenuRoot) {
- CLISTMENUITEM mi = { 0 };
- mi.flags = CMIM_NAME | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
- mi.ptszName = m_tszUserName;
- Menu_ModifyItem(mainMenuRoot, &mi);
- }
+ if (mainMenuRoot)
+ Menu_ModifyItem(mainMenuRoot, m_tszUserName, INVALID_HANDLE_VALUE, CMIF_KEEPUNTRANSLATED);
break;
case EV_PROTO_ONCONTACTDELETED: