summaryrefslogtreecommitdiff
path: root/src/core/stdchat
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-11-28 21:45:37 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-11-28 21:45:37 +0000
commit30707c980d1560b358dbf2671a4d2a26a1e8173c (patch)
tree74aee5adaaac976e1398274ca64c5461a60f1feb /src/core/stdchat
parent335ec43a4bfdcbbd0b2257037f1f3e0553d89076 (diff)
various menu initialization quirks
git-svn-id: http://svn.miranda-ng.org/main/trunk@2552 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/core/stdchat')
-rw-r--r--src/core/stdchat/src/clist.cpp21
-rw-r--r--src/core/stdchat/src/services.cpp3
2 files changed, 11 insertions, 13 deletions
diff --git a/src/core/stdchat/src/clist.cpp b/src/core/stdchat/src/clist.cpp
index 83467c0c71..687ed7f50b 100644
--- a/src/core/stdchat/src/clist.cpp
+++ b/src/core/stdchat/src/clist.cpp
@@ -197,28 +197,27 @@ int CList_PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
if ( hContact ) {
char* szProto = GetContactProto(hContact);
- CLISTMENUITEM clmi = {0};
- clmi.cbSize = sizeof(CLISTMENUITEM);
- clmi.flags = CMIM_FLAGS | CMIF_DEFAULT | CMIF_HIDDEN;
+ CLISTMENUITEM mi = { sizeof(mi) };
+ mi.flags = CMIM_FLAGS | CMIF_DEFAULT | CMIF_HIDDEN;
if ( szProto ) {
// display this menu item only for chats
if ( DBGetContactSettingByte( hContact, szProto, "ChatRoom", 0 )) {
// still hide it for offline protos
if ( CallProtoService( szProto, PS_GETSTATUS, 0, 0 ) != ID_STATUS_OFFLINE ) {
- clmi.flags &= ~CMIF_HIDDEN;
- clmi.flags |= CMIM_NAME;
+ mi.flags &= ~CMIF_HIDDEN;
+ mi.flags |= CMIM_NAME;
if ( DBGetContactSettingWord( hContact, szProto, "Status", 0 ) == ID_STATUS_OFFLINE )
- clmi.pszName = ( char* )LPGEN("Join chat");
+ mi.pszName = ( char* )LPGEN("Join chat");
else
- clmi.pszName = ( char* )LPGEN("Open chat window");
+ mi.pszName = ( char* )LPGEN("Open chat window");
} } }
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hJoinMenuItem, ( LPARAM )&clmi );
+ CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hJoinMenuItem, ( LPARAM )&mi );
- clmi.flags &= ~(CMIM_NAME | CMIF_DEFAULT);
- clmi.flags |= CMIF_NOTOFFLINE;
- CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hLeaveMenuItem, ( LPARAM )&clmi );
+ mi.flags &= ~(CMIM_NAME | CMIF_DEFAULT);
+ mi.flags |= CMIF_NOTOFFLINE;
+ CallService( MS_CLIST_MODIFYMENUITEM, ( WPARAM )hLeaveMenuItem, ( LPARAM )&mi );
}
return 0;
}
diff --git a/src/core/stdchat/src/services.cpp b/src/core/stdchat/src/services.cpp
index 6d08843093..247b71b3c9 100644
--- a/src/core/stdchat/src/services.cpp
+++ b/src/core/stdchat/src/services.cpp
@@ -219,8 +219,7 @@ static int ModulesLoaded(WPARAM wParam,LPARAM lParam)
AddIcons();
LoadIcons();
{
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.position = -2000090001;
mi.flags = CMIF_DEFAULT | CMIF_ICONFROMICOLIB;
mi.icolibItem = LoadSkinnedIconHandle( SKINICON_CHAT_JOIN );