diff options
Diffstat (limited to 'protocols/GTalkExt')
-rw-r--r-- | protocols/GTalkExt/src/avatar.cpp | 6 | ||||
-rw-r--r-- | protocols/GTalkExt/src/handlers.cpp | 40 | ||||
-rw-r--r-- | protocols/GTalkExt/src/inbox.cpp | 12 | ||||
-rw-r--r-- | protocols/GTalkExt/src/notifications.cpp | 20 | ||||
-rw-r--r-- | protocols/GTalkExt/src/options.cpp | 4 | ||||
-rw-r--r-- | protocols/GTalkExt/src/tipper_items.cpp | 10 |
6 files changed, 46 insertions, 46 deletions
diff --git a/protocols/GTalkExt/src/avatar.cpp b/protocols/GTalkExt/src/avatar.cpp index edd023c8d5..9c87926832 100644 --- a/protocols/GTalkExt/src/avatar.cpp +++ b/protocols/GTalkExt/src/avatar.cpp @@ -45,7 +45,7 @@ LPTSTR CreateAvaFile(HANDLE *hFile) return NULL;
wchar_t full[MAX_PATH + 2];
- mir_sntprintf(full, AVA_FILE_NAME_FORMAT, path, name);
+ mir_snwprintf(full, AVA_FILE_NAME_FORMAT, path, name);
CreateDirectoryTreeT(full);
HANDLE h = CreateFile(full, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
@@ -57,7 +57,7 @@ LPTSTR CreateAvaFile(HANDLE *hFile) else
CloseHandle(h);
- return mir_tstrdup(full);
+ return mir_wstrdup(full);
}
BOOL SaveAvatar(HANDLE hFile)
@@ -144,7 +144,7 @@ void SetAvatar(MCONTACT hContact) return;
HANDLE hFile;
- ptrT avaFile(CreateAvaFile(&hFile));
+ ptrW avaFile(CreateAvaFile(&hFile));
if (avaFile == NULL)
return;
diff --git a/protocols/GTalkExt/src/handlers.cpp b/protocols/GTalkExt/src/handlers.cpp index 5dd4cf0345..485dc454a4 100644 --- a/protocols/GTalkExt/src/handlers.cpp +++ b/protocols/GTalkExt/src/handlers.cpp @@ -41,25 +41,25 @@ GoogleTalkAcc* isGoogle(LPARAM lParam) void FormatMessageUrl(LPCTSTR format, LPTSTR buf, LPCTSTR mailbox, LPCTSTR tid)
{
ULARGE_INTEGER iTid; iTid.QuadPart = _wtoi64(tid);
- size_t l = mir_tstrlen(buf);
- mir_sntprintf(buf, l, format, mailbox, iTid.HighPart, iTid.LowPart);
- assert(l >= mir_tstrlen(buf));
+ size_t l = mir_wstrlen(buf);
+ mir_snwprintf(buf, l, format, mailbox, iTid.HighPart, iTid.LowPart);
+ assert(l >= mir_wstrlen(buf));
}
void MakeUrlHex(LPTSTR url, LPCTSTR tid)
{
ULARGE_INTEGER iTid; iTid.QuadPart = _wtoi64(tid);
LPTSTR tidInUrl = wcsstr(url, tid);
- LPTSTR trail = tidInUrl + mir_tstrlen(tid);
+ LPTSTR trail = tidInUrl + mir_wstrlen(tid);
wsprintf(tidInUrl, L"%x%08x", iTid.HighPart, iTid.LowPart); //!!!!!!!!!!!!
- wmemmove(tidInUrl + mir_tstrlen(tidInUrl), trail, mir_tstrlen(trail) + 1);
+ wmemmove(tidInUrl + mir_wstrlen(tidInUrl), trail, mir_wstrlen(trail) + 1);
}
LPTSTR ExtractJid(LPCTSTR jidWithRes)
{
LPCTSTR p = wcsrchr(jidWithRes, '/');
if (p == NULL)
- return mir_tstrdup(jidWithRes);
+ return mir_wstrdup(jidWithRes);
size_t l = size_t(p - jidWithRes);
LPTSTR result = (LPTSTR)mir_alloc((l + 1) * sizeof(wchar_t));
@@ -149,7 +149,7 @@ BOOL MailListHandler(IJabberInterface *ji, HXML node, void *) {
LPCTSTR jidWithRes = xmlGetAttrValue(node, ATTRNAME_TO);
__try {
- if (!node || mir_tstrcmp(xmlGetAttrValue(node, ATTRNAME_TYPE), IQTYPE_RESULT)) return TRUE;
+ if (!node || mir_wstrcmp(xmlGetAttrValue(node, ATTRNAME_TYPE), IQTYPE_RESULT)) return TRUE;
LPCTSTR jid = xmlGetAttrValue(node, ATTRNAME_FROM);
assert(jid);
@@ -177,15 +177,15 @@ void RequestMail(LPCTSTR jidWithRes, IJabberInterface *ji) xmlAddAttr(node, ATTRNAME_FROM, jidWithRes);
UINT uID = ji->SerialNext();
- ptrT jid(ExtractJid(jidWithRes));
+ ptrW jid(ExtractJid(jidWithRes));
xmlAddAttr(node, ATTRNAME_TO, jid);
- ptrT
+ ptrW
lastMailTime(ReadJidSetting(LAST_MAIL_TIME_FROM_JID, jid)),
lastThreadId(ReadJidSetting(LAST_THREAD_ID_FROM_JID, jid));
wchar_t id[30];
- mir_sntprintf(id, JABBER_IQID_FORMAT, uID);
+ mir_snwprintf(id, JABBER_IQID_FORMAT, uID);
xmlAddAttr(node, ATTRNAME_ID, id);
child = xmlAddChild(node, NODENAME_QUERY, NULL);
@@ -241,11 +241,11 @@ void SetNotificationSetting(LPCTSTR jidWithResource, IJabberInterface *ji) xmlAddAttr(node, ATTRNAME_TYPE, IQTYPE_SET);
xmlAddAttr(node, ATTRNAME_FROM, jidWithResource);
- ptrT jid(ExtractJid(jidWithResource));
+ ptrW jid(ExtractJid(jidWithResource));
xmlAddAttr(node, ATTRNAME_TO, jid);
wchar_t id[30];
- mir_sntprintf(id, JABBER_IQID_FORMAT, ji->SerialNext());
+ mir_snwprintf(id, JABBER_IQID_FORMAT, ji->SerialNext());
xmlAddAttr(node, ATTRNAME_ID, id);
child = xmlAddChild(node, NODENAME_USERSETTING, NULL);
@@ -294,7 +294,7 @@ BOOL SendHandler(IJabberInterface *ji, HXML node, void *) ji->AddTemporaryIqHandler(DiscoverHandler, JABBER_IQ_TYPE_RESULT, _wtoi(ptszId + 4), NULL, RESPONSE_TIMEOUT, 500);
}
- if (!mir_tstrcmp(xmlGetName(node), L"presence") && xmlGetAttrValue(node, ATTRNAME_TO) == 0) {
+ if (!mir_wstrcmp(xmlGetName(node), L"presence") && xmlGetAttrValue(node, ATTRNAME_TO) == 0) {
if (!gta->m_bGoogleSharedStatus)
return FALSE;
@@ -317,7 +317,7 @@ BOOL OnIqResultGoogleSharedStatus(IJabberInterface *ji, HXML node, void *) {
GoogleTalkAcc *gta = isGoogle(LPARAM(ji));
if (gta != NULL) {
- gta->m_bGoogleSharedStatus = mir_tstrcmp(xmlGetAttrValue(node, ATTRNAME_TYPE), IQTYPE_RESULT) == 0;
+ gta->m_bGoogleSharedStatus = mir_wstrcmp(xmlGetAttrValue(node, ATTRNAME_TYPE), IQTYPE_RESULT) == 0;
gta->m_bGoogleSharedStatusLock = FALSE;
}
return FALSE;
@@ -328,7 +328,7 @@ BOOL OnIqSetGoogleSharedStatus(IJabberInterface *ji, HXML iqNode, void *) GoogleTalkAcc *gta = isGoogle(LPARAM(ji));
if (gta == NULL)
return FALSE;
- if (mir_tstrcmp(xmlGetAttrValue(iqNode, ATTRNAME_TYPE), IQTYPE_SET))
+ if (mir_wstrcmp(xmlGetAttrValue(iqNode, ATTRNAME_TYPE), IQTYPE_SET))
return FALSE;
if (gta->m_bGoogleSharedStatusLock)
return TRUE;
@@ -336,11 +336,11 @@ BOOL OnIqSetGoogleSharedStatus(IJabberInterface *ji, HXML iqNode, void *) int status;
HXML query = xmlGetChildByPath(iqNode, NODENAME_QUERY, 0);
HXML node = xmlGetChildByPath(query, L"invisible", 0);
- if (0 == mir_tstrcmpi(L"true", xmlGetAttrValue(node, L"value")))
+ if (0 == mir_wstrcmpi(L"true", xmlGetAttrValue(node, L"value")))
status = ID_STATUS_INVISIBLE;
else {
LPCTSTR txt = xmlGetText(xmlGetChildByPath(query, L"show", 0));
- if (txt && 0 == mir_tstrcmpi(L"dnd", txt))
+ if (txt && 0 == mir_wstrcmpi(L"dnd", txt))
status = ID_STATUS_DND;
else if (gta->m_pa->ppro->m_iStatus == ID_STATUS_DND || gta->m_pa->ppro->m_iStatus == ID_STATUS_INVISIBLE)
status = ID_STATUS_ONLINE;
@@ -364,12 +364,12 @@ void GoogleTalkAcc::SendIqGoogleSharedStatus(LPCTSTR status, LPCTSTR msg) xmlAddAttrInt(query, L"version", 2);
xmlAddChild(query, L"status", msg);
- if (!mir_tstrcmp(status, L"invisible")) {
+ if (!mir_wstrcmp(status, L"invisible")) {
xmlAddChild(query, L"show", L"default");
xmlAddAttr(xmlAddChild(query, L"invisible", 0), L"value", L"true");
}
else {
- if (!mir_tstrcmp(status, L"dnd"))
+ if (!mir_wstrcmp(status, L"dnd"))
xmlAddChild(query, L"show", L"dnd");
else
xmlAddChild(query, L"show", L"default");
@@ -390,7 +390,7 @@ int OnServerDiscoInfo(WPARAM wParam, LPARAM lParam) // m_ThreadInfo->jabberServerCaps |= JABBER_CAPS_PING;
JABBER_DISCO_FIELD *fld = (JABBER_DISCO_FIELD*)wParam;
- if (!mir_tstrcmp(fld->category, L"server") && !mir_tstrcmp(fld->type, L"im") && !mir_tstrcmp(fld->name, L"Google Talk")) {
+ if (!mir_wstrcmp(fld->category, L"server") && !mir_wstrcmp(fld->type, L"im") && !mir_wstrcmp(fld->name, L"Google Talk")) {
HXML iq = xmlCreateNode(NODENAME_IQ, NULL, FALSE);
xmlAddAttr(iq, ATTRNAME_TYPE, IQTYPE_GET);
diff --git a/protocols/GTalkExt/src/inbox.cpp b/protocols/GTalkExt/src/inbox.cpp index f4e6c3ee4d..2e73250e7d 100644 --- a/protocols/GTalkExt/src/inbox.cpp +++ b/protocols/GTalkExt/src/inbox.cpp @@ -168,8 +168,8 @@ BOOL OpenUrlWithAuth(LPCSTR acc, LPCTSTR mailbox, LPCTSTR url) int pwdLen = GetMailboxPwd(acc, NULL, 0);
if (!pwdLen++) return FALSE;
- size_t urlLen = mir_tstrlen(url) + 1;
- size_t mailboxLen = mir_tstrlen(mailbox) + 1;
+ size_t urlLen = mir_wstrlen(url) + 1;
+ size_t mailboxLen = mir_wstrlen(mailbox) + 1;
OPEN_URL_HEADER *data = (OPEN_URL_HEADER*)malloc(sizeof(OPEN_URL_HEADER) + urlLen + mailboxLen + pwdLen);
data->url = (LPSTR)data + sizeof(OPEN_URL_HEADER);
@@ -196,7 +196,7 @@ void OpenUrl(LPCSTR acc, LPCTSTR mailbox, LPCTSTR url) void OpenContactInbox(LPCSTR szModuleName)
{
- ptrT tszJid(db_get_tsa(0, szModuleName, "jid"));
+ ptrW tszJid(db_get_tsa(0, szModuleName, "jid"));
if (tszJid == NULL)
return;
@@ -206,9 +206,9 @@ void OpenContactInbox(LPCSTR szModuleName) *host++ = 0;
wchar_t buf[1024];
- if (mir_tstrcmpi(host, COMMON_GMAIL_HOST1) && mir_tstrcmpi(host, COMMON_GMAIL_HOST2))
- mir_sntprintf(buf, INBOX_URL_FORMAT, L"a/", host); // hosted
+ if (mir_wstrcmpi(host, COMMON_GMAIL_HOST1) && mir_wstrcmpi(host, COMMON_GMAIL_HOST2))
+ mir_snwprintf(buf, INBOX_URL_FORMAT, L"a/", host); // hosted
else
- mir_sntprintf(buf, INBOX_URL_FORMAT, L"", L"mail"); // common
+ mir_snwprintf(buf, INBOX_URL_FORMAT, L"", L"mail"); // common
OpenUrl(szModuleName, tszJid, buf);
}
diff --git a/protocols/GTalkExt/src/notifications.cpp b/protocols/GTalkExt/src/notifications.cpp index fda2db7eb5..e2243609ca 100644 --- a/protocols/GTalkExt/src/notifications.cpp +++ b/protocols/GTalkExt/src/notifications.cpp @@ -54,8 +54,8 @@ LPCSTR GetJidAcc(LPCTSTR jid) Proto_EnumAccounts(&count, &protos);
for (int i = 0; i < count; i++) {
if (getJabberApi(protos[i]->szModuleName)) {
- ptrT tszJid(db_get_tsa(0, protos[i]->szModuleName, "jid"));
- if (!mir_tstrcmpi(jid, tszJid))
+ ptrW tszJid(db_get_tsa(0, protos[i]->szModuleName, "jid"));
+ if (!mir_wstrcmpi(jid, tszJid))
return protos[i]->szModuleName;
}
}
@@ -158,7 +158,7 @@ static bool DoAddPopup(POPUPDATAT *data) void FormatPseudocontactDisplayName(LPTSTR buff, LPCTSTR jid, LPCTSTR unreadCount)
{
- if (mir_tstrcmp(unreadCount, L"0"))
+ if (mir_wstrcmp(unreadCount, L"0"))
wsprintf(buff, L"%s [%s]", jid, unreadCount); //!!!!!!!!!!!
else
wsprintf(buff, L"%s", jid); //!!!!!!!!!!!
@@ -177,7 +177,7 @@ MCONTACT SetupPseudocontact(LPCTSTR jid, LPCTSTR unreadCount, LPCSTR acc, LPCTST // SetAvatar(hContact);
if (displayName == NULL) {
- wchar_t *tszTemp = (wchar_t*)alloca((mir_tstrlen(jid) + mir_tstrlen(unreadCount) + 3 + 1) * sizeof(wchar_t));
+ wchar_t *tszTemp = (wchar_t*)alloca((mir_wstrlen(jid) + mir_wstrlen(unreadCount) + 3 + 1) * sizeof(wchar_t));
FormatPseudocontactDisplayName(tszTemp, jid, unreadCount);
db_set_ts(hContact, CLIST_MODULE_NAME, CONTACT_DISPLAY_NAME_SETTING, tszTemp);
}
@@ -230,8 +230,8 @@ void ShowNotification(LPCSTR acc, POPUPDATAT *data, LPCTSTR jid, LPCTSTR url, LP }
data->PluginWindowProc = PopupProc;
- size_t lurl = (mir_tstrlen(url) + 1) * sizeof(wchar_t);
- size_t ljid = (mir_tstrlen(jid) + 1) * sizeof(wchar_t);
+ size_t lurl = (mir_wstrlen(url) + 1) * sizeof(wchar_t);
+ size_t ljid = (mir_wstrlen(jid) + 1) * sizeof(wchar_t);
POPUP_DATA_HEADER *ppdh = (POPUP_DATA_HEADER*)malloc(sizeof(POPUP_DATA_HEADER) + lurl + ljid);
ppdh->MarkRead = FALSE;
@@ -253,7 +253,7 @@ void UnreadMailNotification(LPCSTR acc, LPCTSTR jid, LPCTSTR url, LPCTSTR unread POPUPDATAT data = { 0 };
FormatPseudocontactDisplayName(&data.lptzContactName[0], jid, unreadCount);
- mir_sntprintf(data.lptzText, TranslateT("You've received an e-mail\n%s unread threads"), unreadCount);
+ mir_snwprintf(data.lptzText, TranslateT("You've received an e-mail\n%s unread threads"), unreadCount);
ShowNotification(acc, &data, jid, url, unreadCount);
}
@@ -276,9 +276,9 @@ void UnreadThreadNotification(LPCSTR acc, LPCTSTR jid, LPCTSTR url, LPCTSTR unre }
if (ReadCheckbox(0, IDC_ADDSNIP, (UINT_PTR)TlsGetValue(itlsSettings)))
- mir_sntprintf(data.lptzText, TranslateTS(FULL_NOTIFICATION_FORMAT), mtn->subj, tszSenders.c_str(), mtn->snip);
+ mir_snwprintf(data.lptzText, TranslateTS(FULL_NOTIFICATION_FORMAT), mtn->subj, tszSenders.c_str(), mtn->snip);
else
- mir_sntprintf(data.lptzText, TranslateTS(SHORT_NOTIFICATION_FORMAT), mtn->subj, tszSenders.c_str());
+ mir_snwprintf(data.lptzText, TranslateTS(SHORT_NOTIFICATION_FORMAT), mtn->subj, tszSenders.c_str());
ShowNotification(acc, &data, jid, url, unreadCount);
}
@@ -321,7 +321,7 @@ BOOL CALLBACK ClosePopupFunc(__in HWND hwnd, __in LPARAM lParam) if (!ppdh)
return TRUE;
- if (!mir_tstrcmpi(ppis->url, ppdh->url) && !mir_tstrcmpi(ppis->jid, ppdh->jid))
+ if (!mir_wstrcmpi(ppis->url, ppdh->url) && !mir_wstrcmpi(ppis->jid, ppdh->jid))
SendMessage(hwnd, MESSAGE_CLOSEPOPUP, 0, 0);
return TRUE;
diff --git a/protocols/GTalkExt/src/options.cpp b/protocols/GTalkExt/src/options.cpp index 02394e0949..9183d773e4 100644 --- a/protocols/GTalkExt/src/options.cpp +++ b/protocols/GTalkExt/src/options.cpp @@ -155,8 +155,8 @@ INT_PTR CALLBACK AccOptionsDlgProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lPa void ShowTestPopup(HWND wnd)
{
POPUPDATAT data = { 0 };
- mir_sntprintf(data.lptzContactName, TranslateTS(TEST_LETTER_INBOX));
- mir_sntprintf(data.lptzText, TranslateTS(FULL_NOTIFICATION_FORMAT), TranslateTS(TEST_LETTER_SUBJECT), TranslateTS(TEST_LETTER_SENDER), TranslateTS(TEST_LETTER_SNIP));
+ mir_snwprintf(data.lptzContactName, TranslateTS(TEST_LETTER_INBOX));
+ mir_snwprintf(data.lptzText, TranslateTS(FULL_NOTIFICATION_FORMAT), TranslateTS(TEST_LETTER_SUBJECT), TranslateTS(TEST_LETTER_SENDER), TranslateTS(TEST_LETTER_SNIP));
int len = SendDlgItemMessage(wnd, IDC_TIMEOUTEDIT, WM_GETTEXTLENGTH, 0, 0) + 1;
LPTSTR timeout = (LPTSTR)_alloca(len * sizeof(wchar_t));
diff --git a/protocols/GTalkExt/src/tipper_items.cpp b/protocols/GTalkExt/src/tipper_items.cpp index ef886b764f..929078c2f7 100644 --- a/protocols/GTalkExt/src/tipper_items.cpp +++ b/protocols/GTalkExt/src/tipper_items.cpp @@ -74,15 +74,15 @@ void SetLabelProp(int index, LPSTR setting) {
sprintf(setting, LABEL_SETTING_PROP, index); //!!!!!!!!!!!!!!
- ptrT tszProp(db_get_tsa(0, TIPPER_ITEMS_MOD_NAME, setting));
+ ptrW tszProp(db_get_tsa(0, TIPPER_ITEMS_MOD_NAME, setting));
if (tszProp == NULL)
return;
- ptrT tszLastWritten(db_get_tsa(0, SHORT_PLUGIN_NAME, LAST_WRITTEN_LABEL_SETTING));
+ ptrW tszLastWritten(db_get_tsa(0, SHORT_PLUGIN_NAME, LAST_WRITTEN_LABEL_SETTING));
if (tszLastWritten == NULL)
return;
- if (!mir_tstrcmp(tszProp, tszLastWritten)) {
+ if (!mir_wstrcmp(tszProp, tszLastWritten)) {
LPTSTR label = TranslateTS(UNREAD_THREADS_LABEL);
db_set_ts(0, SHORT_PLUGIN_NAME, LAST_WRITTEN_LABEL_SETTING, label);
db_set_ts(0, TIPPER_ITEMS_MOD_NAME, setting, label);
@@ -103,9 +103,9 @@ void AddTipperItem() for (i = 0; i < itemCount; i++) {
mir_snprintf(setting, l, VALUE_SETTING_PROP, i);
- ptrT tszSetting(db_get_tsa(0, TIPPER_ITEMS_MOD_NAME, setting));
+ ptrW tszSetting(db_get_tsa(0, TIPPER_ITEMS_MOD_NAME, setting));
if (tszSetting) {
- if (!mir_tstrcmp(UNREAD_THREADS_RAW, tszSetting)) {
+ if (!mir_wstrcmp(UNREAD_THREADS_RAW, tszSetting)) {
SetLabelProp(i, setting);
return;
}
|