summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/FacebookRM/src')
-rw-r--r--protocols/FacebookRM/src/avatars.cpp4
-rw-r--r--protocols/FacebookRM/src/chat.cpp4
-rw-r--r--protocols/FacebookRM/src/communication.cpp8
-rw-r--r--protocols/FacebookRM/src/contacts.cpp2
-rw-r--r--protocols/FacebookRM/src/dialogs.cpp2
-rw-r--r--protocols/FacebookRM/src/messages.cpp4
-rw-r--r--protocols/FacebookRM/src/process.cpp4
-rw-r--r--protocols/FacebookRM/src/proto.cpp26
8 files changed, 27 insertions, 27 deletions
diff --git a/protocols/FacebookRM/src/avatars.cpp b/protocols/FacebookRM/src/avatars.cpp
index e7a9849290..b85699b520 100644
--- a/protocols/FacebookRM/src/avatars.cpp
+++ b/protocols/FacebookRM/src/avatars.cpp
@@ -33,7 +33,7 @@ bool FacebookProto::GetDbAvatarInfo(PROTO_AVATAR_INFORMATION &pai, std::string *
utils::text::replace_first(url, "%s", std::string(id));
}
- std::tstring filename = GetAvatarFolder() + _T('\\') + std::tstring(_A2T(id)) + _T(".jpg");
+ std::tstring filename = GetAvatarFolder() + _T('\\') + std::tstring(_A2T(id)) + L".jpg";
_tcsncpy_s(pai.filename, filename.c_str(), _TRUNCATE);
pai.format = ProtoGetAvatarFormat(pai.filename);
@@ -126,7 +126,7 @@ void FacebookProto::UpdateAvatarWorker(void *)
std::tstring FacebookProto::GetAvatarFolder()
{
TCHAR path[MAX_PATH];
- mir_sntprintf(path, _T("%s\\%s"), VARST(_T("%miranda_avatarcache%")), m_tszUserName);
+ mir_sntprintf(path, L"%s\\%s", VARST(L"%miranda_avatarcache%"), m_tszUserName);
return path;
}
diff --git a/protocols/FacebookRM/src/chat.cpp b/protocols/FacebookRM/src/chat.cpp
index 9ec90536a7..79d9874e93 100644
--- a/protocols/FacebookRM/src/chat.cpp
+++ b/protocols/FacebookRM/src/chat.cpp
@@ -376,7 +376,7 @@ int FacebookProto::OnGCMenuHook(WPARAM, LPARAM lParam)
{
{ LPGENT("User &details"), 10, MENU_ITEM, FALSE },
{ LPGENT("User &history"), 20, MENU_ITEM, FALSE },
- { _T(""), 100, MENU_SEPARATOR, FALSE },
+ { L"", 100, MENU_SEPARATOR, FALSE },
{ LPGENT("&Leave chat session"), 110, MENU_ITEM, FALSE }
};
gcmi->nItems = _countof(Items);
@@ -415,7 +415,7 @@ void FacebookProto::PrepareNotificationsChatRoom() {
MCONTACT hNotificationsChatRoom = ChatIDToHContact(FACEBOOK_NOTIFICATIONS_CHATROOM);
if (hNotificationsChatRoom == NULL || getDword(hNotificationsChatRoom, "Status", ID_STATUS_OFFLINE) != ID_STATUS_ONLINE) {
TCHAR nameT[200];
- mir_sntprintf(nameT, _T("%s: %s"), m_tszUserName, TranslateT("Notifications"));
+ mir_sntprintf(nameT, L"%s: %s", m_tszUserName, TranslateT("Notifications"));
// Create the group chat session
GCSESSION gcw = { sizeof(gcw) };
diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp
index 128613ed06..21ff44d15d 100644
--- a/protocols/FacebookRM/src/communication.cpp
+++ b/protocols/FacebookRM/src/communication.cpp
@@ -735,7 +735,7 @@ void facebook_client::insert_reader(MCONTACT hContact, time_t timestamp, const s
// Load old readers
ptrT told(parent->getTStringA(hContact, FACEBOOK_KEY_MESSAGE_READERS));
if (told)
- treaders = std::tstring(told) + _T(", ");
+ treaders = std::tstring(told) + L", ";
// Append new reader name and remember them
treaders += utils::text::prepare_name(treaderName, true);
@@ -932,13 +932,13 @@ bool facebook_client::login(const char *username, const char *password)
// 2) Approve last unknown login
if (resp.data.find("name=\"submit[This was me]\"") != std::string::npos) {
CMString tszTitle;
- tszTitle.AppendFormat(_T("%s - %s"), parent->m_tszUserName, TranslateT("Check last login"));
+ tszTitle.AppendFormat(L"%s - %s", parent->m_tszUserName, TranslateT("Check last login"));
CMString tszMessage(TranslateT("Do you recognize this activity?"));
std::string activity = utils::text::slashu_to_utf8(utils::text::source_get_value(&resp.data, 3, "<body", "</strong></div>", "</div>"));
activity = utils::text::trim(utils::text::html_entities_decode(utils::text::remove_html(activity)));
if (!activity.empty()) {
- tszMessage.AppendFormat(_T("\n\n%s"), ptrT(mir_utf8decodeT(activity.c_str())));
+ tszMessage.AppendFormat(L"\n\n%s", ptrT(mir_utf8decodeT(activity.c_str())));
}
if (MessageBox(0, tszMessage, tszTitle, MB_ICONWARNING | MB_YESNO | MB_DEFBUTTON1) == IDYES) {
@@ -1694,7 +1694,7 @@ bool facebook_client::save_url(const std::string &url, const std::tstring &filen
CreateDirectoryTreeT(dir.c_str());
// Write to file
- FILE *f = _tfopen(filename.c_str(), _T("wb"));
+ FILE *f = _tfopen(filename.c_str(), L"wb");
if (f != NULL) {
fwrite(resp->pData, 1, resp->dataLength, f);
fclose(f);
diff --git a/protocols/FacebookRM/src/contacts.cpp b/protocols/FacebookRM/src/contacts.cpp
index a75d61f58c..95e4307ad0 100644
--- a/protocols/FacebookRM/src/contacts.cpp
+++ b/protocols/FacebookRM/src/contacts.cpp
@@ -371,7 +371,7 @@ void FacebookProto::LoadChatInfo(facebook_chatroom *fbc)
continue;
if (namesUsed > 0)
- fbc->chat_name += _T(", ");
+ fbc->chat_name += L", ";
std::tstring tname = _A2T(participant.c_str(), CP_UTF8);
fbc->chat_name += utils::text::prepare_name(tname, false);
diff --git a/protocols/FacebookRM/src/dialogs.cpp b/protocols/FacebookRM/src/dialogs.cpp
index d12af3fd03..2f349531ff 100644
--- a/protocols/FacebookRM/src/dialogs.cpp
+++ b/protocols/FacebookRM/src/dialogs.cpp
@@ -202,7 +202,7 @@ INT_PTR CALLBACK FBMindProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lpara
SendDlgItemMessage(hwnd, IDC_URL, EM_LIMITTEXT, 1024, 0);
ptrT place(data->proto->getTStringA(FACEBOOK_KEY_PLACE));
- SetDlgItemText(hwnd, IDC_PLACE, place != NULL ? place : _T("Miranda NG"));
+ SetDlgItemText(hwnd, IDC_PLACE, place != NULL ? place : L"Miranda NG");
bShowContacts = data->proto->getByte("PostStatusExpand", 0) > 0;
ResizeHorizontal(hwnd, bShowContacts);
diff --git a/protocols/FacebookRM/src/messages.cpp b/protocols/FacebookRM/src/messages.cpp
index a7fdc4674f..bfb4dd24d4 100644
--- a/protocols/FacebookRM/src/messages.cpp
+++ b/protocols/FacebookRM/src/messages.cpp
@@ -217,11 +217,11 @@ void FacebookProto::StickerAsSmiley(std::string sticker, const std::string &url,
std::string b64 = ptrA(mir_base64_encode((PBYTE)sticker.c_str(), (unsigned)sticker.length()));
b64 = utils::url::encode(b64);
- std::tstring filename = GetAvatarFolder() + _T("\\stickers\\");
+ std::tstring filename = GetAvatarFolder() + L"\\stickers\\";
ptrT dir(mir_tstrdup(filename.c_str()));
filename += (TCHAR*)_A2T(b64.c_str());
- filename += _T(".png");
+ filename += L".png";
// Check if we have this sticker already and download it it not
if (GetFileAttributes(filename.c_str()) == INVALID_FILE_ATTRIBUTES) {
diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp
index c76b0c6800..80cd20e3d7 100644
--- a/protocols/FacebookRM/src/process.cpp
+++ b/protocols/FacebookRM/src/process.cpp
@@ -520,7 +520,7 @@ std::string truncateUtf8(std::string &text, size_t maxLength) {
// TODO: Probably there is much simpler and nicer way
std::tstring ttext = ptrT(mir_utf8decodeT(text.c_str()));
if (ttext.length() > maxLength) {
- ttext = ttext.substr(0, maxLength) + _T("\x2026"); // unicode ellipsis
+ ttext = ttext.substr(0, maxLength) + L"\x2026"; // unicode ellipsis
return std::string(_T2A(ttext.c_str(), CP_UTF8));
}
// It's not longer, return given string
@@ -805,7 +805,7 @@ void FacebookProto::ReceiveMessages(std::vector<facebook_message> &messages, boo
if (!hChatContact) {
// hopefully shouldn't happen, but who knows?
- debugLog(_T("!!! No hChatContact for %s"), fbc->thread_id.c_str());
+ debugLog(L"!!! No hChatContact for %s", fbc->thread_id.c_str());
continue;
}
diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp
index c5dbb60c2c..7f7720f350 100644
--- a/protocols/FacebookRM/src/proto.cpp
+++ b/protocols/FacebookRM/src/proto.cpp
@@ -52,7 +52,7 @@ FacebookProto::FacebookProto(const char* proto_name, const TCHAR* username) :
m_pagePrefix = (pagePrefix != NULL) ? _T2A(pagePrefix, CP_UTF8) : TEXT_EMOJI_PAGE;
if (m_tszDefaultGroup == NULL)
- m_tszDefaultGroup = mir_tstrdup(_T("Facebook"));
+ m_tszDefaultGroup = mir_tstrdup(L"Facebook");
CreateProtoService(PS_CREATEACCMGRUI, &FacebookProto::SvcCreateAccMgrUI);
CreateProtoService(PS_GETMYAWAYMSG, &FacebookProto::GetMyAwayMsg);
@@ -92,7 +92,7 @@ FacebookProto::FacebookProto(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);
}
facy.set_handle(m_hNetlibUser);
@@ -271,7 +271,7 @@ HANDLE FacebookProto::SearchByEmail(const TCHAR* email)
HANDLE FacebookProto::SearchByName(const TCHAR* nick, const TCHAR* firstName, const TCHAR* lastName)
{
TCHAR arg[200];
- mir_sntprintf(arg, _T("%s %s %s"), nick, firstName, lastName);
+ mir_sntprintf(arg, L"%s %s %s", nick, firstName, lastName);
return SearchByEmail(arg); // Facebook is using one search method for everything (except IDs)
}
@@ -886,7 +886,7 @@ void FacebookProto::OpenUrlThread(void *p) {
open_url *data = static_cast<open_url*>(p);
- ShellExecute(NULL, _T("open"), data->browser, data->url, NULL, SW_SHOWDEFAULT);
+ ShellExecute(NULL, L"open", data->browser, data->url, NULL, SW_SHOWDEFAULT);
delete data;
}
@@ -1009,7 +1009,7 @@ void FacebookProto::InitPopups()
char name[256];
// Client
- mir_sntprintf(desc, _T("%s/%s"), m_tszUserName, TranslateT("Client errors"));
+ mir_sntprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Client errors"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Client");
ppc.ptszDescription = desc;
ppc.pszName = name;
@@ -1020,7 +1020,7 @@ void FacebookProto::InitPopups()
popupClasses.push_back(Popup_RegisterClass(&ppc));
// Newsfeeds
- mir_sntprintf(desc, _T("%s/%s"), m_tszUserName, TranslateT("Wall posts"));
+ mir_sntprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Wall posts"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Newsfeed");
ppc.ptszDescription = desc;
ppc.pszName = name;
@@ -1031,7 +1031,7 @@ void FacebookProto::InitPopups()
popupClasses.push_back(Popup_RegisterClass(&ppc));
// Notifications
- mir_sntprintf(desc, _T("%s/%s"), m_tszUserName, TranslateT("Notifications"));
+ mir_sntprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Notifications"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Notification");
ppc.ptszDescription = desc;
ppc.pszName = name;
@@ -1042,7 +1042,7 @@ void FacebookProto::InitPopups()
popupClasses.push_back(Popup_RegisterClass(&ppc));
// Others
- mir_sntprintf(desc, _T("%s/%s"), m_tszUserName, TranslateT("Other events"));
+ mir_sntprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Other events"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Other");
ppc.ptszDescription = desc;
ppc.pszName = name;
@@ -1053,7 +1053,7 @@ void FacebookProto::InitPopups()
popupClasses.push_back(Popup_RegisterClass(&ppc));
// Friendship changes
- mir_sntprintf(desc, _T("%s/%s"), m_tszUserName, TranslateT("Friendship events"));
+ mir_sntprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Friendship events"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Friendship");
ppc.ptszDescription = desc;
ppc.pszName = name;
@@ -1064,7 +1064,7 @@ void FacebookProto::InitPopups()
popupClasses.push_back(Popup_RegisterClass(&ppc));
// Ticker
- mir_sntprintf(desc, _T("%s/%s"), m_tszUserName, TranslateT("Real-time friends activity"));
+ mir_sntprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Real-time friends activity"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Ticker");
ppc.ptszDescription = desc;
ppc.pszName = name;
@@ -1075,7 +1075,7 @@ void FacebookProto::InitPopups()
popupClasses.push_back(Popup_RegisterClass(&ppc));
// On this day
- mir_sntprintf(desc, _T("%s/%s"), m_tszUserName, TranslateT("\"On this day\" posts"));
+ mir_sntprintf(desc, L"%s/%s", m_tszUserName, TranslateT("\"On this day\" posts"));
mir_snprintf(name, "%s_%s", m_szModuleName, "OnThisDay");
ppc.ptszDescription = desc;
ppc.pszName = name;
@@ -1143,7 +1143,7 @@ void FacebookProto::MessageRead(MCONTACT hContact)
return;
TCHAR ttime[64];
- _tcsftime(ttime, _countof(ttime), _T("%X"), localtime(&time));
+ _tcsftime(ttime, _countof(ttime), L"%X", localtime(&time));
StatusTextData st = { 0 };
st.cbSize = sizeof(st);
@@ -1152,7 +1152,7 @@ void FacebookProto::MessageRead(MCONTACT hContact)
if (isChatRoom(hContact)) {
// Load readers names
ptrT treaders(getTStringA(hContact, FACEBOOK_KEY_MESSAGE_READERS));
- mir_sntprintf(st.tszText, TranslateT("Message read: %s by %s"), ttime, treaders ? treaders : _T("???"));
+ mir_sntprintf(st.tszText, TranslateT("Message read: %s by %s"), ttime, treaders ? treaders : L"???");
CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hContact, (LPARAM)&st);
} else if (!ServiceExists(MS_MESSAGESTATE_UPDATE)){
mir_sntprintf(st.tszText, TranslateT("Message read: %s"), ttime);