diff options
Diffstat (limited to 'protocols/VKontakte/src/vk_proto.cpp')
-rw-r--r-- | protocols/VKontakte/src/vk_proto.cpp | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index f7c5c77900..a31f4658a2 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -33,7 +33,7 @@ LIST<CVkProto> vk_Instances(1, sttCompareProtocols); mir_cs csInstances;
static COLORREF sttColors[] = { 0, 1, 2, 3, 4, 5, 6 };
-CVkProto::CVkProto(const char *szModuleName, const TCHAR *ptszUserName) :
+CVkProto::CVkProto(const char *szModuleName, const wchar_t *ptszUserName) :
PROTO<CVkProto>(szModuleName, ptszUserName),
m_arRequestsQueue(10, sttCompareAsyncHttpRequest),
m_sendIds(3, PtrKeySortT),
@@ -61,7 +61,7 @@ CVkProto::CVkProto(const char *szModuleName, const TCHAR *ptszUserName) : HookProtoEvent(ME_OPT_INITIALISE, &CVkProto::OnOptionsInit);
- TCHAR descr[512];
+ wchar_t descr[512];
mir_sntprintf(descr, TranslateT("%s server connection"), m_tszUserName);
NETLIBUSER nlu = {sizeof(nlu)};
@@ -120,7 +120,7 @@ int CVkProto::OnModulesLoaded(WPARAM, LPARAM) HookProtoEvent(ME_DB_EVENT_MARKED_READ, &CVkProto::OnDbEventRead);
HookProtoEvent(ME_DB_CONTACT_SETTINGCHANGED, &CVkProto::OnDbSettingChanged);
//Sounds
- SkinAddNewSoundExT("VKNewsFeed", m_tszUserName, LPGENT("VKontakte newsfeed & notification event"));
+ SkinAddNewSoundExT("VKNewsFeed", m_tszUserName, LPGENW("VKontakte newsfeed & notification event"));
InitPopups();
InitMenus();
@@ -233,70 +233,70 @@ void CVkProto::InitMenus() mi.pszService = PS_VISITPROFILE;
mi.position = -200001000 + CMI_VISITPROFILE;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_VISITPROFILE));
- mi.name.t = LPGENT("Visit profile");
+ 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.name.t = LPGENT("Mark messages as read");
+ 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.name.t = LPGENT("Send message to user\'s 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.name.t = LPGENT("Add as friend");
+ 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.name.t = LPGENT("Delete from friend list");
+ 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.name.t = LPGENT("Ban user");
+ 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.name.t = LPGENT("Report 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.name.t = LPGENT("Destroy room");
+ 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.name.t = LPGENT("Open 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.name.t = LPGENT("Load news from VK");
+ 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);
@@ -304,7 +304,7 @@ void CVkProto::InitMenus() mi.pszService = PS_GETSERVERHISTORY;
mi.position = -200001000 + CMI_GETSERVERHISTORY;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
- mi.name.t = LPGENT("Reload messages from vk.com...");
+ 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);
@@ -313,42 +313,42 @@ void CVkProto::InitMenus() mi.pszService = PS_GETSERVERHISTORYLAST1DAY;
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST1DAY;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
- mi.name.t = LPGENT("for last 1 day");
+ 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.name.t = LPGENT("for last 3 days");
+ 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.name.t = LPGENT("for last week");
+ 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.name.t = LPGENT("for last 30 days");
+ 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.name.t = LPGENT("for last 90 days");
+ 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.name.t = LPGENT("for all time");
+ 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);
}
@@ -418,7 +418,7 @@ LRESULT CALLBACK PopupDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa void CVkProto::InitPopups(void)
{
- TCHAR desc[256];
+ wchar_t desc[256];
char name[256];
POPUPCLASS ppc = { sizeof(ppc) };
ppc.flags = PCF_TCHAR;
@@ -446,14 +446,14 @@ void CVkProto::InitPopups(void) m_hPopupClassNotification = Popup_RegisterClass(&ppc);
}
-void CVkProto::MsgPopup(MCONTACT hContact, const TCHAR *szMsg, const TCHAR *szTitle, bool err)
+void CVkProto::MsgPopup(MCONTACT hContact, const wchar_t *szMsg, const wchar_t *szTitle, bool err)
{
if (ServiceExists(MS_POPUP_ADDPOPUPCLASS)) {
char name[256];
POPUPDATACLASS ppd = { sizeof(ppd) };
- ppd.ptszTitle = szTitle;
- ppd.ptszText = szMsg;
+ ppd.pwszTitle = szTitle;
+ ppd.pwszText = szMsg;
ppd.pszClassName = name;
ppd.hContact = hContact;
ppd.PluginData = new CVkSendMsgParam(hContact);
@@ -534,7 +534,7 @@ MCONTACT CVkProto::AddToList(int, PROTOSEARCHRESULT *psr) {
debugLogA("CVkProto::AddToList");
- int uid = _ttoi(psr->id.t);
+ int uid = _wtoi(psr->id.w);
if (!uid)
return NULL;
@@ -543,7 +543,7 @@ MCONTACT CVkProto::AddToList(int, PROTOSEARCHRESULT *psr) return hContact;
}
-int CVkProto::AuthRequest(MCONTACT hContact, const TCHAR *message)
+int CVkProto::AuthRequest(MCONTACT hContact, const wchar_t *message)
{
debugLogA("CVkProto::AuthRequest");
if (!IsOnline())
@@ -553,9 +553,9 @@ int CVkProto::AuthRequest(MCONTACT hContact, const TCHAR *message) if (userID == -1 || !hContact || userID == VK_FEED_USER)
return 1;
- TCHAR msg[501] = {0};
+ wchar_t msg[501] = {0};
if (message)
- _tcsncpy_s(msg, 500, message, _TRUNCATE);
+ wcsncpy_s(msg, 500, message, _TRUNCATE);
Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/friends.add.json", true, &CVkProto::OnReceiveAuthRequest)
<< INT_PARAM("user_id", userID)
@@ -616,7 +616,7 @@ int CVkProto::Authorize(MEVENT hDbEvent) return AuthRequest(hContact, NULL);
}
-int CVkProto::AuthDeny(MEVENT hDbEvent, const TCHAR*)
+int CVkProto::AuthDeny(MEVENT hDbEvent, const wchar_t*)
{
debugLogA("CVkProto::AuthDeny");
if (!IsOnline())
|