From 2f261839b60692e33d0e160344d0d636d49c90ba Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 27 Jul 2016 14:23:31 +0000 Subject: less TCHARs git-svn-id: http://svn.miranda-ng.org/main/trunk@17138 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/VKontakte/src/misc.cpp | 24 ++++++++-------- protocols/VKontakte/src/vk_avatars.cpp | 6 ++-- protocols/VKontakte/src/vk_chats.cpp | 48 +++++++++++++++---------------- protocols/VKontakte/src/vk_dialogs.cpp | 4 +-- protocols/VKontakte/src/vk_feed.cpp | 4 +-- protocols/VKontakte/src/vk_files.cpp | 2 +- protocols/VKontakte/src/vk_history.cpp | 4 +-- protocols/VKontakte/src/vk_options.cpp | 18 ++++++------ protocols/VKontakte/src/vk_options.h | 6 ++-- protocols/VKontakte/src/vk_pollserver.cpp | 4 +-- protocols/VKontakte/src/vk_proto.cpp | 12 ++++---- protocols/VKontakte/src/vk_search.cpp | 26 ++++++++--------- protocols/VKontakte/src/vk_status.cpp | 10 +++---- protocols/VKontakte/src/vk_struct.cpp | 4 +-- protocols/VKontakte/src/vk_struct.h | 6 ++-- protocols/VKontakte/src/vk_thread.cpp | 22 +++++++------- 16 files changed, 100 insertions(+), 100 deletions(-) (limited to 'protocols/VKontakte') diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index 340a27c78e..31865ddd4a 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -152,7 +152,7 @@ wchar_t* CVkProto::GetUserStoredPassword() { debugLogA("CVkProto::GetUserStoredPassword"); ptrA szRawPass(getStringA("Password")); - return (szRawPass != NULL) ? mir_utf8decodeT(szRawPass) : NULL; + return (szRawPass != NULL) ? mir_utf8decodeW(szRawPass) : NULL; } void CVkProto::SetAllContactStatuses(int iStatus) @@ -389,9 +389,9 @@ bool CVkProto::AutoFillForm(char *pBody, CMStringA &szAction, CMStringA& szResul CMStringA name = getAttr(pFieldBeg, "name"); CMStringA value = getAttr(pFieldBeg, "value"); if (name == "email") - value = (char*)T2Utf(ptrT(getTStringA("Login"))); + value = (char*)T2Utf(ptrW(getTStringA("Login"))); else if (name == "pass") - value = (char*)T2Utf(ptrT(GetUserStoredPassword())); + value = (char*)T2Utf(ptrW(GetUserStoredPassword())); else if (name == "captcha_key") { char *pCaptchaBeg = strstr(pFormBeg, "hContact == NULL || param->hContact == INVALID_CONTACT_ID || !IsOnline()) return; - for (int i = 0; i < MAX_RETRIES && IsEmpty(ptrT(db_get_tsa(param->hContact, m_szModuleName, "Nick"))); i++) { + for (int i = 0; i < MAX_RETRIES && IsEmpty(ptrW(db_get_tsa(param->hContact, m_szModuleName, "Nick"))); i++) { Sleep(1500); if (!IsOnline()) @@ -519,9 +519,9 @@ void CVkProto::DBAddAuthRequest(const MCONTACT hContact, bool added) { debugLogA("CVkProto::DBAddAuthRequest"); - T2Utf szNick(ptrT(db_get_tsa(hContact, m_szModuleName, "Nick"))); - T2Utf szFirstName(ptrT(db_get_tsa(hContact, m_szModuleName, "FirstName"))); - T2Utf szLastName(ptrT(db_get_tsa(hContact, m_szModuleName, "LastName"))); + T2Utf szNick(ptrW(db_get_tsa(hContact, m_szModuleName, "Nick"))); + T2Utf szFirstName(ptrW(db_get_tsa(hContact, m_szModuleName, "FirstName"))); + T2Utf szLastName(ptrW(db_get_tsa(hContact, m_szModuleName, "LastName"))); //blob is: uin(DWORD), hContact(DWORD), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ), reason(ASCIIZ) //blob is: 0(DWORD), hContact(DWORD), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), ""(ASCIIZ), ""(ASCIIZ) @@ -589,7 +589,7 @@ void CVkProto::SetMirVer(MCONTACT hContact, int platform) return; } - CMString MirVer, OldMirVer(ptrT(db_get_tsa(hContact, m_szModuleName, "MirVer"))); + CMString MirVer, OldMirVer(ptrW(db_get_tsa(hContact, m_szModuleName, "MirVer"))); bool bSetFlag = true; switch (platform) { @@ -685,7 +685,7 @@ void CVkProto::SetSrmmReadStatus(MCONTACT hContact) StatusTextData st = { 0 }; st.cbSize = sizeof(st); st.hIcon = IcoLib_GetIconByHandle(GetIconHandle(IDI_READMSG)); - mir_sntprintf(st.tszText, TranslateT("Message read: %s"), ttime); + mir_snwprintf(st.tszText, TranslateT("Message read: %s"), ttime); CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hContact, (LPARAM)&st); } @@ -1245,7 +1245,7 @@ CMString CVkProto::GetFwdMessages(const JSONNode &jnMessages, const JSONNode &jn else { MCONTACT hContact = FindUser(uid); if (hContact || uid == m_msgId) - tszNick = ptrT(db_get_tsa(hContact, m_szModuleName, "Nick")); + tszNick = ptrW(db_get_tsa(hContact, m_szModuleName, "Nick")); else tszNick = TranslateT("(Unknown contact)"); tszUrl.AppendFormat(L"https://vk.com/id%d", uid); diff --git a/protocols/VKontakte/src/vk_avatars.cpp b/protocols/VKontakte/src/vk_avatars.cpp index a2ada3e6d0..7401f2a386 100644 --- a/protocols/VKontakte/src/vk_avatars.cpp +++ b/protocols/VKontakte/src/vk_avatars.cpp @@ -130,7 +130,7 @@ INT_PTR CVkProto::SvcGetMyAvatar(WPARAM wParam, LPARAM lParam) void CVkProto::GetAvatarFileName(MCONTACT hContact, wchar_t *pszDest, size_t cbLen) { - int tPathLen = mir_sntprintf(pszDest, cbLen, L"%s\\%S", VARST(L"%miranda_avatarcache%"), m_szModuleName); + int tPathLen = mir_snwprintf(pszDest, cbLen, L"%s\\%S", VARST(L"%miranda_avatarcache%"), m_szModuleName); DWORD dwAttributes = GetFileAttributes(pszDest); if (dwAttributes == 0xffffffff || (dwAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) @@ -139,7 +139,7 @@ void CVkProto::GetAvatarFileName(MCONTACT hContact, wchar_t *pszDest, size_t cbL pszDest[tPathLen++] = '\\'; const wchar_t *szFileType = L".jpg"; - ptrT szUrl(getTStringA(hContact, "AvatarUrl")); + ptrW szUrl(getTStringA(hContact, "AvatarUrl")); if (szUrl) { wchar_t *p = wcsrchr(szUrl, '.'); if (p != NULL) @@ -147,7 +147,7 @@ void CVkProto::GetAvatarFileName(MCONTACT hContact, wchar_t *pszDest, size_t cbL } LONG id = getDword(hContact, "ID", -1); - mir_sntprintf(pszDest + tPathLen, MAX_PATH - tPathLen, L"%d%s", id, szFileType); + mir_snwprintf(pszDest + tPathLen, MAX_PATH - tPathLen, L"%d%s", id, szFileType); } void CVkProto::SetAvatarUrl(MCONTACT hContact, CMString &tszUrl) diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp index 10726e6842..33add5f629 100644 --- a/protocols/VKontakte/src/vk_chats.cpp +++ b/protocols/VKontakte/src/vk_chats.cpp @@ -46,12 +46,12 @@ CVkChatInfo* CVkProto::AppendChat(int id, const JSONNode &jnDlg) c = new CVkChatInfo(id); if (jnDlg) { tszTitle = jnDlg["title"].as_mstring(); - c->m_tszTopic = mir_tstrdup(!tszTitle.IsEmpty() ? tszTitle : L""); + c->m_tszTopic = mir_wstrdup(!tszTitle.IsEmpty() ? tszTitle : L""); } CMString sid; sid.Format(L"%S_%d", m_szModuleName, id); - c->m_tszId = mir_tstrdup(sid); + c->m_tszId = mir_wstrdup(sid); GCSESSION gcw = { sizeof(gcw) }; gcw.iType = GCW_CHATROOM; @@ -183,13 +183,13 @@ void CVkProto::OnReceiveChatInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe bNew = cu->m_bUnknown; cu->m_bDel = false; - CMString tszNick(ptrT(db_get_tsa(cc->m_hContact, m_szModuleName, CMStringA(FORMAT, "nick%d", cu->m_uid)))); + CMString tszNick(ptrW(db_get_tsa(cc->m_hContact, m_szModuleName, CMStringA(FORMAT, "nick%d", cu->m_uid)))); if (tszNick.IsEmpty()) { CMString fName(jnUser["first_name"].as_mstring()); CMString lName(jnUser["last_name"].as_mstring()); tszNick = fName.Trim() + L" " + lName.Trim(); } - cu->m_tszNick = mir_tstrdup(tszNick); + cu->m_tszNick = mir_wstrdup(tszNick); cu->m_bUnknown = false; if (bNew) { @@ -217,7 +217,7 @@ void CVkProto::OnReceiveChatInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe gce.ptszUID = tszId; gce.dwFlags = GCEF_REMOVECONTACT | GCEF_NOTNOTIFY; gce.time = time(NULL); - gce.ptszNick = mir_tstrdup(CMString(FORMAT, L"%s (https://vk.com/id%s)", cu.m_tszNick, tszId)); + gce.ptszNick = mir_wstrdup(CMString(FORMAT, L"%s (https://vk.com/id%s)", cu.m_tszNick, tszId)); CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce); cc->m_users.remove(i); @@ -272,10 +272,10 @@ void CVkProto::SetChatTitle(CVkChatInfo *cc, LPCTSTR tszTopic) if (!cc) return; - if (mir_tstrcmp(cc->m_tszTopic, tszTopic) == 0) + if (mir_wstrcmp(cc->m_tszTopic, tszTopic) == 0) return; - cc->m_tszTopic = mir_tstrdup(tszTopic); + cc->m_tszTopic = mir_wstrdup(tszTopic); setTString(cc->m_hContact, "Nick", tszTopic); GCDEST gcd = { m_szModuleName, cc->m_tszId, GC_EVENT_CHANGESESSIONAME }; @@ -406,7 +406,7 @@ void CVkProto::AppendChatMessage(int id, const JSONNode &jnMsg, const JSONNode & cm->m_uid = uid; cm->m_date = msgTime; - cm->m_tszBody = mir_tstrdup(tszBody); + cm->m_tszBody = mir_wstrdup(tszBody); cm->m_bHistory = bIsHistory; cm->m_bIsAction = bIsAction; } @@ -419,8 +419,8 @@ void CVkProto::AppendChatMessage(CVkChatInfo *cc, int uid, int msgTime, LPCTSTR CVkChatUser *cu = cc->m_users.find((CVkChatUser*)&uid); if (cu == NULL) { cc->m_users.insert(cu = new CVkChatUser(uid)); - CMString tszNick(ptrT(db_get_tsa(cc->m_hContact, m_szModuleName, CMStringA(FORMAT, "nick%d", cu->m_uid)))); - cu->m_tszNick = mir_tstrdup(tszNick.IsEmpty() ? (hContact ? ptrT(db_get_tsa(hContact, m_szModuleName, "Nick")) : TranslateT("Unknown")) : tszNick); + CMString tszNick(ptrW(db_get_tsa(cc->m_hContact, m_szModuleName, CMStringA(FORMAT, "nick%d", cu->m_uid)))); + cu->m_tszNick = mir_wstrdup(tszNick.IsEmpty() ? (hContact ? ptrW(db_get_tsa(hContact, m_szModuleName, "Nick")) : TranslateT("Unknown")) : tszNick); cu->m_bUnknown = true; } @@ -433,8 +433,8 @@ void CVkProto::AppendChatMessage(CVkChatInfo *cc, int uid, int msgTime, LPCTSTR gce.ptszUID = tszId; gce.time = msgTime; gce.dwFlags = (bIsHistory) ? GCEF_NOTNOTIFY : GCEF_ADDTOLOG; - gce.ptszNick = cu->m_tszNick ? mir_tstrdup(cu->m_tszNick) : mir_tstrdup(hContact ? ptrT(db_get_tsa(hContact, m_szModuleName, "Nick")) : TranslateT("Unknown")); - gce.ptszText = IsEmpty((wchar_t *)ptszBody) ? mir_tstrdup(L"...") : mir_tstrdup(ptszBody); + gce.ptszNick = cu->m_tszNick ? mir_wstrdup(cu->m_tszNick) : mir_wstrdup(hContact ? ptrW(db_get_tsa(hContact, m_szModuleName, "Nick")) : TranslateT("Unknown")); + gce.ptszText = IsEmpty((wchar_t *)ptszBody) ? mir_wstrdup(L"...") : mir_wstrdup(ptszBody); CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce); StopChatContactTyping(cc->m_chatid, uid); } @@ -444,7 +444,7 @@ void CVkProto::AppendChatMessage(CVkChatInfo *cc, int uid, int msgTime, LPCTSTR CVkChatInfo* CVkProto::GetChatById(LPCTSTR ptszId) { for (int i = 0; i < m_chats.getCount(); i++) - if (!mir_tstrcmp(m_chats[i].m_tszId, ptszId)) + if (!mir_wstrcmp(m_chats[i].m_tszId, ptszId)) return &m_chats[i]; return NULL; @@ -454,7 +454,7 @@ CVkChatInfo* CVkProto::GetChatById(LPCTSTR ptszId) void CVkProto::SetChatStatus(MCONTACT hContact, int iStatus) { - ptrT tszChatID(getTStringA(hContact, "ChatRoomID")); + ptrW tszChatID(getTStringA(hContact, "ChatRoomID")); if (tszChatID == NULL) return; @@ -496,9 +496,9 @@ int CVkProto::OnChatEvent(WPARAM, LPARAM lParam) switch (gch->pDest->iType) { case GC_USER_MESSAGE: - if (IsOnline() && mir_tstrlen(gch->ptszText) > 0) { - ptrT ptszBuf(mir_tstrdup(gch->ptszText)); - rtrimt(ptszBuf); + if (IsOnline() && mir_wstrlen(gch->ptszText) > 0) { + ptrW ptszBuf(mir_wstrdup(gch->ptszText)); + rtrimw(ptszBuf); UnEscapeChatTags(ptszBuf); SendMsg(cc->m_hContact, 0, T2Utf(ptszBuf)); } @@ -641,7 +641,7 @@ INT_PTR __cdecl CVkProto::OnLeaveChat(WPARAM hContact, LPARAM) if (!IsOnline()) return 1; - ptrT tszChatID(getTStringA(hContact, "ChatRoomID")); + ptrW tszChatID(getTStringA(hContact, "ChatRoomID")); if (tszChatID == NULL) return 1; @@ -695,7 +695,7 @@ void CVkProto::KickFromChat(int chat_id, int user_id, const JSONNode &jnMsg, con if (msg.IsEmpty()) { msg = TranslateT("You've been kicked by "); if (hContact != NULL) - msg += ptrT(db_get_tsa(hContact, m_szModuleName, "Nick")); + msg += ptrW(db_get_tsa(hContact, m_szModuleName, "Nick")); else msg += TranslateT("(Unknown contact)"); } @@ -799,15 +799,15 @@ void CVkProto::NickMenuHook(CVkChatInfo *cc, GCHOOK *gch) wchar_t tszId[20]; _itow(cu->m_uid, tszId, 10); - gce.ptszNick = mir_tstrdup(cu->m_tszNick); + gce.ptszNick = mir_wstrdup(cu->m_tszNick); gce.bIsMe = (cu->m_uid == m_myUserId); gce.ptszUID = tszId; - gce.ptszText = mir_tstrdup(tszNewNick); + gce.ptszText = mir_wstrdup(tszNewNick); gce.dwFlags = GCEF_ADDTOLOG; gce.time = time(NULL); CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce); - cu->m_tszNick = mir_tstrdup(tszNewNick); + cu->m_tszNick = mir_wstrdup(tszNewNick); setTString(cc->m_hContact, CMStringA(FORMAT, "nick%d", cu->m_uid), tszNewNick); } break; @@ -901,7 +901,7 @@ void CVkProto::ChatContactTypingThread(void *p) StatusTextData st = { 0 }; st.cbSize = sizeof(st); - mir_sntprintf(st.tszText, TranslateT("%s is typing a message..."), cu->m_tszNick); + mir_snwprintf(st.tszText, TranslateT("%s is typing a message..."), cu->m_tszNick); CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hChatContact, (LPARAM)&st); } @@ -933,7 +933,7 @@ void CVkProto::StopChatContactTyping(int iChatId, int iUserId) StatusTextData st = { 0 }; st.cbSize = sizeof(st); - mir_sntprintf(st.tszText, L" "); + mir_snwprintf(st.tszText, L" "); // CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hChatContact, NULL) clears statusbar very slowly. // (1-10 sec(!!!) for me on tabSRMM O_o) diff --git a/protocols/VKontakte/src/vk_dialogs.cpp b/protocols/VKontakte/src/vk_dialogs.cpp index 5c119b5d5b..b043e9c242 100644 --- a/protocols/VKontakte/src/vk_dialogs.cpp +++ b/protocols/VKontakte/src/vk_dialogs.cpp @@ -142,7 +142,7 @@ void CVkWallPostForm::On_btnShare_Click(CCtrlButton*) void CVkWallPostForm::On_edtValue_Change(CCtrlEdit*) { - m_btnShare.Enable(!IsEmpty(ptrT(m_edtMsg.GetText())) || !IsEmpty(ptrT(m_edtUrl.GetText()))); + m_btnShare.Enable(!IsEmpty(ptrW(m_edtMsg.GetText())) || !IsEmpty(ptrW(m_edtUrl.GetText()))); } ////////////////////////////////// IDD_INVITE ///////////////////////////////////////////// @@ -213,7 +213,7 @@ void CVkGCCreateForm::btnOk_OnOk(CCtrlButton*) bool bRes = !szUIds.IsEmpty(); if (bRes) - m_proto->CreateNewChat(szUIds, ptrT(m_edtTitle.GetText())); + m_proto->CreateNewChat(szUIds, ptrW(m_edtTitle.GetText())); EndDialog(m_hwnd, bRes); } diff --git a/protocols/VKontakte/src/vk_feed.cpp b/protocols/VKontakte/src/vk_feed.cpp index be5b0eed16..0ab7fdd00d 100644 --- a/protocols/VKontakte/src/vk_feed.cpp +++ b/protocols/VKontakte/src/vk_feed.cpp @@ -85,7 +85,7 @@ void CVkProto::AddCListEvent(bool bNews) cle.hContact = hContact; cle.hDbEvent = NULL; wchar_t toolTip[255]; - mir_sntprintf(toolTip, bNews ? TranslateT("New news") : TranslateT("New notifications")); + mir_snwprintf(toolTip, bNews ? TranslateT("New news") : TranslateT("New notifications")); cle.ptszTooltip = toolTip; pcli->pfnAddEvent(&cle); } @@ -541,7 +541,7 @@ CVKNewsItem* CVkProto::GetVkGroupInvates(const JSONNode &jnItem, OBJLISThContact)) { - ptrT tszChatID(getTStringA(fup->hContact, "ChatRoomID")); + ptrW tszChatID(getTStringA(fup->hContact, "ChatRoomID")); if (!tszChatID) { SendFileFiled(fup, VKERR_INVALID_USER); return; diff --git a/protocols/VKontakte/src/vk_history.cpp b/protocols/VKontakte/src/vk_history.cpp index ec6ed4100e..2d07963dad 100644 --- a/protocols/VKontakte/src/vk_history.cpp +++ b/protocols/VKontakte/src/vk_history.cpp @@ -188,7 +188,7 @@ void CVkProto::OnReceiveHistoryMessages(NETLIBHTTPREQUEST *reply, AsyncHttpReque if (m_iLoadHistoryTask > 0) m_iLoadHistoryTask--; - ptrT ptszNick(db_get_tsa(param->hContact, m_szModuleName, "Nick")); + ptrW ptszNick(db_get_tsa(param->hContact, m_szModuleName, "Nick")); CMString str(FORMAT, L"%s %s %s", TranslateT("Error loading message history from server"), TranslateT("for"), ptszNick); MsgPopup(param->hContact, str, TranslateT("Error"), true); @@ -280,7 +280,7 @@ void CVkProto::OnReceiveHistoryMessages(NETLIBHTTPREQUEST *reply, AsyncHttpReque if (m_iLoadHistoryTask > 0) m_iLoadHistoryTask--; - ptrT ptszNick(db_get_tsa(param->hContact, m_szModuleName, "Nick")); + ptrW ptszNick(db_get_tsa(param->hContact, m_szModuleName, "Nick")); CMString str(FORMAT, TranslateT("Loading messages for %s is completed"), ptszNick); debugLog(L"CVkProto::OnReceiveHistoryMessages for %s m_iLoadHistoryTask=%d", ptszNick, m_iLoadHistoryTask); diff --git a/protocols/VKontakte/src/vk_options.cpp b/protocols/VKontakte/src/vk_options.cpp index aedf678894..b83e711ab1 100644 --- a/protocols/VKontakte/src/vk_options.cpp +++ b/protocols/VKontakte/src/vk_options.cpp @@ -54,7 +54,7 @@ void CVkAccMgrForm::OnInitDialog() void CVkAccMgrForm::OnApply() { pass_ptrT ptszNewPass(m_edtPassword.GetText()); - bool bPassChanged = mir_tstrcmp(m_ptszOldPass, ptszNewPass) != 0; + bool bPassChanged = mir_wstrcmp(m_ptszOldPass, ptszNewPass) != 0; if (bPassChanged) { T2Utf szRawPasswd(ptszNewPass); m_proto->setString("Password", szRawPasswd); @@ -62,8 +62,8 @@ void CVkAccMgrForm::OnApply() m_ptszOldPass = ptszNewPass; } - ptrT ptszNewLogin(m_edtLogin.GetText()); - if (bPassChanged || mir_tstrcmpi(m_ptszOldLogin, ptszNewLogin)) + ptrW ptszNewLogin(m_edtLogin.GetText()); + if (bPassChanged || mir_wstrcmpi(m_ptszOldLogin, ptszNewLogin)) m_proto->ClearAccessToken(); m_ptszOldLogin = ptszNewLogin; } @@ -182,7 +182,7 @@ void CVkOptionAccountForm::OnInitDialog() for (size_t i = 0; i < _countof(vkLangCodes); i++) { int cur = m_cbxVKLang.AddString(TranslateTS(vkLangCodes[i].szDescription), (LPARAM)vkLangCodes[i].szCode); - if (!mir_tstrcmpi(vkLangCodes[i].szCode, m_proto->m_vkOptions.ptszVKLang)) + if (!mir_wstrcmpi(vkLangCodes[i].szCode, m_proto->m_vkOptions.ptszVKLang)) m_cbxVKLang.SetCurSel(cur); } @@ -194,14 +194,14 @@ void CVkOptionAccountForm::OnApply() m_proto->m_vkOptions.iMarkMessageReadOn = m_cbxMarkAsRead.GetItemData(m_cbxMarkAsRead.GetCurSel()); m_proto->m_vkOptions.ptszVKLang = (wchar_t *)m_cbxVKLang.GetItemData(m_cbxVKLang.GetCurSel()); - ptrT ptszGroupName(m_edtGroupName.GetText()); - if (mir_tstrcmp(m_ptszOldGroup, ptszGroupName)) { + ptrW ptszGroupName(m_edtGroupName.GetText()); + if (mir_wstrcmp(m_ptszOldGroup, ptszGroupName)) { Clist_GroupCreate(NULL, ptszGroupName); m_ptszOldGroup = ptszGroupName; } pass_ptrT ptszNewPass(m_edtPassword.GetText()); - bool bPassChanged = mir_tstrcmp(m_ptszOldPass, ptszNewPass) != 0; + bool bPassChanged = mir_wstrcmp(m_ptszOldPass, ptszNewPass) != 0; if (bPassChanged) { T2Utf szRawPasswd(ptszNewPass); m_proto->setString("Password", szRawPasswd); @@ -209,8 +209,8 @@ void CVkOptionAccountForm::OnApply() m_ptszOldPass = ptszNewPass; } - ptrT ptszNewLogin(m_edtLogin.GetText()); - if (bPassChanged || mir_tstrcmpi(m_ptszOldLogin, ptszNewLogin)) + ptrW ptszNewLogin(m_edtLogin.GetText()); + if (bPassChanged || mir_wstrcmpi(m_ptszOldLogin, ptszNewLogin)) m_proto->ClearAccessToken(); m_ptszOldLogin = ptszNewLogin; diff --git a/protocols/VKontakte/src/vk_options.h b/protocols/VKontakte/src/vk_options.h index ed5e35bc15..ddc9b42d09 100644 --- a/protocols/VKontakte/src/vk_options.h +++ b/protocols/VKontakte/src/vk_options.h @@ -31,7 +31,7 @@ class CVkAccMgrForm : public CVkDlgBase CCtrlHyperlink m_hlLink; pass_ptrT m_ptszOldPass; - ptrT m_ptszOldLogin; + ptrW m_ptszOldLogin; public: CVkAccMgrForm(CVkProto *proto, HWND hwndParent); @@ -55,8 +55,8 @@ class CVkOptionAccountForm : public CVkDlgBase CCtrlCombo m_cbxMarkAsRead; pass_ptrT m_ptszOldPass; - ptrT m_ptszOldLogin; - ptrT m_ptszOldGroup; + ptrW m_ptszOldLogin; + ptrW m_ptszOldGroup; public: CVkOptionAccountForm(CVkProto *proto); diff --git a/protocols/VKontakte/src/vk_pollserver.cpp b/protocols/VKontakte/src/vk_pollserver.cpp index a18754ce83..372a73e92f 100644 --- a/protocols/VKontakte/src/vk_pollserver.cpp +++ b/protocols/VKontakte/src/vk_pollserver.cpp @@ -41,8 +41,8 @@ void CVkProto::OnReceivePollingInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest * itoa(jnResponse["ts"].as_int(), ts, 10); m_pollingTs = mir_strdup(ts); - m_pollingKey = mir_t2a(jnResponse["key"].as_mstring()); - m_pollingServer = mir_t2a(jnResponse["server"].as_mstring()); + m_pollingKey = mir_u2a(jnResponse["key"].as_mstring()); + m_pollingServer = mir_u2a(jnResponse["server"].as_mstring()); if (!m_hPollingThread) { debugLogA("CVkProto::OnReceivePollingInfo m_hPollingThread is NULL"); diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index a31f4658a2..8144f79aa2 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -19,7 +19,7 @@ along with this program. If not, see . static int sttCompareProtocols(const CVkProto *p1, const CVkProto *p2) { - return mir_tstrcmp(p1->m_tszUserName, p2->m_tszUserName); + return mir_wstrcmp(p1->m_tszUserName, p2->m_tszUserName); } static int sttCompareAsyncHttpRequest(const AsyncHttpRequest *p1, const AsyncHttpRequest *p2) @@ -62,7 +62,7 @@ CVkProto::CVkProto(const char *szModuleName, const wchar_t *ptszUserName) : HookProtoEvent(ME_OPT_INITIALISE, &CVkProto::OnOptionsInit); wchar_t descr[512]; - mir_sntprintf(descr, TranslateT("%s server connection"), m_tszUserName); + mir_snwprintf(descr, TranslateT("%s server connection"), m_tszUserName); NETLIBUSER nlu = {sizeof(nlu)}; nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR; @@ -357,7 +357,7 @@ int CVkProto::OnPreBuildContactMenu(WPARAM hContact, LPARAM) { LONG userID = getDword(hContact, "ID", -1); bool bisFriend = (getBool(hContact, "Auth", true) == 0); - bool bisBroadcast = !(IsEmpty(ptrT(db_get_tsa(hContact, m_szModuleName, "AudioUrl")))); + bool bisBroadcast = !(IsEmpty(ptrW(db_get_tsa(hContact, m_szModuleName, "AudioUrl")))); Menu_ShowItem(m_hContactMenuItems[CMI_VISITPROFILE], userID != VK_FEED_USER); Menu_ShowItem(m_hContactMenuItems[CMI_MARKMESSAGESASREAD], !isChatRoom(hContact) && userID != VK_FEED_USER); Menu_ShowItem(m_hContactMenuItems[CMI_WALLPOST], !isChatRoom(hContact)); @@ -425,7 +425,7 @@ void CVkProto::InitPopups(void) ppc.PluginWindowProc = PopupDlgProc; ppc.lParam = APF_RETURN_HWND; - mir_sntprintf(desc, L"%s %s", m_tszUserName, TranslateT("Errors")); + mir_snwprintf(desc, L"%s %s", m_tszUserName, TranslateT("Errors")); mir_snprintf(name, "%s_%s", m_szModuleName, "Error"); ppc.ptszDescription = desc; ppc.pszName = name; @@ -435,7 +435,7 @@ void CVkProto::InitPopups(void) ppc.iSeconds = 60; m_hPopupClassError = Popup_RegisterClass(&ppc); - mir_sntprintf(desc, L"%s %s", m_tszUserName, TranslateT("Notification")); + mir_snwprintf(desc, L"%s %s", m_tszUserName, TranslateT("Notification")); mir_snprintf(name, "%s_%s", m_szModuleName, "Notification"); ppc.ptszDescription = desc; ppc.pszName = name; @@ -576,7 +576,7 @@ void CVkProto::OnReceiveAuthRequest(NETLIBHTTPREQUEST *reply, AsyncHttpRequest * setByte(param->hContact, "Auth", 0); if (iRet == 2) { CMString msg, - tszNick(ptrT(db_get_tsa(param->hContact, m_szModuleName, "Nick"))); + tszNick(ptrW(db_get_tsa(param->hContact, m_szModuleName, "Nick"))); if (tszNick.IsEmpty()) tszNick = TranslateT("(Unknown contact)"); msg.AppendFormat(TranslateT("User %s added as friend"), tszNick); diff --git a/protocols/VKontakte/src/vk_search.cpp b/protocols/VKontakte/src/vk_search.cpp index c19c3610bf..f3004e3855 100644 --- a/protocols/VKontakte/src/vk_search.cpp +++ b/protocols/VKontakte/src/vk_search.cpp @@ -33,9 +33,9 @@ HANDLE CVkProto::SearchByName(const wchar_t *nick, const wchar_t *firstName, con { PROTOSEARCHBYNAME *psr = new (PROTOSEARCHBYNAME); - psr->pszFirstName = mir_tstrdup(firstName); - psr->pszLastName = mir_tstrdup(lastName); - psr->pszNick = mir_tstrdup(nick); + psr->pszFirstName = mir_wstrdup(firstName); + psr->pszLastName = mir_wstrdup(lastName); + psr->pszNick = mir_wstrdup(nick); ForkThread(&CVkProto::SearchThread, (void *)psr); return (HANDLE)1; @@ -69,7 +69,7 @@ void __cdecl CVkProto::SearchThread(void *p) PROTOSEARCHBYNAME *pParam = (PROTOSEARCHBYNAME *)p; wchar_t arg[200]; - mir_sntprintf(arg, L"%s %s %s", pParam->pszFirstName, pParam->pszNick, pParam->pszLastName); + mir_snwprintf(arg, L"%s %s %s", pParam->pszFirstName, pParam->pszNick, pParam->pszLastName); debugLog(L"CVkProto::SearchThread %s", arg); if (!IsOnline()) return; @@ -126,10 +126,10 @@ void CVkProto::OnSearch(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq) CMString Nick(jnRecord["nickname"].as_mstring()); CMString Domain(jnRecord["domain"].as_mstring()); - psr.id.w = mir_tstrdup(Id); - psr.firstName.w = mir_tstrdup(FirstName); - psr.lastName.w = mir_tstrdup(LastName); - psr.nick.w = Nick.IsEmpty() ? mir_tstrdup(Domain) : mir_tstrdup(Nick); + psr.id.w = mir_wstrdup(Id); + psr.firstName.w = mir_wstrdup(FirstName); + psr.lastName.w = mir_wstrdup(LastName); + psr.nick.w = Nick.IsEmpty() ? mir_wstrdup(Domain) : mir_wstrdup(Nick); bool filter = true; if (pParam) { @@ -184,11 +184,11 @@ void CVkProto::OnSearchByMail(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq) CMString Nick(jnRecord["nickname"].as_mstring()); CMString Email(jnRecord["contact"].as_mstring()); - psr.id.w = mir_tstrdup(Id); - psr.firstName.w = mir_tstrdup(FirstName); - psr.lastName.w = mir_tstrdup(LastName); - psr.nick.w = Nick.IsEmpty() ? mir_tstrdup(Email) : mir_tstrdup(Nick); - psr.email.w = mir_tstrdup(Email); + psr.id.w = mir_wstrdup(Id); + psr.firstName.w = mir_wstrdup(FirstName); + psr.lastName.w = mir_wstrdup(LastName); + psr.nick.w = Nick.IsEmpty() ? mir_wstrdup(Email) : mir_wstrdup(Nick); + psr.email.w = mir_wstrdup(Email); ProtoBroadcastAck(0, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)1, (LPARAM)&psr); } diff --git a/protocols/VKontakte/src/vk_status.cpp b/protocols/VKontakte/src/vk_status.cpp index add498f486..9fc8aef944 100644 --- a/protocols/VKontakte/src/vk_status.cpp +++ b/protocols/VKontakte/src/vk_status.cpp @@ -69,8 +69,8 @@ void CVkProto::SetServerStatus(int iNewStatus) return; int iOldStatus = m_iStatus; - CMString oldStatusMsg(ptrT(db_get_tsa(NULL, m_szModuleName, "OldStatusMsg"))); - ptrT ptszListeningToMsg(db_get_tsa(NULL, m_szModuleName, "ListeningTo")); + CMString oldStatusMsg(ptrW(db_get_tsa(NULL, m_szModuleName, "OldStatusMsg"))); + ptrW ptszListeningToMsg(db_get_tsa(NULL, m_szModuleName, "ListeningTo")); if (iNewStatus == ID_STATUS_OFFLINE) { m_bNeedSendOnline = false; @@ -126,7 +126,7 @@ void CVkProto::OnReceiveStatusMsg(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pR OnReceiveStatus(reply, pReq); - ptrT ptszOldStatusMsg(db_get_tsa(NULL, m_szModuleName, "OldStatusMsg")); + ptrW ptszOldStatusMsg(db_get_tsa(NULL, m_szModuleName, "OldStatusMsg")); CMString tszOldStatusMsg(ptszOldStatusMsg); ENTER_STRING pForm = { sizeof(pForm) }; @@ -139,7 +139,7 @@ void CVkProto::OnReceiveStatusMsg(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pR if (!EnterString(&pForm)) return; - CMString tszNewStatusMsg(ptrT(pForm.ptszResult)); + CMString tszNewStatusMsg(ptrW(pForm.ptszResult)); if (tszOldStatusMsg == tszNewStatusMsg) return; @@ -240,7 +240,7 @@ INT_PTR __cdecl CVkProto::SvcSetListeningTo(WPARAM, LPARAM lParam) db_unset(NULL, m_szModuleName, "ListeningTo"); else if (pliInfo->dwFlags & LTI_UNICODE) { if (ServiceExists(MS_LISTENINGTO_GETPARSEDTEXT)) - tszListeningTo = ptrT((LPWSTR)CallService(MS_LISTENINGTO_GETPARSEDTEXT, (WPARAM)L"%artist% - %title%", (LPARAM)pliInfo)); + tszListeningTo = ptrW((LPWSTR)CallService(MS_LISTENINGTO_GETPARSEDTEXT, (WPARAM)L"%artist% - %title%", (LPARAM)pliInfo)); else tszListeningTo.Format(L"%s - %s", pliInfo->ptszArtist ? pliInfo->ptszArtist : L"", diff --git a/protocols/VKontakte/src/vk_struct.cpp b/protocols/VKontakte/src/vk_struct.cpp index a1d074a9ad..12bc8804d0 100644 --- a/protocols/VKontakte/src/vk_struct.cpp +++ b/protocols/VKontakte/src/vk_struct.cpp @@ -100,8 +100,8 @@ void AsyncHttpRequest::Redirect(NETLIBHTTPREQUEST *nhr) CVkFileUploadParam::CVkFileUploadParam(MCONTACT _hContact, const wchar_t *_desc, wchar_t **_files) : hContact(_hContact), - Desc(mir_tstrdup(_desc)), - FileName(mir_tstrdup(_files[0])), + Desc(mir_wstrdup(_desc)), + FileName(mir_wstrdup(_files[0])), atr(NULL), fname(NULL), filetype(typeInvalid) diff --git a/protocols/VKontakte/src/vk_struct.h b/protocols/VKontakte/src/vk_struct.h index 86cee657fe..19e320eb67 100644 --- a/protocols/VKontakte/src/vk_struct.h +++ b/protocols/VKontakte/src/vk_struct.h @@ -141,7 +141,7 @@ struct CVkChatMessage : public MZeroedObject int m_mid, m_uid, m_date; bool m_bHistory, m_bIsAction; - ptrT m_tszBody; + ptrW m_tszBody; }; struct CVkChatUser : public MZeroedObject @@ -154,7 +154,7 @@ struct CVkChatUser : public MZeroedObject int m_uid; bool m_bDel, m_bUnknown; - ptrT m_tszNick; + ptrW m_tszNick; }; struct CVkChatInfo : public MZeroedObject @@ -170,7 +170,7 @@ struct CVkChatInfo : public MZeroedObject int m_chatid, m_admin_id; bool m_bHistoryRead; - ptrT m_tszTopic, m_tszId; + ptrW m_tszTopic, m_tszId; MCONTACT m_hContact; OBJLIST m_users; OBJLIST m_msgs; diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index 185f52e583..ea600d8eb4 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -355,11 +355,11 @@ MCONTACT CVkProto::SetContactInfo(const JSONNode &jnItem, bool flag, bool self) setTString(hContact, "Phone", tszValue); tszValue = jnItem["status"].as_mstring(); - CMString tszOldStatus(ptrT(db_get_tsa(hContact, hContact ? "CList" : m_szModuleName, "StatusMsg"))); + CMString tszOldStatus(ptrW(db_get_tsa(hContact, hContact ? "CList" : m_szModuleName, "StatusMsg"))); if (tszValue != tszOldStatus) db_set_ts(hContact, hContact ? "CList" : m_szModuleName, "StatusMsg", tszValue); - CMString tszOldListeningTo(ptrT(db_get_tsa(hContact, m_szModuleName, "ListeningTo"))); + CMString tszOldListeningTo(ptrW(db_get_tsa(hContact, m_szModuleName, "ListeningTo"))); const JSONNode &jnAudio = jnItem["status_audio"]; if (jnAudio) { CMString tszListeningTo(FORMAT, L"%s - %s", jnAudio["artist"].as_mstring(), jnAudio["title"].as_mstring()); @@ -428,13 +428,13 @@ MCONTACT CVkProto::SetContactInfo(const JSONNode &jnItem, bool flag, bool self) for (int i = iInteres; iInteres > 0; i++) { CMStringA InteresCat(FORMAT, "Interest%dCat", iInteres); - ptrT ptszCat(db_get_tsa(hContact, m_szModuleName, InteresCat)); + ptrW ptszCat(db_get_tsa(hContact, m_szModuleName, InteresCat)); if (!ptszCat) break; db_unset(hContact, m_szModuleName, InteresCat); CMStringA InteresText(FORMAT, "Interest%dText", iInteres); - ptrT ptszText(db_get_tsa(hContact, m_szModuleName, InteresText)); + ptrW ptszText(db_get_tsa(hContact, m_szModuleName, InteresText)); if (!ptszText) break; db_unset(hContact, m_szModuleName, InteresText); @@ -678,7 +678,7 @@ INT_PTR __cdecl CVkProto::SvcDeleteFriend(WPARAM hContact, LPARAM flag) if (!IsOnline() || userID == -1 || userID == VK_FEED_USER) return 1; - ptrT ptszNick(db_get_tsa(hContact, m_szModuleName, "Nick")); + ptrW ptszNick(db_get_tsa(hContact, m_szModuleName, "Nick")); CMString ptszMsg; if (flag == 0) { ptszMsg.AppendFormat(TranslateT("Are you sure to delete %s from your friend list?"), IsEmpty(ptszNick) ? TranslateT("(Unknown contact)") : ptszNick); @@ -699,7 +699,7 @@ void CVkProto::OnReceiveDeleteFriend(NETLIBHTTPREQUEST *reply, AsyncHttpRequest JSONNode jnRoot; const JSONNode &jnResponse = CheckJsonResponse(pReq, reply, jnRoot); if (jnResponse) { - CMString tszNick(ptrT(db_get_tsa(param->hContact, m_szModuleName, "Nick"))); + CMString tszNick(ptrW(db_get_tsa(param->hContact, m_szModuleName, "Nick"))); if (tszNick.IsEmpty()) tszNick = TranslateT("(Unknown contact)"); CMString msgformat, msg; @@ -771,7 +771,7 @@ INT_PTR __cdecl CVkProto::SvcBanUser(WPARAM hContact, LPARAM) tszVarWarning += ".\n"; code += "return 1;"; - ptrT ptszNick(db_get_tsa(hContact, m_szModuleName, "Nick")); + ptrW ptszNick(db_get_tsa(hContact, m_szModuleName, "Nick")); CMString ptszMsg(FORMAT, TranslateT("Are you sure to ban %s? %s%sContinue?"), IsEmpty(ptszNick) ? TranslateT("(Unknown contact)") : ptszNick, tszVarWarning.IsEmpty() ? L" " : TranslateT("\nIt will also"), @@ -796,7 +796,7 @@ INT_PTR __cdecl CVkProto::SvcReportAbuse(WPARAM hContact, LPARAM) if (!IsOnline() || userID == -1 || userID == VK_FEED_USER) return 1; - CMString tszNick(ptrT(db_get_tsa(hContact, m_szModuleName, "Nick"))), + CMString tszNick(ptrW(db_get_tsa(hContact, m_szModuleName, "Nick"))), ptszMsg(FORMAT, TranslateT("Are you sure to report abuse on %s?"), tszNick.IsEmpty() ? TranslateT("(Unknown contact)") : tszNick); if (IDNO == MessageBox(NULL, ptszMsg, TranslateT("Attention!"), MB_ICONWARNING | MB_YESNO)) return 1; @@ -812,7 +812,7 @@ INT_PTR __cdecl CVkProto::SvcOpenBroadcast(WPARAM hContact, LPARAM) { debugLogA("CVkProto::SvcOpenBroadcast"); - CMString tszAudio(ptrT(db_get_tsa(hContact, m_szModuleName, "AudioUrl"))); + CMString tszAudio(ptrW(db_get_tsa(hContact, m_szModuleName, "AudioUrl"))); if (!tszAudio.IsEmpty()) Utils_OpenUrlT(tszAudio); @@ -823,14 +823,14 @@ INT_PTR __cdecl CVkProto::SvcVisitProfile(WPARAM hContact, LPARAM) { debugLogA("CVkProto::SvcVisitProfile"); if (isChatRoom(hContact)) { - ptrT tszHomepage(db_get_tsa(hContact, m_szModuleName, "Homepage")); + ptrW tszHomepage(db_get_tsa(hContact, m_szModuleName, "Homepage")); if(!IsEmpty(tszHomepage)) Utils_OpenUrlT(tszHomepage); return 0; } LONG userID = getDword(hContact, "ID", -1); - ptrT tszDomain(db_get_tsa(hContact, m_szModuleName, "domain")); + ptrW tszDomain(db_get_tsa(hContact, m_szModuleName, "domain")); CMString tszUrl("https://vk.com/"); if (tszDomain) -- cgit v1.2.3