diff options
Diffstat (limited to 'protocols/MSN/src')
-rw-r--r-- | protocols/MSN/src/msn.cpp | 2 | ||||
-rw-r--r-- | protocols/MSN/src/msn_chat.cpp | 30 | ||||
-rw-r--r-- | protocols/MSN/src/msn_commands.cpp | 54 | ||||
-rw-r--r-- | protocols/MSN/src/msn_libstr.cpp | 10 | ||||
-rw-r--r-- | protocols/MSN/src/msn_lists.cpp | 6 | ||||
-rw-r--r-- | protocols/MSN/src/msn_mail.cpp | 12 | ||||
-rw-r--r-- | protocols/MSN/src/msn_misc.cpp | 54 | ||||
-rw-r--r-- | protocols/MSN/src/msn_natdetect.cpp | 2 | ||||
-rw-r--r-- | protocols/MSN/src/msn_opts.cpp | 2 | ||||
-rw-r--r-- | protocols/MSN/src/msn_p2p.cpp | 12 | ||||
-rw-r--r-- | protocols/MSN/src/msn_proto.cpp | 24 | ||||
-rw-r--r-- | protocols/MSN/src/msn_skypeab.cpp | 16 | ||||
-rw-r--r-- | protocols/MSN/src/msn_srv.cpp | 2 | ||||
-rw-r--r-- | protocols/MSN/src/msn_svcs.cpp | 28 | ||||
-rw-r--r-- | protocols/MSN/src/msn_threads.cpp | 4 | ||||
-rw-r--r-- | protocols/MSN/src/stdafx.h | 2 |
16 files changed, 130 insertions, 130 deletions
diff --git a/protocols/MSN/src/msn.cpp b/protocols/MSN/src/msn.cpp index 2f217da0b5..9fa392318d 100644 --- a/protocols/MSN/src/msn.cpp +++ b/protocols/MSN/src/msn.cpp @@ -61,7 +61,7 @@ int MSN_GCMenuHook(WPARAM wParam, LPARAM lParam); // Protocol instances
static int sttCompareProtocols(const CMsnProto *p1, const CMsnProto *p2)
{
- return mir_tstrcmp(p1->m_tszUserName, p2->m_tszUserName);
+ return mir_wstrcmp(p1->m_tszUserName, p2->m_tszUserName);
}
OBJLIST<CMsnProto> g_Instances(1, sttCompareProtocols);
diff --git a/protocols/MSN/src/msn_chat.cpp b/protocols/MSN/src/msn_chat.cpp index 995404ea9b..539280f125 100644 --- a/protocols/MSN/src/msn_chat.cpp +++ b/protocols/MSN/src/msn_chat.cpp @@ -55,7 +55,7 @@ int CMsnProto::MSN_ChatInit(GCThreadData *info, const char *pszID, const char *p wchar_t szName[512];
InterlockedIncrement(&m_chatID);
if (*pszTopic) wcsncpy(szName, _A2T(pszTopic), _countof(szName));
- else mir_sntprintf(szName, L"%s %s%d",
+ else mir_snwprintf(szName, L"%s %s%d",
m_tszUserName, TranslateT("Chat #"), m_chatID);
GCSESSION gcw = { sizeof(gcw) };
@@ -123,7 +123,7 @@ void CMsnProto::MSN_ChatStart(ezxml_t xmli) info->mJoinedContacts.insert(gcu);
strncpy(gcu->WLID, mri, sizeof(gcu->WLID));
}
- mir_tstrcpy(gcu->role, _A2T(role));
+ mir_wstrcpy(gcu->role, _A2T(role));
if (pszCreator && !mir_strcmp(mri, pszCreator)) info->mCreator = gcu;
char* szEmail, *szNet;
@@ -186,10 +186,10 @@ void CMsnProto::MSN_GCProcessThreadActivity(ezxml_t xmli, const wchar_t *mChatID GCEVENT gce = { sizeof(gce), &gcd };
gce.dwFlags = GCEF_ADDTOLOG;
gce.time = MsnTSToUnixtime(ezxml_txt(ezxml_child(xmli, "eventtime")));
- gce.ptszUID = initiator?mir_a2t(initiator->txt):NULL;
+ gce.ptszUID = initiator?mir_a2u(initiator->txt):NULL;
MCONTACT hContInitiator = MSN_HContactFromEmail(initiator->txt);
gce.ptszNick = GetContactNameT(hContInitiator);
- gce.ptszText = mir_a2t(ezxml_txt(ezxml_child(xmli, "value")));
+ gce.ptszText = mir_a2u(ezxml_txt(ezxml_child(xmli, "value")));
CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce);
mir_free((wchar_t*)gce.ptszUID);
mir_free((wchar_t*)gce.ptszText);
@@ -244,7 +244,7 @@ void CMsnProto::MSN_GCProcessThreadActivity(ezxml_t xmli, const wchar_t *mChatID char *szEmail, *szNet;
parseWLID(NEWSTR_ALLOCA(pszTarget), &szNet, &szEmail, NULL);
gce.bIsMe = !mir_strcmpi(szEmail, GetMyUsername(atoi(szNet)));
- gce.ptszUID = mir_a2t(pszTarget);
+ gce.ptszUID = mir_a2u(pszTarget);
MCONTACT hContTarget = MSN_HContactFromEmail(pszTarget);
gce.ptszNick = GetContactNameT(hContTarget);
CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce);
@@ -287,12 +287,12 @@ void CMsnProto::MSN_GCAddMessage(wchar_t *mChatID, MCONTACT hContact, char *emai GCDEST gcd = { m_szModuleName, mChatID, GC_EVENT_MESSAGE };
GCEVENT gce = { sizeof(gce), &gcd };
gce.dwFlags = GCEF_ADDTOLOG;
- gce.ptszUID = mir_a2t(email);
+ gce.ptszUID = mir_a2u(email);
gce.ptszNick = GetContactNameT(hContact);
gce.time = ts;
gce.bIsMe = sentMsg;
- wchar_t* p = mir_utf8decodeT(msgBody);
+ wchar_t* p = mir_utf8decodeW(msgBody);
gce.ptszText = EscapeChatTags(p);
mir_free(p);
@@ -333,7 +333,7 @@ static void ChatInviteSend(HANDLE hItem, HWND hwndList, STRLIST &str, CMsnProto wchar_t buf[128] = L"";
SendMessage(hwndList, CLM_GETITEMTEXT, (WPARAM)hItem, (LPARAM)buf);
- if (buf[0]) str.insert(mir_t2a(buf));
+ if (buf[0]) str.insert(mir_u2a(buf));
}
else {
MsnContact *msc = ppro->Lists_Get((UINT_PTR)hItem);
@@ -502,7 +502,7 @@ int CMsnProto::MSN_GCEventHook(WPARAM, LPARAM lParam) GCThreadData* thread = MSN_GetThreadByChatId(gch->pDest->ptszID);
if (thread) {
wchar_t* pszMsg = UnEscapeChatTags(NEWWSTR_ALLOCA(gch->ptszText));
- rtrimt(pszMsg); // remove the ending linebreak
+ rtrimw(pszMsg); // remove the ending linebreak
msnNsThread->sendMessage('N', thread->szEmail, thread->netId, UTF8(pszMsg), 0);
DBVARIANT dbv;
@@ -512,7 +512,7 @@ int CMsnProto::MSN_GCEventHook(WPARAM, LPARAM lParam) GCEVENT gce = { sizeof(gce), &gcd };
gce.dwFlags = GCEF_ADDTOLOG;
gce.ptszNick = bError ? L"" : dbv.ptszVal;
- gce.ptszUID = mir_a2t(MyOptions.szEmail);
+ gce.ptszUID = mir_a2u(MyOptions.szEmail);
gce.time = time(NULL);
gce.ptszText = gch->ptszText;
gce.bIsMe = TRUE;
@@ -532,7 +532,7 @@ int CMsnProto::MSN_GCEventHook(WPARAM, LPARAM lParam) case GC_USER_PRIVMESS:
{
- char *email = mir_t2a(gch->ptszUID);
+ char *email = mir_u2a(gch->ptszUID);
MCONTACT hContact = MSN_HContactFromEmail(email);
CallService(MS_MSG_SENDMESSAGE, hContact, 0);
mir_free(email);
@@ -574,7 +574,7 @@ int CMsnProto::MSN_GCEventHook(WPARAM, LPARAM lParam) case 40:
const wchar_t *pszRole = MSN_GCGetRole(MSN_GetThreadByChatId(gch->pDest->ptszID), _T2A(gch->ptszUID));
- MSN_Promoteuser(gch, (pszRole && !mir_tstrcmp(pszRole, L"admin")) ? "user" : "admin");
+ MSN_Promoteuser(gch, (pszRole && !mir_wstrcmp(pszRole, L"admin")) ? "user" : "admin");
break;
}
break;
@@ -599,7 +599,7 @@ int CMsnProto::MSN_GCMenuHook(WPARAM, LPARAM lParam) gcmi->Item = (gc_item*)Items;
}
else if (gcmi->Type == MENU_ON_NICKLIST) {
- char *email = mir_t2a(gcmi->pszUID);
+ char *email = mir_u2a(gcmi->pszUID);
if (!_stricmp(GetMyUsername(NETID_SKYPE), email)) {
static const struct gc_item Items[] =
{
@@ -620,13 +620,13 @@ int CMsnProto::MSN_GCMenuHook(WPARAM, LPARAM lParam) { LPGENW("&Op user") , 40, MENU_ITEM, FALSE }
};
GCThreadData* thread = MSN_GetThreadByChatId(gcmi->pszID);
- if (thread && thread->mMe && mir_tstrcmpi(thread->mMe->role, L"admin")) {
+ if (thread && thread->mMe && mir_wstrcmpi(thread->mMe->role, L"admin")) {
Items[2].bDisabled = TRUE;
Items[3].bDisabled = TRUE;
}
else {
const wchar_t *pszRole = MSN_GCGetRole(thread, email);
- if (pszRole && !mir_tstrcmpi(pszRole, L"admin"))
+ if (pszRole && !mir_wstrcmpi(pszRole, L"admin"))
Items[3].pszDesc = LPGENW("&Deop user");
}
gcmi->nItems = _countof(Items);
diff --git a/protocols/MSN/src/msn_commands.cpp b/protocols/MSN/src/msn_commands.cpp index b38a1c2680..2a37ab21e1 100644 --- a/protocols/MSN/src/msn_commands.cpp +++ b/protocols/MSN/src/msn_commands.cpp @@ -181,7 +181,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para }
msgBody = tHeader.readFromBuffer(msgBody);
if (!(email = NEWSTR_ALLOCA(tHeader["From"]))) return;
- mChatID = mir_a2t(tHeader["To"]);
+ mChatID = mir_a2u(tHeader["To"]);
if (wcsncmp(mChatID, L"19:", 3)) mChatID[0]=0; // NETID_THREAD
msgBody = tHeader.readFromBuffer(msgBody);
msgBody = tHeader.readFromBuffer(msgBody);
@@ -274,7 +274,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para psr[cnt] = (PROTOSEARCHRESULT*)mir_calloc(sizeof(PROTOSEARCHRESULT));
psr[cnt]->cbSize = sizeof(psr);
psr[cnt]->flags = PSR_TCHAR;
- psr[cnt]->id.w = psr[cnt]->nick.w = psr[cnt]->email.w = mir_a2t(wlid);
+ psr[cnt]->id.w = psr[cnt]->nick.w = psr[cnt]->email.w = mir_a2u(wlid);
cnt++;
}
}
@@ -513,20 +513,20 @@ void CMsnProto::MSN_ProcessURIObject(MCONTACT hContact, ezxml_t xmli) }
if (!pszFile || !*pszFile) pszFile="file";
}
- ft->std.tszCurrentFile = mir_utf8decodeT(pszFile);
+ ft->std.tszCurrentFile = mir_utf8decodeW(pszFile);
ft->std.totalBytes = ft->std.currentFileSize = fileSize;
ft->std.totalFiles = 1;
ft->szInvcookie = (char*)mir_calloc(strlen(uri)+16);
sprintf(ft->szInvcookie, "%s/content/imgpsh", uri);
wchar_t tComment[40];
- mir_sntprintf(tComment, TranslateT("%I64u bytes"), ft->std.currentFileSize);
+ mir_snwprintf(tComment, TranslateT("%I64u bytes"), ft->std.currentFileSize);
PROTORECVFILET pre = { 0 };
pre.dwFlags = PRFF_TCHAR;
pre.fileCount = 1;
pre.timestamp = time(NULL);
- pre.descr.w = (desc = ezxml_child(xmli, "Description"))?mir_utf8decodeT(desc->txt):tComment;
+ pre.descr.w = (desc = ezxml_child(xmli, "Description"))?mir_utf8decodeW(desc->txt):tComment;
pre.files.w = &ft->std.tszCurrentFile;
pre.lParam = (LPARAM)ft;
ProtoChainRecvFile(ft->std.hContact, &pre);
@@ -569,7 +569,7 @@ void CMsnProto::MSN_ProcessYFind(char* buf, size_t len) const char *szNetId = ezxml_attr(cont, "t");
if (msnSearchId != NULL) {
if (szNetId != NULL) {
- ptrT szEmailT(mir_utf8decodeT(szEmail));
+ ptrW szEmailT(mir_utf8decodeW(szEmail));
PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
@@ -749,7 +749,7 @@ void CMsnProto::MSN_ProcessStatusMessage(ezxml_t xmli, const char* wlid) }
{
- ptrT tszStatus(mir_utf8decodeT(szStatMsg));
+ ptrW tszStatus(mir_utf8decodeW(szStatMsg));
if (szInst) MSN_SetMirVer(hContact, Lists_GetPlace(szEmail, szInst));
else {
MsnContact *cont = Lists_Get(hContact);
@@ -808,7 +808,7 @@ void CMsnProto::MSN_ProcessStatusMessage(ezxml_t xmli, const char* wlid) char *format = mir_strdup(parts[3]);
char *unknown = NULL;
if (ServiceExists(MS_LISTENINGTO_GETUNKNOWNTEXT))
- unknown = mir_utf8encodeT((wchar_t *)CallService(MS_LISTENINGTO_GETUNKNOWNTEXT, 0, 0));
+ unknown = mir_utf8encodeW((wchar_t *)CallService(MS_LISTENINGTO_GETUNKNOWNTEXT, 0, 0));
for (unsigned i = 4; i < pCount; i++) {
char part[16];
@@ -836,17 +836,17 @@ void CMsnProto::MSN_ProcessStatusMessage(ezxml_t xmli, const char* wlid) LISTENINGTOINFO lti = { 0 };
lti.cbSize = sizeof(LISTENINGTOINFO);
- lti.ptszTitle = mir_utf8decodeT(parts[4]);
- if (pCount > 5) lti.ptszArtist = mir_utf8decodeT(parts[5]);
- if (pCount > 6) lti.ptszAlbum = mir_utf8decodeT(parts[6]);
- if (pCount > 7) lti.ptszTrack = mir_utf8decodeT(parts[7]);
- if (pCount > 8) lti.ptszYear = mir_utf8decodeT(parts[8]);
- if (pCount > 9) lti.ptszGenre = mir_utf8decodeT(parts[9]);
- if (pCount > 10) lti.ptszLength = mir_utf8decodeT(parts[10]);
- if (pCount > 11) lti.ptszPlayer = mir_utf8decodeT(parts[11]);
- else lti.ptszPlayer = mir_utf8decodeT(parts[0]);
- if (pCount > 12) lti.ptszType = mir_utf8decodeT(parts[12]);
- else lti.ptszType = mir_utf8decodeT(parts[1]);
+ lti.ptszTitle = mir_utf8decodeW(parts[4]);
+ if (pCount > 5) lti.ptszArtist = mir_utf8decodeW(parts[5]);
+ if (pCount > 6) lti.ptszAlbum = mir_utf8decodeW(parts[6]);
+ if (pCount > 7) lti.ptszTrack = mir_utf8decodeW(parts[7]);
+ if (pCount > 8) lti.ptszYear = mir_utf8decodeW(parts[8]);
+ if (pCount > 9) lti.ptszGenre = mir_utf8decodeW(parts[9]);
+ if (pCount > 10) lti.ptszLength = mir_utf8decodeW(parts[10]);
+ if (pCount > 11) lti.ptszPlayer = mir_utf8decodeW(parts[11]);
+ else lti.ptszPlayer = mir_utf8decodeW(parts[0]);
+ if (pCount > 12) lti.ptszType = mir_utf8decodeW(parts[12]);
+ else lti.ptszType = mir_utf8decodeW(parts[1]);
wchar_t *cm = (wchar_t *)CallService(MS_LISTENINGTO_GETPARSEDTEXT, (WPARAM)L"%title% - %artist%", (LPARAM)<i);
setTString(hContact, "ListeningTo", cm);
@@ -898,7 +898,7 @@ void CMsnProto::MSN_ProcessNotificationMessage(char* buf, size_t len) SkinPlaySound(alertsoundname);
- wchar_t* alrt = mir_utf8decodeT(ezxml_txt(xmltxt));
+ wchar_t* alrt = mir_utf8decodeW(ezxml_txt(xmltxt));
MSN_ShowPopup(TranslateT("MSN Alert"), alrt, MSN_ALERT_POPUP | MSN_ALLOW_MSGBOX, fullurl);
mir_free(alrt);
}
@@ -1463,14 +1463,14 @@ void CMsnProto::MSN_InviteMessage(ThreadData* info, char* msgBody, char* email, ft->std.hContact = MSN_HContactFromEmail(email, nick, true, true);
mir_free(ft->std.tszCurrentFile);
- ft->std.tszCurrentFile = mir_utf8decodeT(Appfile);
+ ft->std.tszCurrentFile = mir_utf8decodeW(Appfile);
ft->std.totalBytes = ft->std.currentFileSize = _atoi64(Appfilesize);
ft->std.totalFiles = 1;
ft->szInvcookie = mir_strdup(Invcookie);
ft->p2p_dest = mir_strdup(email);
wchar_t tComment[40];
- mir_sntprintf(tComment, TranslateT("%I64u bytes"), ft->std.currentFileSize);
+ mir_snwprintf(tComment, TranslateT("%I64u bytes"), ft->std.currentFileSize);
PROTORECVFILET pre = { 0 };
pre.dwFlags = PRFF_TCHAR;
@@ -1536,8 +1536,8 @@ void CMsnProto::MSN_InviteMessage(ThreadData* info, char* msgBody, char* email, // netmeeting receive 1
if (Appname != NULL && !_stricmp(Appname, "NetMeeting")) {
- wchar_t text[512], *tszEmail = mir_a2t(email);
- mir_sntprintf(text, TranslateT("Accept NetMeeting request from %s?"), tszEmail);
+ wchar_t text[512], *tszEmail = mir_a2u(email);
+ mir_snwprintf(text, TranslateT("Accept NetMeeting request from %s?"), tszEmail);
mir_free(tszEmail);
if (MessageBox(NULL, text, TranslateT("MSN Protocol"), MB_YESNO | MB_ICONQUESTION) == IDYES) {
@@ -1646,7 +1646,7 @@ void CMsnProto::MSN_CustomSmiley(const char* msgBody, char* email, char* nick, i wchar_t path[MAX_PATH];
MSN_GetCustomSmileyFileName(hContact, path, _countof(path), smileyName, iSmileyType);
- ft->std.tszCurrentFile = mir_tstrdup(path);
+ ft->std.tszCurrentFile = mir_wstrdup(path);
if (p2p_IsDlFileOk(ft))
delete ft;
@@ -1885,7 +1885,7 @@ LBL_InvalidCommand: GCEVENT gce = { sizeof(gce), &gcd };
gce.dwFlags = GCEF_ADDTOLOG;
gce.ptszNick = GetContactNameT(hContact);
- gce.ptszUID = mir_a2t(data.userEmail);
+ gce.ptszUID = mir_a2u(data.userEmail);
gce.time = time(NULL);
gce.bIsMe = FALSE;
CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce);
@@ -2141,7 +2141,7 @@ LBL_InvalidCommand: GCEVENT gce = { sizeof(gce), &gcd };
gce.dwFlags = GCEF_ADDTOLOG;
gce.ptszNick = GetContactNameT(hContact);
- gce.ptszUID = mir_a2t(data.userEmail);
+ gce.ptszUID = mir_a2u(data.userEmail);
gce.ptszStatus = TranslateT("Others");
gce.time = time(NULL);
gce.bIsMe = FALSE;
diff --git a/protocols/MSN/src/msn_libstr.cpp b/protocols/MSN/src/msn_libstr.cpp index 9e0cd37318..e51ac49e88 100644 --- a/protocols/MSN/src/msn_libstr.cpp +++ b/protocols/MSN/src/msn_libstr.cpp @@ -27,7 +27,7 @@ static wchar_t* a2tf(const wchar_t* str, bool unicode) if (str == NULL)
return NULL;
- return unicode ? mir_tstrdup(str) : mir_a2t((char*)str);
+ return unicode ? mir_wstrdup(str) : mir_a2u((char*)str);
}
void overrideStr(wchar_t*& dest, const wchar_t* src, bool unicode, const wchar_t* def)
@@ -38,7 +38,7 @@ void overrideStr(wchar_t*& dest, const wchar_t* src, bool unicode, const wchar_t if (src != NULL)
dest = a2tf(src, unicode);
else if (def != NULL)
- dest = mir_tstrdup(def);
+ dest = mir_wstrdup(def);
}
char* arrayToHex(BYTE* data, size_t datasz)
@@ -305,11 +305,11 @@ wchar_t* EscapeChatTags(const wchar_t* pszText) nChars++;
if (nChars == 0)
- return mir_tstrdup(pszText);
+ return mir_wstrdup(pszText);
- wchar_t *pszNewText = (wchar_t*)mir_alloc(sizeof(wchar_t)*(mir_tstrlen(pszText) + 1 + nChars));
+ wchar_t *pszNewText = (wchar_t*)mir_alloc(sizeof(wchar_t)*(mir_wstrlen(pszText) + 1 + nChars));
if (pszNewText == NULL)
- return mir_tstrdup(pszText);
+ return mir_wstrdup(pszText);
const wchar_t *s = pszText;
wchar_t *d = pszNewText;
diff --git a/protocols/MSN/src/msn_lists.cpp b/protocols/MSN/src/msn_lists.cpp index 28126efa5d..acd43695cb 100644 --- a/protocols/MSN/src/msn_lists.cpp +++ b/protocols/MSN/src/msn_lists.cpp @@ -245,12 +245,12 @@ void CMsnProto::MSN_CleanupLists(void) int count = db_event_count(p.hContact);
if (count) {
wchar_t text[256];
- wchar_t *sze = mir_a2t(p.email);
- mir_sntprintf(text, TranslateT("Contact %s has been removed from the server.\nWould you like to keep it as \"Local Only\" contact to preserve history?"), sze);
+ wchar_t *sze = mir_a2u(p.email);
+ mir_snwprintf(text, TranslateT("Contact %s has been removed from the server.\nWould you like to keep it as \"Local Only\" contact to preserve history?"), sze);
mir_free(sze);
wchar_t title[128];
- mir_sntprintf(title, TranslateT("%s protocol"), m_tszUserName);
+ mir_snwprintf(title, TranslateT("%s protocol"), m_tszUserName);
if (MessageBox(NULL, text, title, MB_YESNO | MB_ICONQUESTION | MB_SETFOREGROUND) == IDYES) {
MSN_AddUser(p.hContact, p.email, 0, LIST_LL);
diff --git a/protocols/MSN/src/msn_mail.cpp b/protocols/MSN/src/msn_mail.cpp index 27cb629258..2016dfc9b9 100644 --- a/protocols/MSN/src/msn_mail.cpp +++ b/protocols/MSN/src/msn_mail.cpp @@ -255,14 +255,14 @@ void CMsnProto::sttNotificationMessage(char* msgBody, bool isInitial) wchar_t* mimeSubjectW = tFileInfo.decode(Subject);
- mir_sntprintf(tBuffer2, TranslateT("Subject: %s"), mimeSubjectW);
+ mir_snwprintf(tBuffer2, TranslateT("Subject: %s"), mimeSubjectW);
wchar_t* msgtxt = _stricmp(From, Fromaddr) ?
TranslateT("Hotmail from %s (%S)") : TranslateT("Hotmail from %s");
- mir_sntprintf(tBuffer, msgtxt, mimeFromW, Fromaddr);
+ mir_snwprintf(tBuffer, msgtxt, mimeFromW, Fromaddr);
mir_free(mimeFromW);
mir_free(mimeSubjectW);
ShowPopup = true;
@@ -271,8 +271,8 @@ void CMsnProto::sttNotificationMessage(char* msgBody, bool isInitial) const char* MailData = tFileInfo["Mail-Data"];
if (MailData != NULL) processMailData((char*)MailData);
- mir_sntprintf(tBuffer, m_tszUserName);
- mir_sntprintf(tBuffer2, TranslateT("Unread mail is available: %d in Inbox and %d in other folders."), mUnreadMessages, mUnreadJunkEmails);
+ mir_snwprintf(tBuffer, m_tszUserName);
+ mir_snwprintf(tBuffer2, TranslateT("Unread mail is available: %d in Inbox and %d in other folders."), mUnreadMessages, mUnreadJunkEmails);
}
if (UnreadMessages == mUnreadMessages && UnreadJunkEmails == mUnreadJunkEmails && !isInitial)
@@ -385,10 +385,10 @@ void CMsnProto::displayEmailCount(MCONTACT hContact) ch = wcschr(ch + 1, '[');
} while (ch && !iswdigit(ch[1]));
if (ch) *ch = 0;
- rtrimt(name);
+ rtrimw(name);
wchar_t szNick[128];
- mir_sntprintf(szNick, getByte("DisableHotmailJunk", 0) ? L"%s [%d]" : L"%s [%d][%d]", name, mUnreadMessages, mUnreadJunkEmails);
+ mir_snwprintf(szNick, getByte("DisableHotmailJunk", 0) ? L"%s [%d]" : L"%s [%d][%d]", name, mUnreadMessages, mUnreadJunkEmails);
nickChg = true;
setTString(hContact, "Nick", szNick);
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp index 3d76b63cde..5b6b1b1ec7 100644 --- a/protocols/MSN/src/msn_misc.cpp +++ b/protocols/MSN/src/msn_misc.cpp @@ -118,7 +118,7 @@ void CMsnProto::InitCustomFolders(void) if (InitCstFldRan) return;
wchar_t folder[MAX_PATH];
- mir_sntprintf(folder, L"%%miranda_avatarcache%%\\%S", m_szModuleName);
+ mir_snwprintf(folder, L"%%miranda_avatarcache%%\\%S", m_szModuleName);
hCustomSmileyFolder = FoldersRegisterCustomPathT(LPGEN("Custom Smileys"), m_szModuleName, folder, m_tszUserName);
InitCstFldRan = true;
@@ -170,7 +170,7 @@ char* MSN_GetAvatarHash(char* szContext, char** pszUrl) // MSN_GetAvatarFileName - gets a file name for an contact's avatar
void CMsnProto::MSN_GetAvatarFileName(MCONTACT hContact, wchar_t* pszDest, size_t cbLen, const wchar_t *ext)
{
- size_t tPathLen = mir_sntprintf(pszDest, cbLen, L"%s\\%S", VARST(L"%miranda_avatarcache%"), m_szModuleName);
+ size_t tPathLen = mir_snwprintf(pszDest, cbLen, L"%s\\%S", VARST(L"%miranda_avatarcache%"), m_szModuleName);
if (_waccess(pszDest, 0))
CreateDirectoryTreeT(pszDest);
@@ -181,8 +181,8 @@ void CMsnProto::MSN_GetAvatarFileName(MCONTACT hContact, wchar_t* pszDest, size_ if (getString(hContact, "PictContext", &dbv) == 0) {
char* szAvatarHash = MSN_GetAvatarHash(dbv.pszVal);
if (szAvatarHash != NULL) {
- wchar_t *sztAvatarHash = mir_a2t(szAvatarHash);
- tPathLen += mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, L"\\%s.", sztAvatarHash);
+ wchar_t *sztAvatarHash = mir_a2u(szAvatarHash);
+ tPathLen += mir_snwprintf(pszDest + tPathLen, cbLen - tPathLen, L"\\%s.", sztAvatarHash);
mir_free(sztAvatarHash);
mir_free(szAvatarHash);
}
@@ -196,13 +196,13 @@ void CMsnProto::MSN_GetAvatarFileName(MCONTACT hContact, wchar_t* pszDest, size_ pszDest[0] = 0;
}
else {
- wchar_t *sztModuleName = mir_a2t(m_szModuleName);
- tPathLen += mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, L"\\%s avatar.", sztModuleName);
+ wchar_t *sztModuleName = mir_a2u(m_szModuleName);
+ tPathLen += mir_snwprintf(pszDest + tPathLen, cbLen - tPathLen, L"\\%s avatar.", sztModuleName);
mir_free(sztModuleName);
}
if (ext == NULL) {
- mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, L"*");
+ mir_snwprintf(pszDest + tPathLen, cbLen - tPathLen, L"*");
bool found = false;
_wfinddata_t c_file;
@@ -210,7 +210,7 @@ void CMsnProto::MSN_GetAvatarFileName(MCONTACT hContact, wchar_t* pszDest, size_ if (hFile > -1L) {
do {
if (wcsrchr(c_file.name, '.')) {
- mir_sntprintf(pszDest + tPathLen2, cbLen - tPathLen2, L"\\%s", c_file.name);
+ mir_snwprintf(pszDest + tPathLen2, cbLen - tPathLen2, L"\\%s", c_file.name);
found = true;
}
} while (_wfindnext(hFile, &c_file) == 0);
@@ -221,7 +221,7 @@ void CMsnProto::MSN_GetAvatarFileName(MCONTACT hContact, wchar_t* pszDest, size_ }
else {
tPathLen--;
- mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, ext);
+ mir_snwprintf(pszDest + tPathLen, cbLen - tPathLen, ext);
}
}
@@ -319,14 +319,14 @@ void CMsnProto::MSN_GetCustomSmileyFileName(MCONTACT hContact, wchar_t* pszDest, wchar_t* path = (wchar_t*)alloca(cbLen * sizeof(wchar_t));
if (hCustomSmileyFolder == NULL || FoldersGetCustomPathT(hCustomSmileyFolder, path, (int)cbLen, L"")) {
wchar_t *tmpPath = Utils_ReplaceVarsT(L"%miranda_userdata%");
- wchar_t *tszModuleName = mir_a2t(m_szModuleName);
- tPathLen = mir_sntprintf(pszDest, cbLen, L"%s\\%s\\CustomSmiley", tmpPath, tszModuleName);
+ wchar_t *tszModuleName = mir_a2u(m_szModuleName);
+ tPathLen = mir_snwprintf(pszDest, cbLen, L"%s\\%s\\CustomSmiley", tmpPath, tszModuleName);
mir_free(tszModuleName);
mir_free(tmpPath);
}
else {
- mir_tstrcpy(pszDest, path);
- tPathLen = mir_tstrlen(pszDest);
+ mir_wstrcpy(pszDest, path);
+ tPathLen = mir_wstrlen(pszDest);
}
if (hContact != NULL) {
@@ -337,12 +337,12 @@ void CMsnProto::MSN_GetCustomSmileyFileName(MCONTACT hContact, wchar_t* pszDest, _ui64tow((UINT_PTR)hContact, dbv.ptszVal, 10);
}
- tPathLen += mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, L"\\%s", dbv.ptszVal);
+ tPathLen += mir_snwprintf(pszDest + tPathLen, cbLen - tPathLen, L"\\%s", dbv.ptszVal);
db_free(&dbv);
}
else {
- wchar_t *tszModuleName = mir_a2t(m_szModuleName);
- tPathLen += mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, L"\\%s", tszModuleName);
+ wchar_t *tszModuleName = mir_a2u(m_szModuleName);
+ tPathLen += mir_snwprintf(pszDest + tPathLen, cbLen - tPathLen, L"\\%s", tszModuleName);
mir_free(tszModuleName);
}
@@ -356,8 +356,8 @@ void CMsnProto::MSN_GetCustomSmileyFileName(MCONTACT hContact, wchar_t* pszDest, if (!exist)
CreateDirectoryTreeT(pszDest);
- wchar_t *sztSmileyName = mir_a2t(SmileyName);
- mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, L"\\%s.%s", sztSmileyName,
+ wchar_t *sztSmileyName = mir_a2u(SmileyName);
+ mir_snwprintf(pszDest + tPathLen, cbLen - tPathLen, L"\\%s.%s", sztSmileyName,
type == MSN_APPID_CUSTOMSMILEY ? L"png" : L"gif");
mir_free(sztSmileyName);
}
@@ -791,7 +791,7 @@ void CMsnProto::MSN_SetServerStatus(int newStatus) wchar_t buf[128] = L"Miranda";
DWORD buflen = _countof(buf);
GetComputerName(buf, &buflen);
- szPlace = mir_utf8encodeT(buf);
+ szPlace = mir_utf8encodeW(buf);
}
char** msgptr = GetStatusMsgLoc(newStatus);
@@ -921,7 +921,7 @@ void CMsnProto::MSN_ShowError(const char* msgtext, ...) wchar_t *buf = Langpack_PcharToTchar(msgtext);
va_start(tArgs, msgtext);
- mir_vsntprintf(tBuffer, _countof(tBuffer), buf, tArgs);
+ mir_vsnwprintf(tBuffer, _countof(tBuffer), buf, tArgs);
va_end(tArgs);
mir_free(buf);
@@ -996,14 +996,14 @@ void CMsnProto::InitPopups(void) ppc.colorBack = RGB(173, 206, 247);
ppc.colorText = GetSysColor(COLOR_WINDOWTEXT);
ppc.iSeconds = 3;
- mir_sntprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Hotmail"));
+ mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Hotmail"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Hotmail");
hPopupHotmail = Popup_RegisterClass(&ppc);
ppc.colorBack = RGB(173, 206, 247);
ppc.colorText = GetSysColor(COLOR_WINDOWTEXT);
ppc.iSeconds = 3;
- mir_sntprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Notify"));
+ mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Notify"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Notify");
hPopupNotify = Popup_RegisterClass(&ppc);
@@ -1012,7 +1012,7 @@ void CMsnProto::InitPopups(void) ppc.colorText = RGB(255, 245, 225); //Yellow
ppc.iSeconds = 60;
- mir_sntprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Error"));
+ mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Error"));
mir_snprintf(name, "%s_%s", m_szModuleName, "Error");
hPopupError = Popup_RegisterClass(&ppc);
}
@@ -1026,7 +1026,7 @@ void CALLBACK sttMainThreadCallback(void *param) if ((iserr && !pud->proto->MyOptions.ShowErrorsAsPopups) || !ServiceExists(MS_POPUP_ADDPOPUPCLASS)) {
if (pud->flags & MSN_ALLOW_MSGBOX) {
wchar_t szMsg[MAX_SECONDLINE + MAX_CONTACTNAME];
- mir_sntprintf(szMsg, L"%s:\n%s", pud->title, pud->text);
+ mir_snwprintf(szMsg, L"%s:\n%s", pud->title, pud->text);
int ret = MessageBox(NULL, szMsg, TranslateT("MSN Protocol"),
MB_YESNO | (iserr ? MB_ICONERROR : MB_ICONINFORMATION));
if (ret == IDYES)
@@ -1066,8 +1066,8 @@ void CMsnProto::MSN_ShowPopup(const wchar_t* nickname, const wchar_t* msg, int f PopupData *pud = (PopupData*)mir_calloc(sizeof(PopupData));
pud->flags = flags;
pud->url = mir_strdup(url);
- pud->title = mir_tstrdup(nickname);
- pud->text = mir_tstrdup(msg);
+ pud->title = mir_wstrdup(nickname);
+ pud->text = mir_wstrdup(msg);
pud->proto = this;
CallFunctionAsync(sttMainThreadCallback, pud);
@@ -1180,7 +1180,7 @@ int filetransfer::openNext(void) if (std.ptszFiles && std.ptszFiles[cf]) {
bCompleted = false;
- replaceStrT(std.tszCurrentFile, std.ptszFiles[cf]);
+ replaceStrW(std.tszCurrentFile, std.ptszFiles[cf]);
fileId = _wopen(std.tszCurrentFile, _O_BINARY | _O_RDONLY, _S_IREAD);
if (fileId != -1) {
std.currentFileSize = _filelengthi64(fileId);
diff --git a/protocols/MSN/src/msn_natdetect.cpp b/protocols/MSN/src/msn_natdetect.cpp index 30ecdbc16f..e468eebf2c 100644 --- a/protocols/MSN/src/msn_natdetect.cpp +++ b/protocols/MSN/src/msn_natdetect.cpp @@ -314,7 +314,7 @@ static bool IsIcfEnabled(void) wchar_t szFileName[MAX_PATH];
GetModuleFileName(NULL, szFileName, _countof(szFileName));
- wszFileName = mir_t2u(szFileName);
+ wszFileName = mir_wstrdup(szFileName);
// Allocate a BSTR for the process image file name.
fwBstrProcessImageFileName = SysAllocString(wszFileName);
diff --git a/protocols/MSN/src/msn_opts.cpp b/protocols/MSN/src/msn_opts.cpp index 96437c9bef..38b32891a8 100644 --- a/protocols/MSN/src/msn_opts.cpp +++ b/protocols/MSN/src/msn_opts.cpp @@ -250,7 +250,7 @@ LBL_Continue: #ifdef OBSOLETE
GetDlgItemText(hwndDlg, IDC_HANDLE2, screenStr, _countof(screenStr));
if (!proto->getTString("Nick", &dbv)) {
- if (mir_tstrcmp(dbv.ptszVal, screenStr))
+ if (mir_wstrcmp(dbv.ptszVal, screenStr))
proto->MSN_SendNickname(screenStr);
db_free(&dbv);
}
diff --git a/protocols/MSN/src/msn_p2p.cpp b/protocols/MSN/src/msn_p2p.cpp index 632aede4bc..5bb5a9b610 100644 --- a/protocols/MSN/src/msn_p2p.cpp +++ b/protocols/MSN/src/msn_p2p.cpp @@ -259,8 +259,8 @@ void CMsnProto::p2p_savePicture2disk(filetransfer* ft) cont.hContact = ft->std.hContact;
cont.type = 1;
- wchar_t* pathcpy = mir_tstrdup(ft->std.tszCurrentFile);
- mir_tstrcpy(wcsrchr(pathcpy, '.') + 1, ext);
+ wchar_t* pathcpy = mir_wstrdup(ft->std.tszCurrentFile);
+ mir_wstrcpy(wcsrchr(pathcpy, '.') + 1, ext);
_wrename(ft->std.tszCurrentFile, pathcpy);
cont.path = pathcpy;
@@ -1184,7 +1184,7 @@ void CMsnProto::p2p_InitFileTransfer( }
else {
mir_free(ft->std.tszCurrentFile);
- ft->std.tszCurrentFile = mir_tstrdup(szFileName);
+ ft->std.tszCurrentFile = mir_wstrdup(szFileName);
// debugLogA("My avatar file opened for %s as %08p::%d", szEmail, ft, ft->fileId);
ft->std.totalBytes = ft->std.currentFileSize = _filelengthi64(ft->fileId);
ft->std.flags |= PFTS_SENDING;
@@ -1218,13 +1218,13 @@ void CMsnProto::p2p_InitFileTransfer( }
mir_free(ft->std.tszCurrentFile);
- ft->std.tszCurrentFile = mir_u2t(wszFileName);
+ ft->std.tszCurrentFile = mir_wstrdup(wszFileName);
ft->std.totalBytes = ft->std.currentFileSize = ((HFileContext*)szContext)->dwSize;
ft->std.totalFiles = 1;
wchar_t tComment[40];
- mir_sntprintf(tComment, TranslateT("%I64u bytes"), ft->std.currentFileSize);
+ mir_snwprintf(tComment, TranslateT("%I64u bytes"), ft->std.currentFileSize);
PROTORECVFILET pre = { 0 };
pre.dwFlags = PRFF_TCHAR;
@@ -2030,7 +2030,7 @@ void CMsnProto::p2p_invite(unsigned iAppID, filetransfer* ft, const char *wlid) else
pszFiles = ft->std.tszCurrentFile;
- wchar_t *fname = mir_t2u(pszFiles);
+ wchar_t *fname = mir_wstrdup(pszFiles);
wcsncpy(ctx->wszFileName, fname, MAX_PATH);
mir_free(fname);
diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp index 624c736f97..e9e6950beb 100644 --- a/protocols/MSN/src/msn_proto.cpp +++ b/protocols/MSN/src/msn_proto.cpp @@ -144,7 +144,7 @@ CMsnProto::CMsnProto(const char* aProtoName, const wchar_t* aUserName) : nlu1.ptszDescriptiveName = szBuffer;
mir_snprintf(szDbsettings, "%s_HTTPS", m_szModuleName);
- mir_sntprintf(szBuffer, TranslateT("%s plugin HTTPS connections"), m_tszUserName);
+ mir_snwprintf(szBuffer, TranslateT("%s plugin HTTPS connections"), m_tszUserName);
hNetlibUserHttps = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu1);
NETLIBUSER nlu = { 0 };
@@ -158,7 +158,7 @@ CMsnProto::CMsnProto(const char* aProtoName, const wchar_t* aUserName) : nlu.pfnHttpGatewayWrapSend = msn_httpGatewayWrapSend;
nlu.pfnHttpGatewayUnwrapRecv = msn_httpGatewayUnwrapRecv;
- mir_sntprintf(szBuffer, TranslateT("%s plugin connections"), m_tszUserName);
+ mir_snwprintf(szBuffer, TranslateT("%s plugin connections"), m_tszUserName);
m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
m_DisplayNameCache = NULL;
@@ -451,7 +451,7 @@ HANDLE __cdecl CMsnProto::SearchBasic(const wchar_t* id) {
if (!msnLoggedIn) return 0;
- wchar_t* email = mir_tstrdup(id);
+ wchar_t* email = mir_wstrdup(id);
ForkThread(&CMsnProto::MsnSearchAckThread, email);
return email;
@@ -492,8 +492,8 @@ void __cdecl CMsnProto::MsnFileAckThread(void* arg) filetransfer* ft = (filetransfer*)arg;
wchar_t filefull[MAX_PATH];
- mir_sntprintf(filefull, L"%s\\%s", ft->std.tszWorkingDir, ft->std.tszCurrentFile);
- replaceStrT(ft->std.tszCurrentFile, filefull);
+ mir_snwprintf(filefull, L"%s\\%s", ft->std.tszWorkingDir, ft->std.tszCurrentFile);
+ replaceStrW(ft->std.tszCurrentFile, filefull);
ResetEvent(ft->hResumeEvt);
if (ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_FILERESUME, ft, (LPARAM)&ft->std))
@@ -583,13 +583,13 @@ HANDLE __cdecl CMsnProto::FileAllow(MCONTACT, HANDLE hTransfer, const wchar_t* s return 0;
#endif
- if ((ft->std.tszWorkingDir = mir_tstrdup(szPath)) == NULL) {
+ if ((ft->std.tszWorkingDir = mir_wstrdup(szPath)) == NULL) {
wchar_t szCurrDir[MAX_PATH];
GetCurrentDirectory(_countof(szCurrDir), szCurrDir);
- ft->std.tszWorkingDir = mir_tstrdup(szCurrDir);
+ ft->std.tszWorkingDir = mir_wstrdup(szCurrDir);
}
else {
- size_t len = mir_tstrlen(ft->std.tszWorkingDir) - 1;
+ size_t len = mir_wstrlen(ft->std.tszWorkingDir) - 1;
if (ft->std.tszWorkingDir[len] == '\\')
ft->std.tszWorkingDir[len] = 0;
}
@@ -672,7 +672,7 @@ int __cdecl CMsnProto::FileResume(HANDLE hTransfer, int* action, const wchar_t** ft->bCanceled = true;
break;
case FILERESUME_RENAME:
- replaceStrT(ft->std.tszCurrentFile, *szFilename);
+ replaceStrW(ft->std.tszCurrentFile, *szFilename);
break;
case FILERESUME_OVERWRITE:
ft->std.currentFileProgress = 0;
@@ -701,7 +701,7 @@ int __cdecl CMsnProto::FileResume(HANDLE hTransfer, int* action, const wchar_t** break;
case FILERESUME_RENAME:
- replaceStrT(ft->std.tszCurrentFile, *szFilename);
+ replaceStrW(ft->std.tszCurrentFile, *szFilename);
default:
bool fcrt = ft->create() != -1;
@@ -829,7 +829,7 @@ int CMsnProto::RecvContacts(MCONTACT hContact, PROTORECVEVENT* pre) int i;
for (i = 0; i < pre->lParam; i++)
- dbei.cbBlob += int(mir_tstrlen(isrList[i]->nick.w) + 2 + mir_tstrlen(isrList[i]->id.w));
+ dbei.cbBlob += int(mir_wstrlen(isrList[i]->nick.w) + 2 + mir_wstrlen(isrList[i]->id.w));
dbei.pBlob = (PBYTE)_alloca(dbei.cbBlob);
for (i = 0, pCurBlob = dbei.pBlob; i < pre->lParam; i++) {
mir_strcpy((char*)pCurBlob, _T2A(isrList[i]->nick.w));
@@ -1054,7 +1054,7 @@ int __cdecl CMsnProto::SetAwayMsg(int status, const wchar_t* msg) return 1;
mir_free(*msgptr);
- char* buf = *msgptr = mir_utf8encodeT(msg);
+ char* buf = *msgptr = mir_utf8encodeW(msg);
if (buf && mir_strlen(buf) > 1859) {
buf[1859] = 0;
const int i = 1858;
diff --git a/protocols/MSN/src/msn_skypeab.cpp b/protocols/MSN/src/msn_skypeab.cpp index 034b75f52e..a0cd9ca76d 100644 --- a/protocols/MSN/src/msn_skypeab.cpp +++ b/protocols/MSN/src/msn_skypeab.cpp @@ -45,7 +45,7 @@ static wchar_t* get_json_str(JSONNode *item, const char *pszValue) {
if (JSONNode *node = json_get(item, pszValue)) {
wchar_t *ret = json_as_string(node);
- if (!mir_tstrcmp(ret, L"null")) {
+ if (!mir_wstrcmp(ret, L"null")) {
mir_free(ret);
return NULL;
}
@@ -79,14 +79,14 @@ bool CMsnProto::MSN_SKYABRefreshClist(void) JSONNode *items = json_as_array(root), *item;
for (size_t i = 0; i < json_size(items); i++) {
int lstId = LIST_FL;
- ptrT nick;
+ ptrW nick;
item = json_at(items, i);
if (item == NULL)
break;
- ptrA skypename(mir_t2a(ptrT(json_as_string(json_get(item, "skypename")))));
- ptrA pszNick(mir_t2a(ptrT(get_json_str(item, "fullname"))));
+ ptrA skypename(mir_u2a(ptrW(json_as_string(json_get(item, "skypename")))));
+ ptrA pszNick(mir_u2a(ptrW(get_json_str(item, "fullname"))));
char szWLId[128];
mir_snprintf(szWLId, sizeof(szWLId), "%d:%s", NETID_SKYPE, skypename);
MCONTACT hContact = MSN_HContactFromEmail(szWLId, pszNick, true, false);
@@ -137,8 +137,8 @@ bool CMsnProto::MSN_SKYABGetProfiles(const char *pszPOST) break;
node = json_get(item, "username");
- ptrA skypename(mir_t2a(ptrT(json_as_string(node))));
- ptrT value;
+ ptrA skypename(mir_u2a(ptrW(json_as_string(node))));
+ ptrW value;
char szWLId[128];
mir_snprintf(szWLId, sizeof(szWLId), "%d:%s", NETID_SKYPE, skypename);
MCONTACT hContact = MSN_HContactFromEmail(szWLId, skypename, false, false);
@@ -184,8 +184,8 @@ bool CMsnProto::MSN_SKYABGetProfile(const char *wlid) if (item == NULL)
return false;
- ptrA skypename(mir_t2a(ptrT(json_as_string(json_get(item, "username")))));
- ptrT value;
+ ptrA skypename(mir_u2a(ptrW(json_as_string(json_get(item, "username")))));
+ ptrW value;
char szWLId[128];
mir_snprintf(szWLId, sizeof(szWLId), "%d:%s", NETID_SKYPE, skypename);
MCONTACT hContact = MSN_HContactFromEmail(szWLId, skypename, false, false);
diff --git a/protocols/MSN/src/msn_srv.cpp b/protocols/MSN/src/msn_srv.cpp index 33f1a10da5..b854e48596 100644 --- a/protocols/MSN/src/msn_srv.cpp +++ b/protocols/MSN/src/msn_srv.cpp @@ -38,7 +38,7 @@ void CMsnProto::MSN_AddGroup(const char* grpName, const char *grpId, bool init) m_arGroups.insert(p);
if (init)
- Clist_GroupCreate(0, ptrT(mir_utf8decodeT(grpName)));
+ Clist_GroupCreate(0, ptrW(mir_utf8decodeW(grpName)));
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/MSN/src/msn_svcs.cpp b/protocols/MSN/src/msn_svcs.cpp index a0cc11efe2..4746906aca 100644 --- a/protocols/MSN/src/msn_svcs.cpp +++ b/protocols/MSN/src/msn_svcs.cpp @@ -81,7 +81,7 @@ INT_PTR CMsnProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam) MSN_GetAvatarFileName(NULL, filename, _countof(filename), NULL);
pai->format = ProtoGetAvatarFormat(filename);
if (pai->format != PA_FORMAT_UNKNOWN)
- mir_tstrcpy(pai->filename, filename);
+ mir_wstrcpy(pai->filename, filename);
return pai->format == PA_FORMAT_UNKNOWN ? GAIR_NOAVATAR : GAIR_SUCCESS;
}
@@ -113,7 +113,7 @@ INT_PTR CMsnProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam) mir_free(szAvatarHash);
}
}
- mir_tstrcpy(pai->filename, filename);
+ mir_wstrcpy(pai->filename, filename);
return GAIR_SUCCESS;
}
@@ -140,7 +140,7 @@ INT_PTR CMsnProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam) ft->p2p_object = mir_strdup(szContext);
MSN_GetAvatarFileName(pai->hContact, filename, _countof(filename), L"unk");
- ft->std.tszCurrentFile = mir_tstrdup(filename);
+ ft->std.tszCurrentFile = mir_wstrdup(filename);
p2p_invite(MSN_APPID_AVATAR, ft, NULL);
}
@@ -216,7 +216,7 @@ INT_PTR CMsnProto::SetAvatar(WPARAM, LPARAM lParam) MSN_SetMyAvatar(fname, pData, dwPngSize);
StoreAvatarData* par = (StoreAvatarData*)mir_alloc(sizeof(StoreAvatarData));
- par->szName = mir_tstrdup(fname);
+ par->szName = mir_wstrdup(fname);
par->data = pData;
par->dataSize = dwPngSize;
par->szMimeType = "image/png";
@@ -301,15 +301,15 @@ INT_PTR CMsnProto::GetCurrentMedia(WPARAM, LPARAM lParam) if (cm == NULL || cm->cbSize != sizeof(LISTENINGTOINFO))
return -1;
- cm->ptszArtist = mir_tstrdup(msnCurrentMedia.ptszArtist);
- cm->ptszAlbum = mir_tstrdup(msnCurrentMedia.ptszAlbum);
- cm->ptszTitle = mir_tstrdup(msnCurrentMedia.ptszTitle);
- cm->ptszTrack = mir_tstrdup(msnCurrentMedia.ptszTrack);
- cm->ptszYear = mir_tstrdup(msnCurrentMedia.ptszYear);
- cm->ptszGenre = mir_tstrdup(msnCurrentMedia.ptszGenre);
- cm->ptszLength = mir_tstrdup(msnCurrentMedia.ptszLength);
- cm->ptszPlayer = mir_tstrdup(msnCurrentMedia.ptszPlayer);
- cm->ptszType = mir_tstrdup(msnCurrentMedia.ptszType);
+ cm->ptszArtist = mir_wstrdup(msnCurrentMedia.ptszArtist);
+ cm->ptszAlbum = mir_wstrdup(msnCurrentMedia.ptszAlbum);
+ cm->ptszTitle = mir_wstrdup(msnCurrentMedia.ptszTitle);
+ cm->ptszTrack = mir_wstrdup(msnCurrentMedia.ptszTrack);
+ cm->ptszYear = mir_wstrdup(msnCurrentMedia.ptszYear);
+ cm->ptszGenre = mir_wstrdup(msnCurrentMedia.ptszGenre);
+ cm->ptszLength = mir_wstrdup(msnCurrentMedia.ptszLength);
+ cm->ptszPlayer = mir_wstrdup(msnCurrentMedia.ptszPlayer);
+ cm->ptszType = mir_wstrdup(msnCurrentMedia.ptszType);
cm->dwFlags = msnCurrentMedia.dwFlags;
return 0;
@@ -360,7 +360,7 @@ INT_PTR CMsnProto::SetCurrentMedia(WPARAM, LPARAM lParam) text = (wchar_t *)CallService(MS_LISTENINGTO_GETPARSEDTEXT, (WPARAM)L"%title% - %artist%", (LPARAM)&msnCurrentMedia);
else {
text = (wchar_t *)mir_alloc(128 * sizeof(wchar_t));
- mir_sntprintf(text, 128, L"%s - %s", (msnCurrentMedia.ptszTitle ? msnCurrentMedia.ptszTitle : L""),
+ mir_snwprintf(text, 128, L"%s - %s", (msnCurrentMedia.ptszTitle ? msnCurrentMedia.ptszTitle : L""),
(msnCurrentMedia.ptszArtist ? msnCurrentMedia.ptszArtist : L""));
}
setTString("ListeningTo", text);
diff --git a/protocols/MSN/src/msn_threads.cpp b/protocols/MSN/src/msn_threads.cpp index ea171e6215..d3ec36dc86 100644 --- a/protocols/MSN/src/msn_threads.cpp +++ b/protocols/MSN/src/msn_threads.cpp @@ -385,13 +385,13 @@ ThreadData* CMsnProto::MSN_GetThreadByContact(const char* wlid, TInfoType type) GCThreadData* CMsnProto::MSN_GetThreadByChatId(const wchar_t* chatId)
{
- if (mir_tstrlen(chatId) == 0)
+ if (mir_wstrlen(chatId) == 0)
return NULL;
mir_cslock lck(m_csThreads);
for (int i = 0; i < m_arGCThreads.getCount(); i++) {
GCThreadData *T = m_arGCThreads[i];
- if (mir_tstrcmpi(T->mChatID, chatId) == 0)
+ if (mir_wstrcmpi(T->mChatID, chatId) == 0)
return T;
}
diff --git a/protocols/MSN/src/stdafx.h b/protocols/MSN/src/stdafx.h index 859023b6bc..3439a57fc0 100644 --- a/protocols/MSN/src/stdafx.h +++ b/protocols/MSN/src/stdafx.h @@ -1033,7 +1033,7 @@ struct InviteChatParam CMsnProto* ppro;
InviteChatParam(const wchar_t* id, MCONTACT hContact, CMsnProto* ppro)
- : id(mir_tstrdup(id)), hContact(hContact), ppro(ppro) {}
+ : id(mir_wstrdup(id)), hContact(hContact), ppro(ppro) {}
~InviteChatParam() {
mir_free(id);
|