summaryrefslogtreecommitdiff
path: root/protocols/AimOscar
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/AimOscar
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/AimOscar')
-rw-r--r--protocols/AimOscar/src/proto.cpp8
-rw-r--r--protocols/AimOscar/src/theme.cpp54
2 files changed, 26 insertions, 36 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;
}