diff options
author | George Hazan <george.hazan@gmail.com> | 2016-07-29 12:36:34 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-07-29 12:36:34 +0000 |
commit | 428bf0cbd77813a43094cb5c984436deff251936 (patch) | |
tree | d7dfa8971153d53a849e45c942be97fe5b90b7ec /protocols/WhatsApp/src | |
parent | 82ef17ca5286f58ae7af604fb9518e8dc496b7c3 (diff) |
no more TCHARs
git-svn-id: http://svn.miranda-ng.org/main/trunk@17143 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/WhatsApp/src')
-rw-r--r-- | protocols/WhatsApp/src/avatars.cpp | 2 | ||||
-rw-r--r-- | protocols/WhatsApp/src/chat.cpp | 16 | ||||
-rw-r--r-- | protocols/WhatsApp/src/contacts.cpp | 8 | ||||
-rw-r--r-- | protocols/WhatsApp/src/dialogs.cpp | 2 | ||||
-rw-r--r-- | protocols/WhatsApp/src/messages.cpp | 2 | ||||
-rw-r--r-- | protocols/WhatsApp/src/proto.cpp | 14 |
6 files changed, 22 insertions, 22 deletions
diff --git a/protocols/WhatsApp/src/avatars.cpp b/protocols/WhatsApp/src/avatars.cpp index 536602bcb2..bb163013d5 100644 --- a/protocols/WhatsApp/src/avatars.cpp +++ b/protocols/WhatsApp/src/avatars.cpp @@ -116,7 +116,7 @@ int WhatsAppProto::InternalSetAvatar(MCONTACT hContact, const char *szJid, const saveInfo.tszName = tszTempFile;
saveInfo.dwMask = IMGI_HBITMAP;
saveInfo.fif = FIF_JPEG;
- CallService(MS_IMG_SAVE, (WPARAM)&saveInfo, IMGL_TCHAR);
+ CallService(MS_IMG_SAVE, (WPARAM)&saveInfo, IMGL_WCHAR);
if (hbmpPreview != resize.hBmp)
DeleteObject(hbmpPreview);
diff --git a/protocols/WhatsApp/src/chat.cpp b/protocols/WhatsApp/src/chat.cpp index 26a46bec48..eded520031 100644 --- a/protocols/WhatsApp/src/chat.cpp +++ b/protocols/WhatsApp/src/chat.cpp @@ -85,7 +85,7 @@ int WhatsAppProto::onGroupChatEvent(WPARAM, LPARAM lParam) setWord(hContact, "Status", ID_STATUS_ONLINE);
db_set_b(hContact, "CList", "Hidden", 1);
- setTString(hContact, "Nick", gch->ptszUID);
+ setWString(hContact, "Nick", gch->ptszUID);
db_set_dw(hContact, "Ignore", "Mask1", 0);
}
CallService(MS_MSG_SENDMESSAGE, hContact, 0);
@@ -145,8 +145,8 @@ void WhatsAppProto::ChatLogMenuHook(WAChatInfo *pInfo, struct GCHOOK *gch) void WhatsAppProto::EditChatSubject(WAChatInfo *pInfo)
{
- CMString title(FORMAT, TranslateT("Set new subject for %s"), pInfo->tszNick);
- ptrW tszOldValue(getTStringA(pInfo->hContact, WHATSAPP_KEY_NICK));
+ CMStringW title(FORMAT, TranslateT("Set new subject for %s"), pInfo->tszNick);
+ ptrW tszOldValue(getWStringA(pInfo->hContact, WHATSAPP_KEY_NICK));
ENTER_STRING es = { 0 };
es.cbSize = sizeof(es);
@@ -225,7 +225,7 @@ void WhatsAppProto::AddChatUser(WAChatInfo*, const wchar_t *ptszJid) PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
- psr.flags = PSR_TCHAR;
+ psr.flags = PSR_UNICODE;
psr.id.w = (wchar_t*)ptszJid;
psr.nick.w = GetChatUserNick(jid);
@@ -253,7 +253,7 @@ void WhatsAppProto::KickChatUser(WAChatInfo *pInfo, const wchar_t *ptszJid) int WhatsAppProto::OnDeleteChat(WPARAM hContact, LPARAM)
{
if (isChatRoom(hContact) && isOnline()) {
- ptrW tszID(getTStringA(hContact, WHATSAPP_KEY_ID));
+ ptrW tszID(getWStringA(hContact, WHATSAPP_KEY_ID));
if (tszID)
m_pConnection->sendJoinLeaveGroup(_T2A(tszID), false);
}
@@ -314,7 +314,7 @@ WAChatInfo* WhatsAppProto::InitChat(const std::string &jid, const std::string &n GCDEST gcd = { m_szModuleName, ptszJid, GC_EVENT_ADDGROUP };
GCEVENT gce = { sizeof(gce), &gcd };
for (int i = _countof(sttStatuses) - 1; i >= 0; i--) {
- gce.ptszStatus = TranslateTS(sttStatuses[i]);
+ gce.ptszStatus = TranslateW(sttStatuses[i]);
CallServiceSync(MS_GC_EVENT, NULL, (LPARAM)&gce);
}
@@ -419,7 +419,7 @@ void WhatsAppProto::onGroupNewSubject(const std::string &gjid, const std::string return;
ptrW tszText(str2t(newSubject));
- ptrW tszTextDb(getTStringA(pInfo->hContact, WHATSAPP_KEY_NICK));
+ ptrW tszTextDb(getWStringA(pInfo->hContact, WHATSAPP_KEY_NICK));
if (!mir_wstrcmp(tszText, tszTextDb)) // notify about subject change only if differs from the stored one
return;
@@ -436,7 +436,7 @@ void WhatsAppProto::onGroupNewSubject(const std::string &gjid, const std::string gce.ptszText = tszText;
CallServiceSync(MS_GC_EVENT, NULL, (LPARAM)&gce);
- setTString(pInfo->hContact, WHATSAPP_KEY_NICK, tszText);
+ setWString(pInfo->hContact, WHATSAPP_KEY_NICK, tszText);
}
void WhatsAppProto::onGroupAddUser(const std::string &gjid, const std::string &ujid, int ts)
diff --git a/protocols/WhatsApp/src/contacts.cpp b/protocols/WhatsApp/src/contacts.cpp index 8026cc0912..e4f0d50330 100644 --- a/protocols/WhatsApp/src/contacts.cpp +++ b/protocols/WhatsApp/src/contacts.cpp @@ -21,7 +21,7 @@ MCONTACT WhatsAppProto::AddToContactList(const std::string &jid, const char *new if (oldName.compare(string(new_name)) != 0) {
db_set_utf(hContact, m_szModuleName, WHATSAPP_KEY_NICK, new_name);
- CMString tmp(FORMAT, TranslateT("is now known as '%s'"), ptrW(mir_utf8decodeW(new_name)));
+ CMStringW tmp(FORMAT, TranslateT("is now known as '%s'"), ptrW(mir_utf8decodeW(new_name)));
this->NotifyEvent(_A2T(oldName.c_str()), tmp, hContact, WHATSAPP_EVENT_OTHER);
}
}
@@ -42,7 +42,7 @@ MCONTACT WhatsAppProto::AddToContactList(const std::string &jid, const char *new setString(hContact, "MirVer", "WhatsApp");
db_unset(hContact, "CList", "MyHandle");
db_set_b(hContact, "CList", "NotOnList", 1);
- db_set_ts(hContact, "CList", "Group", m_tszDefaultGroup);
+ db_set_ws(hContact, "CList", "Group", m_tszDefaultGroup);
if (new_name != NULL)
db_set_utf(hContact, m_szModuleName, WHATSAPP_KEY_NICK, new_name);
@@ -74,9 +74,9 @@ void WhatsAppProto::SetAllContactStatuses(int status, bool reset_client) {
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
if (reset_client) {
- ptrW tszMirVer(getTStringA(hContact, "MirVer"));
+ ptrW tszMirVer(getWStringA(hContact, "MirVer"));
if (mir_wstrcmp(tszMirVer, L"WhatsApp"))
- setTString(hContact, "MirVer", L"WhatsApp");
+ setWString(hContact, "MirVer", L"WhatsApp");
db_set_ws(hContact, "CList", "StatusMsg", L"");
}
diff --git a/protocols/WhatsApp/src/dialogs.cpp b/protocols/WhatsApp/src/dialogs.cpp index 6a86685895..be9cb7de70 100644 --- a/protocols/WhatsApp/src/dialogs.cpp +++ b/protocols/WhatsApp/src/dialogs.cpp @@ -134,7 +134,7 @@ int WhatsAppProto::OnOptionsInit(WPARAM wParam, LPARAM) {
OPTIONSDIALOGPAGE odp = { 0 };
odp.pwszTitle = m_tszUserName;
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE;
odp.pwszGroup = LPGENW("Network");
odp.pwszTab = LPGENW("Account");
diff --git a/protocols/WhatsApp/src/messages.cpp b/protocols/WhatsApp/src/messages.cpp index 388b12f309..98bea34363 100644 --- a/protocols/WhatsApp/src/messages.cpp +++ b/protocols/WhatsApp/src/messages.cpp @@ -133,5 +133,5 @@ void WhatsAppProto::onMessageStatusUpdate(const FMessage &fmsg) wchar_t ttime[64];
wcsftime(ttime, _countof(ttime), L"%X", localtime(&ts));
- utils::setStatusMessage(hContact, CMString(FORMAT, TranslateT("Message received: %s by %s"), ttime, ptszBy));
+ utils::setStatusMessage(hContact, CMStringW(FORMAT, TranslateT("Message received: %s by %s"), ttime, ptszBy));
}
diff --git a/protocols/WhatsApp/src/proto.cpp b/protocols/WhatsApp/src/proto.cpp index e40588f0cc..a0b3b3cbe4 100644 --- a/protocols/WhatsApp/src/proto.cpp +++ b/protocols/WhatsApp/src/proto.cpp @@ -14,7 +14,7 @@ struct SearchParam WhatsAppProto::WhatsAppProto(const char *proto_name, const wchar_t *username)
: PROTO<WhatsAppProto>(proto_name, username),
- m_tszDefaultGroup(getTStringA(WHATSAPP_KEY_DEF_GROUP))
+ m_tszDefaultGroup(getWStringA(WHATSAPP_KEY_DEF_GROUP))
{
update_loop_lock_ = CreateEvent(NULL, false, false, NULL);
@@ -36,7 +36,7 @@ WhatsAppProto::WhatsAppProto(const char *proto_name, const wchar_t *username) mir_snwprintf(descr, TranslateT("%s server connection"), m_tszUserName);
NETLIBUSER nlu = { sizeof(nlu) };
- nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
+ nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE;
nlu.szSettingsModule = m_szModuleName;
nlu.ptszDescriptiveName = descr;
m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
@@ -48,10 +48,10 @@ WhatsAppProto::WhatsAppProto(const char *proto_name, const wchar_t *username) WASocketConnection::initNetwork(m_hNetlibUser);
- m_tszAvatarFolder = std::wstring(VARST(L"%miranda_avatarcache%")) + L"\\" + m_tszUserName;
+ m_tszAvatarFolder = std::wstring(VARSW(L"%miranda_avatarcache%")) + L"\\" + m_tszUserName;
DWORD dwAttributes = GetFileAttributes(m_tszAvatarFolder.c_str());
if (dwAttributes == 0xffffffff || (dwAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
- CreateDirectoryTreeT(m_tszAvatarFolder.c_str());
+ CreateDirectoryTreeW(m_tszAvatarFolder.c_str());
if (m_tszDefaultGroup == NULL)
m_tszDefaultGroup = mir_wstrdup(L"WhatsApp");
@@ -196,7 +196,7 @@ void WhatsAppProto::SearchAckThread(void *targ) SearchParam *param = (SearchParam*)targ;
PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
- psr.flags = PSR_TCHAR;
+ psr.flags = PSR_UNICODE;
psr.nick.w = psr.firstName.w = psr.lastName.w = L"";
psr.id.w = (wchar_t*)param->jid.c_str();
@@ -285,13 +285,13 @@ bool WhatsAppProto::Register(int state, const string &cc, const string &number, if (reason == "stale")
NotifyEvent(ptszTitle, TranslateT("Registration failed due to stale code. Please request a new code"), NULL, WHATSAPP_EVENT_CLIENT);
else {
- CMString tmp(FORMAT, TranslateT("Registration failed. Reason: %s"), _A2T(reason.c_str()));
+ CMStringW tmp(FORMAT, TranslateT("Registration failed. Reason: %s"), _A2T(reason.c_str()));
NotifyEvent(ptszTitle, tmp, NULL, WHATSAPP_EVENT_CLIENT);
}
const JSONNode &tmpVal = resp["retry_after"];
if (tmpVal) {
- CMString tmp(FORMAT, TranslateT("Please try again in %i seconds"), tmpVal.as_int());
+ CMStringW tmp(FORMAT, TranslateT("Please try again in %i seconds"), tmpVal.as_int());
NotifyEvent(ptszTitle, tmp, NULL, WHATSAPP_EVENT_OTHER);
}
return false;
|