diff options
author | George Hazan <george.hazan@gmail.com> | 2016-07-25 10:31:04 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-07-25 10:31:04 +0000 |
commit | 8ae3679aa1339ce9abee53adb69902bd6b7513dc (patch) | |
tree | 94ef8927e12043ed6dcc15e1e640d68a8add520e /protocols/WhatsApp | |
parent | 1e273e28d89b5838e3d0f0cafac9676577cb71ce (diff) |
hello, Unix.
phase 1: removing _T()
git-svn-id: http://svn.miranda-ng.org/main/trunk@17127 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/WhatsApp')
-rw-r--r-- | protocols/WhatsApp/src/avatars.cpp | 14 | ||||
-rw-r--r-- | protocols/WhatsApp/src/chat.cpp | 8 | ||||
-rw-r--r-- | protocols/WhatsApp/src/constants.h | 2 | ||||
-rw-r--r-- | protocols/WhatsApp/src/contacts.cpp | 10 | ||||
-rw-r--r-- | protocols/WhatsApp/src/dialogs.cpp | 8 | ||||
-rw-r--r-- | protocols/WhatsApp/src/media.cpp | 4 | ||||
-rw-r--r-- | protocols/WhatsApp/src/messages.cpp | 2 | ||||
-rw-r--r-- | protocols/WhatsApp/src/proto.cpp | 8 |
8 files changed, 28 insertions, 28 deletions
diff --git a/protocols/WhatsApp/src/avatars.cpp b/protocols/WhatsApp/src/avatars.cpp index 36d14bce77..2121430f62 100644 --- a/protocols/WhatsApp/src/avatars.cpp +++ b/protocols/WhatsApp/src/avatars.cpp @@ -46,24 +46,24 @@ INT_PTR WhatsAppProto::GetAvatarCaps(WPARAM wParam, LPARAM lParam) std::tstring WhatsAppProto::GetAvatarFileName(MCONTACT hContact)
{
- std::tstring result = m_tszAvatarFolder + _T("\\");
+ std::tstring result = m_tszAvatarFolder + L"\\";
std::string jid;
if (hContact != NULL) {
ptrA szId(getStringA(hContact, isChatRoom(hContact) ? "ChatRoomID" : WHATSAPP_KEY_ID));
if (szId == NULL)
- return _T("");
+ return L"";
jid = szId;
}
else jid = m_szJid;
- return result + std::tstring(_A2T(jid.c_str())) + _T(".jpg");
+ return result + std::tstring(_A2T(jid.c_str())) + L".jpg";
}
INT_PTR WhatsAppProto::GetMyAvatar(WPARAM wParam, LPARAM lParam)
{
- std::tstring tszOwnAvatar(m_tszAvatarFolder + _T("\\myavatar.jpg"));
+ std::tstring tszOwnAvatar(m_tszAvatarFolder + L"\\myavatar.jpg");
_tcsncpy_s((TCHAR*)wParam, lParam, tszOwnAvatar.c_str(), _TRUNCATE);
return 0;
}
@@ -102,13 +102,13 @@ int WhatsAppProto::InternalSetAvatar(MCONTACT hContact, const char *szJid, const TCHAR tszTempFile[MAX_PATH], tszMyFile[MAX_PATH];
if (hContact == NULL) {
- mir_sntprintf(tszMyFile, _T("%s\\myavatar.jpg"), m_tszAvatarFolder.c_str());
- mir_sntprintf(tszTempFile, _T("%s\\myavatar.preview.jpg"), m_tszAvatarFolder.c_str());
+ mir_sntprintf(tszMyFile, L"%s\\myavatar.jpg", m_tszAvatarFolder.c_str());
+ mir_sntprintf(tszTempFile, L"%s\\myavatar.preview.jpg", m_tszAvatarFolder.c_str());
}
else {
std::tstring tszContactAva = GetAvatarFileName(hContact);
_tcsncpy_s(tszMyFile, tszContactAva.c_str(), _TRUNCATE);
- _tcsncpy_s(tszTempFile, (tszContactAva + _T(".preview")).c_str(), _TRUNCATE);
+ _tcsncpy_s(tszTempFile, (tszContactAva + L".preview").c_str(), _TRUNCATE);
}
IMGSRVC_INFO saveInfo = { sizeof(saveInfo), 0 };
diff --git a/protocols/WhatsApp/src/chat.cpp b/protocols/WhatsApp/src/chat.cpp index ab84dfb4be..e55e8274cf 100644 --- a/protocols/WhatsApp/src/chat.cpp +++ b/protocols/WhatsApp/src/chat.cpp @@ -21,7 +21,7 @@ INT_PTR __cdecl WhatsAppProto::OnCreateGroup(WPARAM, LPARAM) ENTER_STRING es = { 0 };
es.cbSize = sizeof(es);
es.type = ESF_MULTILINE;
- es.caption = _T("Enter a subject for new group");
+ es.caption = L"Enter a subject for new group";
es.szModuleName = m_szModuleName;
if (EnterString(&es)) {
if (isOnline()) {
@@ -175,8 +175,8 @@ void WhatsAppProto::SetChatAvatar(WAChatInfo *pInfo) ofn.lpstrFile = tszFileName;
ofn.nMaxFile = ofn.nMaxFileTitle = _countof(tszFileName);
ofn.Flags = OFN_HIDEREADONLY;
- ofn.lpstrInitialDir = _T(".");
- ofn.lpstrDefExt = _T("");
+ ofn.lpstrInitialDir = L".";
+ ofn.lpstrDefExt = L"";
if (GetOpenFileName(&ofn))
if (_taccess(tszFileName, 4) != -1)
InternalSetAvatar(pInfo->hContact, _T2A(pInfo->tszJid), tszFileName);
@@ -513,7 +513,7 @@ void WhatsAppProto::onGetParticipants(const std::string &gjid, const std::vector GCEVENT gce = { sizeof(gce), &gcd };
gce.ptszNick = nick;
gce.ptszUID = utils::removeA(ujid);
- gce.ptszStatus = (bIsOwner) ? _T("Owners") : _T("Members");
+ gce.ptszStatus = (bIsOwner) ? L"Owners" : L"Members";
CallServiceSync(MS_GC_EVENT, NULL, (LPARAM)&gce);
}
}
diff --git a/protocols/WhatsApp/src/constants.h b/protocols/WhatsApp/src/constants.h index 2fb002ab5b..e535eabded 100644 --- a/protocols/WhatsApp/src/constants.h +++ b/protocols/WhatsApp/src/constants.h @@ -2,7 +2,7 @@ #define CONSTANTS_H
// Version management
-#define PRODUCT_NAME _T("WhatsApp Protocol")
+#define PRODUCT_NAME L"WhatsApp Protocol"
// Limits
#define WHATSAPP_GROUP_NAME_LIMIT 420
diff --git a/protocols/WhatsApp/src/contacts.cpp b/protocols/WhatsApp/src/contacts.cpp index 413d3b80f1..3dfeec59a1 100644 --- a/protocols/WhatsApp/src/contacts.cpp +++ b/protocols/WhatsApp/src/contacts.cpp @@ -75,10 +75,10 @@ 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) {
ptrT tszMirVer(getTStringA(hContact, "MirVer"));
- if (mir_tstrcmp(tszMirVer, _T("WhatsApp")))
- setTString(hContact, "MirVer", _T("WhatsApp"));
+ if (mir_tstrcmp(tszMirVer, L"WhatsApp"))
+ setTString(hContact, "MirVer", L"WhatsApp");
- db_set_ws(hContact, "CList", "StatusMsg", _T(""));
+ db_set_ws(hContact, "CList", "StatusMsg", L"");
}
if (getWord(hContact, "Status", ID_STATUS_OFFLINE) != status)
@@ -163,7 +163,7 @@ void WhatsAppProto::onSendGetPicture(const std::string &jid, const std::vector<u // Save avatar
std::tstring filename = GetAvatarFileName(hContact);
- FILE *f = _tfopen(filename.c_str(), _T("wb"));
+ FILE *f = _tfopen(filename.c_str(), L"wb");
size_t r = fwrite(std::string(data.begin(), data.end()).c_str(), 1, data.size(), f);
fclose(f);
@@ -187,5 +187,5 @@ void WhatsAppProto::onSendGetPicture(const std::string &jid, const std::vector<u TCHAR* WhatsAppProto::GetContactDisplayName(const string& jid)
{
MCONTACT hContact = ContactIDToHContact(jid);
- return (hContact) ? pcli->pfnGetContactDisplayName(hContact, 0) : _T("none");
+ return (hContact) ? pcli->pfnGetContactDisplayName(hContact, 0) : L"none";
}
diff --git a/protocols/WhatsApp/src/dialogs.cpp b/protocols/WhatsApp/src/dialogs.cpp index 069603bb2b..b770210dd6 100644 --- a/protocols/WhatsApp/src/dialogs.cpp +++ b/protocols/WhatsApp/src/dialogs.cpp @@ -31,10 +31,10 @@ public: CreateLink(m_remoteTime, WHATSAPP_KEY_USE_REMOTE_TIME, DBVT_BYTE, false);
CreateLink(m_autorun, WHATSAPP_KEY_AUTORUNCHATS, DBVT_BYTE, true);
- CreateLink(m_cc, WHATSAPP_KEY_CC, _T(""));
- CreateLink(m_nick, WHATSAPP_KEY_NICK, _T(""));
- CreateLink(m_login, WHATSAPP_KEY_LOGIN, _T(""));
- CreateLink(m_group, WHATSAPP_KEY_DEF_GROUP, _T(""));
+ CreateLink(m_cc, WHATSAPP_KEY_CC, L"");
+ CreateLink(m_nick, WHATSAPP_KEY_NICK, L"");
+ CreateLink(m_login, WHATSAPP_KEY_LOGIN, L"");
+ CreateLink(m_group, WHATSAPP_KEY_DEF_GROUP, L"");
m_requestSMS.OnClick = Callback(this, &COptionsDlg::OnRequestSMSClick);
m_requestVoice.OnClick = Callback(this, &COptionsDlg::OnRequestVoiceClick);
diff --git a/protocols/WhatsApp/src/media.cpp b/protocols/WhatsApp/src/media.cpp index 7136a3862a..c94d5ab6c8 100644 --- a/protocols/WhatsApp/src/media.cpp +++ b/protocols/WhatsApp/src/media.cpp @@ -17,7 +17,7 @@ HANDLE WhatsAppProto::SendFile(MCONTACT hContact, const TCHAR* desc, TCHAR **pps }
// get file size
- FILE *hFile = _tfopen(ppszFiles[0], _T("rb"));
+ FILE *hFile = _tfopen(ppszFiles[0], L"rb");
if (hFile == NULL) {
debugLogA(__FUNCTION__": cannot open file %s", ppszFiles[0]);
mir_free(name);
@@ -69,7 +69,7 @@ HANDLE WhatsAppProto::SendFile(MCONTACT hContact, const TCHAR* desc, TCHAR **pps SHA256_CONTEXT sha256;
mir_sha256_init(&sha256);
- FILE *fd = _tfopen(ppszFiles[0], _T("rb"));
+ FILE *fd = _tfopen(ppszFiles[0], L"rb");
int read = 0;
do {
char buf[1024];
diff --git a/protocols/WhatsApp/src/messages.cpp b/protocols/WhatsApp/src/messages.cpp index 163144df5e..aa48df5444 100644 --- a/protocols/WhatsApp/src/messages.cpp +++ b/protocols/WhatsApp/src/messages.cpp @@ -132,6 +132,6 @@ void WhatsAppProto::onMessageStatusUpdate(const FMessage &fmsg) time_t ts = atol(fmsg.key.id.substr(0, delim).c_str());
TCHAR ttime[64];
- _tcsftime(ttime, _countof(ttime), _T("%X"), localtime(&ts));
+ _tcsftime(ttime, _countof(ttime), L"%X", localtime(&ts));
utils::setStatusMessage(hContact, CMString(FORMAT, TranslateT("Message received: %s by %s"), ttime, ptszBy));
}
diff --git a/protocols/WhatsApp/src/proto.cpp b/protocols/WhatsApp/src/proto.cpp index 63068ab57d..a361ad3e16 100644 --- a/protocols/WhatsApp/src/proto.cpp +++ b/protocols/WhatsApp/src/proto.cpp @@ -43,18 +43,18 @@ WhatsAppProto::WhatsAppProto(const char *proto_name, const TCHAR *username) if (m_hNetlibUser == NULL) {
TCHAR error[200];
mir_sntprintf(error, TranslateT("Unable to initialize Netlib for %s."), m_tszUserName);
- MessageBox(NULL, error, _T("Miranda NG"), MB_OK | MB_ICONERROR);
+ MessageBox(NULL, error, L"Miranda NG", MB_OK | MB_ICONERROR);
}
WASocketConnection::initNetwork(m_hNetlibUser);
- m_tszAvatarFolder = std::tstring(VARST(_T("%miranda_avatarcache%"))) + _T("\\") + m_tszUserName;
+ m_tszAvatarFolder = std::tstring(VARST(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());
if (m_tszDefaultGroup == NULL)
- m_tszDefaultGroup = mir_tstrdup(_T("WhatsApp"));
+ m_tszDefaultGroup = mir_tstrdup(L"WhatsApp");
Clist_GroupCreate(0, m_tszDefaultGroup);
SetAllContactStatuses(ID_STATUS_OFFLINE, true);
@@ -197,7 +197,7 @@ void WhatsAppProto::SearchAckThread(void *targ) PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
psr.flags = PSR_TCHAR;
- psr.nick.t = psr.firstName.t = psr.lastName.t = _T("");
+ psr.nick.t = psr.firstName.t = psr.lastName.t = L"";
psr.id.t = (TCHAR*)param->jid.c_str();
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)param->id, (LPARAM)&psr);
|