summaryrefslogtreecommitdiff
path: root/protocols/VKontakte
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-27 06:04:46 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-27 06:04:46 +0000
commitdcf71bc98f0298333494583bf1852dd9f9bea90b (patch)
tree8cf8b8772f7035ef902d300386438a1fbe1c9a4b /protocols/VKontakte
parentc3aa3fb189b237130d658811f04d32c7ae739fa4 (diff)
code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@14406 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte')
-rw-r--r--protocols/VKontakte/src/vk_proto.cpp27
1 files changed, 5 insertions, 22 deletions
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp
index dfd5bfcea4..6e52444d8c 100644
--- a/protocols/VKontakte/src/vk_proto.cpp
+++ b/protocols/VKontakte/src/vk_proto.cpp
@@ -191,48 +191,46 @@ void CVkProto::InitMenus()
CreateProtoService(PS_SETSTATUSMSG, &CVkProto::SvcSetStatusMsg);
CreateProtoService(PS_WALLPOST, &CVkProto::SvcWallPost);
- CLISTMENUITEM mi = { 0 };
char szService[100];
+ CLISTMENUITEM mi = { 0 };
+ mi.pszService = szService;
+
// Proto menu
mi.hParentMenu = Menu_GetProtocolRoot(m_szModuleName);
mir_snprintf(szService, "%s%s", m_szModuleName, PS_CREATECHAT);
- mi.pszService = szService;
mi.position = 10009 + PMI_CREATECHAT;
mi.icolibItem = Skin_GetIconHandle(SKINICON_CHAT_JOIN);
mi.pszName = LPGEN("Create new chat");
g_hProtoMenuItems[PMI_CREATECHAT] = Menu_AddProtoMenuItem(&mi);
mir_snprintf(szService, "%s%s", m_szModuleName, PS_SETSTATUSMSG);
- mi.pszService = szService;
mi.position = 10009 + PMI_SETSTATUSMSG;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_STATUS));
mi.pszName = LPGEN("Status message");
g_hProtoMenuItems[PMI_SETSTATUSMSG] = Menu_AddProtoMenuItem(&mi);
mir_snprintf(szService, "%s%s", m_szModuleName, PS_WALLPOST);
- mi.pszService = szService;
mi.position = 10009 + PMI_WALLPOST;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_WALL));
mi.pszName = LPGEN("Send message to my wall");
g_hProtoMenuItems[PMI_WALLPOST] = Menu_AddProtoMenuItem(&mi);
mir_snprintf(szService, "%s%s", m_szModuleName, PS_LOADVKNEWS);
- mi.pszService = szService;
mi.position = 10009 + PMI_LOADVKNEWS;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_NOTIFICATION));
mi.pszName = LPGEN("Load news from VK");
g_hProtoMenuItems[PMI_LOADVKNEWS] = Menu_AddProtoMenuItem(&mi);
mir_snprintf(szService, "%s%s", m_szModuleName, PS_VISITPROFILE);
- mi.pszService = szService;
mi.position = 10009 + PMI_VISITPROFILE;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_VISITPROFILE));
mi.pszName = LPGEN("Visit profile");
g_hProtoMenuItems[PMI_VISITPROFILE] = Menu_AddProtoMenuItem(&mi);
- //Contact Menu Items
+ // Contact Menu Items
+ mi.hParentMenu = NULL;
mi.pszContactOwner = m_szModuleName;
mi.flags = CMIF_TCHAR;
@@ -244,53 +242,45 @@ void CVkProto::InitMenus()
mi.position = -200001000 + CMI_WALLPOST;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_WALL));
mi.ptszName = LPGENT("Send message to user\'s wall");
- mi.pszService = szService;
g_hContactMenuItems[CMI_WALLPOST] = Menu_AddContactMenuItem(&mi);
mir_snprintf(szService, "%s%s", m_szModuleName, PS_ADDASFRIEND);
mi.position = -200001000 + CMI_ADDASFRIEND;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_FRIENDADD));
mi.ptszName = LPGENT("Add as friend");
- mi.pszService = szService;
g_hContactMenuItems[CMI_ADDASFRIEND] = Menu_AddContactMenuItem(&mi);
mir_snprintf(szService, "%s%s", m_szModuleName, PS_DELETEFRIEND);
mi.position = -200001000 + CMI_DELETEFRIEND;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_FRIENDDEL));
mi.ptszName = LPGENT("Delete from friend list");
- mi.pszService = szService;
g_hContactMenuItems[CMI_DELETEFRIEND] = Menu_AddContactMenuItem(&mi);
mir_snprintf(szService, "%s%s", m_szModuleName, PS_BANUSER);
mi.position = -200001000 + CMI_BANUSER;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_BAN));
mi.ptszName = LPGENT("Ban user");
- mi.pszService = szService;
g_hContactMenuItems[CMI_BANUSER] = Menu_AddContactMenuItem(&mi);
mir_snprintf(szService, "%s%s", m_szModuleName, PS_REPORTABUSE);
mi.position = -200001000 + CMI_REPORTABUSE;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_ABUSE));
mi.ptszName = LPGENT("Report abuse");
- mi.pszService = szService;
g_hContactMenuItems[CMI_REPORTABUSE] = Menu_AddContactMenuItem(&mi);
mir_snprintf(szService, "%s%s", m_szModuleName, PS_DESTROYKICKCHAT);
mi.position = -200001000 + CMI_DESTROYKICKCHAT;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_FRIENDDEL));
mi.ptszName = LPGENT("Destroy room");
- mi.pszService = szService;
g_hContactMenuItems[CMI_DESTROYKICKCHAT] = Menu_AddContactMenuItem(&mi);
mir_snprintf(szService, "%s%s", m_szModuleName, PS_OPENBROADCAST);
mi.position = -200001000 + CMI_OPENBROADCAST;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_BROADCAST));
mi.ptszName = LPGENT("Open broadcast");
- mi.pszService = szService;
g_hContactMenuItems[CMI_OPENBROADCAST] = Menu_AddContactMenuItem(&mi);
mir_snprintf(szService, "%s%s", m_szModuleName, PS_LOADVKNEWS);
- mi.pszService = szService;
mi.position = -200001000 + CMI_LOADVKNEWS;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_NOTIFICATION));
mi.ptszName = LPGENT("Load news from VK");
@@ -301,7 +291,6 @@ void CVkProto::InitMenus()
mi.position = -200001000 + CMI_GETSERVERHISTORY;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
mi.ptszName = LPGENT("Reload messages from vk.com...");
- mi.pszService = szService;
g_hContactMenuItems[CMI_GETSERVERHISTORY] = Menu_AddContactMenuItem(&mi);
mi.hParentMenu = g_hContactMenuItems[CMI_GETSERVERHISTORY];
@@ -310,42 +299,36 @@ void CVkProto::InitMenus()
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST1DAY;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
mi.ptszName = LPGENT("for last 1 day");
- mi.pszService = szService;
g_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST1DAY] = Menu_AddContactMenuItem(&mi);
mir_snprintf(szService, "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST3DAY);
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST3DAY;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
mi.ptszName = LPGENT("for last 3 days");
- mi.pszService = szService;
g_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST3DAY] = Menu_AddContactMenuItem(&mi);
mir_snprintf(szService, "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST7DAY);
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST7DAY;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
mi.ptszName = LPGENT("for last week");
- mi.pszService = szService;
g_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST7DAY] = Menu_AddContactMenuItem(&mi);
mir_snprintf(szService, "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST30DAY);
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST30DAY;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
mi.ptszName = LPGENT("for last 30 days");
- mi.pszService = szService;
g_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST30DAY] = Menu_AddContactMenuItem(&mi);
mir_snprintf(szService, "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST90DAY);
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST90DAY;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
mi.ptszName = LPGENT("for last 90 days");
- mi.pszService = szService;
g_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST90DAY] = Menu_AddContactMenuItem(&mi);
mir_snprintf(szService, "%s%s", m_szModuleName, PS_GETALLSERVERHISTORY);
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETALLSERVERHISTORY;
mi.icolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
mi.ptszName = LPGENT("for all time");
- mi.pszService = szService;
g_hContactHistoryMenuItems[CHMI_GETALLSERVERHISTORY] = Menu_AddContactMenuItem(&mi);
}