From 88790eed4ffd9ca555c8f9b73cb014a93b57a34f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 22 Jun 2015 20:38:56 +0000 Subject: Menu_ModifyItem unbound from CLISTMENUITEM structure git-svn-id: http://svn.miranda-ng.org/main/trunk@14334 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/core/stdaway/src/awaymsg.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'src/core') diff --git a/src/core/stdaway/src/awaymsg.cpp b/src/core/stdaway/src/awaymsg.cpp index 2415198d4a..6be4cf1a7e 100644 --- a/src/core/stdaway/src/awaymsg.cpp +++ b/src/core/stdaway/src/awaymsg.cpp @@ -133,29 +133,23 @@ static INT_PTR GetMessageCommand(WPARAM wParam, LPARAM) static int AwayMsgPreBuildMenu(WPARAM hContact, LPARAM) { - TCHAR str[128]; char *szProto = GetContactProto(hContact); - - CLISTMENUITEM mi = { 0 }; - mi.flags = CMIM_FLAGS | CMIF_NOTOFFLINE | CMIF_HIDDEN | CMIF_TCHAR; - if (szProto != NULL) { int chatRoom = db_get_b(hContact, szProto, "ChatRoom", 0); if (!chatRoom) { int status = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE); - mir_sntprintf(str, _countof(str), TranslateT("Re&ad %s message"), pcli->pfnGetStatusModeDescription(status, 0)); - mi.ptszName = str; if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGRECV) { if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(status)) { - mi.flags = CMIM_FLAGS | CMIM_NAME | CMIF_NOTOFFLINE | CMIM_ICON | CMIF_TCHAR; - mi.hIcon = Skin_LoadProtoIcon(szProto, status); + TCHAR str[128]; + mir_sntprintf(str, _countof(str), TranslateT("Re&ad %s message"), pcli->pfnGetStatusModeDescription(status, 0)); + Menu_ModifyItem(hAwayMsgMenuItem, str, Skin_LoadProtoIcon(szProto, status), CMIF_NOTOFFLINE); + return 0; } } } } - Menu_ModifyItem(hAwayMsgMenuItem, &mi); - IcoLib_ReleaseIcon(mi.hIcon, 0); + Menu_ShowItem(hAwayMsgMenuItem, false); return 0; } -- cgit v1.2.3