summaryrefslogtreecommitdiff
path: root/protocols/VKontakte
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-04-12 21:07:14 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-04-12 21:07:14 +0300
commit0dee9779ac8846ed47c0989b6b9b7e62b42a23bf (patch)
treed198c2c0fd28dfff006d389dfa7e33b8773f6934 /protocols/VKontakte
parentf0a5881bdc0b1773dd0a39e5788a1c77d7fe5681 (diff)
wiping custom icolib functions: VK
Diffstat (limited to 'protocols/VKontakte')
-rw-r--r--protocols/VKontakte/src/misc.cpp11
-rw-r--r--protocols/VKontakte/src/vk.h1
-rw-r--r--protocols/VKontakte/src/vk_dialogs.cpp4
-rw-r--r--protocols/VKontakte/src/vk_feed.cpp2
-rw-r--r--protocols/VKontakte/src/vk_proto.cpp48
5 files changed, 28 insertions, 38 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp
index 0b55ba50a4..6b299829a4 100644
--- a/protocols/VKontakte/src/misc.cpp
+++ b/protocols/VKontakte/src/misc.cpp
@@ -82,15 +82,6 @@ void InitIcons()
g_plugin.registerIcon(LPGEN("Protocols") "/" LPGEN("VKontakte"), iconList, "VKontakte");
}
-HANDLE GetIconHandle(int iCommand)
-{
- for (auto &it : iconList)
- if (it.defIconID == iCommand)
- return it.hIcolib;
-
- return nullptr;
-}
-
/////////////////////////////////////////////////////////////////////////////////////////
char* ExpUrlEncode(const char *szUrl, bool strict)
@@ -765,7 +756,7 @@ void CVkProto::SetSrmmReadStatus(MCONTACT hContact)
_wcsftime_l(ttime, _countof(ttime), L"%X - %x", localtime(&time), locale);
_free_locale(locale);
- Srmm_SetStatusText(hContact, CMStringW(FORMAT, TranslateT("Message read: %s"), ttime), IcoLib_GetIconByHandle(GetIconHandle(IDI_READMSG)));
+ Srmm_SetStatusText(hContact, CMStringW(FORMAT, TranslateT("Message read: %s"), ttime), g_plugin.getIcon(IDI_READMSG));
}
void CVkProto::MarkDialogAsRead(MCONTACT hContact)
diff --git a/protocols/VKontakte/src/vk.h b/protocols/VKontakte/src/vk.h
index acc4ae940f..8c3d8e14d9 100644
--- a/protocols/VKontakte/src/vk.h
+++ b/protocols/VKontakte/src/vk.h
@@ -108,7 +108,6 @@ LPCSTR findHeader(NETLIBHTTPREQUEST *hdr, LPCSTR szField);
bool wlstrstr(wchar_t *_s1, wchar_t *_s2);
void InitIcons(void);
-HANDLE GetIconHandle(int iCommand);
char* ExpUrlEncode(const char *szUrl, bool strict = false);
diff --git a/protocols/VKontakte/src/vk_dialogs.cpp b/protocols/VKontakte/src/vk_dialogs.cpp
index 3ccf89ab6a..8616098d7f 100644
--- a/protocols/VKontakte/src/vk_dialogs.cpp
+++ b/protocols/VKontakte/src/vk_dialogs.cpp
@@ -34,7 +34,7 @@ CVkCaptchaForm::CVkCaptchaForm(CVkProto *proto, CAPTCHA_FORM_PARAMS *param) :
bool CVkCaptchaForm::OnInitDialog()
{
- Window_SetIcon_IcoLib(m_hwnd, GetIconHandle(IDI_KEYS));
+ Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_KEYS));
m_btnOk.Disable();
m_btnOpenInBrowser.Enable((m_param->bmp != nullptr));
@@ -118,7 +118,7 @@ CVkWallPostForm::CVkWallPostForm(CVkProto *proto, WALLPOST_FORM_PARAMS *param) :
bool CVkWallPostForm::OnInitDialog()
{
- Window_SetIcon_IcoLib(m_hwnd, GetIconHandle(IDI_WALL));
+ Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_WALL));
CMStringW wszTitle(FORMAT, TranslateT("Wall message for %s"), m_param->pwszNick);
SetCaption(wszTitle);
diff --git a/protocols/VKontakte/src/vk_feed.cpp b/protocols/VKontakte/src/vk_feed.cpp
index 1489553ef4..9034495659 100644
--- a/protocols/VKontakte/src/vk_feed.cpp
+++ b/protocols/VKontakte/src/vk_feed.cpp
@@ -76,7 +76,7 @@ void CVkProto::AddCListEvent(bool bNews)
MCONTACT hContact = FindUser(VK_FEED_USER, true);
CLISTEVENT cle = {};
- cle.hIcon = IcoLib_GetIconByHandle(GetIconHandle(IDI_NOTIFICATION));
+ cle.hIcon = g_plugin.getIcon(IDI_NOTIFICATION);
cle.pszService = MS_MSG_READMESSAGE;
cle.flags = CLEF_URGENT | CLEF_UNICODE;
cle.hContact = hContact;
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp
index 3ffbf82c27..a15749e750 100644
--- a/protocols/VKontakte/src/vk_proto.cpp
+++ b/protocols/VKontakte/src/vk_proto.cpp
@@ -160,7 +160,7 @@ void CVkProto::InitMenus()
if (m_vkOptions.bShowProtoMenuItem1) {
mi.pszService = PS_SETSTATUSMSG;
mi.position = 10009 + PMI_SETSTATUSMSG;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_STATUS));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_STATUS);
mi.name.a = LPGEN("Status message");
SET_UID(mi, 0x696bd932, 0xeee4, 0x4c4c, 0xa6, 0xf8, 0xb3, 0x72, 0xdf, 0xc6, 0xfa, 0xd1);
m_hProtoMenuItems[PMI_SETSTATUSMSG] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
@@ -169,7 +169,7 @@ void CVkProto::InitMenus()
if (m_vkOptions.bShowProtoMenuItem2) {
mi.pszService = PS_WALLPOST;
mi.position = 10009 + PMI_WALLPOST;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_WALL));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_WALL);
mi.name.a = LPGEN("Send message to my wall");
SET_UID(mi, 0x50a80044, 0xdddd, 0x47e6, 0x9e, 0x90, 0x32, 0x7b, 0x88, 0x13, 0x21, 0x4e);
m_hProtoMenuItems[PMI_WALLPOST] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
@@ -178,7 +178,7 @@ void CVkProto::InitMenus()
if (m_vkOptions.bShowProtoMenuItem3) {
mi.pszService = PS_LOADVKNEWS;
mi.position = 10009 + PMI_LOADVKNEWS;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_NOTIFICATION));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_NOTIFICATION);
mi.name.a = LPGEN("Load news from VK");
SET_UID(mi, 0x7c449456, 0xb731, 0x48cc, 0x9c, 0x4e, 0x20, 0xe4, 0x66, 0x7a, 0x16, 0x23);
m_hProtoMenuItems[PMI_LOADVKNEWS] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
@@ -187,7 +187,7 @@ void CVkProto::InitMenus()
if (m_vkOptions.bShowProtoMenuItem4) {
mi.pszService = PS_GETALLSERVERHISTORY;
mi.position = 10009 + PMI_GETALLSERVERHISTORY;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_HISTORY);
mi.name.a = LPGEN("Load history for all contacts from VK");
SET_UID(mi, 0xe5028605, 0x92eb, 0x4956, 0xa0, 0xd0, 0x53, 0xb, 0x11, 0x44, 0x8f, 0x14);
m_hProtoMenuItems[PMI_GETALLSERVERHISTORY] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
@@ -196,7 +196,7 @@ void CVkProto::InitMenus()
if (m_vkOptions.bShowProtoMenuItem5) {
mi.pszService = PS_WIPENONFRIENDS;
mi.position = 10009 + PMI_WIPENONFRIENDS;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_FRIENDDEL));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_FRIENDDEL);
mi.name.a = LPGEN("Wipe contacts missing in friend list");
SET_UID(mi, 0xcfe99159, 0xf237, 0x4546, 0x80, 0x3e, 0x51, 0x88, 0x26, 0x55, 0xdc, 0x5f);
m_hProtoMenuItems[PMI_WIPENONFRIENDS] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
@@ -205,7 +205,7 @@ void CVkProto::InitMenus()
if (m_vkOptions.bShowProtoMenuItem6) {
mi.pszService = PS_VISITPROFILE;
mi.position = 10009 + PMI_VISITPROFILE;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_VISITPROFILE));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_VISITPROFILE);
mi.name.a = LPGEN("Visit profile");
SET_UID(mi, 0x9550515e, 0x2a45, 0x4913, 0x95, 0x1a, 0x1e, 0xfa, 0x7, 0xc6, 0x2d, 0x60);
m_hProtoMenuItems[PMI_VISITPROFILE] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
@@ -217,70 +217,70 @@ void CVkProto::InitMenus()
mi.pszService = PS_VISITPROFILE;
mi.position = -200001000 + CMI_VISITPROFILE;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_VISITPROFILE));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_VISITPROFILE);
mi.name.w = LPGENW("Visit profile");
SET_UID(mi, 0x828cc50e, 0x398d, 0x43a2, 0xbf, 0xd3, 0xa9, 0x96, 0x47, 0x9d, 0x52, 0xff);
m_hContactMenuItems[CMI_VISITPROFILE] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_MARKMESSAGESASREAD;
mi.position = -200001000 + CMI_MARKMESSAGESASREAD;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_MARKMESSAGESASREAD));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_MARKMESSAGESASREAD);
mi.name.w = LPGENW("Mark messages as read");
SET_UID(mi, 0x2587a649, 0xe5d5, 0x4e90, 0x8b, 0x35, 0x81, 0x4c, 0xb1, 0x5, 0x94, 0x7);
m_hContactMenuItems[CMI_MARKMESSAGESASREAD] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_WALLPOST;
mi.position = -200001000 + CMI_WALLPOST;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_WALL));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_WALL);
mi.name.w = LPGENW("Send message to user's wall");
SET_UID(mi, 0xd8841aaf, 0x15f6, 0x4be9, 0x9f, 0x4f, 0x16, 0xa9, 0x47, 0x6a, 0x19, 0x81);
m_hContactMenuItems[CMI_WALLPOST] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_ADDASFRIEND;
mi.position = -200001000 + CMI_ADDASFRIEND;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_FRIENDADD));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_FRIENDADD);
mi.name.w = LPGENW("Add as friend");
SET_UID(mi, 0xf11b9a7f, 0x569, 0x4023, 0xb0, 0xd6, 0xa3, 0x16, 0xf6, 0xd4, 0xfb, 0xb5);
m_hContactMenuItems[CMI_ADDASFRIEND] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_DELETEFRIEND;
mi.position = -200001000 + CMI_DELETEFRIEND;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_FRIENDDEL));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_FRIENDDEL);
mi.name.w = LPGENW("Delete from friend list");
SET_UID(mi, 0x1e26514, 0x854f, 0x4e60, 0x8c, 0xf8, 0xab, 0xaa, 0xe0, 0xc3, 0xa5, 0xa7);
m_hContactMenuItems[CMI_DELETEFRIEND] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_BANUSER;
mi.position = -200001000 + CMI_BANUSER;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_BAN));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_BAN);
mi.name.w = LPGENW("Ban user");
SET_UID(mi, 0x7ba06bab, 0xf770, 0x4938, 0x9c, 0x76, 0xef, 0x40, 0xbc, 0x55, 0x0, 0x9b);
m_hContactMenuItems[CMI_BANUSER] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_REPORTABUSE;
mi.position = -200001000 + CMI_REPORTABUSE;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_ABUSE));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_ABUSE);
mi.name.w = LPGENW("Report abuse");
SET_UID(mi, 0x56454cb9, 0xd80, 0x4050, 0xbe, 0xfc, 0x2c, 0xf6, 0x10, 0x2a, 0x7d, 0x19);
m_hContactMenuItems[CMI_REPORTABUSE] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_DESTROYKICKCHAT;
mi.position = -200001000 + CMI_DESTROYKICKCHAT;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_FRIENDDEL));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_FRIENDDEL);
mi.name.w = LPGENW("Destroy room");
SET_UID(mi, 0x4fa6e75a, 0x30cd, 0x4482, 0xae, 0x8f, 0x0, 0x38, 0xd0, 0x17, 0x33, 0xcd);
m_hContactMenuItems[CMI_DESTROYKICKCHAT] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_OPENBROADCAST;
mi.position = -200001000 + CMI_OPENBROADCAST;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_BROADCAST));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_BROADCAST);
mi.name.w = LPGENW("Open broadcast");
SET_UID(mi, 0x85251a06, 0xf734, 0x4985, 0x8c, 0x36, 0x6f, 0x66, 0x46, 0xf9, 0xa0, 0x10);
m_hContactMenuItems[CMI_OPENBROADCAST] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_LOADVKNEWS;
mi.position = -200001000 + CMI_LOADVKNEWS;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_NOTIFICATION));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_NOTIFICATION);
mi.name.w = LPGENW("Load news from VK");
SET_UID(mi, 0xe1f6888b, 0x21ae, 0x409f, 0x82, 0xa2, 0x7b, 0x72, 0xef, 0x47, 0x9, 0xc0);
m_hContactMenuItems[CMI_LOADVKNEWS] = Menu_AddContactMenuItem(&mi, m_szModuleName);
@@ -288,7 +288,7 @@ void CVkProto::InitMenus()
// Sync history menu
mi.pszService = PS_GETSERVERHISTORY;
mi.position = -200001000 + CMI_GETSERVERHISTORY;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_HISTORY);
mi.name.w = LPGENW("Reload messages from vk.com...");
SET_UID(mi, 0xc6b59e9f, 0x5250, 0x4146, 0xb6, 0xf3, 0x2d, 0xe1, 0x4, 0x3b, 0x95, 0xf5);
m_hContactMenuItems[CMI_GETSERVERHISTORY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
@@ -297,42 +297,42 @@ void CVkProto::InitMenus()
mi.pszService = PS_GETSERVERHISTORYLAST1DAY;
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST1DAY;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_HISTORY);
mi.name.w = LPGENW("for last 1 day");
SET_UID(mi, 0x508dce88, 0x1a9a, 0x4dd7, 0x90, 0xf4, 0x41, 0x35, 0x7b, 0xc3, 0x17, 0xed);
m_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST1DAY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_GETSERVERHISTORYLAST3DAY;
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST3DAY;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_HISTORY);
mi.name.w = LPGENW("for last 3 days");
SET_UID(mi, 0x9a878764, 0x5bbf, 0x433a, 0xbd, 0x50, 0xa9, 0xb9, 0x16, 0x1f, 0x99, 0x29);
m_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST3DAY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_GETSERVERHISTORYLAST7DAY;
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST7DAY;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_HISTORY);
mi.name.w = LPGENW("for last week");
SET_UID(mi, 0xc6482460, 0xd280, 0x4596, 0x97, 0x4b, 0xf7, 0xfa, 0x6d, 0xe, 0xd5, 0xda);
m_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST7DAY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_GETSERVERHISTORYLAST30DAY;
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST30DAY;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_HISTORY);
mi.name.w = LPGENW("for last 30 days");
SET_UID(mi, 0xc48e8a9f, 0x2860, 0x4d5b, 0xa8, 0xdf, 0xb8, 0x3f, 0xdf, 0x7b, 0xa2, 0xba);
m_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST30DAY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_GETSERVERHISTORYLAST90DAY;
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST90DAY;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_HISTORY);
mi.name.w = LPGENW("for last 90 days");
SET_UID(mi, 0xd8e30530, 0xa585, 0x4672, 0xa6, 0x39, 0x18, 0xc9, 0xc9, 0xcb, 0xc7, 0x7d);
m_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST90DAY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_GETALLSERVERHISTORYFORCONTACT;
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETALLSERVERHISTORYFORCONTACT;
- mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_HISTORY);
mi.name.w = LPGENW("for all time");
SET_UID(mi, 0xaee3d02b, 0x3667, 0x47c8, 0x9f, 0x43, 0x14, 0xb7, 0xab, 0x52, 0x14, 0x94);
m_hContactHistoryMenuItems[CHMI_GETALLSERVERHISTORYFORCONTACT] = Menu_AddContactMenuItem(&mi, m_szModuleName);
@@ -424,7 +424,7 @@ void CVkProto::InitPopups(void)
mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Notifications"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Notification");
- ppc.hIcon = IcoLib_GetIconByHandle(GetIconHandle(IDI_NOTIFICATION));
+ ppc.hIcon = g_plugin.getIcon(IDI_NOTIFICATION);
ppc.colorBack = RGB(190, 225, 255); // Blue
ppc.colorText = RGB(255, 255, 255); // White
ppc.iSeconds = 4;