diff options
author | George Hazan <george.hazan@gmail.com> | 2016-07-27 14:23:31 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-07-27 14:23:31 +0000 |
commit | 2f261839b60692e33d0e160344d0d636d49c90ba (patch) | |
tree | 187921722698b681d29df3f6e60fb18394a5e9d5 /protocols/JabberG | |
parent | 2e931a0b2780587d85f3902468c935f5adba70c8 (diff) |
less TCHARs
git-svn-id: http://svn.miranda-ng.org/main/trunk@17138 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG')
58 files changed, 1048 insertions, 1048 deletions
diff --git a/protocols/JabberG/src/jabber.cpp b/protocols/JabberG/src/jabber.cpp index 75c4f3dfab..c074e502ef 100644 --- a/protocols/JabberG/src/jabber.cpp +++ b/protocols/JabberG/src/jabber.cpp @@ -75,7 +75,7 @@ bool bSecureIM, bMirOTR, bNewGPG, bPlatform; // Protocol instances
static int sttCompareProtocols(const CJabberProto *p1, const CJabberProto *p2)
{
- return mir_tstrcmp(p1->m_tszUserName, p2->m_tszUserName);
+ return mir_wstrcmp(p1->m_tszUserName, p2->m_tszUserName);
}
LIST<CJabberProto> g_Instances(1, sttCompareProtocols);
@@ -135,7 +135,7 @@ static int OnModulesLoaded(WPARAM, LPARAM) fontid.deffontsettings.charset = DEFAULT_CHARSET;
fontid.deffontsettings.colour = GetSysColor(COLOR_WINDOWTEXT);
fontid.deffontsettings.size = -11;
- mir_tstrncpy(fontid.deffontsettings.szFace, L"MS Shell Dlg", _countof(fontid.deffontsettings.szFace));
+ mir_wstrncpy(fontid.deffontsettings.szFace, L"MS Shell Dlg", _countof(fontid.deffontsettings.szFace));
fontid.deffontsettings.style = 0;
wcsncpy_s(fontid.name, LPGENW("Frame title"), _TRUNCATE);
@@ -195,7 +195,7 @@ extern "C" int __declspec(dllexport) Load() WORD v[4];
CallService(MS_SYSTEM_GETFILEVERSION, 0, (LPARAM)v);
- mir_sntprintf(szCoreVersion, L"%d.%d.%d.%d", v[0], v[1], v[2], v[3]);
+ mir_snwprintf(szCoreVersion, L"%d.%d.%d.%d", v[0], v[1], v[2], v[3]);
CallService(MS_UTILS_GETCOUNTRYLIST, (WPARAM)&g_cbCountries, (LPARAM)&g_countries);
@@ -235,13 +235,13 @@ extern "C" int __declspec(dllexport) Unload(void) if (g_nTempFileId != 0) {
wchar_t tszTempPath[MAX_PATH], tszFilePath[MAX_PATH];
GetTempPath(_countof(tszTempPath), tszTempPath);
- mir_sntprintf(tszFilePath, L"%sjab*.tmp.*", tszTempPath);
+ mir_snwprintf(tszFilePath, L"%sjab*.tmp.*", tszTempPath);
WIN32_FIND_DATA findData;
HANDLE hFind = FindFirstFile(tszFilePath, &findData);
if (hFind != INVALID_HANDLE_VALUE) {
do {
- mir_sntprintf(tszFilePath, L"%s%s", tszTempPath, findData.cFileName);
+ mir_snwprintf(tszFilePath, L"%s%s", tszTempPath, findData.cFileName);
DeleteFile(tszFilePath);
} while (FindNextFile(hFind, &findData));
diff --git a/protocols/JabberG/src/jabber_adhoc.cpp b/protocols/JabberG/src/jabber_adhoc.cpp index ea2d3c6748..e29f3fde4e 100644 --- a/protocols/JabberG/src/jabber_adhoc.cpp +++ b/protocols/JabberG/src/jabber_adhoc.cpp @@ -143,7 +143,7 @@ int CJabberProto::AdHoc_OnJAHMCommandListResult(HWND hwndDlg, HXML iqNode, Jabbe {
int nodeIdx = 0;
const wchar_t * type = XmlGetAttrValue(iqNode, L"type");
- if (!type || !mir_tstrcmp(type, L"error")) {
+ if (!type || !mir_wstrcmp(type, L"error")) {
// error occurred here
wchar_t buff[255];
const wchar_t *code = NULL;
@@ -154,10 +154,10 @@ int CJabberProto::AdHoc_OnJAHMCommandListResult(HWND hwndDlg, HXML iqNode, Jabbe code = XmlGetAttrValue(errorNode, L"code");
description = XmlGetText(errorNode);
}
- mir_sntprintf(buff, TranslateT("Error %s %s"), (code) ? code : L"", (description) ? description : L"");
+ mir_snwprintf(buff, TranslateT("Error %s %s"), (code) ? code : L"", (description) ? description : L"");
JabberFormSetInstruction(hwndDlg, buff);
}
- else if (!mir_tstrcmp(type, L"result")) {
+ else if (!mir_wstrcmp(type, L"result")) {
BOOL validResponse = FALSE;
EnumChildWindows(GetDlgItem(hwndDlg, IDC_FRAME), sttDeleteChildWindowsProc, 0);
dat->CurrentHeight = 0;
@@ -167,7 +167,7 @@ int CJabberProto::AdHoc_OnJAHMCommandListResult(HWND hwndDlg, HXML iqNode, Jabbe if (queryNode) {
const wchar_t *xmlns = XmlGetAttrValue(queryNode, L"xmlns");
const wchar_t *node = XmlGetAttrValue(queryNode, L"node");
- if (xmlns && node && !mir_tstrcmp(xmlns, JABBER_FEAT_DISCO_ITEMS) && !mir_tstrcmp(node, JABBER_FEAT_COMMANDS))
+ if (xmlns && node && !mir_wstrcmp(xmlns, JABBER_FEAT_DISCO_ITEMS) && !mir_wstrcmp(node, JABBER_FEAT_COMMANDS))
validResponse = TRUE;
}
if (queryNode && XmlGetChild(queryNode, 0) && validResponse) {
@@ -213,7 +213,7 @@ int CJabberProto::AdHoc_OnJAHMProcessResult(HWND hwndDlg, HXML workNode, JabberA const wchar_t *type;
if ((type = XmlGetAttrValue(workNode, L"type")) == NULL) return TRUE;
- if (!mir_tstrcmp(type, L"result")) {
+ if (!mir_wstrcmp(type, L"result")) {
// wParam = <iq/> node from responder as a result of command execution
HXML commandNode, xNode;
if ((commandNode = XmlGetChild(dat->AdHocNode, L"command")) == NULL)
@@ -264,12 +264,12 @@ int CJabberProto::AdHoc_OnJAHMProcessResult(HWND hwndDlg, HXML workNode, JabberA EnableDlgItem(hwndDlg, IDC_SUBMIT, TRUE);
}
- if (!status || mir_tstrcmp(status, L"executing")) {
+ if (!status || mir_wstrcmp(status, L"executing")) {
ShowDlgItem(hwndDlg, IDC_SUBMIT, SW_HIDE);
SetDlgItemText(hwndDlg, IDCANCEL, TranslateT("Done"));
}
}
- else if (!mir_tstrcmp(type, L"error")) {
+ else if (!mir_wstrcmp(type, L"error")) {
// error occurred here
int toHide[] = { IDC_FRAME, IDC_FRAME_TEXT, IDC_VSCROLL, IDC_PREV, IDC_NEXT, IDC_COMPLETE, IDC_SUBMIT, 0};
sttShowControls(hwndDlg, FALSE, toHide);
@@ -282,7 +282,7 @@ int CJabberProto::AdHoc_OnJAHMProcessResult(HWND hwndDlg, HXML workNode, JabberA code = XmlGetAttrValue(errorNode, L"code");
description = XmlGetText(errorNode);
}
- mir_sntprintf(buff, TranslateT("Error %s %s"), code ? code : L"", description ? description : L"");
+ mir_snwprintf(buff, TranslateT("Error %s %s"), code ? code : L"", description ? description : L"");
JabberFormSetInstruction(hwndDlg,buff);
}
JabberAdHoc_RefreshFrameScroll(hwndDlg, dat);
@@ -354,7 +354,7 @@ static INT_PTR CALLBACK JabberAdHoc_CommandDlgProc(HWND hwndDlg, UINT msg, WPARA dat = (JabberAdHocData*)mir_calloc(sizeof(JabberAdHocData));
{
CJabberAdhocStartupParams* pStartupParams = (CJabberAdhocStartupParams *)lParam;
- dat->ResponderJID = mir_tstrdup(pStartupParams->m_szJid);
+ dat->ResponderJID = mir_wstrdup(pStartupParams->m_szJid);
dat->proto = pStartupParams->m_pProto;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
@@ -385,7 +385,7 @@ static INT_PTR CALLBACK JabberAdHoc_CommandDlgProc(HWND hwndDlg, UINT msg, WPARA dat->proto->AdHoc_RequestListOfCommands(pStartupParams->m_szJid, hwndDlg);
wchar_t Caption[512];
- mir_sntprintf(Caption, TranslateT("Jabber Ad-Hoc commands at %s"), dat->ResponderJID);
+ mir_snwprintf(Caption, TranslateT("Jabber Ad-Hoc commands at %s"), dat->ResponderJID);
SetWindowText(hwndDlg, Caption);
}
else {
@@ -398,7 +398,7 @@ static INT_PTR CALLBACK JabberAdHoc_CommandDlgProc(HWND hwndDlg, UINT msg, WPARA SetDlgItemText(hwndDlg, IDC_SUBMIT, TranslateT("OK"));
wchar_t Caption[512];
- mir_sntprintf(Caption, TranslateT("Sending Ad-Hoc command to %s"), dat->ResponderJID);
+ mir_snwprintf(Caption, TranslateT("Sending Ad-Hoc command to %s"), dat->ResponderJID);
SetWindowText(hwndDlg, Caption);
}
@@ -513,7 +513,7 @@ int __cdecl CJabberProto::ContactMenuRunCommands(WPARAM hContact, LPARAM lParam) int res = -1;
if ((hContact != NULL || lParam != 0) && m_bJabberOnline) {
- ptrT szJid(getTStringA(hContact, "jid"));
+ ptrW szJid(getTStringA(hContact, "jid"));
if (hContact && szJid != NULL) {
JABBER_LIST_ITEM *item = NULL;
int selected = 0;
@@ -541,8 +541,8 @@ int __cdecl CJabberProto::ContactMenuRunCommands(WPARAM hContact, LPARAM lParam) if (selected > 0) {
JABBER_RESOURCE_STATUS *r = item->arResources[selected - 1];
if (r) {
- mir_tstrncat(jid, L"/", _countof(jid) - mir_tstrlen(jid));
- mir_tstrncat(jid, r->m_tszResourceName, _countof(jid) - mir_tstrlen(jid));
+ mir_wstrncat(jid, L"/", _countof(jid) - mir_wstrlen(jid));
+ mir_wstrncat(jid, r->m_tszResourceName, _countof(jid) - mir_wstrlen(jid));
}
selected = 1;
}
diff --git a/protocols/JabberG/src/jabber_agent.cpp b/protocols/JabberG/src/jabber_agent.cpp index a09ad50983..2e8654f265 100644 --- a/protocols/JabberG/src/jabber_agent.cpp +++ b/protocols/JabberG/src/jabber_agent.cpp @@ -169,13 +169,13 @@ public: break;
if (XmlGetName(n)) {
- if (!mir_tstrcmp(XmlGetName(n), L"instructions")) {
+ if (!mir_wstrcmp(XmlGetName(n), L"instructions")) {
JabberFormSetInstruction(m_hwnd, XmlGetText(n));
}
- else if (!mir_tstrcmp(XmlGetName(n), L"key") || !mir_tstrcmp(XmlGetName(n), L"registered")) {
+ else if (!mir_wstrcmp(XmlGetName(n), L"key") || !mir_wstrcmp(XmlGetName(n), L"registered")) {
// do nothing
}
- else if (!mir_tstrcmp(XmlGetName(n), L"password"))
+ else if (!mir_wstrcmp(XmlGetName(n), L"password"))
JabberFormAppendControl(hFrame, layout_info, JFORM_CTYPE_TEXT_PRIVATE, XmlGetName(n), XmlGetText(n));
else // everything else is a normal text field
JabberFormAppendControl(hFrame, layout_info, JFORM_CTYPE_TEXT_SINGLE, XmlGetName(n), XmlGetText(n));
@@ -253,14 +253,14 @@ public: break;
if (XmlGetName(n)) {
- if (!mir_tstrcmp(XmlGetName(n), L"key")) {
+ if (!mir_wstrcmp(XmlGetName(n), L"key")) {
// field that must be passed along with the registration
if (XmlGetText(n))
XmlAddChild(query, XmlGetName(n), XmlGetText(n));
else
XmlAddChild(query, XmlGetName(n));
}
- else if (!mir_tstrcmp(XmlGetName(n), L"registered") || !mir_tstrcmp(XmlGetName(n), L"instructions")) {
+ else if (!mir_wstrcmp(XmlGetName(n), L"registered") || !mir_wstrcmp(XmlGetName(n), L"instructions")) {
// do nothing, we will skip these
}
else {
diff --git a/protocols/JabberG/src/jabber_api.cpp b/protocols/JabberG/src/jabber_api.cpp index a144c1324d..167c518bdc 100644 --- a/protocols/JabberG/src/jabber_api.cpp +++ b/protocols/JabberG/src/jabber_api.cpp @@ -67,9 +67,9 @@ LPTSTR CJabberProto::GetBestResourceName(LPCTSTR jid) LPCTSTR p = wcschr(jid, '/');
if (p == NULL) {
mir_cslock lck(m_csLists);
- return mir_tstrdup(ListGetBestClientResourceNamePtr(jid));
+ return mir_wstrdup(ListGetBestClientResourceNamePtr(jid));
}
- return mir_tstrdup(jid);
+ return mir_wstrdup(jid);
}
LPTSTR CJabberProto::GetResourceList(LPCTSTR jid)
@@ -94,7 +94,7 @@ LPTSTR CJabberProto::GetResourceList(LPCTSTR jid) }
res.AppendChar(0);
- return mir_tstrndup(res, res.GetLength());
+ return mir_wstrndup(res, res.GetLength());
}
char *CJabberProto::GetModuleName() const
@@ -199,7 +199,7 @@ int CJabberProto::RemoveHandler(HJHANDLER hHandler) JabberFeatCapPairDynamic *CJabberProto::FindFeature(LPCTSTR szFeature)
{
for (int i=0; i < m_lstJabberFeatCapPairsDynamic.getCount(); i++)
- if (!mir_tstrcmp(m_lstJabberFeatCapPairsDynamic[i]->szFeature, szFeature))
+ if (!mir_wstrcmp(m_lstJabberFeatCapPairsDynamic[i]->szFeature, szFeature))
return m_lstJabberFeatCapPairsDynamic[i];
return NULL;
@@ -213,7 +213,7 @@ int CJabberProto::RegisterFeature(LPCTSTR szFeature, LPCTSTR szDescription) // check for this feature in core features, and return false if it's present, to prevent re-registering a core feature
int i;
for (i=0; g_JabberFeatCapPairs[i].szFeature; i++)
- if (!mir_tstrcmp(g_JabberFeatCapPairs[i].szFeature, szFeature))
+ if (!mir_wstrcmp(g_JabberFeatCapPairs[i].szFeature, szFeature))
return false;
mir_cslock lck(m_csLists);
@@ -237,7 +237,7 @@ int CJabberProto::RegisterFeature(LPCTSTR szFeature, LPCTSTR szDescription) return false;
// remove unnecessary symbols from szFeature to make the string shorter, and use it as szExt
- LPTSTR szExt = mir_tstrdup(szFeature);
+ LPTSTR szExt = mir_wstrdup(szFeature);
LPTSTR pSrc, pDst;
for (pSrc = szExt, pDst = szExt; *pSrc; pSrc++)
if (wcschr(L"bcdfghjklmnpqrstvwxz0123456789", *pSrc))
@@ -247,15 +247,15 @@ int CJabberProto::RegisterFeature(LPCTSTR szFeature, LPCTSTR szDescription) fcp = new JabberFeatCapPairDynamic();
fcp->szExt = szExt; // will be deallocated along with other values of JabberFeatCapPairDynamic in CJabberProto destructor
- fcp->szFeature = mir_tstrdup(szFeature);
- fcp->szDescription = szDescription ? mir_tstrdup(szDescription) : NULL;
+ fcp->szFeature = mir_wstrdup(szFeature);
+ fcp->szDescription = szDescription ? mir_wstrdup(szDescription) : NULL;
fcp->jcbCap = jcb;
m_lstJabberFeatCapPairsDynamic.insert(fcp);
}
else if (szDescription) { // update description
if (fcp->szDescription)
mir_free(fcp->szDescription);
- fcp->szDescription = mir_tstrdup(szDescription);
+ fcp->szDescription = mir_wstrdup(szDescription);
}
return true;
}
@@ -281,7 +281,7 @@ int CJabberProto::AddFeatures(LPCTSTR szFeatures) m_uEnabledFeatCapsDynamic |= fcp->jcbCap;
else
ret = false;
- szFeat += mir_tstrlen(szFeat) + 1;
+ szFeat += mir_wstrlen(szFeat) + 1;
}
lck.unlock();
@@ -306,7 +306,7 @@ int CJabberProto::RemoveFeatures(LPCTSTR szFeatures) else
ret = false; // indicate that there was an error removing at least one of the specified features
- szFeat += mir_tstrlen(szFeat) + 1;
+ szFeat += mir_wstrlen(szFeat) + 1;
}
lck.unlock();
@@ -328,25 +328,25 @@ LPTSTR CJabberProto::GetResourceFeatures(LPCTSTR jid) // calculate total necessary string length
for (i=0; g_JabberFeatCapPairs[i].szFeature; i++)
if (jcb & g_JabberFeatCapPairs[i].jcbCap)
- iLen += mir_tstrlen(g_JabberFeatCapPairs[i].szFeature) + 1;
+ iLen += mir_wstrlen(g_JabberFeatCapPairs[i].szFeature) + 1;
for (i=0; i < m_lstJabberFeatCapPairsDynamic.getCount(); i++)
if (jcb & m_lstJabberFeatCapPairsDynamic[i]->jcbCap)
- iLen += mir_tstrlen(m_lstJabberFeatCapPairsDynamic[i]->szFeature) + 1;
+ iLen += mir_wstrlen(m_lstJabberFeatCapPairsDynamic[i]->szFeature) + 1;
// allocate memory and fill it
LPTSTR str = (LPTSTR)mir_alloc(iLen * sizeof(wchar_t));
LPTSTR p = str;
for (i=0; g_JabberFeatCapPairs[i].szFeature; i++)
if (jcb & g_JabberFeatCapPairs[i].jcbCap) {
- mir_tstrcpy(p, g_JabberFeatCapPairs[i].szFeature);
- p += mir_tstrlen(g_JabberFeatCapPairs[i].szFeature) + 1;
+ mir_wstrcpy(p, g_JabberFeatCapPairs[i].szFeature);
+ p += mir_wstrlen(g_JabberFeatCapPairs[i].szFeature) + 1;
}
for (i=0; i < m_lstJabberFeatCapPairsDynamic.getCount(); i++)
if (jcb & m_lstJabberFeatCapPairsDynamic[i]->jcbCap) {
- mir_tstrcpy(p, m_lstJabberFeatCapPairsDynamic[i]->szFeature);
- p += mir_tstrlen(m_lstJabberFeatCapPairsDynamic[i]->szFeature) + 1;
+ mir_wstrcpy(p, m_lstJabberFeatCapPairsDynamic[i]->szFeature);
+ p += mir_wstrlen(m_lstJabberFeatCapPairsDynamic[i]->szFeature) + 1;
}
*p = 0; // extra zero terminator
diff --git a/protocols/JabberG/src/jabber_archive.cpp b/protocols/JabberG/src/jabber_archive.cpp index d0718ab3ca..863a19fb44 100644 --- a/protocols/JabberG/src/jabber_archive.cpp +++ b/protocols/JabberG/src/jabber_archive.cpp @@ -58,11 +58,11 @@ void CJabberProto::RetrieveMessageArchive(MCONTACT hContact, JABBER_LIST_ITEM *p void CJabberProto::OnIqResultGetCollectionList(HXML iqNode, CJabberIqInfo*)
{
const wchar_t *to = XmlGetAttrValue(iqNode, L"to");
- if (to == NULL || mir_tstrcmp(XmlGetAttrValue(iqNode, L"type"), L"result"))
+ if (to == NULL || mir_wstrcmp(XmlGetAttrValue(iqNode, L"type"), L"result"))
return;
HXML list = XmlGetChild(iqNode, "list");
- if (!list || mir_tstrcmp(XmlGetAttrValue(list, L"xmlns"), JABBER_FEAT_ARCHIVE))
+ if (!list || mir_wstrcmp(XmlGetAttrValue(list, L"xmlns"), JABBER_FEAT_ARCHIVE))
return;
for (int nodeIdx = 1;; nodeIdx++) {
@@ -221,11 +221,11 @@ BOOL IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO& dbei) void CJabberProto::OnIqResultGetCollection(HXML iqNode, CJabberIqInfo*)
{
- if (mir_tstrcmp(XmlGetAttrValue(iqNode, L"type"), L"result"))
+ if (mir_wstrcmp(XmlGetAttrValue(iqNode, L"type"), L"result"))
return;
HXML chatNode = XmlGetChild(iqNode, "chat");
- if (!chatNode || mir_tstrcmp(XmlGetAttrValue(chatNode, L"xmlns"), JABBER_FEAT_ARCHIVE))
+ if (!chatNode || mir_wstrcmp(XmlGetAttrValue(chatNode, L"xmlns"), JABBER_FEAT_ARCHIVE))
return;
const wchar_t* start = XmlGetAttrValue(chatNode, L"start");
@@ -249,9 +249,9 @@ void CJabberProto::OnIqResultGetCollection(HXML iqNode, CJabberIqInfo*) int from;
const wchar_t *itemName = XmlGetName(itemNode);
- if (!mir_tstrcmp(itemName, L"to"))
+ if (!mir_wstrcmp(itemName, L"to"))
from = DBEF_SENT;
- else if (!mir_tstrcmp(itemName, L"from"))
+ else if (!mir_wstrcmp(itemName, L"from"))
from = 0;
else
continue;
diff --git a/protocols/JabberG/src/jabber_bookmarks.cpp b/protocols/JabberG/src/jabber_bookmarks.cpp index f7915fe86b..b1cc884948 100644 --- a/protocols/JabberG/src/jabber_bookmarks.cpp +++ b/protocols/JabberG/src/jabber_bookmarks.cpp @@ -47,7 +47,7 @@ static INT_PTR CALLBACK JabberAddBookmarkDlgProc(HWND hwndDlg, UINT msg, WPARAM param->ppro->m_hwndJabberAddBookmark = hwndDlg;
TranslateDialogDefault(hwndDlg);
if (item = param->m_item) {
- if (!mir_tstrcmp(item->type, L"conference")) {
+ if (!mir_wstrcmp(item->type, L"conference")) {
if (!wcschr(item->jid, '@')) { //no room name - consider it is transport
CheckDlgButton(hwndDlg, IDC_AGENT_RADIO, BST_CHECKED);
EnableWindow(GetDlgItem(hwndDlg, IDC_NICK), FALSE);
@@ -118,18 +118,18 @@ static INT_PTR CALLBACK JabberAddBookmarkDlgProc(HWND hwndDlg, UINT msg, WPARAM item = param->ppro->ListAdd(LIST_BOOKMARK, roomJID);
if (IsDlgButtonChecked(hwndDlg, IDC_URL_RADIO) == BST_CHECKED)
- replaceStrT(item->type, L"url");
+ replaceStrW(item->type, L"url");
else
- replaceStrT(item->type, L"conference");
+ replaceStrW(item->type, L"conference");
GetDlgItemText(hwndDlg, IDC_NICK, text, _countof(text));
- replaceStrT(item->nick, text);
+ replaceStrW(item->nick, text);
GetDlgItemText(hwndDlg, IDC_PASSWORD, text, _countof(text));
- replaceStrT(item->password, text);
+ replaceStrW(item->password, text);
GetDlgItemText(hwndDlg, IDC_NAME, text, _countof(text));
- replaceStrT(item->name, (text[0] == 0) ? roomJID : text);
+ replaceStrW(item->name, (text[0] == 0) ? roomJID : text);
item->bAutoJoin = IsDlgButtonChecked(hwndDlg, IDC_CHECK_BM_AUTOJOIN) == BST_CHECKED;
@@ -329,7 +329,7 @@ void CJabberDlgBookmarks::OpenBookmark() JABBER_LIST_ITEM *item = m_proto->ListGetItemPtr(LIST_BOOKMARK, address);
if (item == NULL) return;
- if (!mir_tstrcmpi(item->type, L"conference")) {
+ if (!mir_wstrcmpi(item->type, L"conference")) {
m_lvBookmarks.SetItemState(iItem, 0, LVIS_SELECTED); // Unselect the item
/* some hack for using bookmark to transport not under XEP-0048 */
@@ -344,7 +344,7 @@ void CJabberDlgBookmarks::OpenBookmark() if (item->nick && *item->nick)
m_proto->GroupchatJoinRoom(server, room, item->nick, item->password);
else
- m_proto->GroupchatJoinRoom(server, room, ptrT(JabberNickFromJID(m_proto->m_szJabberJID)), item->password);
+ m_proto->GroupchatJoinRoom(server, room, ptrW(JabberNickFromJID(m_proto->m_szJabberJID)), item->password);
}
}
else Utils_OpenUrlT(item->jid);
@@ -391,7 +391,7 @@ void CJabberDlgBookmarks::OnProtoRefresh(WPARAM, LPARAM) LISTFOREACH(i, m_proto, LIST_BOOKMARK)
{
if (item = m_proto->ListGetItemPtrFromIndex(i)) {
- int itemType = mir_tstrcmpi(item->type, L"conference") ? 1 : 0;
+ int itemType = mir_wstrcmpi(item->type, L"conference") ? 1 : 0;
int iItem = m_lvBookmarks.AddItem(item->name, itemType, (LPARAM)item->jid, itemType);
m_lvBookmarks.SetItem(iItem, 1, item->jid);
if (itemType == 0)
diff --git a/protocols/JabberG/src/jabber_byte.cpp b/protocols/JabberG/src/jabber_byte.cpp index c889f7099f..a940fee985 100644 --- a/protocols/JabberG/src/jabber_byte.cpp +++ b/protocols/JabberG/src/jabber_byte.cpp @@ -61,16 +61,16 @@ void CJabberProto::IqResultProxyDiscovery(HXML iqNode, CJabberIqInfo *pInfo) HXML queryNode = XmlGetChild(iqNode , "query");
if (queryNode) {
const wchar_t *queryXmlns = XmlGetAttrValue(queryNode, L"xmlns");
- if (queryXmlns && !mir_tstrcmp(queryXmlns, JABBER_FEAT_BYTESTREAMS)) {
+ if (queryXmlns && !mir_wstrcmp(queryXmlns, JABBER_FEAT_BYTESTREAMS)) {
HXML streamHostNode = XmlGetChild(queryNode , "streamhost");
if (streamHostNode) {
const wchar_t *streamJid = XmlGetAttrValue(streamHostNode, L"jid");
const wchar_t *streamHost = XmlGetAttrValue(streamHostNode, L"host");
const wchar_t *streamPort = XmlGetAttrValue(streamHostNode, L"port");
if (streamJid && streamHost && streamPort) {
- jbt->szProxyHost = mir_tstrdup(streamHost);
- jbt->szProxyJid = mir_tstrdup(streamJid);
- jbt->szProxyPort = mir_tstrdup(streamPort);
+ jbt->szProxyHost = mir_wstrdup(streamHost);
+ jbt->szProxyJid = mir_wstrdup(streamJid);
+ jbt->szProxyPort = mir_wstrdup(streamPort);
jbt->bProxyDiscovered = TRUE;
} } } } }
else if (pInfo->GetIqType() == JABBER_IQ_TYPE_ERROR)
@@ -94,7 +94,7 @@ void JabberByteSendConnection(HANDLE hConn, DWORD /*dwRemoteIP*/, void* extra) NETLIBCONNINFO connInfo = { sizeof(connInfo) };
CallService(MS_NETLIB_GETCONNECTIONINFO, (WPARAM)hConn, (LPARAM)&connInfo);
- mir_sntprintf(szPort, L"%u", connInfo.wPort);
+ mir_snwprintf(szPort, L"%u", connInfo.wPort);
ppro->debugLogA("bytestream_send_connection incoming connection accepted: %s", connInfo.szIpPort);
if ((item = ppro->ListGetItemPtr(LIST_BYTE, szPort)) == NULL) {
@@ -153,7 +153,7 @@ void CJabberProto::ByteSendThread(JABBER_BYTE_TRANSFER *jbt) BOOL bDirect = m_options.BsDirect;
if (m_options.BsProxyManual) {
- ptrT proxyJid( getTStringA("BsProxyServer"));
+ ptrW proxyJid( getTStringA("BsProxyServer"));
if (proxyJid) {
jbt->bProxyDiscovered = FALSE;
jbt->szProxyHost = NULL;
@@ -209,7 +209,7 @@ void CJabberProto::ByteSendThread(JABBER_BYTE_TRANSFER *jbt) if (localAddr == NULL)
localAddr = (char*)CallService(MS_NETLIB_ADDRESSTOSTRING, 1, nlb.dwExternalIP);
- mir_sntprintf(szPort, L"%d", nlb.wPort);
+ mir_snwprintf(szPort, L"%d", nlb.wPort);
JABBER_LIST_ITEM *item = ListAdd(LIST_BYTE, szPort);
item->jbt = jbt;
hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
@@ -258,7 +258,7 @@ void CJabberProto::ByteSendThread(JABBER_BYTE_TRANSFER *jbt) return;
}
- if (jbt->bProxyDiscovered && !mir_tstrcmp(jbt->szProxyJid, jbt->szStreamhostUsed)) {
+ if (jbt->bProxyDiscovered && !mir_wstrcmp(jbt->szProxyJid, jbt->szStreamhostUsed)) {
// jabber proxy used
if (bDirect) {
SetEvent(jbt->hSendEvent);
@@ -300,12 +300,12 @@ void CJabberProto::ByteInitiateResult(HXML iqNode, CJabberIqInfo *pInfo) HXML queryNode = XmlGetChild(iqNode , "query");
if (queryNode) {
const wchar_t *queryXmlns = XmlGetAttrValue(queryNode, L"xmlns");
- if (queryXmlns && !mir_tstrcmp(queryXmlns, JABBER_FEAT_BYTESTREAMS)) {
+ if (queryXmlns && !mir_wstrcmp(queryXmlns, JABBER_FEAT_BYTESTREAMS)) {
HXML streamHostNode = XmlGetChild(queryNode , "streamhost-used");
if (streamHostNode) {
const wchar_t *streamJid = XmlGetAttrValue(streamHostNode, L"jid");
if (streamJid)
- jbt->szStreamhostUsed = mir_tstrdup(streamJid);
+ jbt->szStreamhostUsed = mir_wstrdup(streamJid);
} } } }
if (jbt->hProxyEvent)
@@ -364,7 +364,7 @@ int CJabberProto::ByteSendParse(HANDLE hConn, JABBER_BYTE_TRANSFER *jbt, char* b wchar_t *szInitiatorJid = JabberPrepareJid(jbt->srcJID);
wchar_t *szTargetJid = JabberPrepareJid(jbt->dstJID);
- mir_sntprintf(text, L"%s%s%s", jbt->sid, szInitiatorJid, szTargetJid);
+ mir_snwprintf(text, L"%s%s%s", jbt->sid, szInitiatorJid, szTargetJid);
mir_free(szInitiatorJid);
mir_free(szTargetJid);
@@ -407,13 +407,13 @@ void CJabberProto::IqResultStreamActivate(HXML iqNode, CJabberIqInfo*) int id = JabberGetPacketID(iqNode);
wchar_t listJid[JABBER_MAX_JID_LEN];
- mir_sntprintf(listJid, L"ftproxy_%d", id);
+ mir_snwprintf(listJid, L"ftproxy_%d", id);
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_FTIQID, listJid);
if (item == NULL)
return;
- if (!mir_tstrcmp(XmlGetAttrValue(iqNode, L"type"), L"result"))
+ if (!mir_wstrcmp(XmlGetAttrValue(iqNode, L"type"), L"result"))
item->jbt->bStreamActivated = TRUE;
if (item->jbt->hProxyEvent)
@@ -445,11 +445,11 @@ void CJabberProto::ByteSendViaProxy(JABBER_BYTE_TRANSFER *jbt) szHost = jbt->szProxyHost;
port = (WORD)_wtoi(szPort);
- replaceStrT(jbt->streamhostJID, jbt->szProxyJid);
+ replaceStrW(jbt->streamhostJID, jbt->szProxyJid);
NETLIBOPENCONNECTION nloc = { 0 };
nloc.cbSize = sizeof(nloc);
- nloc.szHost = mir_t2a(szHost);
+ nloc.szHost = mir_u2a(szHost);
nloc.wPort = port;
hConn = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)m_hNetlibUser, (LPARAM)&nloc);
mir_free((void*)nloc.szHost);
@@ -513,7 +513,7 @@ int CJabberProto::ByteSendProxyParse(HANDLE hConn, JABBER_BYTE_TRANSFER *jbt, ch wchar_t *szInitiatorJid = JabberPrepareJid(jbt->srcJID);
wchar_t *szTargetJid = JabberPrepareJid(jbt->dstJID);
- mir_sntprintf(text, L"%s%s%s", jbt->sid, szInitiatorJid, szTargetJid);
+ mir_snwprintf(text, L"%s%s%s", jbt->sid, szInitiatorJid, szTargetJid);
mir_free(szInitiatorJid);
mir_free(szTargetJid);
@@ -556,7 +556,7 @@ int CJabberProto::ByteSendProxyParse(HANDLE hConn, JABBER_BYTE_TRANSFER *jbt, ch int iqId = SerialNext();
wchar_t listJid[256];
- mir_sntprintf(listJid, L"ftproxy_%d", iqId);
+ mir_snwprintf(listJid, L"ftproxy_%d", iqId);
JABBER_LIST_ITEM *item = ListAdd(LIST_FTIQID, listJid);
item->jbt = jbt;
@@ -612,10 +612,10 @@ void __cdecl CJabberProto::ByteReceiveThread(JABBER_BYTE_TRANSFER *jbt) }
if (szId && from && to && sid && (n = XmlGetChild(queryNode, "streamhost")) != NULL) {
- jbt->iqId = mir_tstrdup(szId);
- jbt->srcJID = mir_tstrdup(from);
- jbt->dstJID = mir_tstrdup(to);
- jbt->sid = mir_tstrdup(sid);
+ jbt->iqId = mir_wstrdup(szId);
+ jbt->srcJID = mir_wstrdup(from);
+ jbt->dstJID = mir_wstrdup(to);
+ jbt->sid = mir_wstrdup(sid);
if ((buffer = (char*)mir_alloc(JABBER_NETWORK_BUFFER_SIZE))) {
for (i = 1; (n = XmlGetNthChild(queryNode, L"streamhost", i)) != NULL; i++) {
@@ -624,12 +624,12 @@ void __cdecl CJabberProto::ByteReceiveThread(JABBER_BYTE_TRANSFER *jbt) (str = XmlGetAttrValue(n, L"jid")) != NULL) {
port = (WORD)_wtoi(szPort);
- replaceStrT(jbt->streamhostJID, str);
+ replaceStrW(jbt->streamhostJID, str);
debugLog(L"bytestream_recv connecting to %s:%d", szHost, port);
NETLIBOPENCONNECTION nloc = { 0 };
nloc.cbSize = sizeof(nloc);
- nloc.szHost = mir_t2a(szHost);
+ nloc.szHost = mir_u2a(szHost);
nloc.wPort = port;
hConn = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)m_hNetlibUser, (LPARAM)&nloc);
mir_free((void*)nloc.szHost);
@@ -707,9 +707,9 @@ int CJabberProto::ByteReceiveParse(HANDLE hConn, JABBER_BYTE_TRANSFER *jbt, char wchar_t text[JABBER_MAX_JID_LEN * 2];
{
- ptrT szInitiatorJid(JabberPrepareJid(jbt->srcJID));
- ptrT szTargetJid(JabberPrepareJid(jbt->dstJID));
- mir_sntprintf(text, L"%s%s%s", jbt->sid, szInitiatorJid, szTargetJid);
+ ptrW szInitiatorJid(JabberPrepareJid(jbt->srcJID));
+ ptrW szTargetJid(JabberPrepareJid(jbt->dstJID));
+ mir_snwprintf(text, L"%s%s%s", jbt->sid, szInitiatorJid, szTargetJid);
}
T2Utf szAuthString(text);
diff --git a/protocols/JabberG/src/jabber_caps.cpp b/protocols/JabberG/src/jabber_caps.cpp index 275e869901..f4457137c8 100644 --- a/protocols/JabberG/src/jabber_caps.cpp +++ b/protocols/JabberG/src/jabber_caps.cpp @@ -111,22 +111,22 @@ void CJabberProto::OnIqResultCapsDiscoInfoSI(HXML, CJabberIqInfo *pInfo) HXML xform;
for (int i = 1; (xform = XmlGetNthChild(query, L"x", i)) != NULL; i++) {
wchar_t *szFormTypeValue = XPath(xform, L"field[@var='FORM_TYPE']/value");
- if (szFormTypeValue && !mir_tstrcmp(szFormTypeValue, L"urn:xmpp:dataforms:softwareinfo")) {
+ if (szFormTypeValue && !mir_wstrcmp(szFormTypeValue, L"urn:xmpp:dataforms:softwareinfo")) {
wchar_t *szTmp = XPath(xform, L"field[@var='os']/value");
if (szTmp)
- r->m_tszOs = mir_tstrdup(szTmp);
+ r->m_tszOs = mir_wstrdup(szTmp);
szTmp = XPath(xform, L"field[@var='os_version']/value");
if (szTmp)
- r->m_tszOsVersion = mir_tstrdup(szTmp);
+ r->m_tszOsVersion = mir_wstrdup(szTmp);
szTmp = XPath(xform, L"field[@var='software']/value");
if (szTmp)
- r->m_tszSoftware = mir_tstrdup(szTmp);
+ r->m_tszSoftware = mir_wstrdup(szTmp);
szTmp = XPath(xform, L"field[@var='software_version']/value");
if (szTmp)
- r->m_tszSoftwareVersion = mir_tstrdup(szTmp);
+ r->m_tszSoftwareVersion = mir_wstrdup(szTmp);
szTmp = XPath(xform, L"field[@var='x-miranda-core-version']/value");
if (szTmp)
- r->m_tszXMirandaCoreVersion = mir_tstrdup(szTmp);
+ r->m_tszXMirandaCoreVersion = mir_wstrdup(szTmp);
JabberUserInfoUpdate(pInfo->GetHContact());
}
@@ -148,7 +148,7 @@ void CJabberProto::OnIqResultCapsDiscoInfo(HXML, CJabberIqInfo *pInfo) continue;
for (int j = 0; g_JabberFeatCapPairs[j].szFeature; j++) {
- if (!mir_tstrcmp(g_JabberFeatCapPairs[j].szFeature, featureName)) {
+ if (!mir_wstrcmp(g_JabberFeatCapPairs[j].szFeature, featureName)) {
jcbCaps |= g_JabberFeatCapPairs[j].jcbCap;
break;
}
@@ -201,7 +201,7 @@ JabberCapsBits CJabberProto::GetTotalJidCapabilites(const wchar_t *jid) if (item) {
for (int i = 0; i < item->arResources.getCount(); i++) {
wchar_t szFullJid[JABBER_MAX_JID_LEN];
- mir_sntprintf(szFullJid, L"%s/%s", szBareJid, item->arResources[i]->m_tszResourceName);
+ mir_snwprintf(szFullJid, L"%s/%s", szBareJid, item->arResources[i]->m_tszResourceName);
JabberCapsBits jcb = GetResourceCapabilites(szFullJid, FALSE);
if (!(jcb & JABBER_RESOURCE_CAPS_ERROR))
jcbToReturn |= jcb;
@@ -240,7 +240,7 @@ JabberCapsBits CJabberProto::GetResourceCapabilites(const wchar_t *jid, BOOL app r->m_dwDiscoInfoRequestTime = pInfo->GetRequestTime();
wchar_t queryNode[512];
- mir_sntprintf(queryNode, L"%s#%s", r->m_tszCapsNode, r->m_tszCapsVer);
+ mir_snwprintf(queryNode, L"%s#%s", r->m_tszCapsNode, r->m_tszCapsVer);
m_ThreadInfo->send(XmlNodeIq(pInfo) << XQUERY(JABBER_FEAT_DISCO_INFO) << XATTR(L"node", queryNode));
bRequestSent = TRUE;
@@ -251,7 +251,7 @@ JabberCapsBits CJabberProto::GetResourceCapabilites(const wchar_t *jid, BOOL app jcbCaps |= jcbMainCaps;
if (jcbMainCaps != JABBER_RESOURCE_CAPS_TIMEOUT && r->m_tszCapsExt) {
- wchar_t *caps = mir_tstrdup(r->m_tszCapsExt);
+ wchar_t *caps = mir_wstrdup(r->m_tszCapsExt);
wchar_t *token = wcstok(caps, L" ");
while (token) {
@@ -349,17 +349,17 @@ JabberCapsBits CJabberProto::GetResourceCapabilites(const wchar_t *jid, BOOL app JabberCapsBits jcbMainCaps = m_clientCapsManager.GetClientCaps(r->m_tszSoftware, r->m_tszSoftwareVersion);
if (jcbMainCaps == JABBER_RESOURCE_CAPS_ERROR) {
// Bombus hack:
- if (!mir_tstrcmp(r->m_tszSoftware, L"Bombus") || !mir_tstrcmp(r->m_tszSoftware, L"BombusMod")) {
+ if (!mir_wstrcmp(r->m_tszSoftware, L"Bombus") || !mir_wstrcmp(r->m_tszSoftware, L"BombusMod")) {
jcbMainCaps = JABBER_CAPS_SI | JABBER_CAPS_SI_FT | JABBER_CAPS_IBB | JABBER_CAPS_MESSAGE_EVENTS | JABBER_CAPS_MESSAGE_EVENTS_NO_DELIVERY | JABBER_CAPS_DATA_FORMS | JABBER_CAPS_LAST_ACTIVITY | JABBER_CAPS_VERSION | JABBER_CAPS_COMMANDS | JABBER_CAPS_VCARD_TEMP;
m_clientCapsManager.SetClientCaps(r->m_tszSoftware, r->m_tszSoftwareVersion, jcbMainCaps);
}
// Neos hack:
- else if (!mir_tstrcmp(r->m_tszSoftware, L"neos")) {
+ else if (!mir_wstrcmp(r->m_tszSoftware, L"neos")) {
jcbMainCaps = JABBER_CAPS_OOB | JABBER_CAPS_MESSAGE_EVENTS | JABBER_CAPS_MESSAGE_EVENTS_NO_DELIVERY | JABBER_CAPS_LAST_ACTIVITY | JABBER_CAPS_VERSION;
m_clientCapsManager.SetClientCaps(r->m_tszSoftware, r->m_tszSoftwareVersion, jcbMainCaps);
}
// sim hack:
- else if (!mir_tstrcmp(r->m_tszSoftware, L"sim")) {
+ else if (!mir_wstrcmp(r->m_tszSoftware, L"sim")) {
jcbMainCaps = JABBER_CAPS_OOB | JABBER_CAPS_VERSION | JABBER_CAPS_MESSAGE_EVENTS | JABBER_CAPS_MESSAGE_EVENTS_NO_DELIVERY;
m_clientCapsManager.SetClientCaps(r->m_tszSoftware, r->m_tszSoftwareVersion, jcbMainCaps);
}
@@ -390,7 +390,7 @@ JabberCapsBits CJabberProto::GetResourceCapabilites(const wchar_t *jid, BOOL app CJabberClientPartialCaps::CJabberClientPartialCaps(const wchar_t *szVer)
{
- m_szVer = mir_tstrdup(szVer);
+ m_szVer = mir_wstrdup(szVer);
m_jcbCaps = JABBER_RESOURCE_CAPS_UNINIT;
m_pNext = NULL;
m_nIqId = -1;
@@ -437,7 +437,7 @@ CJabberClientPartialCaps* CJabberClientCaps::FindByVersion(const wchar_t *szVer) CJabberClientPartialCaps *pCaps = m_pCaps;
while (pCaps) {
- if (!mir_tstrcmp(szVer, pCaps->GetVersion()))
+ if (!mir_wstrcmp(szVer, pCaps->GetVersion()))
break;
pCaps = pCaps->GetNext();
}
@@ -463,7 +463,7 @@ CJabberClientPartialCaps* CJabberClientCaps::FindById(int nIqId) CJabberClientCaps::CJabberClientCaps(const wchar_t *szNode)
{
- m_szNode = mir_tstrdup(szNode);
+ m_szNode = mir_wstrdup(szNode);
m_pCaps = NULL;
m_pNext= NULL;
}
@@ -536,7 +536,7 @@ CJabberClientCaps * CJabberClientCapsManager::FindClient(const wchar_t *szNode) CJabberClientCaps *pClient = m_pClients;
while (pClient) {
- if (!mir_tstrcmp(szNode, pClient->GetNode()))
+ if (!mir_wstrcmp(szNode, pClient->GetNode()))
break;
pClient = pClient->GetNext();
}
@@ -615,8 +615,8 @@ BOOL CJabberClientCapsManager::HandleInfoRequest(HXML, CJabberIqInfo *pInfo, con continue;
wchar_t szExtCap[ 512 ];
- mir_sntprintf(szExtCap, L"%s#%s", JABBER_CAPS_MIRANDA_NODE, g_JabberFeatCapPairsExt[i].szFeature);
- if (!mir_tstrcmp(szNode, szExtCap)) {
+ mir_snwprintf(szExtCap, L"%s#%s", JABBER_CAPS_MIRANDA_NODE, g_JabberFeatCapPairsExt[i].szFeature);
+ if (!mir_wstrcmp(szNode, szExtCap)) {
jcb = g_JabberFeatCapPairsExt[i].jcbCap;
break;
}
@@ -625,8 +625,8 @@ BOOL CJabberClientCapsManager::HandleInfoRequest(HXML, CJabberIqInfo *pInfo, con // check features registered through IJabberNetInterface::RegisterFeature() and IJabberNetInterface::AddFeatures()
for (i=0; i < ppro->m_lstJabberFeatCapPairsDynamic.getCount(); i++) {
wchar_t szExtCap[ 512 ];
- mir_sntprintf(szExtCap, L"%s#%s", JABBER_CAPS_MIRANDA_NODE, ppro->m_lstJabberFeatCapPairsDynamic[i]->szExt);
- if (!mir_tstrcmp(szNode, szExtCap)) {
+ mir_snwprintf(szExtCap, L"%s#%s", JABBER_CAPS_MIRANDA_NODE, ppro->m_lstJabberFeatCapPairsDynamic[i]->szExt);
+ if (!mir_wstrcmp(szNode, szExtCap)) {
jcb = ppro->m_lstJabberFeatCapPairsDynamic[i]->jcbCap;
break;
}
@@ -668,10 +668,10 @@ BOOL CJabberClientCapsManager::HandleInfoRequest(HXML, CJabberIqInfo *pInfo, con if (ppro->m_options.ShowOSVersion) {
if (!GetOSDisplayString(szOsBuffer, _countof(szOsBuffer)))
- mir_tstrncpy(szOsBuffer, L"", _countof(szOsBuffer));
+ mir_wstrncpy(szOsBuffer, L"", _countof(szOsBuffer));
else {
wchar_t *szOsWindows = L"Microsoft Windows";
- size_t nOsWindowsLength = mir_tstrlen(szOsWindows);
+ size_t nOsWindowsLength = mir_wstrlen(szOsWindows);
if (!wcsnicmp(szOsBuffer, szOsWindows, nOsWindowsLength))
os += nOsWindowsLength + 1;
}
diff --git a/protocols/JabberG/src/jabber_captcha.cpp b/protocols/JabberG/src/jabber_captcha.cpp index 159b9c15a0..0de9eda1bb 100644 --- a/protocols/JabberG/src/jabber_captcha.cpp +++ b/protocols/JabberG/src/jabber_captcha.cpp @@ -158,7 +158,7 @@ bool CJabberProto::ProcessCaptcha(HXML node, HXML parentNode, ThreadData *info) param.w = bmp.bmWidth;
param.h = bmp.bmHeight;
int res = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_CAPTCHAFORM), NULL, JabberCaptchaFormDlgProc, (LPARAM)¶m);
- if (mir_tstrcmp(param.Result, L"") == 0 || !res)
+ if (mir_wstrcmp(param.Result, L"") == 0 || !res)
sendCaptchaError(info, param.from, param.to, param.challenge);
else
sendCaptchaResult(param.Result, info, param.from, param.challenge, param.fromjid, param.sid);
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index c260b23348..4f3cf9534c 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -126,7 +126,7 @@ int CJabberProto::GcInit(JABBER_LIST_ITEM *item) for (int i = 0; i < _countof(sttRoleItems); i++)
sttRoleItems[i].translate();
- ptrT szNick(JabberNickFromJID(item->jid));
+ ptrW szNick(JabberNickFromJID(item->jid));
GCSESSION gcw = { sizeof(GCSESSION) };
gcw.iType = GCW_CHATROOM;
@@ -141,22 +141,22 @@ int CJabberProto::GcInit(JABBER_LIST_ITEM *item) if (JABBER_LIST_ITEM *bookmark = ListGetItemPtr(LIST_BOOKMARK, item->jid)) {
if (bookmark->name) {
- ptrT myHandle(db_get_tsa(si->hContact, "CList", "MyHandle"));
+ ptrW myHandle(db_get_tsa(si->hContact, "CList", "MyHandle"));
if (myHandle == NULL)
db_set_ts(si->hContact, "CList", "MyHandle", bookmark->name);
}
}
- ptrT tszNick(getTStringA(si->hContact, "MyNick"));
+ ptrW tszNick(getTStringA(si->hContact, "MyNick"));
if (tszNick != NULL) {
- if (!mir_tstrcmp(tszNick, szNick))
+ if (!mir_wstrcmp(tszNick, szNick))
delSetting(si->hContact, "MyNick");
else
setTString(si->hContact, "MyNick", item->nick);
}
else setTString(si->hContact, "MyNick", item->nick);
- ptrT passw(getTStringA(si->hContact, "Password"));
+ ptrW passw(getTStringA(si->hContact, "Password"));
if (lstrcmp_null(passw, item->password)) {
if (!item->password || !item->password[0])
delSetting(si->hContact, "Password");
@@ -265,7 +265,7 @@ void CJabberProto::GcLogUpdateMemberStatus(JABBER_LIST_ITEM *item, const wchar_t szReason = TranslateT("user banned");
}
- ptrT myNick(mir_tstrdup(item->nick));
+ ptrW myNick(mir_wstrdup(item->nick));
if (myNick == NULL)
myNick = JabberNickFromJID(m_szJabberJID);
@@ -290,7 +290,7 @@ void CJabberProto::GcLogUpdateMemberStatus(JABBER_LIST_ITEM *item, const wchar_t mir_cslock lck(m_csLists);
for (int i = 0; i < item->arResources.getCount(); i++) {
JABBER_RESOURCE_STATUS *JS = item->arResources[i];
- if (!mir_tstrcmp(resource, JS->m_tszResourceName)) {
+ if (!mir_wstrcmp(resource, JS->m_tszResourceName)) {
if (action != GC_EVENT_JOIN) {
switch (action) {
case 0:
@@ -301,7 +301,7 @@ void CJabberProto::GcLogUpdateMemberStatus(JABBER_LIST_ITEM *item, const wchar_t gce.ptszText = TranslateT("Moderator");
}
gce.ptszStatus = TranslateTS(sttStatuses[JabberGcGetStatus(JS)]);
- gce.bIsMe = (mir_tstrcmp(nick, myNick) == 0);
+ gce.bIsMe = (mir_wstrcmp(nick, myNick) == 0);
statusToSet = JS->m_iStatus;
break;
}
@@ -331,14 +331,14 @@ void CJabberProto::GcQuit(JABBER_LIST_ITEM *item, int code, HXML reason) wchar_t *szMessage = NULL;
if (code != 307 && code != 301) {
- ptrT tszMessage(getTStringA("GcMsgQuit"));
+ ptrW tszMessage(getTStringA("GcMsgQuit"));
if (tszMessage != NULL)
szMessage = NEWWSTR_ALLOCA(tszMessage);
else
szMessage = TranslateTS(JABBER_GC_MSG_QUIT);
}
else {
- ptrT myNick(JabberNickFromJID(m_szJabberJID));
+ ptrW myNick(JabberNickFromJID(m_szJabberJID));
GcLogUpdateMemberStatus(item, myNick, myNick, NULL, GC_EVENT_KICK, reason);
}
@@ -353,7 +353,7 @@ void CJabberProto::GcQuit(JABBER_LIST_ITEM *item, int code, HXML reason) if (m_bJabberOnline) {
wchar_t szPresenceTo[JABBER_MAX_JID_LEN];
- mir_sntprintf(szPresenceTo, L"%s/%s", item->jid, item->nick);
+ mir_snwprintf(szPresenceTo, L"%s/%s", item->jid, item->nick);
m_ThreadInfo->send(
XmlNode(L"presence") << XATTR(L"to", szPresenceTo) << XATTR(L"type", L"unavailable")
@@ -513,9 +513,9 @@ int CJabberProto::JabberGcMenuHook(WPARAM, LPARAM lParam) pResourceStatus me(NULL), him(NULL);
for (int i = 0; i < item->arResources.getCount(); i++) {
JABBER_RESOURCE_STATUS *p = item->arResources[i];
- if (!mir_tstrcmp(p->m_tszResourceName, item->nick))
+ if (!mir_wstrcmp(p->m_tszResourceName, item->nick))
me = p;
- if (!mir_tstrcmp(p->m_tszResourceName, gcmi->pszUID))
+ if (!mir_wstrcmp(p->m_tszResourceName, gcmi->pszUID))
him = p;
}
@@ -537,7 +537,7 @@ int CJabberProto::JabberGcMenuHook(WPARAM, LPARAM lParam) wchar_t *bufPtr = url_buf;
for (wchar_t *p = wcsstr(ptszStatusMsg, L"http"); p && *p; p = wcsstr(p + 1, L"http")) {
if (!wcsncmp(p, L"http://", 7) || !wcsncmp(p, L"https://", 8)) {
- mir_tstrncpy(bufPtr, p, _countof(url_buf) - (bufPtr - url_buf));
+ mir_wstrncpy(bufPtr, p, _countof(url_buf) - (bufPtr - url_buf));
gc_item *pItem = sttFindGcMenuItem(gcmi, idx);
pItem->pszDesc = bufPtr;
pItem->uType = MENU_POPUPITEM;
@@ -602,7 +602,7 @@ int CJabberProto::JabberGcMenuHook(WPARAM, LPARAM lParam) }
if (him->m_tszRealJid && *him->m_tszRealJid) {
- mir_sntprintf(sttRJidBuf, TranslateT("Real &JID: %s"), him->m_tszRealJid);
+ mir_snwprintf(sttRJidBuf, TranslateT("Real &JID: %s"), him->m_tszRealJid);
if (wchar_t *tmp = wcschr(sttRJidBuf, '/')) *tmp = 0;
if (MCONTACT hContact = HContactFromJID(him->m_tszRealJid)) {
@@ -710,7 +710,7 @@ public: m_txtReason(this, IDC_REASON),
m_clc(this, IDC_CLIST)
{
- m_room = mir_tstrdup(room);
+ m_room = mir_wstrdup(room);
m_btnAddJid.OnClick = Callback(this, &CGroupchatInviteDlg::OnCommand_AddJid);
m_btnInvite.OnClick = Callback(this, &CGroupchatInviteDlg::OnCommand_Invite);
m_clc.OnNewContact =
@@ -755,17 +755,17 @@ public: int i;
for (i = 0; i < m_newJids.getCount(); i++)
- if (!mir_tstrcmp(m_newJids[i]->jid, buf))
+ if (!mir_wstrcmp(m_newJids[i]->jid, buf))
break;
if (i != m_newJids.getCount())
return;
JabberGcLogInviteDlgJidData *jidData = (JabberGcLogInviteDlgJidData *)mir_alloc(sizeof(JabberGcLogInviteDlgJidData));
- mir_tstrcpy(jidData->jid, buf);
+ mir_wstrcpy(jidData->jid, buf);
CLCINFOITEM cii = { 0 };
cii.cbSize = sizeof(cii);
cii.flags = CLCIIF_CHECKBOX;
- mir_sntprintf(buf, TranslateT("%s (not on roster)"), jidData->jid);
+ mir_snwprintf(buf, TranslateT("%s (not on roster)"), jidData->jid);
cii.pszText = buf;
jidData->hItem = SendDlgItemMessage(m_hwnd, IDC_CLIST, CLM_ADDINFOITEM, 0, (LPARAM)&cii);
SendDlgItemMessage(m_hwnd, IDC_CLIST, CLM_SETCHECKMARK, jidData->hItem, 1);
@@ -776,7 +776,7 @@ public: {
if (!m_room) return;
- ptrT text(m_txtReason.GetText());
+ ptrW text(m_txtReason.GetText());
HWND hwndList = GetDlgItem(m_hwnd, IDC_CLIST);
// invite users from roster
@@ -786,7 +786,7 @@ public: if (int hItem = SendMessage(hwndList, CLM_FINDCONTACT, hContact, 0)) {
if (SendMessage(hwndList, CLM_GETCHECKMARK, (WPARAM)hItem, 0)) {
- ptrT jid(m_proto->getTStringA(hContact, "jid"));
+ ptrW jid(m_proto->getTStringA(hContact, "jid"));
if (jid != NULL)
InviteUser(jid, text);
}
@@ -860,7 +860,7 @@ static INT_PTR CALLBACK sttUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam SendDlgItemMessage(hwndDlg, IDC_ICO_STATUS, STM_SETICON, (WPARAM)Skin_LoadProtoIcon(dat->ppro->m_szModuleName, dat->him->m_iStatus), 0);
wchar_t buf[256];
- mir_sntprintf(buf, TranslateT("%s from\n%s"), dat->him->m_tszResourceName, dat->item->jid);
+ mir_snwprintf(buf, TranslateT("%s from\n%s"), dat->him->m_tszResourceName, dat->item->jid);
SetDlgItemText(hwndDlg, IDC_HEADERBAR, buf);
SetDlgItemText(hwndDlg, IDC_TXT_NICK, dat->him->m_tszResourceName);
@@ -1010,17 +1010,17 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* switch (gch->dwData) {
case IDM_SLAP:
if (ppro->m_bJabberOnline) {
- ptrT szMessage(ppro->getTStringA("GcMsgSlap"));
+ ptrW szMessage(ppro->getTStringA("GcMsgSlap"));
if (szMessage == NULL)
- szMessage = mir_tstrdup(TranslateTS(JABBER_GC_MSG_SLAP));
+ szMessage = mir_wstrdup(TranslateTS(JABBER_GC_MSG_SLAP));
wchar_t buf[256];
// do not use snprintf to avoid possible problems with % symbol
if (wchar_t *p = wcsstr(szMessage, L"%s")) {
*p = 0;
- mir_sntprintf(buf, L"%s%s%s", szMessage, him->m_tszResourceName, p + 2);
+ mir_snwprintf(buf, L"%s%s%s", szMessage, him->m_tszResourceName, p + 2);
}
- else mir_tstrncpy(buf, szMessage, _countof(buf));
+ else mir_wstrncpy(buf, szMessage, _countof(buf));
UnEscapeChatTags(buf);
ppro->m_ThreadInfo->send(
@@ -1060,7 +1060,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* dwLastBanKickTime = GetTickCount();
szBuffer.Format(L"%s: ", me->m_tszResourceName);
szTitle.Format(TranslateT("Reason to kick %s"), him->m_tszResourceName);
- wchar_t *resourceName_copy = mir_tstrdup(him->m_tszResourceName); // copy resource name to prevent possible crash if user list rebuilds
+ wchar_t *resourceName_copy = mir_wstrdup(him->m_tszResourceName); // copy resource name to prevent possible crash if user list rebuilds
if (ppro->EnterString(szBuffer, szTitle, ESF_MULTILINE, "gcReason_"))
ppro->m_ThreadInfo->send(
XmlNodeIq(L"set", ppro->SerialNext(), item->jid) << XQUERY(JABBER_FEAT_MUC_ADMIN)
@@ -1279,7 +1279,7 @@ static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* g if (ppro->EnterString(szBuffer, szTitle, ESF_COMBO, "gcNick_")) {
if (ppro->ListGetItemPtr(LIST_CHATROOM, gch->pDest->ptszID) != NULL) {
wchar_t text[1024];
- mir_sntprintf(text, L"%s/%s", gch->pDest->ptszID, szBuffer);
+ mir_snwprintf(text, L"%s/%s", gch->pDest->ptszID, szBuffer);
ppro->SendPresenceTo(ppro->m_iStatus == ID_STATUS_INVISIBLE ? ID_STATUS_ONLINE : ppro->m_iStatus, text, NULL);
}
}
@@ -1335,7 +1335,7 @@ static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* g int idx = IDM_LINK0;
for (wchar_t *p = wcsstr(item->getTemp()->m_tszStatusMessage, L"http://"); p && *p; p = wcsstr(p + 1, L"http://")) {
if (idx == gch->dwData) {
- char *bufPtr, *url = mir_t2a(p);
+ char *bufPtr, *url = mir_u2a(p);
for (bufPtr = url; *bufPtr && !isspace(*bufPtr); ++bufPtr);
*bufPtr++ = 0;
Utils_OpenUrl(url);
@@ -1364,7 +1364,7 @@ static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* g static void sttSendPrivateMessage(CJabberProto *ppro, JABBER_LIST_ITEM *item, const wchar_t *nick)
{
wchar_t szFullJid[JABBER_MAX_JID_LEN];
- mir_sntprintf(szFullJid, L"%s/%s", item->jid, nick);
+ mir_snwprintf(szFullJid, L"%s/%s", item->jid, nick);
MCONTACT hContact = ppro->DBCreateContact(szFullJid, NULL, true, false);
if (hContact != NULL) {
pResourceStatus r(item->findResource(nick));
@@ -1396,8 +1396,8 @@ int CJabberProto::JabberGcEventHook(WPARAM, LPARAM lParam) switch (gch->pDest->iType) {
case GC_USER_MESSAGE:
- if (gch->ptszText && mir_tstrlen(gch->ptszText) > 0) {
- rtrimt(gch->ptszText);
+ if (gch->ptszText && mir_wstrlen(gch->ptszText) > 0) {
+ rtrimw(gch->ptszText);
if (m_bJabberOnline) {
wchar_t tszID[100];
diff --git a/protocols/JabberG/src/jabber_console.cpp b/protocols/JabberG/src/jabber_console.cpp index 3070d0b223..28af8638a0 100644 --- a/protocols/JabberG/src/jabber_console.cpp +++ b/protocols/JabberG/src/jabber_console.cpp @@ -116,9 +116,9 @@ bool CJabberProto::RecursiveCheckFilter(HXML node, DWORD flags) bool CJabberProto::FilterXml(HXML node, DWORD flags)
{
- if (!m_filterInfo.msg && !mir_tstrcmp(XmlGetName(node), L"message")) return false;
- if (!m_filterInfo.presence && !mir_tstrcmp(XmlGetName(node), L"presence")) return false;
- if (!m_filterInfo.iq && !mir_tstrcmp(XmlGetName(node), L"iq")) return false;
+ if (!m_filterInfo.msg && !mir_wstrcmp(XmlGetName(node), L"message")) return false;
+ if (!m_filterInfo.presence && !mir_wstrcmp(XmlGetName(node), L"presence")) return false;
+ if (!m_filterInfo.iq && !mir_wstrcmp(XmlGetName(node), L"iq")) return false;
if (m_filterInfo.type == TFilterInfo::T_OFF) return true;
mir_cslock lck(m_filterInfo.csPatternLock);
@@ -346,9 +346,9 @@ void CJabberDlgConsole::OnInitDialog() m_proto->m_filterInfo.type = (TFilterInfo::Type)m_proto->getByte("consoleWnd_ftype", TFilterInfo::T_OFF);
*m_proto->m_filterInfo.pattern = 0;
- ptrT tszPattern( m_proto->getTStringA("consoleWnd_fpattern"));
+ ptrW tszPattern( m_proto->getTStringA("consoleWnd_fpattern"));
if (tszPattern != NULL)
- mir_tstrncpy(m_proto->m_filterInfo.pattern, tszPattern, _countof(m_proto->m_filterInfo.pattern));
+ mir_wstrncpy(m_proto->m_filterInfo.pattern, tszPattern, _countof(m_proto->m_filterInfo.pattern));
sttJabberConsoleRebuildStrings(m_proto, GetDlgItem(m_hwnd, IDC_CB_FILTER));
SetDlgItemText(m_hwnd, IDC_CB_FILTER, m_proto->m_filterInfo.pattern);
@@ -552,7 +552,7 @@ INT_PTR CJabberDlgConsole::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) if (len > _countof(m_proto->m_filterInfo.pattern)) {
wchar_t *buf = (wchar_t *)_alloca(len * sizeof(wchar_t));
SendDlgItemMessage(m_hwnd, IDC_CB_FILTER, CB_GETLBTEXT, idx, (LPARAM)buf);
- mir_tstrncpy(m_proto->m_filterInfo.pattern, buf, _countof(m_proto->m_filterInfo.pattern));
+ mir_wstrncpy(m_proto->m_filterInfo.pattern, buf, _countof(m_proto->m_filterInfo.pattern));
}
else SendDlgItemMessage(m_hwnd, IDC_CB_FILTER, CB_GETLBTEXT, idx, (LPARAM)m_proto->m_filterInfo.pattern);
}
diff --git a/protocols/JabberG/src/jabber_disco.cpp b/protocols/JabberG/src/jabber_disco.cpp index e93545ca06..9f2d52f03e 100644 --- a/protocols/JabberG/src/jabber_disco.cpp +++ b/protocols/JabberG/src/jabber_disco.cpp @@ -262,7 +262,7 @@ void CJabberProto::OnIqResultServiceDiscoveryRootInfo(HXML iqNode, CJabberIqInfo if (query) {
HXML feature;
for (int i = 1; (feature = XmlGetNthChild(query, L"feature", i)) != NULL; i++) {
- if (!mir_tstrcmp(XmlGetAttrValue(feature, L"var"), (wchar_t *)pInfo->m_pUserData)) {
+ if (!mir_wstrcmp(XmlGetAttrValue(feature, L"var"), (wchar_t *)pInfo->m_pUserData)) {
CJabberSDNode *pNode = m_SDManager.AddPrimaryNode(pInfo->GetReceiver(), XmlGetAttrValue(iqNode, L"node"), NULL);
SendBothRequests(pNode, NULL);
break;
@@ -402,7 +402,7 @@ void CJabberProto::PerformBrowse(HWND hwndDlg) mir_cslockfull lck(m_SDManager.cs());
m_SDManager.RemoveAll();
- if (!mir_tstrcmp(szJid, _T(SD_FAKEJID_MYAGENTS))) {
+ if (!mir_wstrcmp(szJid, _T(SD_FAKEJID_MYAGENTS))) {
sttBrowseMode = SD_BROWSE_MYAGENTS;
JABBER_LIST_ITEM *item = NULL;
LISTFOREACH(i, this, LIST_ROSTER)
@@ -414,7 +414,7 @@ void CJabberProto::PerformBrowse(HWND hwndDlg) setByte(hContact, "IsTransport", TRUE);
if (m_lstTransports.getIndex(item->jid) == -1)
- m_lstTransports.insert(mir_tstrdup(item->jid));
+ m_lstTransports.insert(mir_wstrdup(item->jid));
CJabberSDNode *pNode = m_SDManager.AddPrimaryNode(item->jid, NULL, NULL);
SendBothRequests(pNode, NULL);
@@ -422,9 +422,9 @@ void CJabberProto::PerformBrowse(HWND hwndDlg) }
}
}
- else if (!mir_tstrcmp(szJid, _T(SD_FAKEJID_CONFERENCES))) {
+ else if (!mir_wstrcmp(szJid, _T(SD_FAKEJID_CONFERENCES))) {
sttBrowseMode = SD_BROWSE_CONFERENCES;
- wchar_t *szServerJid = mir_a2t(m_ThreadInfo->conn.server);
+ wchar_t *szServerJid = mir_a2u(m_ThreadInfo->conn.server);
CJabberIqInfo *pInfo = AddIQ(&CJabberProto::OnIqResultServiceDiscoveryRootItems, JABBER_IQ_TYPE_GET, szServerJid);
pInfo->m_pUserData = (void*)JABBER_FEAT_MUC;
pInfo->SetTimeout(30000);
@@ -433,9 +433,9 @@ void CJabberProto::PerformBrowse(HWND hwndDlg) m_ThreadInfo->send(iq);
mir_free(szServerJid);
}
- else if (!mir_tstrcmp(szJid, _T(SD_FAKEJID_AGENTS))) {
+ else if (!mir_wstrcmp(szJid, _T(SD_FAKEJID_AGENTS))) {
sttBrowseMode = SD_BROWSE_AGENTS;
- wchar_t *szServerJid = mir_a2t(m_ThreadInfo->conn.server);
+ wchar_t *szServerJid = mir_a2u(m_ThreadInfo->conn.server);
CJabberIqInfo *pInfo = AddIQ(&CJabberProto::OnIqResultServiceDiscoveryRootItems, JABBER_IQ_TYPE_GET, szServerJid);
pInfo->m_pUserData = (void*)L"jabber:iq:gateway";
pInfo->SetTimeout(30000);
@@ -444,27 +444,27 @@ void CJabberProto::PerformBrowse(HWND hwndDlg) m_ThreadInfo->send(iq);
mir_free(szServerJid);
}
- else if (!mir_tstrcmp(szJid, _T(SD_FAKEJID_FAVORITES))) {
+ else if (!mir_wstrcmp(szJid, _T(SD_FAKEJID_FAVORITES))) {
sttBrowseMode = SD_BROWSE_FAVORITES;
int count = getDword("discoWnd_favCount", 0);
for (int i = 0; i < count; i++) {
char setting[MAXMODULELABELLENGTH];
mir_snprintf(setting, "discoWnd_favName_%d", i);
- ptrT tszName(getTStringA(setting));
+ ptrW tszName(getTStringA(setting));
if (tszName == NULL)
continue;
mir_snprintf(setting, "discoWnd_favJID_%d", i);
- ptrT dbvJid(getTStringA(setting));
+ ptrW dbvJid(getTStringA(setting));
mir_snprintf(setting, "discoWnd_favNode_%d", i);
- ptrT dbvNode(getTStringA(setting));
+ ptrW dbvNode(getTStringA(setting));
CJabberSDNode *pNode = m_SDManager.AddPrimaryNode(dbvJid, dbvNode, tszName);
SendBothRequests(pNode, NULL);
}
}
else {
sttBrowseMode = SD_BROWSE_NORMAL;
- CJabberSDNode *pNode = m_SDManager.AddPrimaryNode(szJid, mir_tstrlen(szNode) ? szNode : NULL, NULL);
+ CJabberSDNode *pNode = m_SDManager.AddPrimaryNode(szJid, mir_wstrlen(szNode) ? szNode : NULL, NULL);
SendBothRequests(pNode, NULL);
}
lck.unlock();
@@ -518,8 +518,8 @@ void CJabberProto::ApplyNodeIcon(HTREELISTITEM hItem, CJabberSDNode *pNode) if (sttNodeIcons[i].category) {
CJabberSDIdentity *iIdentity;
for (iIdentity = pNode->GetFirstIdentity(); iIdentity; iIdentity = iIdentity->GetNext())
- if (!mir_tstrcmp(iIdentity->GetCategory(), sttNodeIcons[i].category) &&
- (!sttNodeIcons[i].type || !mir_tstrcmp(iIdentity->GetType(), sttNodeIcons[i].type))) {
+ if (!mir_wstrcmp(iIdentity->GetCategory(), sttNodeIcons[i].category) &&
+ (!sttNodeIcons[i].type || !mir_wstrcmp(iIdentity->GetType(), sttNodeIcons[i].type))) {
iIcon = sttNodeIcons[i].listIndex;
break;
}
@@ -529,7 +529,7 @@ void CJabberProto::ApplyNodeIcon(HTREELISTITEM hItem, CJabberSDNode *pNode) if (sttNodeIcons[i].feature) {
CJabberSDFeature *iFeature;
for (iFeature = pNode->GetFirstFeature(); iFeature; iFeature = iFeature->GetNext())
- if (!mir_tstrcmp(iFeature->GetVar(), sttNodeIcons[i].feature)) {
+ if (!mir_wstrcmp(iFeature->GetVar(), sttNodeIcons[i].feature)) {
iIcon = sttNodeIcons[i].listIndex;
break;
}
@@ -802,7 +802,7 @@ void CJabberDlgDiscovery::btnBookmarks_OnClick(CCtrlButton *) for (int i = 0; i < count; i++) {
char setting[MAXMODULELABELLENGTH];
mir_snprintf(setting, "discoWnd_favName_%d", i);
- ptrT tszName(m_proto->getTStringA(setting));
+ ptrW tszName(m_proto->getTStringA(setting));
if (tszName != NULL) {
HMENU hSubMenu = CreatePopupMenu();
AppendMenu(hSubMenu, MF_STRING, 100 + i * 10 + 0, TranslateT("Navigate"));
@@ -851,7 +851,7 @@ void CJabberDlgDiscovery::btnBookmarks_OnClick(CCtrlButton *) char setting[MAXMODULELABELLENGTH];
mir_snprintf(setting, "discoWnd_favJID_%d", res);
- ptrT dbv(m_proto->getTStringA(setting));
+ ptrW dbv(m_proto->getTStringA(setting));
if (dbv) SetDlgItemText(m_hwnd, IDC_COMBO_JID, dbv);
mir_snprintf(setting, "discoWnd_favNode_%d", res);
@@ -1250,7 +1250,7 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM bool bFeatureOk = !bFilterItems;
if (bFilterItems)
for (CJabberSDFeature *iFeature = pNode->GetFirstFeature(); iFeature; iFeature = iFeature->GetNext())
- if (!mir_tstrcmp(iFeature->GetVar(), items[i].feature)) {
+ if (!mir_wstrcmp(iFeature->GetVar(), items[i].feature)) {
bFeatureOk = true;
break;
}
@@ -1381,7 +1381,7 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM item = ListAdd(LIST_ROOM, pNode->GetJid());
if (item == NULL)
break;
- item->name = mir_tstrdup(pNode->GetName());
+ item->name = mir_wstrdup(pNode->GetName());
}
item->type = L"conference";
diff --git a/protocols/JabberG/src/jabber_disco.h b/protocols/JabberG/src/jabber_disco.h index 486d4c7289..ecc55393e6 100644 --- a/protocols/JabberG/src/jabber_disco.h +++ b/protocols/JabberG/src/jabber_disco.h @@ -43,9 +43,9 @@ protected: public:
CJabberSDIdentity(const wchar_t *szCategory, const wchar_t *szType, const wchar_t *szName)
{
- m_szCategory = mir_tstrdup(szCategory);
- m_szType = mir_tstrdup(szType);
- m_szName = mir_tstrdup(szName);
+ m_szCategory = mir_wstrdup(szCategory);
+ m_szType = mir_wstrdup(szType);
+ m_szName = mir_wstrdup(szName);
m_pNext = NULL;
}
~CJabberSDIdentity()
@@ -89,7 +89,7 @@ protected: public:
CJabberSDFeature(const wchar_t *szVar)
{
- m_szVar = szVar ? mir_tstrdup(szVar) : NULL;
+ m_szVar = szVar ? mir_wstrdup(szVar) : NULL;
m_pNext = NULL;
}
~CJabberSDFeature()
@@ -134,9 +134,9 @@ protected: public:
CJabberSDNode(const wchar_t *szJid = NULL, const wchar_t *szNode = NULL, const wchar_t *szName = NULL)
{
- m_szJid = mir_tstrdup(szJid);
- m_szNode = mir_tstrdup(szNode);
- m_szName = mir_tstrdup(szName);
+ m_szJid = mir_wstrdup(szJid);
+ m_szNode = mir_wstrdup(szNode);
+ m_szName = mir_wstrdup(szName);
m_pIdentities = NULL;
m_pFeatures = NULL;
m_pNext = NULL;
@@ -155,11 +155,11 @@ public: }
BOOL RemoveAll()
{
- replaceStrT(m_szJid, NULL);
- replaceStrT(m_szNode, NULL);
- replaceStrT(m_szName, NULL);
- replaceStrT(m_szInfoError, NULL);
- replaceStrT(m_szItemsError, NULL);
+ replaceStrW(m_szJid, NULL);
+ replaceStrW(m_szNode, NULL);
+ replaceStrW(m_szName, NULL);
+ replaceStrW(m_szInfoError, NULL);
+ replaceStrW(m_szItemsError, NULL);
if (m_pIdentities)
delete m_pIdentities;
m_pIdentities = NULL;
@@ -181,8 +181,8 @@ public: }
BOOL ResetInfo()
{
- replaceStrT(m_szInfoError, NULL);
- replaceStrT(m_szItemsError, NULL);
+ replaceStrW(m_szInfoError, NULL);
+ replaceStrW(m_szItemsError, NULL);
if (m_pIdentities)
delete m_pIdentities;
m_pIdentities = NULL;
@@ -229,7 +229,7 @@ public: }
BOOL SetJid(wchar_t *szJid)
{
- replaceStrT(m_szJid, szJid);
+ replaceStrW(m_szJid, szJid);
return TRUE;
}
wchar_t *GetJid()
@@ -238,7 +238,7 @@ public: }
BOOL SetNode(wchar_t *szNode)
{
- replaceStrT(m_szNode, szNode);
+ replaceStrW(m_szNode, szNode);
return TRUE;
}
wchar_t *GetNode()
@@ -335,13 +335,13 @@ public: BOOL SetItemsRequestErrorText(wchar_t *szError)
{
- replaceStrT(m_szItemsError, szError);
+ replaceStrW(m_szItemsError, szError);
return TRUE;
}
BOOL SetInfoRequestErrorText(wchar_t *szError)
{
- replaceStrT(m_szInfoError, szError);
+ replaceStrW(m_szInfoError, szError);
return TRUE;
}
diff --git a/protocols/JabberG/src/jabber_events.cpp b/protocols/JabberG/src/jabber_events.cpp index 24580a5207..61aecd3a6b 100644 --- a/protocols/JabberG/src/jabber_events.cpp +++ b/protocols/JabberG/src/jabber_events.cpp @@ -36,7 +36,7 @@ int CJabberProto::OnContactDeleted(WPARAM hContact, LPARAM) if (!m_bJabberOnline) // should never happen
return 0;
- ptrT jid(getTStringA(hContact, isChatRoom(hContact) ? "ChatRoomID" : "jid"));
+ ptrW jid(getTStringA(hContact, isChatRoom(hContact) ? "ChatRoomID" : "jid"));
if (jid == NULL)
return 0;
@@ -45,7 +45,7 @@ int CJabberProto::OnContactDeleted(WPARAM hContact, LPARAM) wchar_t szStrippedJid[JABBER_MAX_JID_LEN];
JabberStripJid(m_ThreadInfo->fullJID, szStrippedJid, _countof(szStrippedJid));
wchar_t *szDog = wcschr(szStrippedJid, '@');
- if (szDog && mir_tstrcmpi(szDog + 1, jid))
+ if (szDog && mir_wstrcmpi(szDog + 1, jid))
m_ThreadInfo->send(XmlNodeIq(L"set", SerialNext(), jid) << XQUERY(JABBER_FEAT_REGISTER) << XCHILD(L"remove"));
}
@@ -63,24 +63,24 @@ static wchar_t* sttSettingToTchar(DBCONTACTWRITESETTING *cws) {
switch (cws->value.type) {
case DBVT_ASCIIZ:
- return mir_a2t(cws->value.pszVal);
+ return mir_a2u(cws->value.pszVal);
case DBVT_UTF8:
- return mir_utf8decodeT(cws->value.pszVal);
+ return mir_utf8decodeW(cws->value.pszVal);
case DBVT_WCHAR:
- return mir_u2t(cws->value.pwszVal);
+ return mir_wstrdup(cws->value.pwszVal);
}
return NULL;
}
void __cdecl CJabberProto::OnRenameGroup(DBCONTACTWRITESETTING *cws, MCONTACT hContact)
{
- JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, ptrT(getTStringA(hContact, "jid")));
+ JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, ptrW(getTStringA(hContact, "jid")));
if (item == NULL)
return;
- ptrT tszNick(db_get_tsa(hContact, "CList", "MyHandle"));
+ ptrW tszNick(db_get_tsa(hContact, "CList", "MyHandle"));
if (tszNick == NULL)
tszNick = getTStringA(hContact, "Nick");
if (tszNick == NULL)
@@ -96,7 +96,7 @@ void __cdecl CJabberProto::OnRenameGroup(DBCONTACTWRITESETTING *cws, MCONTACT hC }
else {
wchar_t *p = sttSettingToTchar(cws);
- if (cws->value.pszVal != NULL && mir_tstrcmp(p, item->group)) {
+ if (cws->value.pszVal != NULL && mir_wstrcmp(p, item->group)) {
debugLog(L"Group set to %s", p);
if (p)
AddContactToRoster(item->jid, tszNick, p);
@@ -107,7 +107,7 @@ void __cdecl CJabberProto::OnRenameGroup(DBCONTACTWRITESETTING *cws, MCONTACT hC void __cdecl CJabberProto::OnRenameContact(DBCONTACTWRITESETTING *cws, MCONTACT hContact)
{
- JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, ptrT( getTStringA(hContact, "jid")));
+ JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, ptrW( getTStringA(hContact, "jid")));
if (item == NULL)
return;
@@ -118,8 +118,8 @@ void __cdecl CJabberProto::OnRenameContact(DBCONTACTWRITESETTING *cws, MCONTACT return;
}
- ptrT newNick( sttSettingToTchar(cws));
- if (newNick && mir_tstrcmp(item->nick, newNick)) {
+ ptrW newNick( sttSettingToTchar(cws));
+ if (newNick && mir_wstrcmp(item->nick, newNick)) {
debugLog(L"Renaming contact %s: %s -> %s", item->jid, item->nick, newNick);
AddContactToRoster(item->jid, newNick, item->group);
}
@@ -130,12 +130,12 @@ void __cdecl CJabberProto::OnAddContactForever(DBCONTACTWRITESETTING *cws, MCONT if (cws->value.type != DBVT_DELETED && !(cws->value.type == DBVT_BYTE && cws->value.bVal == 0))
return;
- ptrT jid(getTStringA(hContact, "jid"));
+ ptrW jid(getTStringA(hContact, "jid"));
if (jid == NULL)
return;
debugLog(L"Add %s permanently to list", jid);
- ptrT nick(db_get_tsa(hContact, "CList", "MyHandle"));
+ ptrW nick(db_get_tsa(hContact, "CList", "MyHandle"));
if (nick == NULL)
nick = getTStringA(hContact, "Nick");
if (nick == NULL)
@@ -143,10 +143,10 @@ void __cdecl CJabberProto::OnAddContactForever(DBCONTACTWRITESETTING *cws, MCONT if (nick == NULL)
return;
- AddContactToRoster(jid, nick, ptrT(db_get_tsa(hContact, "CList", "Group")));
+ AddContactToRoster(jid, nick, ptrW(db_get_tsa(hContact, "CList", "Group")));
XmlNode xPresence(L"presence"); xPresence << XATTR(L"to", LPCTSTR(jid)) << XATTR(L"type", L"subscribe");
- ptrT myNick(getTStringA(NULL, "Nick"));
+ ptrW myNick(getTStringA(NULL, "Nick"));
if (myNick != NULL)
xPresence << XCHILD(L"nick", LPCTSTR(myNick)) << XATTR(L"xmlns", JABBER_FEAT_NICK);
m_ThreadInfo->send(xPresence);
diff --git a/protocols/JabberG/src/jabber_file.cpp b/protocols/JabberG/src/jabber_file.cpp index a3e2c0776f..27eda280b2 100644 --- a/protocols/JabberG/src/jabber_file.cpp +++ b/protocols/JabberG/src/jabber_file.cpp @@ -118,7 +118,7 @@ int CJabberProto::FileReceiveParse(filetransfer *ft, char* buffer, int datalen) s++;
else
s = ft->httpPath;
- ft->std.tszCurrentFile = mir_tstrdup(s);
+ ft->std.tszCurrentFile = mir_wstrdup(s);
JabberHttpUrlDecode(ft->std.tszCurrentFile);
if (ft->create() == -1) {
ft->state = FT_ERROR;
@@ -179,7 +179,7 @@ void JabberFileServerConnection(JABBER_SOCKET hConnection, DWORD /*dwRemoteIP*/, CallService(MS_NETLIB_GETCONNECTIONINFO, (WPARAM)hConnection, (LPARAM)&connInfo);
wchar_t szPort[10];
- mir_sntprintf(szPort, L"%d", connInfo.wPort);
+ mir_snwprintf(szPort, L"%d", connInfo.wPort);
ppro->debugLogA("File server incoming connection accepted: %s", connInfo.szIpPort);
JABBER_LIST_ITEM *item = ppro->ListGetItemPtr(LIST_FILE, szPort);
@@ -260,7 +260,7 @@ void __cdecl CJabberProto::FileServerThread(filetransfer *ft) ft->hFileEvent = hEvent;
wchar_t szPort[20];
- mir_sntprintf(szPort, L"%d", nlb.wPort);
+ mir_snwprintf(szPort, L"%d", nlb.wPort);
JABBER_LIST_ITEM *item = ListAdd(LIST_FILE, szPort);
item->ft = ft;
@@ -292,9 +292,9 @@ void __cdecl CJabberProto::FileServerThread(filetransfer *ft) char szAddr[256];
mir_snprintf(szAddr, "http://%s:%d/%s", myAddr, nlb.wPort, pFileName);
- size_t len = mir_tstrlen(ptszResource) + mir_tstrlen(ft->jid) + 2;
+ size_t len = mir_wstrlen(ptszResource) + mir_wstrlen(ft->jid) + 2;
wchar_t *fulljid = (wchar_t *)alloca(sizeof(wchar_t) * len);
- mir_sntprintf(fulljid, len, L"%s/%s", ft->jid, ptszResource);
+ mir_snwprintf(fulljid, len, L"%s/%s", ft->jid, ptszResource);
XmlNodeIq iq(L"set", ft->szId, fulljid);
HXML query = iq << XQUERY(JABBER_FEAT_OOB);
@@ -366,7 +366,7 @@ int CJabberProto::FileSendParse(JABBER_SOCKET s, filetransfer *ft, char* buffer, for (t = str + 4; *t != '\0' && *t != ' '; t++);
*t = '\0';
for (t = str + 4; *t != '\0' && *t == '/'; t++);
- ft->httpPath = mir_a2t(t);
+ ft->httpPath = mir_a2u(t);
JabberHttpUrlDecode(ft->httpPath);
ft->state = FT_INITIALIZING;
debugLogA("Change to FT_INITIALIZING");
@@ -386,7 +386,7 @@ int CJabberProto::FileSendParse(JABBER_SOCKET s, filetransfer *ft, char* buffer, else
t = ft->std.ptszFiles[currentFile];
- if (ft->httpPath == NULL || mir_tstrcmp(ft->httpPath, t)) {
+ if (ft->httpPath == NULL || mir_wstrcmp(ft->httpPath, t)) {
if (ft->httpPath == NULL)
debugLogA("Requested file name does not matched (httpPath == NULL)");
else
@@ -501,8 +501,8 @@ int filetransfer::create() return fileId;
wchar_t filefull[MAX_PATH];
- mir_sntprintf(filefull, L"%s\\%s", std.tszWorkingDir, std.tszCurrentFile);
- replaceStrT(std.tszCurrentFile, filefull);
+ mir_snwprintf(filefull, L"%s\\%s", std.tszWorkingDir, std.tszCurrentFile);
+ replaceStrW(std.tszCurrentFile, filefull);
if (hWaitEvent != INVALID_HANDLE_VALUE)
CloseHandle(hWaitEvent);
diff --git a/protocols/JabberG/src/jabber_form.cpp b/protocols/JabberG/src/jabber_form.cpp index a74abfae40..ceabe55ba9 100644 --- a/protocols/JabberG/src/jabber_form.cpp +++ b/protocols/JabberG/src/jabber_form.cpp @@ -110,7 +110,7 @@ void JabberFormSetInstruction(HWND hwndForm, const wchar_t *text) {
if (!text) text = L"";
- size_t len = mir_tstrlen(text);
+ size_t len = mir_wstrlen(text);
size_t fixedLen = len;
for (int i = 1; i < len; i++)
if ((text[i - 1] == '\n') && (text[i] != '\r'))
@@ -142,7 +142,7 @@ void JabberFormSetInstruction(HWND hwndForm, const wchar_t *text) SetRect(&rcText, 0, 0, rcText.right - rcText.left, 0);
HDC hdcEdit = GetDC(GetDlgItem(hwndForm, IDC_INSTRUCTION));
HFONT hfntSave = (HFONT)SelectObject(hdcEdit, (HFONT)SendDlgItemMessage(hwndForm, IDC_INSTRUCTION, WM_GETFONT, 0, 0));
- DrawTextEx(hdcEdit, (wchar_t *)text, (int)mir_tstrlen(text), &rcText, DT_CALCRECT | DT_EDITCONTROL | DT_TOP | DT_WORDBREAK, NULL);
+ DrawTextEx(hdcEdit, (wchar_t *)text, (int)mir_wstrlen(text), &rcText, DT_CALCRECT | DT_EDITCONTROL | DT_TOP | DT_WORDBREAK, NULL);
SelectObject(hdcEdit, hfntSave);
ReleaseDC(GetDlgItem(hwndForm, IDC_INSTRUCTION), hdcEdit);
@@ -205,19 +205,19 @@ void JabberFormSetInstruction(HWND hwndForm, const wchar_t *text) static TJabberFormControlType JabberFormTypeNameToId(const wchar_t *type)
{
- if (!mir_tstrcmp(type, L"text-private"))
+ if (!mir_wstrcmp(type, L"text-private"))
return JFORM_CTYPE_TEXT_PRIVATE;
- if (!mir_tstrcmp(type, L"text-multi") || !mir_tstrcmp(type, L"jid-multi"))
+ if (!mir_wstrcmp(type, L"text-multi") || !mir_wstrcmp(type, L"jid-multi"))
return JFORM_CTYPE_TEXT_MULTI;
- if (!mir_tstrcmp(type, L"boolean"))
+ if (!mir_wstrcmp(type, L"boolean"))
return JFORM_CTYPE_BOOLEAN;
- if (!mir_tstrcmp(type, L"list-single"))
+ if (!mir_wstrcmp(type, L"list-single"))
return JFORM_CTYPE_LIST_SINGLE;
- if (!mir_tstrcmp(type, L"list-multi"))
+ if (!mir_wstrcmp(type, L"list-multi"))
return JFORM_CTYPE_LIST_MULTI;
- if (!mir_tstrcmp(type, L"fixed"))
+ if (!mir_wstrcmp(type, L"fixed"))
return JFORM_CTYPE_FIXED;
- if (!mir_tstrcmp(type, L"hidden"))
+ if (!mir_wstrcmp(type, L"hidden"))
return JFORM_CTYPE_HIDDEN;
return JFORM_CTYPE_TEXT_SINGLE;
@@ -323,7 +323,7 @@ TJabberFormControlInfo *JabberFormAppendControl(HWND hwndStatic, TJabberFormLayo WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_AUTOCHECKBOX | BS_MULTILINE,
0, 0, 0, 0,
hwndStatic, (HMENU)layout_info->id, hInst, NULL);
- if (valueStr && !mir_tstrcmp(valueStr, L"1"))
+ if (valueStr && !mir_wstrcmp(valueStr, L"1"))
SendMessage(item->hCtrl, BM_SETCHECK, 1, 0);
++layout_info->id;
break;
@@ -440,7 +440,7 @@ void JabberFormCreateUI(HWND hwndStatic, HXML xNode, int *formHeight, BOOL bComp wchar_t *labelStr, *valueStr;
RECT frameRect;
- if (xNode == NULL || XmlGetName(xNode) == NULL || mir_tstrcmp(XmlGetName(xNode), L"x") || hwndStatic == NULL)
+ if (xNode == NULL || XmlGetName(xNode) == NULL || mir_wstrcmp(XmlGetName(xNode), L"x") || hwndStatic == NULL)
return;
GetClientRect(hwndStatic, &frameRect);
@@ -460,7 +460,7 @@ void JabberFormCreateUI(HWND hwndStatic, HXML xNode, int *formHeight, BOOL bComp if (!n)
break;
- if (mir_tstrcmp(XmlGetName(n), L"field"))
+ if (mir_wstrcmp(XmlGetName(n), L"field"))
continue;
varStr = XmlGetAttrValue(n, L"var");
@@ -468,24 +468,24 @@ void JabberFormCreateUI(HWND hwndStatic, HXML xNode, int *formHeight, BOOL bComp continue;
if ((label = XmlGetAttrValue(n, L"label")) != NULL)
- labelStr = mir_tstrdup(label);
+ labelStr = mir_wstrdup(label);
else
- labelStr = mir_tstrdup(varStr);
+ labelStr = mir_wstrdup(varStr);
TJabberFormControlType type = JabberFormTypeNameToId(typeName);
if ((v = XmlGetChild(n, "value")) != NULL) {
valueText = XmlGetText(v);
if (type != JFORM_CTYPE_TEXT_MULTI)
- valueStr = mir_tstrdup(valueText);
+ valueStr = mir_wstrdup(valueText);
else {
size_t size = 1;
for (int j = 0;; j++) {
v = XmlGetChild(n, j);
if (!v)
break;
- if (XmlGetName(v) && !mir_tstrcmp(XmlGetName(v), L"value") && XmlGetText(v))
- size += mir_tstrlen(XmlGetText(v)) + 2;
+ if (XmlGetName(v) && !mir_wstrcmp(XmlGetName(v), L"value") && XmlGetText(v))
+ size += mir_wstrlen(XmlGetText(v)) + 2;
}
valueStr = (wchar_t*)mir_alloc(sizeof(wchar_t)*size);
valueStr[0] = '\0';
@@ -493,10 +493,10 @@ void JabberFormCreateUI(HWND hwndStatic, HXML xNode, int *formHeight, BOOL bComp v = XmlGetChild(n, j);
if (!v)
break;
- if (XmlGetName(v) && !mir_tstrcmp(XmlGetName(v), L"value") && XmlGetText(v)) {
+ if (XmlGetName(v) && !mir_wstrcmp(XmlGetName(v), L"value") && XmlGetText(v)) {
if (valueStr[0])
- mir_tstrcat(valueStr, L"\r\n");
- mir_tstrcat(valueStr, XmlGetText(v));
+ mir_wstrcat(valueStr, L"\r\n");
+ mir_wstrcat(valueStr, XmlGetText(v));
}
}
}
@@ -514,7 +514,7 @@ void JabberFormCreateUI(HWND hwndStatic, HXML xNode, int *formHeight, BOOL bComp if (o == NULL)
break;
- if (mir_tstrcmp(XmlGetName(o), L"option"))
+ if (mir_wstrcmp(XmlGetName(o), L"option"))
continue;
if ((v = XmlGetChild(o, "value")) == NULL || XmlGetText(v) == NULL)
continue;
@@ -523,7 +523,7 @@ void JabberFormCreateUI(HWND hwndStatic, HXML xNode, int *formHeight, BOOL bComp if (str == NULL)
continue;
- bool selected = !mir_tstrcmp(valueText, XmlGetText(v));
+ bool selected = !mir_wstrcmp(valueText, XmlGetText(v));
JabberFormAddListItem(item, str, selected);
}
}
@@ -533,7 +533,7 @@ void JabberFormCreateUI(HWND hwndStatic, HXML xNode, int *formHeight, BOOL bComp if (o == NULL)
break;
- if (mir_tstrcmp(XmlGetName(o), L"option"))
+ if (mir_wstrcmp(XmlGetName(o), L"option"))
continue;
if ((v = XmlGetChild(o, "value")) == NULL || XmlGetText(v) == NULL)
continue;
@@ -547,7 +547,7 @@ void JabberFormCreateUI(HWND hwndStatic, HXML xNode, int *formHeight, BOOL bComp vs = XmlGetChild(n, k);
if (!vs)
break;
- if (!mir_tstrcmp(XmlGetName(vs), L"value") && !mir_tstrcmp(XmlGetText(vs), XmlGetText(v))) {
+ if (!mir_wstrcmp(XmlGetName(vs), L"value") && !mir_wstrcmp(XmlGetText(vs), XmlGetText(v))) {
selected = true;
break;
}
@@ -579,7 +579,7 @@ HXML JabberFormGetData(HWND hwndStatic, HXML xNode) const wchar_t *varName, *type, *fieldStr, *labelText, *str2;
wchar_t *p, *q, *str;
- if (xNode == NULL || XmlGetName(xNode) == NULL || mir_tstrcmp(XmlGetName(xNode), L"x") || hwndStatic == NULL)
+ if (xNode == NULL || XmlGetName(xNode) == NULL || mir_wstrcmp(XmlGetName(xNode), L"x") || hwndStatic == NULL)
return NULL;
hFrame = hwndStatic;
@@ -593,7 +593,7 @@ HXML JabberFormGetData(HWND hwndStatic, HXML xNode) break;
fieldStr = NULL;
- if (mir_tstrcmp(XmlGetName(n), L"field"))
+ if (mir_wstrcmp(XmlGetName(n), L"field"))
continue;
if ((varName = XmlGetAttrValue(n, L"var")) == NULL || (type = XmlGetAttrValue(n, L"type")) == NULL)
@@ -602,7 +602,7 @@ HXML JabberFormGetData(HWND hwndStatic, HXML xNode) hCtrl = GetDlgItem(hFrame, id);
HXML field = x << XCHILD(L"field") << XATTR(L"var", varName);
- if (!mir_tstrcmp(type, L"text-multi") || !mir_tstrcmp(type, L"jid-multi")) {
+ if (!mir_wstrcmp(type, L"text-multi") || !mir_wstrcmp(type, L"jid-multi")) {
len = GetWindowTextLength(GetDlgItem(hFrame, id));
str = (wchar_t*)mir_alloc(sizeof(wchar_t)*(len + 1));
GetDlgItemText(hFrame, id, str, len + 1);
@@ -616,13 +616,13 @@ HXML JabberFormGetData(HWND hwndStatic, HXML xNode) mir_free(str);
id++;
}
- else if (!mir_tstrcmp(type, L"boolean")) {
+ else if (!mir_wstrcmp(type, L"boolean")) {
wchar_t buf[10];
_itow(IsDlgButtonChecked(hFrame, id) == BST_CHECKED ? 1 : 0, buf, 10);
field << XCHILD(L"value", buf);
id++;
}
- else if (!mir_tstrcmp(type, L"list-single")) {
+ else if (!mir_wstrcmp(type, L"list-single")) {
len = GetWindowTextLength(GetDlgItem(hFrame, id));
str = (wchar_t*)mir_alloc(sizeof(wchar_t)*(len + 1));
GetDlgItemText(hFrame, id, str, len + 1);
@@ -632,11 +632,11 @@ HXML JabberFormGetData(HWND hwndStatic, HXML xNode) if (!o)
break;
- if (!mir_tstrcmp(XmlGetName(o), L"option")) {
+ if (!mir_wstrcmp(XmlGetName(o), L"option")) {
if ((v = XmlGetChild(o, "value")) != NULL && XmlGetText(v)) {
if ((str2 = XmlGetAttrValue(o, L"label")) == NULL)
str2 = XmlGetText(v);
- if (!mir_tstrcmp(str2, str))
+ if (!mir_wstrcmp(str2, str))
break;
}
}
@@ -648,7 +648,7 @@ HXML JabberFormGetData(HWND hwndStatic, HXML xNode) mir_free(str);
id++;
}
- else if (!mir_tstrcmp(type, L"list-multi")) {
+ else if (!mir_wstrcmp(type, L"list-multi")) {
int count = SendMessage(hCtrl, LB_GETCOUNT, 0, 0);
for (j = 0; j < count; j++) {
if (SendMessage(hCtrl, LB_GETSEL, j, 0) > 0) {
@@ -661,12 +661,12 @@ HXML JabberFormGetData(HWND hwndStatic, HXML xNode) if (!o)
break;
- if (XmlGetName(o) && !mir_tstrcmp(XmlGetName(o), L"option")) {
+ if (XmlGetName(o) && !mir_wstrcmp(XmlGetName(o), L"option")) {
if ((v = XmlGetChild(o, "value")) != NULL && XmlGetText(v)) {
if ((labelText = XmlGetAttrValue(o, L"label")) == NULL)
labelText = XmlGetText(v);
- if (!mir_tstrcmp(labelText, str))
+ if (!mir_wstrcmp(labelText, str))
field << XCHILD(L"value", XmlGetText(v));
}
}
@@ -677,7 +677,7 @@ HXML JabberFormGetData(HWND hwndStatic, HXML xNode) }
id++;
}
- else if (!mir_tstrcmp(type, L"fixed") || !mir_tstrcmp(type, L"hidden")) {
+ else if (!mir_wstrcmp(type, L"fixed") || !mir_wstrcmp(type, L"hidden")) {
v = XmlGetChild(n, "value");
if (v != NULL && XmlGetText(v) != NULL)
field << XCHILD(L"value", XmlGetText(v));
diff --git a/protocols/JabberG/src/jabber_frame.cpp b/protocols/JabberG/src/jabber_frame.cpp index c41f958c7b..e1da41f62c 100644 --- a/protocols/JabberG/src/jabber_frame.cpp +++ b/protocols/JabberG/src/jabber_frame.cpp @@ -59,7 +59,7 @@ public: void SetInfo(HANDLE hIcolibIcon, wchar_t *pszText)
{
mir_free(m_pszText);
- m_pszText = pszText ? mir_tstrdup(pszText) : NULL;
+ m_pszText = pszText ? mir_wstrdup(pszText) : NULL;
m_hIcolibIcon = hIcolibIcon;
}
@@ -83,7 +83,7 @@ CJabberInfoFrame::CJabberInfoFrame(CJabberProto *proto): frame.align = alBottom;
frame.height = 2 * SZ_FRAMEPADDING + GetSystemMetrics(SM_CYSMICON) + SZ_LINEPADDING; // compact height by default
frame.Flags = F_VISIBLE|F_LOCKED|F_NOBORDER|F_TCHAR;
- frame.tname = mir_a2t(proto->m_szModuleName);
+ frame.tname = mir_a2u(proto->m_szModuleName);
frame.TBtname = proto->m_tszUserName;
m_frameId = CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&frame, 0);
mir_free(frame.tname);
diff --git a/protocols/JabberG/src/jabber_ft.cpp b/protocols/JabberG/src/jabber_ft.cpp index a7142148d4..01ef6ac638 100644 --- a/protocols/JabberG/src/jabber_ft.cpp +++ b/protocols/JabberG/src/jabber_ft.cpp @@ -94,13 +94,13 @@ void CJabberProto::FtInitiate(wchar_t* jid, filetransfer *ft) sid[i] = (rand() % 10) + '0';
sid[8] = '\0';
if (ft->sid != NULL) mir_free(ft->sid);
- ft->sid = mir_tstrdup(sid);
+ ft->sid = mir_wstrdup(sid);
filename = ft->std.ptszFiles[ft->std.currentFileNumber];
if ((p = wcsrchr(filename, '\\')) != NULL)
filename = p + 1;
wchar_t tszJid[512];
- mir_sntprintf(tszJid, L"%s/%s", jid, rs);
+ mir_snwprintf(tszJid, L"%s/%s", jid, rs);
XmlNodeIq iq(AddIQ(&CJabberProto::OnFtSiResult, JABBER_IQ_TYPE_SET, tszJid, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_TO, -1, ft));
HXML si = iq << XCHILDNS(L"si", JABBER_FEAT_SI) << XATTR(L"id", sid)
@@ -140,13 +140,13 @@ void CJabberProto::OnFtSiResult(HXML iqNode, CJabberIqInfo *pInfo) if ((xNode = XmlGetChildByTag(featureNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS)) != NULL) {
if ((fieldNode = XmlGetChildByTag(xNode, "field", "var", L"stream-method")) != NULL) {
if ((valueNode = XmlGetChild(fieldNode, "value")) != NULL && XmlGetText(valueNode) != NULL) {
- if ((bDirect || bProxy) && !mir_tstrcmp(XmlGetText(valueNode), JABBER_FEAT_BYTESTREAMS)) {
+ if ((bDirect || bProxy) && !mir_wstrcmp(XmlGetText(valueNode), JABBER_FEAT_BYTESTREAMS)) {
// Start Bytestream session
JABBER_BYTE_TRANSFER *jbt = new JABBER_BYTE_TRANSFER;
memset(jbt, 0, sizeof(JABBER_BYTE_TRANSFER));
- jbt->srcJID = mir_tstrdup(pInfo->m_szTo);
- jbt->dstJID = mir_tstrdup(pInfo->m_szFrom);
- jbt->sid = mir_tstrdup(ft->sid);
+ jbt->srcJID = mir_wstrdup(pInfo->m_szTo);
+ jbt->dstJID = mir_wstrdup(pInfo->m_szFrom);
+ jbt->sid = mir_wstrdup(ft->sid);
jbt->pfnSend = &CJabberProto::FtSend;
jbt->pfnFinal = &CJabberProto::FtSendFinal;
jbt->ft = ft;
@@ -154,12 +154,12 @@ void CJabberProto::OnFtSiResult(HXML iqNode, CJabberIqInfo *pInfo) ft->jbt = jbt;
ForkThread((MyThreadFunc)&CJabberProto::ByteSendThread, jbt);
}
- else if (!mir_tstrcmp(XmlGetText(valueNode), JABBER_FEAT_IBB)) {
+ else if (!mir_wstrcmp(XmlGetText(valueNode), JABBER_FEAT_IBB)) {
JABBER_IBB_TRANSFER *jibb = (JABBER_IBB_TRANSFER *)mir_alloc(sizeof(JABBER_IBB_TRANSFER));
memset(jibb, 0, sizeof(JABBER_IBB_TRANSFER));
- jibb->srcJID = mir_tstrdup(pInfo->m_szTo);
- jibb->dstJID = mir_tstrdup(pInfo->m_szFrom);
- jibb->sid = mir_tstrdup(ft->sid);
+ jibb->srcJID = mir_wstrdup(pInfo->m_szTo);
+ jibb->dstJID = mir_wstrdup(pInfo->m_szFrom);
+ jibb->sid = mir_wstrdup(ft->sid);
jibb->pfnSend = &CJabberProto::FtIbbSend;
jibb->pfnFinal = &CJabberProto::FtSendFinal;
jibb->ft = ft;
@@ -284,7 +284,7 @@ void CJabberProto::FtSendFinal(BOOL success, filetransfer *ft) else {
if (ft->std.currentFileNumber < ft->std.totalFiles - 1) {
ft->std.currentFileNumber++;
- replaceStrT(ft->std.tszCurrentFile, ft->std.ptszFiles[ft->std.currentFileNumber]);
+ replaceStrW(ft->std.tszCurrentFile, ft->std.ptszFiles[ft->std.currentFileNumber]);
ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_NEXTFILE, ft, 0);
FtInitiate(ft->jid, ft);
return;
@@ -307,7 +307,7 @@ void CJabberProto::FtHandleSiRequest(HXML iqNode) if (!iqNode ||
(from = XmlGetAttrValue(iqNode, L"from")) == NULL ||
- (str = XmlGetAttrValue(iqNode, L"type")) == NULL || mir_tstrcmp(str, L"set") ||
+ (str = XmlGetAttrValue(iqNode, L"type")) == NULL || mir_wstrcmp(str, L"set") ||
(siNode = XmlGetChildByTag(iqNode, "si", "xmlns", JABBER_FEAT_SI)) == NULL)
return;
@@ -332,9 +332,9 @@ void CJabberProto::FtHandleSiRequest(HXML iqNode) if (!optionNode)
break;
- if (!mir_tstrcmp(XmlGetName(optionNode), L"option")) {
+ if (!mir_wstrcmp(XmlGetName(optionNode), L"option")) {
if ((n = XmlGetChild(optionNode, "value")) != NULL && XmlGetText(n)) {
- if (!mir_tstrcmp(XmlGetText(n), JABBER_FEAT_BYTESTREAMS)) {
+ if (!mir_wstrcmp(XmlGetText(n), JABBER_FEAT_BYTESTREAMS)) {
ftType = FT_BYTESTREAM;
break;
}
@@ -350,9 +350,9 @@ void CJabberProto::FtHandleSiRequest(HXML iqNode) if (!optionNode)
break;
- if (!mir_tstrcmp(XmlGetName(optionNode), L"option")) {
+ if (!mir_wstrcmp(XmlGetName(optionNode), L"option")) {
if ((n = XmlGetChild(optionNode, "value")) != NULL && XmlGetText(n)) {
- if (!mir_tstrcmp(XmlGetText(n), JABBER_FEAT_IBB)) {
+ if (!mir_wstrcmp(XmlGetText(n), JABBER_FEAT_IBB)) {
ftType = FT_IBB;
break;
}
@@ -365,13 +365,13 @@ void CJabberProto::FtHandleSiRequest(HXML iqNode) // Found known stream mechanism
filetransfer *ft = new filetransfer(this);
ft->dwExpectedRecvFileSize = filesize;
- ft->jid = mir_tstrdup(from);
+ ft->jid = mir_wstrdup(from);
ft->std.hContact = HContactFromJID(from);
- ft->sid = mir_tstrdup(sid);
- ft->szId = mir_tstrdup(szId);
+ ft->sid = mir_wstrdup(sid);
+ ft->szId = mir_wstrdup(szId);
ft->type = ftType;
ft->std.totalFiles = 1;
- ft->std.tszCurrentFile = mir_tstrdup(filename);
+ ft->std.tszCurrentFile = mir_wstrdup(filename);
ft->std.totalBytes = ft->std.currentFileSize = filesize;
PROTORECVFILET pre = { 0 };
@@ -497,9 +497,9 @@ BOOL CJabberProto::FtHandleIbbRequest(HXML iqNode, BOOL bOpen) if (!item->jibb) {
JABBER_IBB_TRANSFER *jibb = (JABBER_IBB_TRANSFER *)mir_alloc(sizeof(JABBER_IBB_TRANSFER));
memset(jibb, 0, sizeof(JABBER_IBB_TRANSFER));
- jibb->srcJID = mir_tstrdup(from);
- jibb->dstJID = mir_tstrdup(to);
- jibb->sid = mir_tstrdup(sid);
+ jibb->srcJID = mir_wstrdup(from);
+ jibb->dstJID = mir_wstrdup(to);
+ jibb->sid = mir_wstrdup(sid);
jibb->pfnRecv = &CJabberProto::FtReceive;
jibb->pfnFinal = &CJabberProto::FtReceiveFinal;
jibb->ft = item->ft;
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp index 9188846f5e..52bef54a38 100644 --- a/protocols/JabberG/src/jabber_groupchat.cpp +++ b/protocols/JabberG/src/jabber_groupchat.cpp @@ -33,7 +33,7 @@ int JabberGcGetStatus(JABBER_RESOURCE_STATUS *r); struct JabberGcRecentInfo
{
- ptrT m_room, m_server, m_nick, m_password;
+ ptrW m_room, m_server, m_nick, m_password;
CJabberProto *ppro;
JabberGcRecentInfo(CJabberProto *proto)
@@ -92,10 +92,10 @@ struct JabberGcRecentInfo void fillData(const wchar_t *room, const wchar_t *server, const wchar_t *nick = NULL, const wchar_t *password = NULL)
{
- m_room = mir_tstrdup(room);
- m_server = mir_tstrdup(server);
- m_nick = mir_tstrdup(nick);
- m_password = mir_tstrdup(password);
+ m_room = mir_wstrdup(room);
+ m_server = mir_wstrdup(server);
+ m_nick = mir_wstrdup(nick);
+ m_password = mir_wstrdup(password);
}
void fillData(const wchar_t *jid)
@@ -173,7 +173,7 @@ private: if (!str1 && str2) return FALSE;
if (!str2 && str1) return FALSE;
- return !mir_tstrcmp(str1, str2);
+ return !mir_wstrcmp(str1, str2);
}
};
@@ -185,16 +185,16 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleJoinGroupchat(WPARAM, LPARAM) INT_PTR __cdecl CJabberProto::OnJoinChat(WPARAM hContact, LPARAM)
{
- ptrT jid(getTStringA(hContact, "ChatRoomID"));
+ ptrW jid(getTStringA(hContact, "ChatRoomID"));
if (jid == NULL)
return 0;
- ptrT nick(getTStringA(hContact, "MyNick"));
+ ptrW nick(getTStringA(hContact, "MyNick"));
if (nick == NULL)
if ((nick = getTStringA("Nick")) == NULL)
return 0;
- ptrT password(getTStringA(hContact, "Password"));
+ ptrW password(getTStringA(hContact, "Password"));
if (getWord(hContact, "Status", 0) != ID_STATUS_ONLINE) {
wchar_t *p = wcschr(jid, '@');
@@ -209,7 +209,7 @@ INT_PTR __cdecl CJabberProto::OnJoinChat(WPARAM hContact, LPARAM) INT_PTR __cdecl CJabberProto::OnLeaveChat(WPARAM hContact, LPARAM)
{
- ptrT jid(getTStringA(hContact, "ChatRoomID"));
+ ptrW jid(getTStringA(hContact, "ChatRoomID"));
if (jid != NULL) {
if (getWord(hContact, "Status", 0) != ID_STATUS_OFFLINE) {
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_CHATROOM, jid);
@@ -246,12 +246,12 @@ void CJabberProto::GroupchatJoinRoom(const wchar_t *server, const wchar_t *room, }
wchar_t text[JABBER_MAX_JID_LEN + 1];
- mir_sntprintf(text, L"%s@%s/%s", room, server, nick);
+ mir_snwprintf(text, L"%s@%s/%s", room, server, nick);
JABBER_LIST_ITEM *item = ListAdd(LIST_CHATROOM, text);
item->bAutoJoin = autojoin;
- replaceStrT(item->nick, nick);
- replaceStrT(item->password, info.m_password);
+ replaceStrW(item->nick, nick);
+ replaceStrW(item->password, info.m_password);
int status = (m_iStatus == ID_STATUS_INVISIBLE) ? ID_STATUS_ONLINE : m_iStatus;
XmlNode x(L"x"); x << XATTR(L"xmlns", JABBER_FEAT_MUC);
@@ -277,8 +277,8 @@ static int sttRoomListAppend(HWND hwndList, RoomInfo::Overlay overlay, const wch {
RoomInfo *info = (RoomInfo *)mir_alloc(sizeof(RoomInfo));
info->overlay = overlay;
- info->line1 = line1 ? mir_tstrdup(line1) : 0;
- info->line2 = line2 ? mir_tstrdup(line2) : 0;
+ info->line1 = line1 ? mir_wstrdup(line1) : 0;
+ info->line2 = line2 ? mir_wstrdup(line2) : 0;
int id = SendMessage(hwndList, CB_ADDSTRING, 0, (LPARAM)name);
SendMessage(hwndList, CB_SETITEMDATA, id, (LPARAM)info);
@@ -403,7 +403,7 @@ protected: CJabberDlgGcJoin::CJabberDlgGcJoin(CJabberProto *proto, wchar_t *jid) :
CSuper(proto, IDD_GROUPCHAT_JOIN, NULL),
btnOk(this, IDOK),
- m_jid(mir_tstrdup(jid))
+ m_jid(mir_wstrdup(jid))
{
btnOk.OnClick = Callback(this, &CJabberDlgGcJoin::OnBtnOk);
}
@@ -439,7 +439,7 @@ void CJabberDlgGcJoin::OnInitDialog() delete pInfo;
}
- ptrT tszNick(m_proto->getTStringA("Nick"));
+ ptrW tszNick(m_proto->getTStringA("Nick"));
if (tszNick == NULL)
tszNick = JabberNickFromJID(m_proto->m_szJabberJID);
SetDlgItemText(m_hwnd, IDC_NICK, tszNick);
@@ -471,7 +471,7 @@ void CJabberDlgGcJoin::OnInitDialog() if (!info.loadRecent(i))
break;
- mir_sntprintf(jid, L"%s@%s (%s)", info.m_room, info.m_server, info.m_nick ? info.m_nick : TranslateT("<no nick>"));
+ mir_snwprintf(jid, L"%s@%s (%s)", info.m_room, info.m_server, info.m_nick ? info.m_nick : TranslateT("<no nick>"));
SetDlgItemText(m_hwnd, IDC_RECENT1 + i, jid);
}
sttJoinDlgShowRecentItems(m_hwnd, i);
@@ -652,7 +652,7 @@ INT_PTR CJabberDlgGcJoin::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) {
JABBER_LIST_ITEM *item = 0;
if (item = m_proto->ListGetItemPtrFromIndex(i))
- if (!mir_tstrcmp(item->type, L"conference"))
+ if (!mir_wstrcmp(item->type, L"conference"))
AppendMenu(hMenu, MF_STRING, (UINT_PTR)item, item->name);
}
AppendMenu(hMenu, MF_SEPARATOR, 0, NULL);
@@ -728,7 +728,7 @@ struct JabberGroupchatChangeNicknameParam {
JabberGroupchatChangeNicknameParam(CJabberProto* ppro_, const wchar_t *jid_) :
ppro(ppro_),
- jid(mir_tstrdup(jid_))
+ jid(mir_wstrdup(jid_))
{}
~JabberGroupchatChangeNicknameParam()
@@ -753,7 +753,7 @@ static VOID CALLBACK JabberGroupchatChangeNickname(void* arg) szBuffer = item->nick;
if (param->ppro->EnterString(szBuffer, szTitle, ESF_COMBO, "gcNick_")) {
- replaceStrT(item->nick, szBuffer);
+ replaceStrW(item->nick, szBuffer);
param->ppro->SendPresenceTo(param->ppro->m_iStatus, CMString(FORMAT, L"%s/%s", item->jid, szBuffer), NULL);
}
}
@@ -785,10 +785,10 @@ void CJabberProto::RenameParticipantNick(JABBER_LIST_ITEM *item, const wchar_t * if (r == NULL)
return;
- r->m_tszResourceName = mir_tstrdup(newNick);
+ r->m_tszResourceName = mir_wstrdup(newNick);
- if (!mir_tstrcmp(item->nick, oldNick)) {
- replaceStrT(item->nick, newNick);
+ if (!mir_wstrcmp(item->nick, oldNick)) {
+ replaceStrW(item->nick, newNick);
MCONTACT hContact = HContactFromJID(item->jid);
if (hContact != NULL)
@@ -815,7 +815,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node) {
const wchar_t *from;
- if (!node || !XmlGetName(node) || mir_tstrcmp(XmlGetName(node), L"presence")) return;
+ if (!node || !XmlGetName(node) || mir_wstrcmp(XmlGetName(node), L"presence")) return;
if ((from = XmlGetAttrValue(node, L"from")) == NULL) return;
const wchar_t *resource = wcschr(from, '/');
@@ -833,8 +833,8 @@ void CJabberProto::GroupchatProcessPresence(HXML node) const wchar_t *nick = cnick ? cnick : (r && r->m_tszNick ? r->m_tszNick : resource);
// process custom nick change
- if (cnick && r && r->m_tszNick && mir_tstrcmp(cnick, r->m_tszNick))
- r->m_tszNick = mir_tstrdup(cnick);
+ if (cnick && r && r->m_tszNick && mir_wstrcmp(cnick, r->m_tszNick))
+ r->m_tszNick = mir_wstrdup(cnick);
HXML xNode = XmlGetChildByTag(node, "x", "xmlns", JABBER_FEAT_MUC_USER);
HXML itemNode = XmlGetChild(xNode, "item");
@@ -842,8 +842,8 @@ void CJabberProto::GroupchatProcessPresence(HXML node) const wchar_t *type = XmlGetAttrValue(node, L"type");
// entering room or a usual room presence
- if (type == NULL || !mir_tstrcmp(type, L"available")) {
- if (ptrT(JabberNickFromJID(from)) == NULL)
+ if (type == NULL || !mir_wstrcmp(type, L"available")) {
+ if (ptrW(JabberNickFromJID(from)) == NULL)
return;
GcInit(item);
@@ -853,10 +853,10 @@ void CJabberProto::GroupchatProcessPresence(HXML node) int status = ID_STATUS_ONLINE;
LPCTSTR ptszShow = XmlGetText(XmlGetChild(node, "show"));
if (ptszShow) {
- if (!mir_tstrcmp(ptszShow, L"away")) status = ID_STATUS_AWAY;
- else if (!mir_tstrcmp(ptszShow, L"xa")) status = ID_STATUS_NA;
- else if (!mir_tstrcmp(ptszShow, L"dnd")) status = ID_STATUS_DND;
- else if (!mir_tstrcmp(ptszShow, L"chat")) status = ID_STATUS_FREECHAT;
+ if (!mir_wstrcmp(ptszShow, L"away")) status = ID_STATUS_AWAY;
+ else if (!mir_wstrcmp(ptszShow, L"xa")) status = ID_STATUS_NA;
+ else if (!mir_wstrcmp(ptszShow, L"dnd")) status = ID_STATUS_DND;
+ else if (!mir_wstrcmp(ptszShow, L"chat")) status = ID_STATUS_FREECHAT;
}
LPCTSTR str = XmlGetText(XmlGetChild(node, "status"));
@@ -881,16 +881,16 @@ void CJabberProto::GroupchatProcessPresence(HXML node) JABBER_GC_ROLE role = r->m_role;
if ((str = XmlGetAttrValue(itemNode, L"affiliation")) != NULL) {
- if (!mir_tstrcmp(str, L"owner")) affiliation = AFFILIATION_OWNER;
- else if (!mir_tstrcmp(str, L"admin")) affiliation = AFFILIATION_ADMIN;
- else if (!mir_tstrcmp(str, L"member")) affiliation = AFFILIATION_MEMBER;
- else if (!mir_tstrcmp(str, L"none")) affiliation = AFFILIATION_NONE;
- else if (!mir_tstrcmp(str, L"outcast")) affiliation = AFFILIATION_OUTCAST;
+ if (!mir_wstrcmp(str, L"owner")) affiliation = AFFILIATION_OWNER;
+ else if (!mir_wstrcmp(str, L"admin")) affiliation = AFFILIATION_ADMIN;
+ else if (!mir_wstrcmp(str, L"member")) affiliation = AFFILIATION_MEMBER;
+ else if (!mir_wstrcmp(str, L"none")) affiliation = AFFILIATION_NONE;
+ else if (!mir_wstrcmp(str, L"outcast")) affiliation = AFFILIATION_OUTCAST;
}
if ((str = XmlGetAttrValue(itemNode, L"role")) != NULL) {
- if (!mir_tstrcmp(str, L"moderator")) role = ROLE_MODERATOR;
- else if (!mir_tstrcmp(str, L"participant")) role = ROLE_PARTICIPANT;
- else if (!mir_tstrcmp(str, L"visitor")) role = ROLE_VISITOR;
+ if (!mir_wstrcmp(str, L"moderator")) role = ROLE_MODERATOR;
+ else if (!mir_wstrcmp(str, L"participant")) role = ROLE_PARTICIPANT;
+ else if (!mir_wstrcmp(str, L"visitor")) role = ROLE_VISITOR;
else role = ROLE_NONE;
}
@@ -911,7 +911,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node) }
if (str = XmlGetAttrValue(itemNode, L"jid"))
- r->m_tszRealJid = mir_tstrdup(str);
+ r->m_tszRealJid = mir_wstrdup(str);
}
}
@@ -936,7 +936,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node) // Check <created/>
if (bRoomCreated) {
HXML n = XmlGetChild(node, "created");
- if (n != NULL && (str = XmlGetAttrValue(n, L"xmlns")) != NULL && !mir_tstrcmp(str, JABBER_FEAT_MUC_OWNER))
+ if (n != NULL && (str = XmlGetAttrValue(n, L"xmlns")) != NULL && !mir_wstrcmp(str, JABBER_FEAT_MUC_OWNER))
// A new room just created by me
// Request room config
m_ThreadInfo->send(
@@ -946,7 +946,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node) }
// leaving room
- else if (!mir_tstrcmp(type, L"unavailable")) {
+ else if (!mir_wstrcmp(type, L"unavailable")) {
const wchar_t *str = 0;
if (xNode != NULL && item->nick != NULL) {
HXML reasonNode = XmlGetChild(itemNode, "reason");
@@ -956,7 +956,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node) if (iStatus == 301 && r != NULL)
GcLogShowInformation(item, r, INFO_BAN);
- if (!mir_tstrcmp(resource, item->nick)) {
+ if (!mir_wstrcmp(resource, item->nick)) {
switch (iStatus) {
case 301:
case 307:
@@ -994,17 +994,17 @@ void CJabberProto::GroupchatProcessPresence(HXML node) }
// processing room errors
- else if (!mir_tstrcmp(type, L"error")) {
+ else if (!mir_wstrcmp(type, L"error")) {
int errorCode = 0;
HXML errorNode = XmlGetChild(node, "error");
- ptrT str(JabberErrorMsg(errorNode, &errorCode));
+ ptrW str(JabberErrorMsg(errorNode, &errorCode));
if (errorCode == JABBER_ERROR_CONFLICT) {
- ptrT newNick(getTStringA("GcAltNick"));
+ ptrW newNick(getTStringA("GcAltNick"));
if (++item->iChatState == 1 && newNick != NULL && newNick[0] != 0) {
- replaceStrT(item->nick, newNick);
+ replaceStrW(item->nick, newNick);
wchar_t text[1024] = { 0 };
- mir_sntprintf(text, L"%s/%s", item->jid, newNick);
+ mir_snwprintf(text, L"%s/%s", item->jid, newNick);
SendPresenceTo(m_iStatus, text, NULL);
}
else {
@@ -1028,12 +1028,12 @@ void CJabberProto::GroupchatProcessMessage(HXML node) JABBER_LIST_ITEM *item;
CMString imgLink;
- if (!XmlGetName(node) || mir_tstrcmp(XmlGetName(node), L"message")) return;
+ if (!XmlGetName(node) || mir_wstrcmp(XmlGetName(node), L"message")) return;
if ((from = XmlGetAttrValue(node, L"from")) == NULL) return;
if ((item = ListGetItemPtr(LIST_CHATROOM, from)) == NULL) return;
if ((type = XmlGetAttrValue(node, L"type")) == NULL) return;
- if (!mir_tstrcmp(type, L"error"))
+ if (!mir_wstrcmp(type, L"error"))
return;
GCDEST gcd = { m_szModuleName, item->jid, 0 };
@@ -1064,7 +1064,7 @@ void CJabberProto::GroupchatProcessMessage(HXML node) resource = tmpnick;
}
}
- item->getTemp()->m_tszStatusMessage = mir_tstrdup(msgText);
+ item->getTemp()->m_tszStatusMessage = mir_wstrdup(msgText);
}
else {
imgLink = ExtractImage(node);
@@ -1079,7 +1079,7 @@ void CJabberProto::GroupchatProcessMessage(HXML node) if (resource == NULL)
gcd.iType = GC_EVENT_INFORMATION;
- else if (wcsncmp(msgText, L"/me ", 4) == 0 && mir_tstrlen(msgText) > 4) {
+ else if (wcsncmp(msgText, L"/me ", 4) == 0 && mir_wstrlen(msgText) > 4) {
msgText += 4;
gcd.iType = GC_EVENT_ACTION;
}
@@ -1115,7 +1115,7 @@ void CJabberProto::GroupchatProcessMessage(HXML node) gce.ptszNick = nick;
gce.time = msgTime;
gce.ptszText = tszText;
- gce.bIsMe = nick == NULL ? FALSE : (mir_tstrcmp(resource, item->nick) == 0);
+ gce.bIsMe = nick == NULL ? FALSE : (mir_wstrcmp(resource, item->nick) == 0);
if (!isHistory)
gce.dwFlags |= GCEF_ADDTOLOG;
@@ -1157,12 +1157,12 @@ public: CSuper::OnInitDialog();
wchar_t buf[256];
- mir_sntprintf(buf, TranslateT("Group chat invitation to\n%s"), m_roomJid);
+ mir_snwprintf(buf, TranslateT("Group chat invitation to\n%s"), m_roomJid);
SetDlgItemText(m_hwnd, IDC_HEADERBAR, buf);
SetDlgItemText(m_hwnd, IDC_FROM, m_from);
SetDlgItemText(m_hwnd, IDC_REASON, m_reason);
- SetDlgItemText(m_hwnd, IDC_NICK, ptrT(JabberNickFromJID(m_proto->m_szJabberJID)));
+ SetDlgItemText(m_hwnd, IDC_NICK, ptrW(JabberNickFromJID(m_proto->m_szJabberJID)));
Window_SetIcon_IcoLib(m_hwnd, g_GetIconHandle(IDI_GROUP));
@@ -1193,7 +1193,7 @@ void CJabberProto::GroupchatProcessInvite(const wchar_t *roomJid, const wchar_t return;
if (m_options.AutoAcceptMUC) {
- ptrT nick(getTStringA(HContactFromJID(m_szJabberJID), "MyNick"));
+ ptrW nick(getTStringA(HContactFromJID(m_szJabberJID), "MyNick"));
if (nick == NULL)
nick = getTStringA("Nick");
if (nick == NULL)
diff --git a/protocols/JabberG/src/jabber_ibb.cpp b/protocols/JabberG/src/jabber_ibb.cpp index f15b3f4776..91a1df8f61 100644 --- a/protocols/JabberG/src/jabber_ibb.cpp +++ b/protocols/JabberG/src/jabber_ibb.cpp @@ -46,11 +46,11 @@ void JabberIbbFreeJibb(JABBER_IBB_TRANSFER *jibb) BOOL CJabberProto::OnFtHandleIbbIq(HXML iqNode, CJabberIqInfo *pInfo)
{
- if (!mir_tstrcmp(pInfo->GetChildNodeName(), L"open"))
+ if (!mir_wstrcmp(pInfo->GetChildNodeName(), L"open"))
FtHandleIbbRequest(iqNode, TRUE);
- else if (!mir_tstrcmp(pInfo->GetChildNodeName(), L"close"))
+ else if (!mir_wstrcmp(pInfo->GetChildNodeName(), L"close"))
FtHandleIbbRequest(iqNode, FALSE);
- else if (!mir_tstrcmp(pInfo->GetChildNodeName(), L"data")) {
+ else if (!mir_wstrcmp(pInfo->GetChildNodeName(), L"data")) {
BOOL bOk = FALSE;
const wchar_t *sid = XmlGetAttrValue(pInfo->GetChildNode(), L"sid");
const wchar_t *seq = XmlGetAttrValue(pInfo->GetChildNode(), L"seq");
diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp index 6d85d38886..64aae7a25b 100644 --- a/protocols/JabberG/src/jabber_icolib.cpp +++ b/protocols/JabberG/src/jabber_icolib.cpp @@ -307,7 +307,7 @@ int CJabberProto::LoadAdvancedIcons(int iID) int first = -1;
HICON empty = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
- mir_sntprintf(Group, LPGENW("Status icons")L"/%s/%S %s", m_tszUserName, proto, TranslateT("transport"));
+ mir_snwprintf(Group, LPGENW("Status icons")L"/%s/%S %s", m_tszUserName, proto, TranslateT("transport"));
mir_snprintf(defFile, "proto_%s.dll", proto);
if (!hAdvancedStatusIcon)
hAdvancedStatusIcon = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0);
@@ -389,7 +389,7 @@ INT_PTR __cdecl CJabberProto::JGetAdvancedStatusIcon(WPARAM hContact, LPARAM) if (!getByte(hContact, "IsTransported", 0))
return -1;
- int iID = GetTransportProtoID(ptrT(getTStringA(hContact, "Transport")));
+ int iID = GetTransportProtoID(ptrW(getTStringA(hContact, "Transport")));
if (iID < 0)
return -1;
@@ -431,7 +431,7 @@ BOOL CJabberProto::DBCheckIsTransportedContact(const wchar_t *jid, MCONTACT hCon }
if (m_lstTransports.getIndex(domain) == -1 && isAgent) {
- m_lstTransports.insert(mir_tstrdup(domain));
+ m_lstTransports.insert(mir_wstrdup(domain));
setByte(hContact, "IsTransport", 1);
}
@@ -445,7 +445,7 @@ BOOL CJabberProto::DBCheckIsTransportedContact(const wchar_t *jid, MCONTACT hCon void CJabberProto::CheckAllContactsAreTransported()
{
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
- ptrT jid(getTStringA(hContact, "jid"));
+ ptrW jid(getTStringA(hContact, "jid"));
if (jid)
DBCheckIsTransportedContact(jid, hContact);
}
diff --git a/protocols/JabberG/src/jabber_iq.cpp b/protocols/JabberG/src/jabber_iq.cpp index 60040145af..79db2a2232 100644 --- a/protocols/JabberG/src/jabber_iq.cpp +++ b/protocols/JabberG/src/jabber_iq.cpp @@ -248,9 +248,9 @@ bool CJabberIqManager::HandleIq(int nIqId, HXML pNode) return false;
int nIqType = JABBER_IQ_TYPE_FAIL;
- if (!mir_tstrcmpi(szType, L"result"))
+ if (!mir_wstrcmpi(szType, L"result"))
nIqType = JABBER_IQ_TYPE_RESULT;
- else if (!mir_tstrcmpi(szType, L"error"))
+ else if (!mir_wstrcmpi(szType, L"error"))
nIqType = JABBER_IQ_TYPE_ERROR;
else
return false;
@@ -300,9 +300,9 @@ bool CJabberIqManager::HandleIqPermanent(HXML pNode) CJabberIqInfo iqInfo;
iqInfo.m_nIqType = JABBER_IQ_TYPE_FAIL;
- if (!mir_tstrcmpi(szType, L"get"))
+ if (!mir_wstrcmpi(szType, L"get"))
iqInfo.m_nIqType = JABBER_IQ_TYPE_GET;
- else if (!mir_tstrcmpi(szType, L"set"))
+ else if (!mir_wstrcmpi(szType, L"set"))
iqInfo.m_nIqType = JABBER_IQ_TYPE_SET;
else
return FALSE;
@@ -317,8 +317,8 @@ bool CJabberIqManager::HandleIqPermanent(HXML pNode) const wchar_t *szTagName = XmlGetName(pFirstChild);
const wchar_t *szXmlns = XmlGetAttrValue(pFirstChild, L"xmlns");
- if ((!pInfo.m_szXmlns || (szXmlns && !mir_tstrcmp(pInfo.m_szXmlns, szXmlns))) &&
- (!pInfo.m_szTag || !mir_tstrcmp(pInfo.m_szTag, szTagName)))
+ if ((!pInfo.m_szXmlns || (szXmlns && !mir_wstrcmp(pInfo.m_szXmlns, szXmlns))) &&
+ (!pInfo.m_szTag || !mir_wstrcmp(pInfo.m_szTag, szTagName)))
{
// node suits handler criteria, call the handler
iqInfo.m_pChildNode = pFirstChild;
@@ -416,9 +416,9 @@ CJabberIqPermanentInfo* CJabberIqManager::AddPermanentHandler( CJabberIqPermanentInfo *pInfo = new CJabberIqPermanentInfo();
pInfo->m_pHandler = pHandler;
pInfo->m_nIqTypes = nIqTypes ? nIqTypes : JABBER_IQ_TYPE_ANY;
- pInfo->m_szXmlns = mir_tstrdup(szXmlns);
+ pInfo->m_szXmlns = mir_wstrdup(szXmlns);
pInfo->m_bAllowPartialNs = bAllowPartialNs;
- pInfo->m_szTag = mir_tstrdup(szTag);
+ pInfo->m_szTag = mir_wstrdup(szTag);
pInfo->m_dwParamsToParse = dwParamsToParse;
pInfo->m_pUserData = pUserData;
pInfo->m_pUserDataFree = pUserDataFree;
diff --git a/protocols/JabberG/src/jabber_iq.h b/protocols/JabberG/src/jabber_iq.h index 6d5b75d68a..a8110ea52c 100644 --- a/protocols/JabberG/src/jabber_iq.h +++ b/protocols/JabberG/src/jabber_iq.h @@ -81,7 +81,7 @@ public: { mir_free(m_szReceiver);
}
- __forceinline void SetReceiver(const wchar_t *szReceiver) { replaceStrT(m_szReceiver, szReceiver); }
+ __forceinline void SetReceiver(const wchar_t *szReceiver) { replaceStrW(m_szReceiver, szReceiver); }
__forceinline void SetParamsToParse(DWORD dwParamsToParse) { m_dwParamsToParse = dwParamsToParse; }
__forceinline void SetTimeout(DWORD dwTimeout) { m_dwTimeout = dwTimeout; }
diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp index 9a87819646..84e5c93ef8 100644 --- a/protocols/JabberG/src/jabber_iq_handlers.cpp +++ b/protocols/JabberG/src/jabber_iq_handlers.cpp @@ -44,7 +44,7 @@ BOOL CJabberProto::OnIqRequestVersion(HXML, CJabberIqInfo *pInfo) if (m_options.ShowOSVersion) {
wchar_t os[256] = { 0 };
if (!GetOSDisplayString(os, _countof(os)))
- mir_tstrncpy(os, L"Microsoft Windows", _countof(os));
+ mir_wstrncpy(os, L"Microsoft Windows", _countof(os));
query << XCHILD(L"os", os);
}
@@ -104,7 +104,7 @@ BOOL CJabberProto::OnIqRequestTime(HXML, CJabberIqInfo *pInfo) TimeZone_PrintDateTime(UTC_TIME_HANDLE, L"I", stime, _countof(stime), 0);
int nGmtOffset = GetGMTOffset();
- mir_sntprintf(szTZ, L"%+03d:%02d", nGmtOffset / 60, nGmtOffset % 60);
+ mir_snwprintf(szTZ, L"%+03d:%02d", nGmtOffset / 60, nGmtOffset % 60);
XmlNodeIq iq(L"result", pInfo);
HXML timeNode = iq << XCHILDNS(L"time", JABBER_FEAT_ENTITY_TIME);
@@ -125,7 +125,7 @@ BOOL CJabberProto::OnIqProcessIqOldTime(HXML, CJabberIqInfo *pInfo) _tzset();
time(<ime);
gmt = gmtime(<ime);
- mir_sntprintf(stime, L"%.4i%.2i%.2iT%.2i:%.2i:%.2i",
+ mir_snwprintf(stime, L"%.4i%.2i%.2iT%.2i:%.2i:%.2i",
gmt->tm_year + 1900, gmt->tm_mon + 1,
gmt->tm_mday, gmt->tm_hour, gmt->tm_min, gmt->tm_sec);
dtime = _wctime(<ime);
@@ -186,7 +186,7 @@ BOOL CJabberProto::OnSiRequest(HXML node, CJabberIqInfo *pInfo) {
const wchar_t *szProfile = XmlGetAttrValue(pInfo->GetChildNode(), L"profile");
- if (szProfile && !mir_tstrcmp(szProfile, JABBER_FEAT_SI_FT))
+ if (szProfile && !mir_wstrcmp(szProfile, JABBER_FEAT_SI_FT))
FtHandleSiRequest(node);
else {
XmlNodeIq iq(L"error", pInfo);
@@ -220,7 +220,7 @@ BOOL CJabberProto::OnRosterPushRequest(HXML, CJabberIqInfo *pInfo) pDelimiter = wcschr(szTo, '/');
if (pDelimiter) *pDelimiter = 0;
- BOOL bRetVal = mir_tstrcmp(szFrom, szTo) == 0;
+ BOOL bRetVal = mir_wstrcmp(szFrom, szTo) == 0;
mir_free(szFrom);
mir_free(szTo);
@@ -240,7 +240,7 @@ BOOL CJabberProto::OnRosterPushRequest(HXML, CJabberIqInfo *pInfo) if (!itemNode)
break;
- if (mir_tstrcmp(XmlGetName(itemNode), L"item") != 0)
+ if (mir_wstrcmp(XmlGetName(itemNode), L"item") != 0)
continue;
if ((jid = XmlGetAttrValue(itemNode, L"jid")) == NULL)
continue;
@@ -248,9 +248,9 @@ BOOL CJabberProto::OnRosterPushRequest(HXML, CJabberIqInfo *pInfo) continue;
// we will not add new account when subscription=remove
- if (!mir_tstrcmp(str, L"to") || !mir_tstrcmp(str, L"both") || !mir_tstrcmp(str, L"from") || !mir_tstrcmp(str, L"none")) {
+ if (!mir_wstrcmp(str, L"to") || !mir_wstrcmp(str, L"both") || !mir_wstrcmp(str, L"from") || !mir_wstrcmp(str, L"none")) {
const wchar_t *name = XmlGetAttrValue(itemNode, L"name");
- ptrT nick((name != NULL) ? mir_tstrdup(name) : JabberNickFromJID(jid));
+ ptrW nick((name != NULL) ? mir_wstrdup(name) : JabberNickFromJID(jid));
if (nick != NULL) {
MCONTACT hContact = HContactFromJID(jid, false);
if (hContact == NULL)
@@ -259,15 +259,15 @@ BOOL CJabberProto::OnRosterPushRequest(HXML, CJabberIqInfo *pInfo) setTString(hContact, "jid", jid);
JABBER_LIST_ITEM *item = ListAdd(LIST_ROSTER, jid, hContact);
- replaceStrT(item->nick, nick);
+ replaceStrW(item->nick, nick);
HXML groupNode = XmlGetChild(itemNode, "group");
- replaceStrT(item->group, XmlGetText(groupNode));
+ replaceStrW(item->group, XmlGetText(groupNode));
if (name != NULL) {
- ptrT tszNick(getTStringA(hContact, "Nick"));
+ ptrW tszNick(getTStringA(hContact, "Nick"));
if (tszNick != NULL) {
- if (mir_tstrcmp(nick, tszNick) != 0)
+ if (mir_wstrcmp(nick, tszNick) != 0)
db_set_ts(hContact, "CList", "MyHandle", nick);
else
db_unset(hContact, "CList", "MyHandle");
@@ -287,9 +287,9 @@ BOOL CJabberProto::OnRosterPushRequest(HXML, CJabberIqInfo *pInfo) }
if (JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, jid)) {
- if (!mir_tstrcmp(str, L"both")) item->subscription = SUB_BOTH;
- else if (!mir_tstrcmp(str, L"to")) item->subscription = SUB_TO;
- else if (!mir_tstrcmp(str, L"from")) item->subscription = SUB_FROM;
+ if (!mir_wstrcmp(str, L"both")) item->subscription = SUB_BOTH;
+ else if (!mir_wstrcmp(str, L"to")) item->subscription = SUB_TO;
+ else if (!mir_wstrcmp(str, L"from")) item->subscription = SUB_FROM;
else item->subscription = SUB_NONE;
debugLog(L"Roster push for jid=%s, set subscription to %s", jid, str);
@@ -298,7 +298,7 @@ BOOL CJabberProto::OnRosterPushRequest(HXML, CJabberIqInfo *pInfo) // subscription = remove is to remove from roster list
// but we will just set the contact to offline and not actually
// remove, so that history will be retained.
- if (!mir_tstrcmp(str, L"remove")) {
+ if (!mir_wstrcmp(str, L"remove")) {
if (hContact) {
SetContactOfflineStatus(hContact);
ListRemove(LIST_ROSTER, jid);
@@ -335,7 +335,7 @@ BOOL CJabberProto::OnIqRequestOOB(HXML, CJabberIqInfo *pInfo) filetransfer *ft = new filetransfer(this);
ft->std.totalFiles = 1;
- ft->jid = mir_tstrdup(pInfo->GetFrom());
+ ft->jid = mir_wstrdup(pInfo->GetFrom());
ft->std.hContact = pInfo->GetHContact();
ft->type = FT_OOB;
ft->httpHostName = NULL;
@@ -355,7 +355,7 @@ BOOL CJabberProto::OnIqRequestOOB(HXML, CJabberIqInfo *pInfo) ft->httpPort = (WORD)_wtoi(p + 1);
*p = '\0';
}
- ft->httpHostName = mir_t2a(text);
+ ft->httpHostName = mir_u2a(text);
}
}
}
@@ -376,7 +376,7 @@ BOOL CJabberProto::OnIqRequestOOB(HXML, CJabberIqInfo *pInfo) str2++;
else
str2 = ft->httpPath;
- str2 = mir_tstrdup(str2);
+ str2 = mir_wstrdup(str2);
JabberHttpUrlDecode(str2);
PROTORECVFILET pre;
@@ -482,10 +482,10 @@ BOOL CJabberProto::OnIqHttpAuth(HXML node, CJabberIqInfo *pInfo) CJabberHttpAuthParams *pParams = (CJabberHttpAuthParams*)mir_calloc(sizeof(CJabberHttpAuthParams));
if (pParams) {
pParams->m_nType = CJabberHttpAuthParams::IQ;
- pParams->m_szFrom = mir_tstrdup(pInfo->GetFrom());
- pParams->m_szId = mir_tstrdup(szId);
- pParams->m_szMethod = mir_tstrdup(szMethod);
- pParams->m_szUrl = mir_tstrdup(szUrl);
+ pParams->m_szFrom = mir_wstrdup(pInfo->GetFrom());
+ pParams->m_szId = mir_wstrdup(szId);
+ pParams->m_szMethod = mir_wstrdup(szMethod);
+ pParams->m_szUrl = mir_wstrdup(szUrl);
AddClistHttpAuthEvent(pParams);
}
return TRUE;
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index de177c797d..caa0532da6 100644 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -35,7 +35,7 @@ void CJabberProto::OnIqResultServerDiscoInfo(HXML iqNode, CJabberIqInfo*) return;
const wchar_t *type = XmlGetAttrValue(iqNode, L"type");
- if (mir_tstrcmp(type, L"result"))
+ if (mir_wstrcmp(type, L"result"))
return;
HXML query = XmlGetChildByTag(iqNode, "query", "xmlns", JABBER_FEAT_DISCO_INFO);
@@ -49,7 +49,7 @@ void CJabberProto::OnIqResultServerDiscoInfo(HXML iqNode, CJabberIqInfo*) XmlGetAttrValue(identity, L"type"),
XmlGetAttrValue(identity, L"name") };
- if (!mir_tstrcmp(tmp.category, L"pubsub") && !mir_tstrcmp(tmp.type, L"pep")) {
+ if (!mir_wstrcmp(tmp.category, L"pubsub") && !mir_wstrcmp(tmp.type, L"pep")) {
m_bPepSupported = true;
EnableMenuItems(true);
@@ -68,7 +68,7 @@ void CJabberProto::OnIqResultServerDiscoInfo(HXML iqNode, CJabberIqInfo*) continue;
for (int j = 0; g_JabberFeatCapPairs[j].szFeature; j++) {
- if (!mir_tstrcmp(g_JabberFeatCapPairs[j].szFeature, featureName)) {
+ if (!mir_wstrcmp(g_JabberFeatCapPairs[j].szFeature, featureName)) {
m_ThreadInfo->jabberServerCaps |= g_JabberFeatCapPairs[j].jcbCap;
break;
}
@@ -96,13 +96,13 @@ void CJabberProto::OnIqResultNestedRosterGroups(HXML iqNode, CJabberIqInfo *pInf return;
// is our default delimiter?
- if ((!szGroupDelimeter && bPrivateStorageSupport) || (szGroupDelimeter && mir_tstrcmp(szGroupDelimeter, L"\\")))
+ if ((!szGroupDelimeter && bPrivateStorageSupport) || (szGroupDelimeter && mir_wstrcmp(szGroupDelimeter, L"\\")))
m_ThreadInfo->send(
XmlNodeIq(L"set", SerialNext()) << XQUERY(JABBER_FEAT_PRIVATE_STORAGE)
<< XCHILD(L"roster", L"\\") << XATTR(L"xmlns", JABBER_FEAT_NESTED_ROSTER_GROUPS));
// roster request
- wchar_t *szUserData = mir_tstrdup(szGroupDelimeter ? szGroupDelimeter : L"\\");
+ wchar_t *szUserData = mir_wstrdup(szGroupDelimeter ? szGroupDelimeter : L"\\");
m_ThreadInfo->send(
XmlNodeIq( AddIQ(&CJabberProto::OnIqResultGetRoster, JABBER_IQ_TYPE_GET, NULL, 0, -1, (void*)szUserData))
<< XCHILDNS(L"query", JABBER_FEAT_IQ_ROSTER));
@@ -134,7 +134,7 @@ void CJabberProto::OnProcessLoginRq(ThreadData *info, DWORD rq) LISTFOREACH(i, this, LIST_BOOKMARK)
{
JABBER_LIST_ITEM *item = ListGetItemPtrFromIndex(i);
- if (item != NULL && !mir_tstrcmp(item->type, L"conference") && item->bAutoJoin)
+ if (item != NULL && !mir_wstrcmp(item->type, L"conference") && item->bAutoJoin)
ll.insert(item);
}
@@ -149,7 +149,7 @@ void CJabberProto::OnProcessLoginRq(ThreadData *info, DWORD rq) if (item->nick && item->nick[0])
GroupchatJoinRoom(server, p, item->nick, item->password, true);
else {
- ptrT nick(getTStringA(HContactFromJID(m_szJabberJID), "MyNick"));
+ ptrW nick(getTStringA(HContactFromJID(m_szJabberJID), "MyNick"));
if (nick == NULL)
nick = getTStringA("Nick");
if (nick == NULL)
@@ -219,7 +219,7 @@ void CJabberProto::OnIqResultGetAuth(HXML iqNode, CJabberIqInfo*) if ((type = XmlGetAttrValue(iqNode, L"type")) == NULL) return;
if ((queryNode = XmlGetChild(iqNode, "query")) == NULL) return;
- if (!mir_tstrcmp(type, L"result")) {
+ if (!mir_wstrcmp(type, L"result")) {
XmlNodeIq iq(AddIQ(&CJabberProto::OnIqResultSetAuth, JABBER_IQ_TYPE_SET));
HXML query = iq << XQUERY(L"jabber:iq:auth");
query << XCHILD(L"username", m_ThreadInfo->conn.username);
@@ -243,11 +243,11 @@ void CJabberProto::OnIqResultGetAuth(HXML iqNode, CJabberIqInfo*) m_ThreadInfo->send(iq);
}
- else if (!mir_tstrcmp(type, L"error")) {
+ else if (!mir_wstrcmp(type, L"error")) {
m_ThreadInfo->send("</stream:stream>");
wchar_t text[128];
- mir_sntprintf(text, TranslateT("Authentication failed for %s."), m_ThreadInfo->conn.username);
+ mir_snwprintf(text, TranslateT("Authentication failed for %s."), m_ThreadInfo->conn.username);
MsgPopup(NULL, text, TranslateT("Jabber Authentication"));
JLoginFailed(LOGINERR_WRONGPASSWORD);
m_ThreadInfo = NULL; // To disallow auto reconnect
@@ -263,19 +263,19 @@ void CJabberProto::OnIqResultSetAuth(HXML iqNode, CJabberIqInfo*) debugLogA("<iq/> iqIdSetAuth");
if ((type = XmlGetAttrValue(iqNode, L"type")) == NULL) return;
- if (!mir_tstrcmp(type, L"result")) {
- ptrT tszNick(getTStringA("Nick"));
+ if (!mir_wstrcmp(type, L"result")) {
+ ptrW tszNick(getTStringA("Nick"));
if (tszNick == NULL)
setTString("Nick", m_ThreadInfo->conn.username);
OnLoggedIn();
}
// What to do if password error? etc...
- else if (!mir_tstrcmp(type, L"error")) {
+ else if (!mir_wstrcmp(type, L"error")) {
wchar_t text[128];
m_ThreadInfo->send("</stream:stream>");
- mir_sntprintf(text, TranslateT("Authentication failed for %s."), m_ThreadInfo->conn.username);
+ mir_snwprintf(text, TranslateT("Authentication failed for %s."), m_ThreadInfo->conn.username);
MsgPopup(NULL, text, TranslateT("Jabber Authentication"));
JLoginFailed(LOGINERR_WRONGPASSWORD);
m_ThreadInfo = NULL; // To disallow auto reconnect
@@ -318,7 +318,7 @@ void CJabberProto::OnIqResultSession(HXML, CJabberIqInfo *pInfo) void CJabberProto::GroupchatJoinByHContact(MCONTACT hContact, bool autojoin)
{
- ptrT roomjid(getTStringA(hContact, "ChatRoomID"));
+ ptrW roomjid(getTStringA(hContact, "ChatRoomID"));
if (roomjid == NULL)
return;
@@ -329,14 +329,14 @@ void CJabberProto::GroupchatJoinByHContact(MCONTACT hContact, bool autojoin) server[0] = 0; server++;
- ptrT nick(getTStringA(hContact, "MyNick"));
+ ptrW nick(getTStringA(hContact, "MyNick"));
if (nick == NULL) {
nick = JabberNickFromJID(m_szJabberJID);
if (nick == NULL)
return;
}
- GroupchatJoinRoom(server, room, nick, ptrT(getTStringA(hContact, "Password")), autojoin);
+ GroupchatJoinRoom(server, room, nick, ptrW(getTStringA(hContact, "Password")), autojoin);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -357,12 +357,12 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo) return;
}
- if (mir_tstrcmp(XmlGetAttrValue(queryNode, L"xmlns"), JABBER_FEAT_IQ_ROSTER)) {
+ if (mir_wstrcmp(XmlGetAttrValue(queryNode, L"xmlns"), JABBER_FEAT_IQ_ROSTER)) {
mir_free(szGroupDelimeter);
return;
}
- if (!mir_tstrcmp(szGroupDelimeter, L"\\")) {
+ if (!mir_wstrcmp(szGroupDelimeter, L"\\")) {
mir_free(szGroupDelimeter);
szGroupDelimeter = NULL;
}
@@ -377,16 +377,16 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo) if (!itemNode)
break;
- if (mir_tstrcmp(XmlGetName(itemNode), L"item"))
+ if (mir_wstrcmp(XmlGetName(itemNode), L"item"))
continue;
const wchar_t *str = XmlGetAttrValue(itemNode, L"subscription");
JABBER_SUBSCRIPTION sub;
if (str == NULL) sub = SUB_NONE;
- else if (!mir_tstrcmp(str, L"both")) sub = SUB_BOTH;
- else if (!mir_tstrcmp(str, L"to")) sub = SUB_TO;
- else if (!mir_tstrcmp(str, L"from")) sub = SUB_FROM;
+ else if (!mir_wstrcmp(str, L"both")) sub = SUB_BOTH;
+ else if (!mir_wstrcmp(str, L"to")) sub = SUB_TO;
+ else if (!mir_wstrcmp(str, L"from")) sub = SUB_FROM;
else sub = SUB_NONE;
const wchar_t *jid = XmlGetAttrValue(itemNode, L"jid");
@@ -396,7 +396,7 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo) bIsTransport = true;
const wchar_t *name = XmlGetAttrValue(itemNode, L"name");
- wchar_t *nick = (name != NULL) ? mir_tstrdup(name) : JabberNickFromJID(jid);
+ wchar_t *nick = (name != NULL) ? mir_wstrdup(name) : JabberNickFromJID(jid);
if (nick == NULL)
continue;
@@ -410,26 +410,26 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo) mir_free(item->nick); item->nick = nick;
HXML groupNode = XmlGetChild(itemNode, "group");
- replaceStrT(item->group, XmlGetText(groupNode));
+ replaceStrW(item->group, XmlGetText(groupNode));
// check group delimiters:
if (item->group && szGroupDelimeter) {
while (wchar_t *szPos = wcsstr(item->group, szGroupDelimeter)) {
*szPos = 0;
- szPos += mir_tstrlen(szGroupDelimeter);
- wchar_t *szNewGroup = (wchar_t *)mir_alloc(sizeof(wchar_t) * (mir_tstrlen(item->group) + mir_tstrlen(szPos) + 2));
- mir_tstrcpy(szNewGroup, item->group);
- mir_tstrcat(szNewGroup, L"\\");
- mir_tstrcat(szNewGroup, szPos);
+ szPos += mir_wstrlen(szGroupDelimeter);
+ wchar_t *szNewGroup = (wchar_t *)mir_alloc(sizeof(wchar_t) * (mir_wstrlen(item->group) + mir_wstrlen(szPos) + 2));
+ mir_wstrcpy(szNewGroup, item->group);
+ mir_wstrcat(szNewGroup, L"\\");
+ mir_wstrcat(szNewGroup, szPos);
mir_free(item->group);
item->group = szNewGroup;
}
}
if (name != NULL) {
- ptrT tszNick(getTStringA(hContact, "Nick"));
+ ptrW tszNick(getTStringA(hContact, "Nick"));
if (tszNick != NULL) {
- if (mir_tstrcmp(nick, tszNick) != 0)
+ if (mir_wstrcmp(nick, tszNick) != 0)
db_set_ts(hContact, "CList", "MyHandle", nick);
else
db_unset(hContact, "CList", "MyHandle");
@@ -461,9 +461,9 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo) Clist_GroupCreate(0, item->group);
// Don't set group again if already correct, or Miranda may show wrong group count in some case
- ptrT tszGroup(db_get_tsa(hContact, "CList", "Group"));
+ ptrW tszGroup(db_get_tsa(hContact, "CList", "Group"));
if (tszGroup != NULL) {
- if (mir_tstrcmp(tszGroup, item->group))
+ if (mir_wstrcmp(tszGroup, item->group))
db_set_ts(hContact, "CList", "Group", item->group);
}
else db_set_ts(hContact, "CList", "Group", item->group);
@@ -492,7 +492,7 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo) if (m_options.RosterSync == TRUE) {
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact;) {
MCONTACT hNext = db_find_next(hContact, m_szModuleName);
- ptrT jid(getTStringA(hContact, "jid"));
+ ptrW jid(getTStringA(hContact, "jid"));
if (jid != NULL && !ListGetItemPtr(LIST_ROSTER, jid)) {
debugLog(L"Syncing roster: preparing to delete %s (hContact=0x%x)", jid, hContact);
CallService(MS_DB_CONTACT_DELETE, hContact, 0);
@@ -533,11 +533,11 @@ void CJabberProto::OnIqResultGetRegister(HXML iqNode, CJabberIqInfo*) if ((type = XmlGetAttrValue(iqNode, L"type")) == NULL) return;
if ((queryNode = XmlGetChild(iqNode, "query")) == NULL) return;
- if (!mir_tstrcmp(type, L"result")) {
+ if (!mir_wstrcmp(type, L"result")) {
if (m_hwndAgentRegInput)
SendMessage(m_hwndAgentRegInput, WM_JABBER_REGINPUT_ACTIVATE, 1 /*success*/, (LPARAM)xmlCopyNode(iqNode));
}
- else if (!mir_tstrcmp(type, L"error")) {
+ else if (!mir_wstrcmp(type, L"error")) {
if (m_hwndAgentRegInput) {
HXML errorNode = XmlGetChild(iqNode, "error");
wchar_t *str = JabberErrorMsg(errorNode);
@@ -557,7 +557,7 @@ void CJabberProto::OnIqResultSetRegister(HXML iqNode, CJabberIqInfo*) if ((type = XmlGetAttrValue(iqNode, L"type")) == NULL) return;
if ((from = XmlGetAttrValue(iqNode, L"from")) == NULL) return;
- if (!mir_tstrcmp(type, L"result")) {
+ if (!mir_wstrcmp(type, L"result")) {
MCONTACT hContact = HContactFromJID(from);
if (hContact != NULL)
setByte(hContact, "IsTransport", true);
@@ -565,7 +565,7 @@ void CJabberProto::OnIqResultSetRegister(HXML iqNode, CJabberIqInfo*) if (m_hwndRegProgress)
SendMessage(m_hwndRegProgress, WM_JABBER_REGDLG_UPDATE, 100, (LPARAM)TranslateT("Registration successful"));
}
- else if (!mir_tstrcmp(type, L"error")) {
+ else if (!mir_wstrcmp(type, L"error")) {
if (m_hwndRegProgress) {
HXML errorNode = XmlGetChild(iqNode, "error");
wchar_t *str = JabberErrorMsg(errorNode);
@@ -621,7 +621,7 @@ void CJabberProto::OnIqResultGetVcardPhoto(HXML n, MCONTACT hContact, bool &hasP debugLog(L"My picture saved to %s", szAvatarFileName);
}
else {
- ptrT jid(getTStringA(hContact, "jid"));
+ ptrW jid(getTStringA(hContact, "jid"));
if (jid != NULL) {
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, jid);
if (item == NULL) {
@@ -631,9 +631,9 @@ void CJabberProto::OnIqResultGetVcardPhoto(HXML n, MCONTACT hContact, bool &hasP }
if (item != NULL) {
hasPhoto = true;
- if (item->photoFileName && mir_tstrcmp(item->photoFileName, szAvatarFileName))
+ if (item->photoFileName && mir_wstrcmp(item->photoFileName, szAvatarFileName))
DeleteFile(item->photoFileName);
- replaceStrT(item->photoFileName, szAvatarFileName);
+ replaceStrW(item->photoFileName, szAvatarFileName);
debugLog(L"Contact's picture saved to %s", szAvatarFileName);
OnIqResultGotAvatar(hContact, o, szPicType);
}
@@ -669,7 +669,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) m_nJabberSearchID = -1;
if ((vCardNode = XmlGetChild(iqNode, "vCard")) != NULL) {
- if (!mir_tstrcmp(type, L"result")) {
+ if (!mir_wstrcmp(type, L"result")) {
PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
psr.flags = PSR_TCHAR;
@@ -681,14 +681,14 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)id, (LPARAM)&psr);
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
}
- else if (!mir_tstrcmp(type, L"error"))
+ else if (!mir_wstrcmp(type, L"error"))
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
}
else ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
return;
}
- size_t len = mir_tstrlen(m_szJabberJID);
+ size_t len = mir_wstrlen(m_szJabberJID);
if (!wcsnicmp(jid, m_szJabberJID, len) && (jid[len] == '/' || jid[len] == '\0')) {
hContact = NULL;
debugLogA("Vcard for myself");
@@ -699,13 +699,13 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) debugLogA("Other user's vcard");
}
- if (!mir_tstrcmp(type, L"error")) {
+ if (!mir_wstrcmp(type, L"error")) {
if ((hContact = HContactFromJID(jid)) != NULL)
ProtoBroadcastAck(hContact, ACKTYPE_GETINFO, ACKRESULT_FAILED, (HANDLE)1, 0);
return;
}
- if (mir_tstrcmp(type, L"result"))
+ if (mir_wstrcmp(type, L"result"))
return;
bool hasFn = false, hasNick = false, hasGiven = false, hasFamily = false, hasMiddle = false,
@@ -723,19 +723,19 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) if (!n)
break;
if (XmlGetName(n) == NULL) continue;
- if (!mir_tstrcmp(XmlGetName(n), L"FN")) {
+ if (!mir_wstrcmp(XmlGetName(n), L"FN")) {
if (XmlGetText(n) != NULL) {
hasFn = true;
setTString(hContact, "FullName", XmlGetText(n));
}
}
- else if (!mir_tstrcmp(XmlGetName(n), L"NICKNAME")) {
+ else if (!mir_wstrcmp(XmlGetName(n), L"NICKNAME")) {
if (XmlGetText(n) != NULL) {
hasNick = true;
setTString(hContact, "Nick", XmlGetText(n));
}
}
- else if (!mir_tstrcmp(XmlGetName(n), L"N")) {
+ else if (!mir_wstrcmp(XmlGetName(n), L"N")) {
// First/Last name
if (!hasGiven && !hasFamily && !hasMiddle) {
if ((m = XmlGetChild(n, "GIVEN")) != NULL && XmlGetText(m) != NULL) {
@@ -752,7 +752,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) }
}
}
- else if (!mir_tstrcmp(XmlGetName(n), L"EMAIL")) {
+ else if (!mir_wstrcmp(XmlGetName(n), L"EMAIL")) {
// E-mail address(es)
if ((m = XmlGetChild(n, "USERID")) == NULL) // Some bad client put e-mail directly in <EMAIL/> instead of <USERID/>
m = n;
@@ -779,7 +779,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) nEmail++;
}
}
- else if (!mir_tstrcmp(XmlGetName(n), L"BDAY")) {
+ else if (!mir_wstrcmp(XmlGetName(n), L"BDAY")) {
// Birthday
if (!hasBday && XmlGetText(n) != NULL) {
if (hContact != NULL) {
@@ -804,7 +804,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) }
}
}
- else if (!mir_tstrcmp(XmlGetName(n), L"GENDER")) {
+ else if (!mir_wstrcmp(XmlGetName(n), L"GENDER")) {
// Gender
if (!hasGender && XmlGetText(n) != NULL) {
if (hContact != NULL) {
@@ -819,7 +819,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) }
}
}
- else if (!mir_tstrcmp(XmlGetName(n), L"ADR")) {
+ else if (!mir_wstrcmp(XmlGetName(n), L"ADR")) {
if (!hasHome && XmlGetChild(n, "HOME") != NULL) {
// Home address
wchar_t text[128];
@@ -828,9 +828,9 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) hasHomeStreet = true;
if (hContact != NULL) {
if ((o = XmlGetChild(n, "EXTADR")) != NULL && XmlGetText(o) != NULL)
- mir_sntprintf(text, L"%s\r\n%s", XmlGetText(m), XmlGetText(o));
+ mir_snwprintf(text, L"%s\r\n%s", XmlGetText(m), XmlGetText(o));
else if ((o = XmlGetChild(n, "EXTADD")) != NULL && XmlGetText(o) != NULL)
- mir_sntprintf(text, L"%s\r\n%s", XmlGetText(m), XmlGetText(o));
+ mir_snwprintf(text, L"%s\r\n%s", XmlGetText(m), XmlGetText(o));
else
wcsncpy_s(text, XmlGetText(m), _TRUNCATE);
text[_countof(text) - 1] = '\0';
@@ -875,9 +875,9 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) hasWorkStreet = true;
if (hContact != NULL) {
if ((o = XmlGetChild(n, "EXTADR")) != NULL && XmlGetText(o) != NULL)
- mir_sntprintf(text, L"%s\r\n%s", XmlGetText(m), XmlGetText(o));
+ mir_snwprintf(text, L"%s\r\n%s", XmlGetText(m), XmlGetText(o));
else if ((o = XmlGetChild(n, "EXTADD")) != NULL && XmlGetText(o) != NULL)
- mir_sntprintf(text, L"%s\r\n%s", XmlGetText(m), XmlGetText(o));
+ mir_snwprintf(text, L"%s\r\n%s", XmlGetText(m), XmlGetText(o));
else
wcsncpy_s(text, XmlGetText(m), _TRUNCATE);
text[_countof(text) - 1] = '\0';
@@ -914,7 +914,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) }
}
}
- else if (!mir_tstrcmp(XmlGetName(n), L"TEL")) {
+ else if (!mir_wstrcmp(XmlGetName(n), L"TEL")) {
// Telephone/Fax/Cellular
if ((m = XmlGetChild(n, "NUMBER")) != NULL && XmlGetText(m) != NULL) {
if (hContact != NULL) {
@@ -966,14 +966,14 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) }
}
}
- else if (!mir_tstrcmp(XmlGetName(n), L"URL")) {
+ else if (!mir_wstrcmp(XmlGetName(n), L"URL")) {
// Homepage
if (!hasUrl && XmlGetText(n) != NULL) {
hasUrl = true;
setTString(hContact, "Homepage", XmlGetText(n));
}
}
- else if (!mir_tstrcmp(XmlGetName(n), L"ORG")) {
+ else if (!mir_wstrcmp(XmlGetName(n), L"ORG")) {
if (!hasOrgname && !hasOrgunit) {
if ((m = XmlGetChild(n, "ORGNAME")) != NULL && XmlGetText(m) != NULL) {
hasOrgname = true;
@@ -985,19 +985,19 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) }
}
}
- else if (!mir_tstrcmp(XmlGetName(n), L"ROLE")) {
+ else if (!mir_wstrcmp(XmlGetName(n), L"ROLE")) {
if (!hasRole && XmlGetText(n) != NULL) {
hasRole = true;
setTString(hContact, "Role", XmlGetText(n));
}
}
- else if (!mir_tstrcmp(XmlGetName(n), L"TITLE")) {
+ else if (!mir_wstrcmp(XmlGetName(n), L"TITLE")) {
if (!hasTitle && XmlGetText(n) != NULL) {
hasTitle = true;
setTString(hContact, "CompanyPosition", XmlGetText(n));
}
}
- else if (!mir_tstrcmp(XmlGetName(n), L"DESC")) {
+ else if (!mir_wstrcmp(XmlGetName(n), L"DESC")) {
if (!hasDesc && XmlGetText(n) != NULL) {
hasDesc = true;
CMString tszMemo(XmlGetText(n));
@@ -1005,16 +1005,16 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) setTString(hContact, "About", tszMemo);
}
}
- else if (!mir_tstrcmp(XmlGetName(n), L"PHOTO"))
+ else if (!mir_wstrcmp(XmlGetName(n), L"PHOTO"))
OnIqResultGetVcardPhoto(n, hContact, hasPhoto);
}
}
if (hasFn && !hasNick) {
- ptrT nick(getTStringA(hContact, "Nick"));
- ptrT jidNick(JabberNickFromJID(jid));
- if (!nick || (jidNick && !mir_tstrcmpi(nick, jidNick)))
- setTString(hContact, "Nick", ptrT(getTStringA(hContact, "FullName")));
+ ptrW nick(getTStringA(hContact, "Nick"));
+ ptrW jidNick(JabberNickFromJID(jid));
+ if (!nick || (jidNick && !mir_wstrcmpi(nick, jidNick)))
+ setTString(hContact, "Nick", ptrW(getTStringA(hContact, "FullName")));
}
if (!hasFn)
delSetting(hContact, "FullName");
@@ -1125,7 +1125,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) debugLogA("Has no avatar");
delSetting(hContact, "AvatarHash");
- if (ptrT(getTStringA(hContact, "AvatarSaved")) != NULL) {
+ if (ptrW(getTStringA(hContact, "AvatarSaved")) != NULL) {
delSetting(hContact, "AvatarSaved");
ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, NULL, NULL);
}
@@ -1159,7 +1159,7 @@ void CJabberProto::OnIqResultSetSearch(HXML iqNode, CJabberIqInfo*) if ((type = XmlGetAttrValue(iqNode, L"type")) == NULL) return;
if ((id = JabberGetPacketID(iqNode)) == -1) return;
- if (!mir_tstrcmp(type, L"result")) {
+ if (!mir_wstrcmp(type, L"result")) {
if ((queryNode = XmlGetChild(iqNode, "query")) == NULL)
return;
@@ -1170,7 +1170,7 @@ void CJabberProto::OnIqResultSetSearch(HXML iqNode, CJabberIqInfo*) if (!itemNode)
break;
- if (!mir_tstrcmp(XmlGetName(itemNode), L"item")) {
+ if (!mir_wstrcmp(XmlGetName(itemNode), L"item")) {
if ((jid = XmlGetAttrValue(itemNode, L"jid")) != NULL) {
psr.id.w = (wchar_t*)jid;
debugLog(L"Result jid = %s", jid);
@@ -1198,7 +1198,7 @@ void CJabberProto::OnIqResultSetSearch(HXML iqNode, CJabberIqInfo*) ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
}
- else if (!mir_tstrcmp(type, L"error"))
+ else if (!mir_wstrcmp(type, L"error"))
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
}
@@ -1215,14 +1215,14 @@ void CJabberProto::OnIqResultExtSearch(HXML iqNode, CJabberIqInfo*) if (id == -1)
return;
- if (!mir_tstrcmp(type, L"result")) {
+ if (!mir_wstrcmp(type, L"result")) {
if ((queryNode = XmlGetChild(iqNode, "query")) == NULL) return;
if ((queryNode = XmlGetChild(queryNode, "x")) == NULL) return;
for (int i = 0;; i++) {
HXML itemNode = XmlGetChild(queryNode, i);
if (!itemNode)
break;
- if (mir_tstrcmp(XmlGetName(itemNode), L"item"))
+ if (mir_wstrcmp(XmlGetName(itemNode), L"item"))
continue;
PROTOSEARCHRESULT psr = { 0 };
@@ -1234,7 +1234,7 @@ void CJabberProto::OnIqResultExtSearch(HXML iqNode, CJabberIqInfo*) if (!fieldNode)
break;
- if (mir_tstrcmp(XmlGetName(fieldNode), L"field"))
+ if (mir_wstrcmp(XmlGetName(fieldNode), L"field"))
continue;
const wchar_t *fieldName = XmlGetAttrValue(fieldNode, L"var");
@@ -1245,19 +1245,19 @@ void CJabberProto::OnIqResultExtSearch(HXML iqNode, CJabberIqInfo*) if (n == NULL)
continue;
- if (!mir_tstrcmp(fieldName, L"jid")) {
+ if (!mir_wstrcmp(fieldName, L"jid")) {
psr.id.w = (wchar_t*)XmlGetText(n);
debugLog(L"Result jid = %s", psr.id.w);
}
- else if (!mir_tstrcmp(fieldName, L"nickname"))
+ else if (!mir_wstrcmp(fieldName, L"nickname"))
psr.nick.w = (XmlGetText(n) != NULL) ? (wchar_t*)XmlGetText(n) : L"";
- else if (!mir_tstrcmp(fieldName, L"fn"))
+ else if (!mir_wstrcmp(fieldName, L"fn"))
psr.firstName.w = (XmlGetText(n) != NULL) ? (wchar_t*)XmlGetText(n) : L"";
- else if (!mir_tstrcmp(fieldName, L"given"))
+ else if (!mir_wstrcmp(fieldName, L"given"))
psr.firstName.w = (XmlGetText(n) != NULL) ? (wchar_t*)XmlGetText(n) : L"";
- else if (!mir_tstrcmp(fieldName, L"family"))
+ else if (!mir_wstrcmp(fieldName, L"family"))
psr.lastName.w = (XmlGetText(n) != NULL) ? (wchar_t*)XmlGetText(n) : L"";
- else if (!mir_tstrcmp(fieldName, L"email"))
+ else if (!mir_wstrcmp(fieldName, L"email"))
psr.email.w = (XmlGetText(n) != NULL) ? (wchar_t*)XmlGetText(n) : L"";
}
@@ -1266,7 +1266,7 @@ void CJabberProto::OnIqResultExtSearch(HXML iqNode, CJabberIqInfo*) ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
}
- else if (!mir_tstrcmp(type, L"error"))
+ else if (!mir_wstrcmp(type, L"error"))
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
}
@@ -1278,11 +1278,11 @@ void CJabberProto::OnIqResultSetPassword(HXML iqNode, CJabberIqInfo*) if (type == NULL)
return;
- if (!mir_tstrcmp(type, L"result")) {
+ if (!mir_wstrcmp(type, L"result")) {
wcsncpy_s(m_ThreadInfo->conn.password, m_ThreadInfo->tszNewPassword, _TRUNCATE);
MessageBox(NULL, TranslateT("Password is successfully changed. Don't forget to update your password in the Jabber protocol option."), TranslateT("Change Password"), MB_OK | MB_ICONINFORMATION | MB_SETFOREGROUND);
}
- else if (!mir_tstrcmp(type, L"error"))
+ else if (!mir_wstrcmp(type, L"error"))
MessageBox(NULL, TranslateT("Password cannot be changed."), TranslateT("Change Password"), MB_OK | MB_ICONSTOP | MB_SETFOREGROUND);
}
@@ -1300,7 +1300,7 @@ void CJabberProto::OnIqResultGetVCardAvatar(HXML iqNode, CJabberIqInfo*) const wchar_t *type;
if ((type = XmlGetAttrValue(iqNode, L"type")) == NULL) return;
- if (mir_tstrcmp(type, L"result")) return;
+ if (mir_wstrcmp(type, L"result")) return;
HXML vCard = XmlGetChild(iqNode, "vCard");
if (vCard == NULL) return;
@@ -1309,7 +1309,7 @@ void CJabberProto::OnIqResultGetVCardAvatar(HXML iqNode, CJabberIqInfo*) if (XmlGetChildCount(vCard) == 0) {
delSetting(hContact, "AvatarHash");
- if (ptrT(getTStringA(hContact, "AvatarSaved")) != NULL) {
+ if (ptrW(getTStringA(hContact, "AvatarSaved")) != NULL) {
delSetting(hContact, "AvatarSaved");
ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, NULL, NULL);
}
@@ -1339,11 +1339,11 @@ void CJabberProto::OnIqResultGetClientAvatar(HXML iqNode, CJabberIqInfo*) return;
HXML n = NULL;
- if ((type = XmlGetAttrValue(iqNode, L"type")) != NULL && !mir_tstrcmp(type, L"result")) {
+ if ((type = XmlGetAttrValue(iqNode, L"type")) != NULL && !mir_wstrcmp(type, L"result")) {
HXML queryNode = XmlGetChild(iqNode, "query");
if (queryNode != NULL) {
const wchar_t *xmlns = XmlGetAttrValue(queryNode, L"xmlns");
- if (!mir_tstrcmp(xmlns, JABBER_FEAT_AVATAR))
+ if (!mir_wstrcmp(xmlns, JABBER_FEAT_AVATAR))
n = XmlGetChild(queryNode, "data");
}
}
@@ -1354,7 +1354,7 @@ void CJabberProto::OnIqResultGetClientAvatar(HXML iqNode, CJabberIqInfo*) }
wchar_t szJid[JABBER_MAX_JID_LEN];
- mir_tstrncpy(szJid, from, _countof(szJid));
+ mir_wstrncpy(szJid, from, _countof(szJid));
wchar_t *res = wcschr(szJid, '/');
if (res != NULL)
*res = 0;
@@ -1379,11 +1379,11 @@ void CJabberProto::OnIqResultGetServerAvatar(HXML iqNode, CJabberIqInfo*) HXML n = NULL;
const wchar_t *type = XmlGetAttrValue(iqNode, L"type");
- if (!mir_tstrcmp(type, L"result")) {
+ if (!mir_wstrcmp(type, L"result")) {
HXML queryNode = XmlGetChild(iqNode, "query");
if (queryNode != NULL) {
const wchar_t *xmlns = XmlGetAttrValue(queryNode, L"xmlns");
- if (!mir_tstrcmp(xmlns, JABBER_FEAT_SERVER_AVATAR))
+ if (!mir_wstrcmp(xmlns, JABBER_FEAT_SERVER_AVATAR))
n = XmlGetChild(queryNode, "data");
}
}
@@ -1394,7 +1394,7 @@ void CJabberProto::OnIqResultGetServerAvatar(HXML iqNode, CJabberIqInfo*) }
wchar_t szJid[JABBER_MAX_JID_LEN];
- mir_tstrncpy(szJid, from, _countof(szJid));
+ mir_wstrncpy(szJid, from, _countof(szJid));
wchar_t *res = wcschr(szJid, '/');
if (res != NULL)
*res = 0;
@@ -1414,10 +1414,10 @@ void CJabberProto::OnIqResultGotAvatar(MCONTACT hContact, HXML n, const wchar_t int pictureType;
if (mimeType != NULL) {
- if (!mir_tstrcmp(mimeType, L"image/jpeg")) pictureType = PA_FORMAT_JPEG;
- else if (!mir_tstrcmp(mimeType, L"image/png")) pictureType = PA_FORMAT_PNG;
- else if (!mir_tstrcmp(mimeType, L"image/gif")) pictureType = PA_FORMAT_GIF;
- else if (!mir_tstrcmp(mimeType, L"image/bmp")) pictureType = PA_FORMAT_BMP;
+ if (!mir_wstrcmp(mimeType, L"image/jpeg")) pictureType = PA_FORMAT_JPEG;
+ else if (!mir_wstrcmp(mimeType, L"image/png")) pictureType = PA_FORMAT_PNG;
+ else if (!mir_wstrcmp(mimeType, L"image/gif")) pictureType = PA_FORMAT_GIF;
+ else if (!mir_wstrcmp(mimeType, L"image/bmp")) pictureType = PA_FORMAT_BMP;
else {
LBL_ErrFormat:
debugLog(L"Invalid mime type specified for picture: %s", mimeType);
@@ -1474,7 +1474,7 @@ void CJabberProto::OnIqResultDiscoBookmarks(HXML iqNode, CJabberIqInfo*) return;
const wchar_t *jid;
- if (!mir_tstrcmp(type, L"result")) {
+ if (!mir_wstrcmp(type, L"result")) {
if (m_ThreadInfo && !(m_ThreadInfo->jabberServerCaps & JABBER_CAPS_PRIVATE_STORAGE)) {
m_ThreadInfo->jabberServerCaps |= JABBER_CAPS_PRIVATE_STORAGE;
EnableMenuItems(true);
@@ -1486,23 +1486,23 @@ void CJabberProto::OnIqResultDiscoBookmarks(HXML iqNode, CJabberIqInfo*) HXML itemNode;
for (int i = 0; itemNode = XmlGetChild(storageNode, i); i++) {
if (LPCTSTR name = XmlGetName(itemNode)) {
- if (!mir_tstrcmp(name, L"conference") && (jid = XmlGetAttrValue(itemNode, L"jid"))) {
+ if (!mir_wstrcmp(name, L"conference") && (jid = XmlGetAttrValue(itemNode, L"jid"))) {
JABBER_LIST_ITEM *item = ListAdd(LIST_BOOKMARK, jid);
- item->name = mir_tstrdup(XmlGetAttrValue(itemNode, L"name"));
- item->type = mir_tstrdup(L"conference");
+ item->name = mir_wstrdup(XmlGetAttrValue(itemNode, L"name"));
+ item->type = mir_wstrdup(L"conference");
item->bUseResource = true;
- item->nick = mir_tstrdup(XPathT(itemNode, "nick"));
- item->password = mir_tstrdup(XPathT(itemNode, "password"));
+ item->nick = mir_wstrdup(XPathT(itemNode, "nick"));
+ item->password = mir_wstrdup(XPathT(itemNode, "password"));
const wchar_t *autoJ = XmlGetAttrValue(itemNode, L"autojoin");
if (autoJ != NULL)
- item->bAutoJoin = !mir_tstrcmp(autoJ, L"true") || !mir_tstrcmp(autoJ, L"1");
+ item->bAutoJoin = !mir_wstrcmp(autoJ, L"true") || !mir_wstrcmp(autoJ, L"1");
}
- else if (!mir_tstrcmp(name, L"url") && (jid = XmlGetAttrValue(itemNode, L"url"))) {
+ else if (!mir_wstrcmp(name, L"url") && (jid = XmlGetAttrValue(itemNode, L"url"))) {
JABBER_LIST_ITEM *item = ListAdd(LIST_BOOKMARK, jid);
item->bUseResource = true;
- item->name = mir_tstrdup(XmlGetAttrValue(itemNode, L"name"));
- item->type = mir_tstrdup(L"url");
+ item->name = mir_wstrdup(XmlGetAttrValue(itemNode, L"name"));
+ item->type = mir_wstrdup(L"url");
}
}
}
@@ -1512,7 +1512,7 @@ void CJabberProto::OnIqResultDiscoBookmarks(HXML iqNode, CJabberIqInfo*) OnProcessLoginRq(m_ThreadInfo, JABBER_LOGIN_BOOKMARKS);
}
}
- else if (!mir_tstrcmp(type, L"error")) {
+ else if (!mir_wstrcmp(type, L"error")) {
if (m_ThreadInfo->jabberServerCaps & JABBER_CAPS_PRIVATE_STORAGE) {
m_ThreadInfo->jabberServerCaps &= ~JABBER_CAPS_PRIVATE_STORAGE;
EnableMenuItems(true);
@@ -1532,7 +1532,7 @@ void CJabberProto::SetBookmarkRequest(XmlNodeIq& iq) if (item == NULL || item->jid == NULL)
continue;
- if (!mir_tstrcmp(item->type, L"conference")) {
+ if (!mir_wstrcmp(item->type, L"conference")) {
HXML itemNode = storage << XCHILD(L"conference") << XATTR(L"jid", item->jid);
if (item->name)
itemNode << XATTR(L"name", item->name);
@@ -1544,7 +1544,7 @@ void CJabberProto::SetBookmarkRequest(XmlNodeIq& iq) itemNode << XCHILD(L"password", item->password);
}
- if (!mir_tstrcmp(item->type, L"url")) {
+ if (!mir_wstrcmp(item->type, L"url")) {
HXML itemNode = storage << XCHILD(L"url") << XATTR(L"url", item->jid);
if (item->name)
itemNode << XATTR(L"name", item->name);
@@ -1563,10 +1563,10 @@ void CJabberProto::OnIqResultSetBookmarks(HXML iqNode, CJabberIqInfo*) if (type == NULL)
return;
- if (!mir_tstrcmp(type, L"result")) {
+ if (!mir_wstrcmp(type, L"result")) {
UI_SAFE_NOTIFY(m_pDlgBookmarks, WM_JABBER_REFRESH);
}
- else if (!mir_tstrcmp(type, L"error")) {
+ else if (!mir_wstrcmp(type, L"error")) {
HXML errorNode = XmlGetChild(iqNode, "error");
wchar_t *str = JabberErrorMsg(errorNode);
MessageBox(NULL, str, TranslateT("Jabber Bookmarks Error"), MB_OK | MB_SETFOREGROUND);
@@ -1593,7 +1593,7 @@ void CJabberProto::OnIqResultLastActivity(HXML iqNode, CJabberIqInfo *pInfo) LPCTSTR szLastStatusMessage = XPathT(iqNode, "query[@xmlns='jabber:iq:last']");
if (szLastStatusMessage) // replace only if it exists
- r->m_tszStatusMessage = mir_tstrdup(szLastStatusMessage);
+ r->m_tszStatusMessage = mir_wstrdup(szLastStatusMessage);
}
r->m_dwIdleStartTime = lastActivity;
diff --git a/protocols/JabberG/src/jabber_iqid_muc.cpp b/protocols/JabberG/src/jabber_iqid_muc.cpp index 1795ccbcfb..1904cb0cf7 100644 --- a/protocols/JabberG/src/jabber_iqid_muc.cpp +++ b/protocols/JabberG/src/jabber_iqid_muc.cpp @@ -49,17 +49,17 @@ void CJabberProto::OnIqResultGetMuc(HXML iqNode, CJabberIqInfo*) if (from == NULL)
return;
- if (!mir_tstrcmp(type, L"result")) {
+ if (!mir_wstrcmp(type, L"result")) {
HXML queryNode = XmlGetChild(iqNode, L"query");
if (queryNode != NULL) {
LPCTSTR str = XmlGetAttrValue(queryNode, L"xmlns");
- if (!mir_tstrcmp(str, JABBER_FEAT_MUC_OWNER)) {
+ if (!mir_wstrcmp(str, JABBER_FEAT_MUC_OWNER)) {
HXML xNode = XmlGetChild(queryNode, L"x");
if (xNode != NULL) {
str = XmlGetAttrValue(xNode, L"xmlns");
- if (!mir_tstrcmp(str, JABBER_FEAT_DATA_FORMS))
+ if (!mir_wstrcmp(str, JABBER_FEAT_DATA_FORMS))
//LaunchForm(xNode);
- FormCreateDialog(xNode, L"Jabber Conference Room Configuration", &CJabberProto::SetMucConfig, mir_tstrdup(from));
+ FormCreateDialog(xNode, L"Jabber Conference Room Configuration", &CJabberProto::SetMucConfig, mir_wstrdup(from));
}
}
}
@@ -116,14 +116,14 @@ static void sttFillJidList(HWND hwndDlg) if (jidListInfo->type == MUC_BANLIST) {
LPCTSTR reason = XmlGetText(XmlGetChild(itemNode, L"reason"));
if (reason != NULL) {
- mir_sntprintf(tszItemText, L"%s (%s)", jid, reason);
+ mir_snwprintf(tszItemText, L"%s (%s)", jid, reason);
lvi.pszText = tszItemText;
}
}
else if (jidListInfo->type == MUC_VOICELIST || jidListInfo->type == MUC_MODERATORLIST) {
LPCTSTR nick = XmlGetAttrValue(itemNode, L"nick");
if (nick != NULL) {
- mir_sntprintf(tszItemText, L"%s (%s)", nick, jid);
+ mir_snwprintf(tszItemText, L"%s (%s)", nick, jid);
lvi.pszText = tszItemText;
}
}
@@ -131,7 +131,7 @@ static void sttFillJidList(HWND hwndDlg) if (filter && *filter && !JabberStrIStr(lvi.pszText, filter))
continue;
- lvi.lParam = (LPARAM)mir_tstrdup(jid);
+ lvi.lParam = (LPARAM)mir_wstrdup(jid);
ListView_InsertItem(hwndList, &lvi);
lvi.iItem++;
@@ -235,17 +235,17 @@ static INT_PTR CALLBACK JabberMucJidListDlgProc(HWND hwndDlg, UINT msg, WPARAM w SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
// Populate displayed list from iqNode
- mir_tstrncpy(title, TranslateT("JID List"), _countof(title));
+ mir_wstrncpy(title, TranslateT("JID List"), _countof(title));
if ((dat = (JABBER_MUC_JIDLIST_INFO *)lParam) != NULL) {
HXML iqNode = dat->iqNode;
if (iqNode != NULL) {
LPCTSTR from = XmlGetAttrValue(iqNode, L"from");
if (from != NULL) {
- dat->roomJid = mir_tstrdup(from);
+ dat->roomJid = mir_wstrdup(from);
HXML queryNode = XmlGetChild(iqNode, L"query");
if (queryNode != NULL) {
- wchar_t *localFrom = mir_tstrdup(from);
- mir_sntprintf(title, TranslateT("%s, %d items (%s)"),
+ wchar_t *localFrom = mir_wstrdup(from);
+ mir_snwprintf(title, TranslateT("%s, %d items (%s)"),
(dat->type == MUC_VOICELIST) ? TranslateT("Voice List") :
(dat->type == MUC_MEMBERLIST) ? TranslateT("Member List") :
(dat->type == MUC_MODERATORLIST) ? TranslateT("Moderator List") :
@@ -345,7 +345,7 @@ static INT_PTR CALLBACK JabberMucJidListDlgProc(HWND hwndDlg, UINT msg, WPARAM w //delete
wchar_t msgText[128];
- mir_sntprintf(msgText, TranslateT("Removing %s?"), text);
+ mir_snwprintf(msgText, TranslateT("Removing %s?"), text);
if (MessageBox(hwndDlg, msgText, dat->type2str(), MB_YESNO | MB_SETFOREGROUND) == IDYES) {
dat->ppro->DeleteMucListItem(dat, (wchar_t*)lvi.lParam);
mir_free((void *)lvi.lParam);
@@ -484,7 +484,7 @@ void CJabberProto::OnIqResultMucGetJidList(HXML iqNode, JABBER_MUC_JIDLIST_TYPE if (type == NULL)
return;
- if (!mir_tstrcmp(type, L"result")) {
+ if (!mir_wstrcmp(type, L"result")) {
JABBER_MUC_JIDLIST_INFO *jidListInfo = new JABBER_MUC_JIDLIST_INFO;
if (jidListInfo != NULL) {
jidListInfo->type = listType;
diff --git a/protocols/JabberG/src/jabber_libstr.cpp b/protocols/JabberG/src/jabber_libstr.cpp index 24b13f8478..8c8ce64065 100644 --- a/protocols/JabberG/src/jabber_libstr.cpp +++ b/protocols/JabberG/src/jabber_libstr.cpp @@ -29,5 +29,5 @@ int lstrcmp_null(const wchar_t *s1, const wchar_t *s2) if (!s1 && !s2) return 0;
if (!s1) return -1;
if (!s2) return 1;
- return mir_tstrcmp(s1, s2);
+ return mir_wstrcmp(s1, s2);
}
diff --git a/protocols/JabberG/src/jabber_list.cpp b/protocols/JabberG/src/jabber_list.cpp index 434bdd1028..1e4c95f77f 100644 --- a/protocols/JabberG/src/jabber_list.cpp +++ b/protocols/JabberG/src/jabber_list.cpp @@ -91,12 +91,12 @@ void CJabberProto::ListInit(void) {
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
if (isChatRoom(hContact)) {
- ptrT jid(getTStringA(hContact, "ChatRoomID"));
+ ptrW jid(getTStringA(hContact, "ChatRoomID"));
if (jid != NULL)
ListAdd(LIST_CHATROOM, jid, hContact);
}
else {
- ptrT jid(getTStringA(hContact, "jid"));
+ ptrW jid(getTStringA(hContact, "jid"));
if (jid != NULL)
ListAdd(LIST_ROSTER, jid, hContact);
}
@@ -127,7 +127,7 @@ JABBER_LIST_ITEM* CJabberProto::ListAdd(JABBER_LIST list, const wchar_t *jid, MC return item;
}
- wchar_t *s = mir_tstrdup(jid);
+ wchar_t *s = mir_wstrdup(jid);
wchar_t *q = NULL;
// strip resource name if any
//fyr
@@ -244,7 +244,7 @@ pResourceStatus JABBER_LIST_ITEM::findResource(const wchar_t *resourceName) cons for (int i = 0; i < arResources.getCount(); i++) {
JABBER_RESOURCE_STATUS *r = arResources[i];
- if (!mir_tstrcmp(r->m_tszResourceName, resourceName))
+ if (!mir_wstrcmp(r->m_tszResourceName, resourceName))
return r;
}
@@ -282,7 +282,7 @@ bool CJabberProto::ListAddResource(JABBER_LIST list, const wchar_t *jid, int sta JABBER_RESOURCE_STATUS *r = LI->findResource(resource);
if (r != NULL) { // Already exists, update status and statusMessage
r->m_iStatus = status;
- r->m_tszStatusMessage = mir_tstrdup(statusMessage);
+ r->m_tszStatusMessage = mir_wstrdup(statusMessage);
r->m_iPriority = priority;
}
else { // Does not exist, add new resource
@@ -291,10 +291,10 @@ bool CJabberProto::ListAddResource(JABBER_LIST list, const wchar_t *jid, int sta r->m_iStatus = status;
r->m_affiliation = AFFILIATION_NONE;
r->m_role = ROLE_NONE;
- r->m_tszResourceName = mir_tstrdup(resource);
- r->m_tszNick = mir_tstrdup(nick);
+ r->m_tszResourceName = mir_wstrdup(resource);
+ r->m_tszNick = mir_wstrdup(nick);
if (statusMessage)
- r->m_tszStatusMessage = mir_tstrdup(statusMessage);
+ r->m_tszStatusMessage = mir_wstrdup(statusMessage);
r->m_iPriority = priority;
LI->arResources.insert(r);
}
@@ -303,7 +303,7 @@ bool CJabberProto::ListAddResource(JABBER_LIST list, const wchar_t *jid, int sta else {
JABBER_RESOURCE_STATUS *r = LI->getTemp();
r->m_iStatus = status;
- r->m_tszStatusMessage = mir_tstrdup(statusMessage);
+ r->m_tszStatusMessage = mir_wstrdup(statusMessage);
}
lck.unlock();
diff --git a/protocols/JabberG/src/jabber_list.h b/protocols/JabberG/src/jabber_list.h index 29f145422c..f3184582eb 100644 --- a/protocols/JabberG/src/jabber_list.h +++ b/protocols/JabberG/src/jabber_list.h @@ -85,29 +85,29 @@ public: void Release();
int m_iStatus;
- ptrT m_tszResourceName;
- ptrT m_tszStatusMessage;
+ ptrW m_tszResourceName;
+ ptrW m_tszStatusMessage;
int m_iPriority; // resource priority, -128..+127
time_t m_dwIdleStartTime;// XEP-0012 support
// groupchat support
JABBER_GC_AFFILIATION m_affiliation;
JABBER_GC_ROLE m_role;
- ptrT m_tszNick;
- ptrT m_tszRealJid; // real jid for jabber conferences
+ ptrW m_tszNick;
+ ptrW m_tszRealJid; // real jid for jabber conferences
// XEP-0115 support
- ptrT m_tszCapsNode;
- ptrT m_tszCapsVer;
- ptrT m_tszCapsExt;
+ ptrW m_tszCapsNode;
+ ptrW m_tszCapsVer;
+ ptrW m_tszCapsExt;
DWORD m_dwVersionRequestTime, m_dwDiscoInfoRequestTime;
JabberCapsBits m_jcbCachedCaps;
JabberCapsBits m_jcbManualDiscoveredCaps;
// XEP-232 support
- ptrT m_tszOs, m_tszOsVersion;
- ptrT m_tszSoftware, m_tszSoftwareVersion, m_tszXMirandaCoreVersion;
+ ptrW m_tszOs, m_tszOsVersion;
+ ptrW m_tszSoftware, m_tszSoftwareVersion, m_tszXMirandaCoreVersion;
// XEP-0085 gone event support
BOOL m_bMessageSessionActive;
@@ -221,7 +221,7 @@ struct JABBER_HTTP_AVATARS MCONTACT hContact;
JABBER_HTTP_AVATARS(const wchar_t *tUrl, MCONTACT thContact)
- : Url(mir_t2a(tUrl)), hContact(thContact) {}
+ : Url(mir_u2a(tUrl)), hContact(thContact) {}
~JABBER_HTTP_AVATARS() { mir_free(Url); }
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index 3df1e3989d..512ec95593 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -374,7 +374,7 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM) bool bIsTransport = getBool(hContact, "IsTransport", false);
if ((bIsChatRoom == GCW_CHATROOM) || bIsChatRoom == 0) {
- if (ptrT(getTStringA(hContact, bIsChatRoom ? (char*)"ChatRoomID" : (char*)"jid")) != NULL) {
+ if (ptrW(getTStringA(hContact, bIsChatRoom ? (char*)"ChatRoomID" : (char*)"jid")) != NULL) {
Menu_ShowItem(g_hMenuConvert, TRUE);
Menu_ModifyItem(g_hMenuConvert, bIsChatRoom ? LPGENW("&Convert to Contact") : LPGENW("&Convert to Chat Room"));
}
@@ -388,7 +388,7 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM) Menu_ModifyItem(g_hMenuDirectPresence[i + 1], NULL, Skin_LoadProtoIcon(m_szModuleName, PresenceModeArray[i].mode));
if (bIsChatRoom) {
- ptrT roomid(getTStringA(hContact, "ChatRoomID"));
+ ptrW roomid(getTStringA(hContact, "ChatRoomID"));
if (roomid != NULL) {
Menu_ShowItem(g_hMenuRosterAdd, FALSE);
@@ -406,7 +406,7 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM) Menu_ShowItem(g_hMenuRefresh, TRUE);
}
- ptrT jid(getTStringA(hContact, "jid"));
+ ptrW jid(getTStringA(hContact, "jid"));
if (jid == NULL)
return 0;
@@ -477,7 +477,7 @@ INT_PTR __cdecl CJabberProto::OnMenuConvertChatContact(WPARAM hContact, LPARAM) BYTE bIsChatRoom = isChatRoom(hContact);
const char *szSetting = (bIsChatRoom) ? "ChatRoomID" : "jid";
- ptrT jid(getTStringA(hContact, szSetting));
+ ptrW jid(getTStringA(hContact, szSetting));
if (jid != NULL) {
delSetting(hContact, szSetting);
setTString(hContact, szSetting, jid);
@@ -491,21 +491,21 @@ INT_PTR __cdecl CJabberProto::OnMenuRosterAdd(WPARAM hContact, LPARAM) if (!hContact)
return 0; // we do not add ourself to the roster. (buggy situation - should not happen)
- ptrT roomID(getTStringA(hContact, "ChatRoomID"));
+ ptrW roomID(getTStringA(hContact, "ChatRoomID"));
if (roomID == NULL)
return 0;
if (ListGetItemPtr(LIST_ROSTER, roomID) == NULL) {
- ptrT group(db_get_tsa(hContact, "CList", "Group"));
- ptrT nick(getTStringA(hContact, "Nick"));
+ ptrW group(db_get_tsa(hContact, "CList", "Group"));
+ ptrW nick(getTStringA(hContact, "Nick"));
AddContactToRoster(roomID, nick, group);
if (m_options.AddRoster2Bookmarks == TRUE) {
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_BOOKMARK, roomID);
if (item == NULL) {
item = new JABBER_LIST_ITEM();
- item->jid = mir_tstrdup(roomID);
- item->name = mir_tstrdup(nick);
+ item->jid = mir_wstrdup(roomID);
+ item->name = mir_wstrdup(nick);
item->nick = getTStringA(hContact, "MyNick");
AddEditBookmark(item);
delete item;
@@ -518,7 +518,7 @@ INT_PTR __cdecl CJabberProto::OnMenuRosterAdd(WPARAM hContact, LPARAM) INT_PTR __cdecl CJabberProto::OnMenuHandleRequestAuth(WPARAM hContact, LPARAM)
{
if (hContact != NULL && m_bJabberOnline) {
- ptrT jid(getTStringA(hContact, "jid"));
+ ptrW jid(getTStringA(hContact, "jid"));
if (jid != NULL)
m_ThreadInfo->send(XmlNode(L"presence") << XATTR(L"to", jid) << XATTR(L"type", L"subscribe"));
}
@@ -528,7 +528,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleRequestAuth(WPARAM hContact, LPARAM) INT_PTR __cdecl CJabberProto::OnMenuHandleGrantAuth(WPARAM hContact, LPARAM)
{
if (hContact != NULL && m_bJabberOnline) {
- ptrT jid(getTStringA(hContact, "jid"));
+ ptrW jid(getTStringA(hContact, "jid"));
if (jid != NULL)
m_ThreadInfo->send(XmlNode(L"presence") << XATTR(L"to", jid) << XATTR(L"type", L"subscribed"));
}
@@ -538,7 +538,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleGrantAuth(WPARAM hContact, LPARAM) INT_PTR __cdecl CJabberProto::OnMenuRevokeAuth(WPARAM hContact, LPARAM)
{
if (hContact != NULL && m_bJabberOnline) {
- ptrT jid(getTStringA(hContact, "jid"));
+ ptrW jid(getTStringA(hContact, "jid"));
if (jid != NULL)
m_ThreadInfo->send(XmlNode(L"presence") << XATTR(L"to", jid) << XATTR(L"type", L"unsubscribed"));
}
@@ -550,7 +550,7 @@ INT_PTR __cdecl CJabberProto::OnMenuTransportLogin(WPARAM hContact, LPARAM) if (!getByte(hContact, "IsTransport", 0))
return 0;
- JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, ptrT(getTStringA(hContact, "jid")));
+ JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, ptrW(getTStringA(hContact, "jid")));
if (item != NULL) {
XmlNode p(L"presence"); XmlAddAttr(p, L"to", item->jid);
if (item->getTemp()->m_iStatus == ID_STATUS_ONLINE)
@@ -565,7 +565,7 @@ INT_PTR __cdecl CJabberProto::OnMenuTransportResolve(WPARAM hContact, LPARAM) if (!getByte(hContact, "IsTransport", 0))
return 0;
- ptrT jid(getTStringA(hContact, "jid"));
+ ptrW jid(getTStringA(hContact, "jid"));
if (jid != NULL)
ResolveTransportNicks(jid);
return 0;
@@ -576,13 +576,13 @@ INT_PTR __cdecl CJabberProto::OnMenuBookmarkAdd(WPARAM hContact, LPARAM) if (!hContact)
return 0; // we do not add ourself to the roster. (buggy situation - should not happen)
- ptrT roomID(getTStringA(hContact, "ChatRoomID"));
+ ptrW roomID(getTStringA(hContact, "ChatRoomID"));
if (roomID == NULL)
return 0;
if (ListGetItemPtr(LIST_BOOKMARK, roomID) == NULL) {
JABBER_LIST_ITEM *item = new JABBER_LIST_ITEM();
- item->jid = mir_tstrdup(roomID);
+ item->jid = mir_wstrdup(roomID);
item->name = pcli->pfnGetContactDisplayName(hContact, 0);
item->type = L"conference";
item->nick = getTStringA(hContact, "MyNick");
@@ -723,11 +723,11 @@ void CJabberProto::MenuInit() mir_snprintf(srvFce, "/menuSetPriority/%d", steps[i]);
if (steps[i] > 0) {
- mir_sntprintf(szName, TranslateT("Increase priority by %d"), steps[i]);
+ mir_snwprintf(szName, TranslateT("Increase priority by %d"), steps[i]);
mi.hIcolibItem = GetIconHandle(IDI_ARROW_UP);
}
else {
- mir_sntprintf(szName, TranslateT("Decrease priority by %d"), -steps[i]);
+ mir_snwprintf(szName, TranslateT("Decrease priority by %d"), -steps[i]);
mi.hIcolibItem = GetIconHandle(IDI_ARROW_DOWN);
}
@@ -771,7 +771,7 @@ void CJabberProto::UpdatePriorityMenu(int priority) return;
wchar_t szName[128];
- mir_sntprintf(szName, TranslateT("Resource priority [%d]"), (int)priority);
+ mir_snwprintf(szName, TranslateT("Resource priority [%d]"), (int)priority);
Menu_ModifyItem(m_hMenuPriorityRoot, szName);
m_priorityMenuVal = priority;
@@ -941,7 +941,7 @@ int CJabberProto::OnProcessSrmmEvent(WPARAM, LPARAM lParam) hDialogsList = WindowList_Create();
WindowList_Add(hDialogsList, event->hwndWindow, event->hContact);
- ptrT jid(getTStringA(event->hContact, "jid"));
+ ptrW jid(getTStringA(event->hContact, "jid"));
if (jid != NULL) {
JABBER_LIST_ITEM *pItem = ListGetItemPtr(LIST_ROSTER, jid);
if (pItem && m_ThreadInfo && (m_ThreadInfo->jabberServerCaps & JABBER_CAPS_ARCHIVE_AUTO) && m_options.EnableMsgArchive)
@@ -991,14 +991,14 @@ int CJabberProto::OnProcessSrmmIconClick(WPARAM hContact, LPARAM lParam) if (!hContact)
return 0;
- JABBER_LIST_ITEM *LI = ListGetItemPtr(LIST_ROSTER, ptrT(getTStringA(hContact, "jid")));
+ JABBER_LIST_ITEM *LI = ListGetItemPtr(LIST_ROSTER, ptrW(getTStringA(hContact, "jid")));
if (LI == NULL)
return 0;
HMENU hMenu = CreatePopupMenu();
wchar_t buf[256];
- mir_sntprintf(buf, TranslateT("Last active (%s)"),
+ mir_snwprintf(buf, TranslateT("Last active (%s)"),
LI->m_pLastSeenResource ? LI->m_pLastSeenResource->m_tszResourceName : TranslateT("No activity yet, use server's choice"));
AppendMenu(hMenu, MF_STRING, MENUITEM_LASTSEEN, buf);
@@ -1041,7 +1041,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleResource(WPARAM hContact, LPARAM, LPAR if (!m_bJabberOnline || !hContact)
return 0;
- ptrT tszJid(getTStringA(hContact, "jid"));
+ ptrW tszJid(getTStringA(hContact, "jid"));
if (tszJid == NULL)
return 0;
@@ -1073,9 +1073,9 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleDirectPresence(WPARAM hContact, LPARAM return 0;
wchar_t *jid, text[1024];
- ptrT tszJid(getTStringA(hContact, "jid"));
+ ptrW tszJid(getTStringA(hContact, "jid"));
if (tszJid == NULL) {
- ptrT roomid(getTStringA(hContact, "ChatRoomID"));
+ ptrW roomid(getTStringA(hContact, "ChatRoomID"));
if (roomid == NULL)
return 0;
@@ -1083,7 +1083,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleDirectPresence(WPARAM hContact, LPARAM if (item == NULL)
return 0;
- mir_sntprintf(text, L"%s/%s", item->jid, item->nick);
+ mir_snwprintf(text, L"%s/%s", item->jid, item->nick);
jid = text;
}
else jid = tszJid;
diff --git a/protocols/JabberG/src/jabber_message_handlers.cpp b/protocols/JabberG/src/jabber_message_handlers.cpp index cb17a7fa13..b0ffaddade 100644 --- a/protocols/JabberG/src/jabber_message_handlers.cpp +++ b/protocols/JabberG/src/jabber_message_handlers.cpp @@ -36,7 +36,7 @@ BOOL CJabberProto::OnMessageError(HXML node, ThreadData*, CJabberMessageInfo* pI if (item != NULL) { // yes, it is
wchar_t *szErrText = JabberErrorMsg(pInfo->GetChildNode());
if (id != -1) {
- char *errText = mir_t2a(szErrText);
+ char *errText = mir_u2a(szErrText);
ProtoBroadcastAck(pInfo->GetHContact(), ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)id, (LPARAM)errText);
mir_free(errText);
}
@@ -44,9 +44,9 @@ BOOL CJabberProto::OnMessageError(HXML node, ThreadData*, CJabberMessageInfo* pI wchar_t buf[512];
HXML bodyNode = XmlGetChild(node, "body");
if (bodyNode)
- mir_sntprintf(buf, L"%s:\n%s\n%s", pInfo->GetFrom(), XmlGetText(bodyNode), szErrText);
+ mir_snwprintf(buf, L"%s:\n%s\n%s", pInfo->GetFrom(), XmlGetText(bodyNode), szErrText);
else
- mir_sntprintf(buf, L"%s:\n%s", pInfo->GetFrom(), szErrText);
+ mir_snwprintf(buf, L"%s:\n%s", pInfo->GetFrom(), szErrText);
MsgPopup(NULL, buf, TranslateT("Jabber Error"));
}
diff --git a/protocols/JabberG/src/jabber_message_manager.cpp b/protocols/JabberG/src/jabber_message_manager.cpp index c6253582ae..99b853bca9 100644 --- a/protocols/JabberG/src/jabber_message_manager.cpp +++ b/protocols/JabberG/src/jabber_message_manager.cpp @@ -59,15 +59,15 @@ bool CJabberMessageManager::HandleMessagePermanent(HXML node, ThreadData *pThrea LPCTSTR szType = XmlGetAttrValue(node, L"type");
if (szType) {
- if (!mir_tstrcmpi(szType, L"normal"))
+ if (!mir_wstrcmpi(szType, L"normal"))
messageInfo.m_nMessageType = JABBER_MESSAGE_TYPE_NORMAL;
- else if (!mir_tstrcmpi(szType, L"error"))
+ else if (!mir_wstrcmpi(szType, L"error"))
messageInfo.m_nMessageType = JABBER_MESSAGE_TYPE_ERROR;
- else if (!mir_tstrcmpi(szType, L"chat"))
+ else if (!mir_wstrcmpi(szType, L"chat"))
messageInfo.m_nMessageType = JABBER_MESSAGE_TYPE_CHAT;
- else if (!mir_tstrcmpi(szType, L"groupchat"))
+ else if (!mir_wstrcmpi(szType, L"groupchat"))
messageInfo.m_nMessageType = JABBER_MESSAGE_TYPE_GROUPCHAT;
- else if (!mir_tstrcmpi(szType, L"headline"))
+ else if (!mir_wstrcmpi(szType, L"headline"))
messageInfo.m_nMessageType = JABBER_MESSAGE_TYPE_HEADLINE;
else
return false;
@@ -82,7 +82,7 @@ bool CJabberMessageManager::HandleMessagePermanent(HXML node, ThreadData *pThrea LPCTSTR szTagName = XmlGetName(child);
LPCTSTR szXmlns = XmlGetAttrValue(child, L"xmlns");
- if ((!pInfo.m_szXmlns || (szXmlns && !mir_tstrcmp(pInfo.m_szXmlns, szXmlns))) && (!pInfo.m_szTag || !mir_tstrcmp(pInfo.m_szTag, szTagName))) {
+ if ((!pInfo.m_szXmlns || (szXmlns && !mir_wstrcmp(pInfo.m_szXmlns, szXmlns))) && (!pInfo.m_szTag || !mir_wstrcmp(pInfo.m_szTag, szTagName))) {
// node suits handler criteria, call the handler
messageInfo.m_hChildNode = child;
messageInfo.m_szChildTagName = szTagName;
@@ -125,9 +125,9 @@ CJabberMessagePermanentInfo* CJabberMessageManager::AddPermanentHandler( CJabberMessagePermanentInfo* pInfo = new CJabberMessagePermanentInfo();
pInfo->m_pHandler = pHandler;
pInfo->m_nMessageTypes = nMessageTypes ? nMessageTypes : JABBER_MESSAGE_TYPE_ANY;
- pInfo->m_szXmlns = mir_tstrdup(szXmlns);
+ pInfo->m_szXmlns = mir_wstrdup(szXmlns);
pInfo->m_bAllowPartialNs = bAllowPartialNs;
- pInfo->m_szTag = mir_tstrdup(szTag);
+ pInfo->m_szTag = mir_wstrdup(szTag);
pInfo->m_dwParamsToParse = dwParamsToParse;
pInfo->m_pUserData = pUserData;
pInfo->m_pUserDataFree = pUserDataFree;
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp index 36d7eda517..ac90da7561 100644 --- a/protocols/JabberG/src/jabber_misc.cpp +++ b/protocols/JabberG/src/jabber_misc.cpp @@ -156,7 +156,7 @@ BOOL CJabberProto::AddDbPresenceEvent(MCONTACT hContact, BYTE btEventType) void CJabberProto::GetAvatarFileName(MCONTACT hContact, wchar_t* pszDest, size_t cbLen)
{
- int tPathLen = mir_sntprintf(pszDest, cbLen, L"%s\\%S", VARST(L"%miranda_avatarcache%"), m_szModuleName);
+ int tPathLen = mir_snwprintf(pszDest, cbLen, L"%s\\%S", VARST(L"%miranda_avatarcache%"), m_szModuleName);
DWORD dwAttributes = GetFileAttributes(pszDest);
if (dwAttributes == 0xffffffff || (dwAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
@@ -176,15 +176,15 @@ void CJabberProto::GetAvatarFileName(MCONTACT hContact, wchar_t* pszDest, size_t db_free(&dbv);
}
else _i64toa((LONG_PTR)hContact, str, 10);
- mir_sntprintf(pszDest + tPathLen, MAX_PATH - tPathLen, L"%S%s", JabberSha1(str, buf), szFileType);
+ mir_snwprintf(pszDest + tPathLen, MAX_PATH - tPathLen, L"%S%s", JabberSha1(str, buf), szFileType);
}
else if (m_ThreadInfo != NULL) {
- mir_sntprintf(pszDest + tPathLen, MAX_PATH - tPathLen, L"%s@%S avatar%s",
+ mir_snwprintf(pszDest + tPathLen, MAX_PATH - tPathLen, L"%s@%S avatar%s",
m_ThreadInfo->conn.username, m_ThreadInfo->conn.server, szFileType);
}
else {
ptrA res1(getStringA("LoginName")), res2(getStringA("LoginServer"));
- mir_sntprintf(pszDest + tPathLen, MAX_PATH - tPathLen, L"%S@%S avatar%s",
+ mir_snwprintf(pszDest + tPathLen, MAX_PATH - tPathLen, L"%S@%S avatar%s",
(res1) ? (LPSTR)res1 : "noname", (res2) ? (LPSTR)res2 : m_szModuleName, szFileType);
}
}
@@ -203,15 +203,15 @@ void CJabberProto::ResolveTransportNicks(const wchar_t *jid) if (!getByte(hContact, "IsTransported", 0))
continue;
- ptrT dbJid(getTStringA(hContact, "jid")); if (dbJid == NULL) continue;
- ptrT dbNick(getTStringA(hContact, "Nick")); if (dbNick == NULL) continue;
+ ptrW dbJid(getTStringA(hContact, "jid")); if (dbJid == NULL) continue;
+ ptrW dbNick(getTStringA(hContact, "Nick")); if (dbNick == NULL) continue;
wchar_t *p = wcschr(dbJid, '@');
if (p == NULL)
continue;
*p = 0;
- if (!mir_tstrcmp(jid, p + 1) && !mir_tstrcmp(dbJid, dbNick)) {
+ if (!mir_wstrcmp(jid, p + 1) && !mir_wstrcmp(dbJid, dbNick)) {
*p = '@';
m_ThreadInfo->resolveID = SendGetVcard(dbJid);
m_ThreadInfo->resolveContact = hContact;
@@ -379,15 +379,15 @@ void CJabberProto::UpdateMirVer(MCONTACT hContact, pResourceStatus &resource) if (!tszMirVer.IsEmpty())
setTString(hContact, "MirVer", tszMirVer);
- ptrT jid(getTStringA(hContact, "jid"));
+ ptrW jid(getTStringA(hContact, "jid"));
if (jid == NULL)
return;
wchar_t szFullJid[JABBER_MAX_JID_LEN];
if (resource->m_tszResourceName && !wcschr(jid, '/'))
- mir_sntprintf(szFullJid, L"%s/%s", jid, resource->m_tszResourceName);
+ mir_snwprintf(szFullJid, L"%s/%s", jid, resource->m_tszResourceName);
else
- mir_tstrncpy(szFullJid, jid, _countof(szFullJid));
+ mir_wstrncpy(szFullJid, jid, _countof(szFullJid));
setTString(hContact, DBSETTING_DISPLAY_UID, szFullJid);
}
@@ -438,7 +438,7 @@ void CJabberProto::SetContactOfflineStatus(MCONTACT hContact) void CJabberProto::InitPopups(void)
{
wchar_t desc[256];
- mir_sntprintf(desc, L"%s %s", m_tszUserName, TranslateT("Errors"));
+ mir_snwprintf(desc, L"%s %s", m_tszUserName, TranslateT("Errors"));
char name[256];
mir_snprintf(name, "%s_%s", m_szModuleName, "Error");
diff --git a/protocols/JabberG/src/jabber_notes.cpp b/protocols/JabberG/src/jabber_notes.cpp index 58fd94594c..66f16d6f1a 100644 --- a/protocols/JabberG/src/jabber_notes.cpp +++ b/protocols/JabberG/src/jabber_notes.cpp @@ -35,10 +35,10 @@ static wchar_t* StrTrimCopy(wchar_t *str) {
if (!str) return 0;
while (*str && iswspace(*str)) ++str;
- if (!*str) return mir_tstrdup(str);
+ if (!*str) return mir_wstrdup(str);
- wchar_t *res = mir_tstrdup(str);
- for (wchar_t *p = res + mir_tstrlen(res) - 1; p >= res; --p) {
+ wchar_t *res = mir_wstrdup(str);
+ for (wchar_t *p = res + mir_wstrlen(res) - 1; p >= res; --p) {
if (iswspace(*p))
*p = 0;
else
@@ -85,8 +85,8 @@ void CNoteItem::SetData(wchar_t *title, wchar_t *from, wchar_t *text, wchar_t *t m_szFrom = StrTrimCopy(from);
const wchar_t *szTags = tags;
- wchar_t *p = m_szTags = (wchar_t *)mir_alloc((mir_tstrlen(szTags) + 2 /*for double zero*/) * sizeof(wchar_t));
- wchar_t *q = m_szTagsStr = (wchar_t *)mir_alloc((mir_tstrlen(szTags) + 1) * sizeof(wchar_t));
+ wchar_t *p = m_szTags = (wchar_t *)mir_alloc((mir_wstrlen(szTags) + 2 /*for double zero*/) * sizeof(wchar_t));
+ wchar_t *q = m_szTagsStr = (wchar_t *)mir_alloc((mir_wstrlen(szTags) + 1) * sizeof(wchar_t));
for (; szTags && *szTags; ++szTags) {
if (iswspace(*szTags))
continue;
@@ -108,8 +108,8 @@ bool CNoteItem::HasTag(const wchar_t *szTag) if (!szTag || !*szTag)
return true;
- for (wchar_t *p = m_szTags; p && *p; p = p + mir_tstrlen(p) + 1)
- if (!mir_tstrcmp(p, szTag))
+ for (wchar_t *p = m_szTags; p && *p; p = p + mir_wstrlen(p) + 1)
+ if (!mir_wstrcmp(p, szTag))
return true;
return false;
@@ -118,9 +118,9 @@ bool CNoteItem::HasTag(const wchar_t *szTag) int CNoteItem::cmp(const CNoteItem *p1, const CNoteItem *p2)
{
int ret = 0;
- if (ret = mir_tstrcmp(p1->m_szTitle, p2->m_szTitle)) return ret;
- if (ret = mir_tstrcmp(p1->m_szText, p2->m_szText)) return ret;
- if (ret = mir_tstrcmp(p1->m_szTagsStr, p2->m_szTagsStr)) return ret;
+ if (ret = mir_wstrcmp(p1->m_szTitle, p2->m_szTitle)) return ret;
+ if (ret = mir_wstrcmp(p1->m_szText, p2->m_szText)) return ret;
+ if (ret = mir_wstrcmp(p1->m_szTagsStr, p2->m_szTagsStr)) return ret;
if (p1 < p2) return -1;
if (p1 > p2) return 1;
return 0;
@@ -190,7 +190,7 @@ private: wchar_t *szTitle = m_txtTitle.GetText();
wchar_t *szText = m_txtText.GetText();
wchar_t *szTags = m_txtTags.GetText();
- wchar_t *szFrom = mir_tstrdup(m_pNote->GetFrom());
+ wchar_t *szFrom = mir_wstrdup(m_pNote->GetFrom());
m_pNote->SetData(szTitle, szFrom, szText, szTags);
mir_free(szTitle);
mir_free(szText);
@@ -375,7 +375,7 @@ public: SelectObject(hdc, m_hfntNormal);
if (pNote->GetFrom()) {
wchar_t buf[256];
- mir_sntprintf(buf, TranslateT("From: %s"), pNote->GetFrom());
+ mir_snwprintf(buf, TranslateT("From: %s"), pNote->GetFrom());
rc.top += DrawText(hdc, buf, -1, &rc, DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
}
rc.top += DrawText(hdc, pNote->GetText(), -1, &rc, DT_NOPREFIX | DT_WORDBREAK | DT_EXPANDTABS | DT_END_ELLIPSIS);
@@ -410,7 +410,7 @@ public: SelectObject(hdc, m_hfntNormal);
if (pNote->GetFrom()) {
wchar_t buf[256];
- mir_sntprintf(buf, TranslateT("From: %s"), pNote->GetFrom());
+ mir_snwprintf(buf, TranslateT("From: %s"), pNote->GetFrom());
rcTmp = rc;
DrawText(hdc, buf, -1, &rcTmp, DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS | DT_CALCRECT);
lps->itemHeight += rcTmp.bottom;
@@ -473,7 +473,7 @@ private: tvi.hInsertAfter = TVI_LAST;
tvi.itemex.mask = TVIF_TEXT | TVIF_PARAM;
tvi.itemex.pszText = (wchar_t *)tag;
- tvi.itemex.lParam = (LPARAM)mir_tstrdup(tag);
+ tvi.itemex.lParam = (LPARAM)mir_wstrdup(tag);
HTREEITEM hti = m_tvFilter.InsertItem(&tvi);
if (bSelect) m_tvFilter.SelectItem(hti);
}
@@ -483,14 +483,14 @@ private: LIST<wchar_t> tagSet(5, wcscmp);
for (int i = 0; i < m_proto->m_notes.getCount(); i++) {
wchar_t *tags = m_proto->m_notes[i].GetTags();
- for (wchar_t *tag = tags; tag && *tag; tag = tag + mir_tstrlen(tag) + 1)
+ for (wchar_t *tag = tags; tag && *tag; tag = tag + mir_wstrlen(tag) + 1)
if (!tagSet.find(tag))
tagSet.insert(tag);
}
bool selected = false;
for (int j = 0; j < tagSet.getCount(); ++j) {
- bool select = !mir_tstrcmp(szActiveTag, tagSet[j]);
+ bool select = !mir_wstrcmp(szActiveTag, tagSet[j]);
selected |= select;
InsertTag(htiRoot, tagSet[j], select);
}
@@ -505,7 +505,7 @@ private: tvi.mask = TVIF_HANDLE | TVIF_PARAM;
tvi.hItem = m_tvFilter.GetSelection();
m_tvFilter.GetItem(&tvi);
- wchar_t *szActiveTag = mir_tstrdup((wchar_t *)tvi.lParam);
+ wchar_t *szActiveTag = mir_wstrdup((wchar_t *)tvi.lParam);
m_tvFilter.DeleteAllItems();
@@ -727,7 +727,7 @@ void CJabberProto::ProcessOutgoingNote(CNoteItem *pNote, bool ok) }
wchar_t buf[1024];
- mir_sntprintf(buf, L"Incoming note: %s\n\n%s\nTags: %s",
+ mir_snwprintf(buf, L"Incoming note: %s\n\n%s\nTags: %s",
pNote->GetTitle(), pNote->GetText(), pNote->GetTagsStr());
JabberCapsBits jcb = GetResourceCapabilites(pNote->GetFrom(), TRUE);
@@ -815,7 +815,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleNotes(WPARAM, LPARAM) INT_PTR __cdecl CJabberProto::OnMenuSendNote(WPARAM wParam, LPARAM)
{
if (wParam) {
- CNoteItem *pItem = new CNoteItem(NULL, ptrT(getTStringA(wParam, "jid")));
+ CNoteItem *pItem = new CNoteItem(NULL, ptrW(getTStringA(wParam, "jid")));
CJabberDlgBase *pDlg = new CJabberDlgNoteItem(this, pItem, &CJabberProto::ProcessOutgoingNote);
pDlg->Show();
}
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp index 828b0a9648..66fb8e5e49 100644 --- a/protocols/JabberG/src/jabber_opt.cpp +++ b/protocols/JabberG/src/jabber_opt.cpp @@ -243,7 +243,7 @@ protected: void OnInitDialog()
{
wchar_t text[256];
- mir_sntprintf(text, STR_FORMAT, TranslateT("Register"), m_regInfo->username, m_regInfo->server, m_regInfo->port);
+ mir_snwprintf(text, STR_FORMAT, TranslateT("Register"), m_regInfo->username, m_regInfo->server, m_regInfo->port);
SetDlgItemText(m_hwnd, IDC_REG_STATUS, text);
}
@@ -331,7 +331,7 @@ CCtrlEditJid::CCtrlEditJid(CDlgBase* dlg, int ctrlId): static void sttStoreJidFromUI(CJabberProto *ppro, CCtrlEdit &txtUsername, CCtrlCombo &cbServer)
{
- ppro->setTString("jid", CMString(FORMAT, L"%s@%s", ptrT(txtUsername.GetText()), ptrT(cbServer.GetText())));
+ ppro->setTString("jid", CMString(FORMAT, L"%s@%s", ptrW(txtUsername.GetText()), ptrW(cbServer.GetText())));
}
class CDlgOptAccount : public CJabberDlgBase
@@ -444,7 +444,7 @@ protected: if (GetComputerName(szCompName, &dwCompNameLength))
m_cbResource.AddString(szCompName);
- ptrT tszResource(m_proto->getTStringA("Resource"));
+ ptrW tszResource(m_proto->getTStringA("Resource"));
if (tszResource != NULL) {
if (CB_ERR == m_cbResource.FindString(tszResource, -1, true))
m_cbResource.AddString(tszResource);
@@ -454,7 +454,7 @@ protected: for (int i = 0; g_LanguageCodes[i].szCode; i++) {
int iItem = m_cbLocale.AddString(TranslateTS(g_LanguageCodes[i].szDescription), (LPARAM)g_LanguageCodes[i].szCode);
- if (!mir_tstrcmp(m_proto->m_tszSelectedLang, g_LanguageCodes[i].szCode))
+ if (!mir_wstrcmp(m_proto->m_tszSelectedLang, g_LanguageCodes[i].szCode))
m_cbLocale.SetCurSel(iItem);
}
@@ -483,7 +483,7 @@ protected: m_proto->m_savedPassword = NULL;
if (m_chkSavePassword.GetState() == BST_CHECKED)
- m_proto->setTString("Password", ptrT(m_txtPassword.GetText()));
+ m_proto->setTString("Password", ptrW(m_txtPassword.GetText()));
else
m_proto->delSetting("Password");
@@ -494,7 +494,7 @@ protected: m_proto->setTString("XmlLang", szLanguageCode);
mir_free(m_proto->m_tszSelectedLang);
- m_proto->m_tszSelectedLang = mir_tstrdup(szLanguageCode);
+ m_proto->m_tszSelectedLang = mir_wstrdup(szLanguageCode);
}
}
@@ -697,7 +697,7 @@ private: if (!n)
break;
- if (!mir_tstrcmp(XmlGetName(n), L"item"))
+ if (!mir_wstrcmp(XmlGetName(n), L"item"))
if (const wchar_t *jid = XmlGetAttrValue(n, L"jid"))
if (m_cbServer.FindString(jid, -1, true) == CB_ERR)
m_cbServer.AddString(jid);
@@ -729,7 +729,7 @@ private: NETLIBHTTPREQUEST *result = (NETLIBHTTPREQUEST *)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)wnd->GetProto()->m_hNetlibUser, (LPARAM)&request);
if (result) {
if (result->resultCode == 200 && result->dataLength && result->pData) {
- wchar_t *buf = mir_a2t(result->pData);
+ wchar_t *buf = mir_a2u(result->pData);
XmlNode node(buf, NULL, NULL);
if (node) {
HXML queryNode = XmlGetChild(node, L"query");
@@ -1016,7 +1016,7 @@ void CJabberProto::_RosterHandleGetRequest(HXML node, CJabberIqInfo*) // now it is require to process whole contact list to add not in roster contacts
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
- ptrT tszJid(getTStringA(hContact, "jid"));
+ ptrW tszJid(getTStringA(hContact, "jid"));
if (tszJid == NULL)
continue;
@@ -1029,8 +1029,8 @@ void CJabberProto::_RosterHandleGetRequest(HXML node, CJabberIqInfo*) if (p) *p = 0;
}
if (ListView_FindItem(hList, -1, &lvfi) == -1) {
- ptrT tszName(db_get_tsa(hContact, "CList", "MyHandle"));
- ptrT tszGroup(db_get_tsa(hContact, "CList", "Group"));
+ ptrW tszName(db_get_tsa(hContact, "CList", "MyHandle"));
+ ptrW tszGroup(db_get_tsa(hContact, "CList", "Group"));
_RosterInsertListItem(hList, tszJid, tszName, tszGroup, NULL, FALSE);
}
}
@@ -1074,24 +1074,24 @@ void CJabberProto::_RosterHandleGetRequest(HXML node, CJabberIqInfo*) BOOL bPushed = itemRoster ? TRUE : FALSE;
if (!bPushed) {
const wchar_t *rosterName = XmlGetAttrValue(itemRoster, L"name");
- if ((rosterName != NULL || name[0] != 0) && mir_tstrcmpi(rosterName, name))
+ if ((rosterName != NULL || name[0] != 0) && mir_wstrcmpi(rosterName, name))
bPushed = TRUE;
if (!bPushed) {
rosterName = XmlGetAttrValue(itemRoster, L"subscription");
- if ((rosterName != NULL || subscr[0] != 0) && mir_tstrcmpi(rosterName, subscr))
+ if ((rosterName != NULL || subscr[0] != 0) && mir_wstrcmpi(rosterName, subscr))
bPushed = TRUE;
}
if (!bPushed) {
const wchar_t *rosterGroup = XmlGetText(XmlGetChild(itemRoster, "group"));
- if ((rosterGroup != NULL || group[0] != 0) && mir_tstrcmpi(rosterGroup, group))
+ if ((rosterGroup != NULL || group[0] != 0) && mir_wstrcmpi(rosterGroup, group))
bPushed = TRUE;
}
}
if (bPushed) {
HXML item = query << XCHILD(L"item");
- if (mir_tstrlen(group))
+ if (mir_wstrlen(group))
item << XCHILD(L"group", group);
- if (mir_tstrlen(name))
+ if (mir_wstrlen(name))
item << XATTR(L"name", name);
item << XATTR(L"jid", jid) << XATTR(L"subscription", subscr[0] ? subscr : L"none");
itemCount++;
@@ -1179,7 +1179,7 @@ void CJabberProto::_RosterExportToFile(HWND hwndDlg) wchar_t filename[MAX_PATH] = { 0 };
wchar_t filter[MAX_PATH];
- mir_sntprintf(filter, L"%s (*.xml)%c*.xml%c%c", TranslateT("XML for MS Excel (UTF-8 encoded)"), 0, 0, 0);
+ mir_snwprintf(filter, L"%s (*.xml)%c*.xml%c%c", TranslateT("XML for MS Excel (UTF-8 encoded)"), 0, 0, 0);
OPENFILENAME ofn = { 0 };
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = hwndDlg;
@@ -1268,7 +1268,7 @@ void CJabberProto::_RosterImportFromFile(HWND hwndDlg) fclose(fp);
_RosterListClear(hwndDlg);
- wchar_t *newBuf = mir_utf8decodeT(buffer);
+ wchar_t *newBuf = mir_utf8decodeW(buffer);
mir_free(buffer);
int nBytesProcessed = 0;
@@ -1295,15 +1295,15 @@ void CJabberProto::_RosterImportFromFile(HWND hwndDlg) HXML Cell = XmlGetNthChild(Row, L"Cell", 1);
HXML Data = (Cell) ? XmlGetChild(Cell, "Data") : XmlNode();
if (Data) {
- if (!mir_tstrcmpi(XmlGetText(Data), L"+")) bAdd = TRUE;
- else if (mir_tstrcmpi(XmlGetText(Data), L"-")) continue;
+ if (!mir_wstrcmpi(XmlGetText(Data), L"+")) bAdd = TRUE;
+ else if (mir_wstrcmpi(XmlGetText(Data), L"-")) continue;
Cell = XmlGetNthChild(Row, L"Cell", 2);
if (Cell) Data = XmlGetChild(Cell, "Data");
else Data = NULL;
if (Data) {
jid = XmlGetText(Data);
- if (!jid || mir_tstrlen(jid) == 0) continue;
+ if (!jid || mir_wstrlen(jid) == 0) continue;
}
Cell = XmlGetNthChild(Row, L"Cell", 3);
@@ -1588,7 +1588,7 @@ protected: if (GetComputerName(szCompName, &dwCompNameLength))
m_cbResource.AddString(szCompName);
- ptrT tszResource(m_proto->getTStringA("Resource"));
+ ptrW tszResource(m_proto->getTStringA("Resource"));
if (tszResource != NULL) {
if (CB_ERR == m_cbResource.FindString(tszResource, -1, true))
m_cbResource.AddString(tszResource);
@@ -1666,7 +1666,7 @@ protected: m_txtManualHost.Enable();
m_txtPort.Enable();
- ptrT dbManualHost(m_proto->getTStringA("ManualHost"));
+ ptrW dbManualHost(m_proto->getTStringA("ManualHost"));
if (dbManualHost != NULL)
m_txtManualHost.SetText(dbManualHost);
@@ -1708,7 +1708,7 @@ protected: DWORD dwCompNameLength = MAX_COMPUTERNAME_LENGTH;
if (GetComputerName(szCompName, &dwCompNameLength)) {
m_cbResource.GetText(szResource, _countof(szResource));
- if (!mir_tstrcmp(szCompName, szResource))
+ if (!mir_wstrcmp(szCompName, szResource))
bUseHostnameAsResource = TRUE;
}
m_proto->m_options.HostNameAsResource = bUseHostnameAsResource;
@@ -2171,7 +2171,7 @@ void CJabberDlgAccMgrUI::RefreshServers(HXML node) if (!n)
break;
- if (!mir_tstrcmp(XmlGetName(n), L"item"))
+ if (!mir_wstrcmp(XmlGetName(n), L"item"))
if (const wchar_t *jid = XmlGetAttrValue(n, L"jid"))
if (m_cbServer.FindString(jid, -1, true) == CB_ERR)
m_cbServer.AddString(jid);
@@ -2199,7 +2199,7 @@ void CJabberDlgAccMgrUI::QueryServerListThread(void *arg) NETLIBHTTPREQUEST *result = (NETLIBHTTPREQUEST *)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)wnd->GetProto()->m_hNetlibUser, (LPARAM)&request);
if (result && IsWindow(hwnd)) {
if ((result->resultCode == 200) && result->dataLength && result->pData) {
- wchar_t *ptszText = mir_a2t(result->pData);
+ wchar_t *ptszText = mir_a2u(result->pData);
XmlNode node(ptszText, NULL, NULL);
if (node) {
HXML queryNode = XmlGetChild(node, L"query");
@@ -2236,7 +2236,7 @@ INT_PTR __cdecl CJabberProto::OnMenuOptions(WPARAM, LPARAM) OPENOPTIONSDIALOG ood = { 0 };
ood.cbSize = sizeof(ood);
ood.pszGroup = "Network";
- ood.pszPage = mir_t2a(m_tszUserName);
+ ood.pszPage = mir_u2a(m_tszUserName);
ood.pszTab = "Account";
Options_Open(&ood);
@@ -2258,7 +2258,7 @@ int CJabberProto::OnModernOptInit(WPARAM, LPARAM) obj.hInstance = hInst;
obj.iSection = MODERNOPT_PAGE_ACCOUNTS;
obj.iType = MODERNOPT_TYPE_SUBSECTIONPAGE;
- obj.lptzSubsection = mir_a2t(m_szModuleName); // title!!!!!!!!!!!
+ obj.lptzSubsection = mir_a2u(m_szModuleName); // title!!!!!!!!!!!
obj.lpzTemplate = MAKEINTRESOURCEA(IDD_MODERNOPT);
obj.iBoldControls = iBoldControls;
obj.pfnDlgProc = JabberWizardDlgProc;
diff --git a/protocols/JabberG/src/jabber_opttree.cpp b/protocols/JabberG/src/jabber_opttree.cpp index e1b800afa2..97566fa22c 100644 --- a/protocols/JabberG/src/jabber_opttree.cpp +++ b/protocols/JabberG/src/jabber_opttree.cpp @@ -112,7 +112,7 @@ void CCtrlTreeOpts::OnInit() int sectionLevel = 0;
HTREEITEM hSection = NULL;
- mir_tstrcpy(itemName, m_options[i]->m_szOptionName);
+ mir_wstrcpy(itemName, m_options[i]->m_szOptionName);
sectionName = itemName;
while (sectionName) {
@@ -228,7 +228,7 @@ void CCtrlTreeOpts::ProcessItemClick(HTREEITEM hti) CCtrlTreeOpts::COptionsItem::COptionsItem(wchar_t *szOption, CMOption<BYTE> &option) :
m_option(&option), m_groupId(OPTTREE_CHECK), m_hItem(NULL)
{
- m_szOptionName = mir_tstrdup(szOption);
+ m_szOptionName = mir_wstrdup(szOption);
}
CCtrlTreeOpts::COptionsItem::~COptionsItem()
diff --git a/protocols/JabberG/src/jabber_password.cpp b/protocols/JabberG/src/jabber_password.cpp index 54d1b74bdd..456c9e5d5b 100644 --- a/protocols/JabberG/src/jabber_password.cpp +++ b/protocols/JabberG/src/jabber_password.cpp @@ -50,7 +50,7 @@ static INT_PTR CALLBACK JabberChangePasswordDlgProc(HWND hwndDlg, UINT msg, WPAR TranslateDialogDefault(hwndDlg);
if (ppro->m_bJabberOnline && ppro->m_ThreadInfo != NULL) {
wchar_t text[1024];
- mir_sntprintf(text, TranslateT("Set New Password for %s@%S"), ppro->m_ThreadInfo->conn.username, ppro->m_ThreadInfo->conn.server);
+ mir_snwprintf(text, TranslateT("Set New Password for %s@%S"), ppro->m_ThreadInfo->conn.username, ppro->m_ThreadInfo->conn.server);
SetWindowText(hwndDlg, text);
}
return TRUE;
@@ -61,16 +61,16 @@ static INT_PTR CALLBACK JabberChangePasswordDlgProc(HWND hwndDlg, UINT msg, WPAR wchar_t newPasswd[512], text[512];
GetDlgItemText(hwndDlg, IDC_NEWPASSWD, newPasswd, _countof(newPasswd));
GetDlgItemText(hwndDlg, IDC_NEWPASSWD2, text, _countof(text));
- if (mir_tstrcmp(newPasswd, text)) {
+ if (mir_wstrcmp(newPasswd, text)) {
MessageBox(hwndDlg, TranslateT("New password does not match."), TranslateT("Change Password"), MB_OK|MB_ICONSTOP|MB_SETFOREGROUND);
break;
}
GetDlgItemText(hwndDlg, IDC_OLDPASSWD, text, _countof(text));
- if (mir_tstrcmp(text, ppro->m_ThreadInfo->conn.password)) {
+ if (mir_wstrcmp(text, ppro->m_ThreadInfo->conn.password)) {
MessageBox(hwndDlg, TranslateT("Current password is incorrect."), TranslateT("Change Password"), MB_OK|MB_ICONSTOP|MB_SETFOREGROUND);
break;
}
- ppro->m_ThreadInfo->tszNewPassword = mir_tstrdup(newPasswd);
+ ppro->m_ThreadInfo->tszNewPassword = mir_wstrdup(newPasswd);
XmlNodeIq iq(ppro->AddIQ(&CJabberProto::OnIqResultSetPassword, JABBER_IQ_TYPE_SET, _A2T(ppro->m_ThreadInfo->conn.server)));
HXML q = iq << XQUERY(JABBER_FEAT_REGISTER);
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp index ba3df4a5b0..8e9e009d1d 100644 --- a/protocols/JabberG/src/jabber_privacy.cpp +++ b/protocols/JabberG/src/jabber_privacy.cpp @@ -58,9 +58,9 @@ void CJabberProto::OnIqResultPrivacyListModify(HXML, CJabberIqInfo *pInfo) if (!pParam->m_dwCount) {
wchar_t szText[ 512 ];
if (!pParam->m_bAllOk)
- mir_sntprintf(szText, TranslateT("Error occurred while applying changes"));
+ mir_snwprintf(szText, TranslateT("Error occurred while applying changes"));
else
- mir_sntprintf(szText, TranslateT("Privacy lists successfully saved"));
+ mir_snwprintf(szText, TranslateT("Privacy lists successfully saved"));
if (m_pDlgPrivacyLists)
m_pDlgPrivacyLists->SetStatusText(szText);
// FIXME: enable apply button
@@ -77,7 +77,7 @@ void CJabberProto::OnIqResultPrivacyList(HXML iqNode, CJabberIqInfo*) if (type == NULL)
return;
- if ( mir_tstrcmp(type, L"result"))
+ if ( mir_wstrcmp(type, L"result"))
return;
HXML query = XmlGetChild(iqNode , "query");
@@ -104,11 +104,11 @@ void CJabberProto::OnIqResultPrivacyList(HXML iqNode, CJabberIqInfo*) const wchar_t *itemType = XmlGetAttrValue(item, L"type");
PrivacyListRuleType nItemType = Else;
if (itemType) {
- if (!mir_tstrcmpi(itemType, L"jid"))
+ if (!mir_wstrcmpi(itemType, L"jid"))
nItemType = Jid;
- else if (!mir_tstrcmpi(itemType, L"group"))
+ else if (!mir_wstrcmpi(itemType, L"group"))
nItemType = Group;
- else if (!mir_tstrcmpi(itemType, L"subscription"))
+ else if (!mir_wstrcmpi(itemType, L"subscription"))
nItemType = Subscription;
}
@@ -116,7 +116,7 @@ void CJabberProto::OnIqResultPrivacyList(HXML iqNode, CJabberIqInfo*) const wchar_t *itemAction = XmlGetAttrValue(item, L"action");
BOOL bAllow = TRUE;
- if (itemAction && !mir_tstrcmpi(itemAction, L"deny"))
+ if (itemAction && !mir_wstrcmpi(itemAction, L"deny"))
bAllow = FALSE;
const wchar_t *itemOrder = XmlGetAttrValue(item, L"order");
@@ -185,7 +185,7 @@ void CJabberProto::OnIqResultPrivacyListActive(HXML iqNode, CJabberIqInfo *pInfo CMString szText;
- if (!mir_tstrcmp(type, L"result")) {
+ if (!mir_wstrcmp(type, L"result")) {
mir_cslock lck(m_privacyListManager.m_cs);
if (pList) {
m_privacyListManager.SetActiveListName(pList->GetListName());
@@ -222,18 +222,18 @@ void CJabberProto::OnIqResultPrivacyListDefault(HXML iqNode, CJabberIqInfo *pInf szText[0] = 0;
{
mir_cslock lck(m_privacyListManager.m_cs);
- if (!mir_tstrcmp(type, L"result")) {
+ if (!mir_wstrcmp(type, L"result")) {
CPrivacyList *pList = (CPrivacyList *)pInfo->GetUserData();
if (pList) {
m_privacyListManager.SetDefaultListName(pList->GetListName());
- mir_sntprintf(szText, TranslateT("Privacy list %s set as default"), pList->GetListName());
+ mir_snwprintf(szText, TranslateT("Privacy list %s set as default"), pList->GetListName());
}
else {
m_privacyListManager.SetDefaultListName(NULL);
- mir_sntprintf(szText, TranslateT("Default privacy list successfully declined"));
+ mir_snwprintf(szText, TranslateT("Default privacy list successfully declined"));
}
}
- else mir_sntprintf(szText, TranslateT("Error occurred while setting default list"));
+ else mir_snwprintf(szText, TranslateT("Error occurred while setting default list"));
}
if (m_pDlgPrivacyLists) {
@@ -423,7 +423,7 @@ public: SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUES, CB_RESETCONTENT, 0, 0);
{
for (MCONTACT hContact = db_find_first(m_proto->m_szModuleName); hContact; hContact = db_find_next(hContact, m_proto->m_szModuleName)) {
- ptrT jid( m_proto->getTStringA(hContact, "jid"));
+ ptrW jid( m_proto->getTStringA(hContact, "jid"));
if (jid != NULL)
SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUES, CB_ADDSTRING, 0, jid);
}
@@ -633,7 +633,7 @@ protected: HANDLE hItem;
wchar_t *jid;
- static int cmp(const TJidData *p1, const TJidData *p2) { return mir_tstrcmp(p1->jid, p2->jid); }
+ static int cmp(const TJidData *p1, const TJidData *p2) { return mir_wstrcmp(p1->jid, p2->jid); }
};
HANDLE hItemDefault;
@@ -661,7 +661,7 @@ protected: {
TJidData *data = (TJidData *)mir_alloc(sizeof(TJidData));
data->hItem = hItem;
- data->jid = mir_tstrdup(jid);
+ data->jid = mir_wstrdup(jid);
newJids.insert(data);
}
@@ -949,7 +949,7 @@ BOOL CJabberDlgPrivacyLists::OnWmDrawItem(UINT, WPARAM, LPARAM lParam) for (i=0; i < _countof(drawItems); i++) {
SIZE sz = {0};
drawItems[i].text = TranslateTS(drawItems[i].textEng);
- GetTextExtentPoint32(lpdis->hDC, drawItems[i].text, (int)mir_tstrlen(drawItems[i].text), &sz);
+ GetTextExtentPoint32(lpdis->hDC, drawItems[i].text, (int)mir_wstrlen(drawItems[i].text), &sz);
totalWidth += sz.cx + 18 + 5; // 18 pixels for icon, 5 pixel spacing
}
@@ -991,16 +991,16 @@ void CJabberDlgPrivacyLists::ShowAdvancedList(CPrivacyList *pList) wchar_t szTypeValue[ 512 ];
switch (pRule->GetType()) {
case Jid:
- mir_sntprintf(szTypeValue, L"If Jabber ID is '%s' then", pRule->GetValue());
+ mir_snwprintf(szTypeValue, L"If Jabber ID is '%s' then", pRule->GetValue());
break;
case Group:
- mir_sntprintf(szTypeValue, L"If group is '%s' then", pRule->GetValue());
+ mir_snwprintf(szTypeValue, L"If group is '%s' then", pRule->GetValue());
break;
case Subscription:
- mir_sntprintf(szTypeValue, L"If subscription is '%s' then", pRule->GetValue());
+ mir_snwprintf(szTypeValue, L"If subscription is '%s' then", pRule->GetValue());
break;
case Else:
- mir_sntprintf(szTypeValue, L"Else");
+ mir_snwprintf(szTypeValue, L"Else");
break;
}
@@ -1011,29 +1011,29 @@ void CJabberDlgPrivacyLists::ShowAdvancedList(CPrivacyList *pList) if (!dwPackets)
dwPackets = JABBER_PL_RULE_TYPE_ALL;
if (dwPackets == JABBER_PL_RULE_TYPE_ALL)
- mir_tstrcpy(szPackets, L"all");
+ mir_wstrcpy(szPackets, L"all");
else {
if (dwPackets & JABBER_PL_RULE_TYPE_MESSAGE)
- mir_tstrcat(szPackets, L"messages");
+ mir_wstrcat(szPackets, L"messages");
if (dwPackets & JABBER_PL_RULE_TYPE_PRESENCE_IN) {
- if (mir_tstrlen(szPackets))
- mir_tstrcat(szPackets, L", ");
- mir_tstrcat(szPackets, L"presence-in");
+ if (mir_wstrlen(szPackets))
+ mir_wstrcat(szPackets, L", ");
+ mir_wstrcat(szPackets, L"presence-in");
}
if (dwPackets & JABBER_PL_RULE_TYPE_PRESENCE_OUT) {
- if (mir_tstrlen(szPackets))
- mir_tstrcat(szPackets, L", ");
- mir_tstrcat(szPackets, L"presence-out");
+ if (mir_wstrlen(szPackets))
+ mir_wstrcat(szPackets, L", ");
+ mir_wstrcat(szPackets, L"presence-out");
}
if (dwPackets & JABBER_PL_RULE_TYPE_IQ) {
- if (mir_tstrlen(szPackets))
- mir_tstrcat(szPackets, L", ");
- mir_tstrcat(szPackets, L"queries");
+ if (mir_wstrlen(szPackets))
+ mir_wstrcat(szPackets, L", ");
+ mir_wstrcat(szPackets, L"queries");
}
}
wchar_t szListItem[ 512 ];
- mir_sntprintf(szListItem, L"%s %s %s", szTypeValue, pRule->GetAction() ? L"allow" : L"deny", szPackets);
+ mir_snwprintf(szListItem, L"%s %s %s", szTypeValue, pRule->GetAction() ? L"allow" : L"deny", szPackets);
LRESULT nItemId = SendDlgItemMessage(m_hwnd, IDC_PL_RULES_LIST, LB_ADDSTRING, 0, (LPARAM)szListItem);
SendDlgItemMessage(m_hwnd, IDC_PL_RULES_LIST, LB_SETITEMDATA, nItemId, (LPARAM)pRule);
@@ -1056,7 +1056,7 @@ void CJabberDlgPrivacyLists::DrawNextRulePart(HDC hdc, COLORREF color, const wch DrawText(hdc, text, -1, rc, DT_LEFT|DT_NOPREFIX|DT_SINGLELINE|DT_VCENTER|DT_WORD_ELLIPSIS);
SIZE sz;
- GetTextExtentPoint32(hdc, text, (int)mir_tstrlen(text), &sz);
+ GetTextExtentPoint32(hdc, text, (int)mir_wstrlen(text), &sz);
rc->left += sz.cx;
}
@@ -1248,8 +1248,8 @@ void CJabberDlgPrivacyLists::DrawLists(LPDRAWITEMSTRUCT lpdis) szName = TranslateT("<none>");
}
else {
- if (!mir_tstrcmp(pList->GetListName(), szActive)) bActive = true;
- if (!mir_tstrcmp(pList->GetListName(), szDefault)) bDefault = true;
+ if (!mir_wstrcmp(pList->GetListName(), szActive)) bActive = true;
+ if (!mir_wstrcmp(pList->GetListName(), szDefault)) bDefault = true;
szName = pList->GetListName();
}
@@ -1385,10 +1385,10 @@ void CJabberDlgPrivacyLists::CListApplyList(HWND hwndList, CPrivacyList *pList) break;
case Subscription:
- if (!mir_tstrcmp(pRule->GetValue(), L"none")) hItem = clc_info.hItemSubNone;
- else if (!mir_tstrcmp(pRule->GetValue(), L"from")) hItem = clc_info.hItemSubFrom;
- else if (!mir_tstrcmp(pRule->GetValue(), L"to")) hItem = clc_info.hItemSubTo;
- else if (!mir_tstrcmp(pRule->GetValue(), L"both")) hItem = clc_info.hItemSubBoth;
+ if (!mir_wstrcmp(pRule->GetValue(), L"none")) hItem = clc_info.hItemSubNone;
+ else if (!mir_wstrcmp(pRule->GetValue(), L"from")) hItem = clc_info.hItemSubFrom;
+ else if (!mir_wstrcmp(pRule->GetValue(), L"to")) hItem = clc_info.hItemSubTo;
+ else if (!mir_wstrcmp(pRule->GetValue(), L"both")) hItem = clc_info.hItemSubBoth;
break;
case Else:
@@ -1462,7 +1462,7 @@ void CJabberDlgPrivacyLists::CListBuildList(HWND hwndList, CPrivacyList *pList) for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
hItem = m_clcClist.FindContact(hContact);
- ptrT jid( m_proto->getTStringA(hContact, "jid"));
+ ptrW jid( m_proto->getTStringA(hContact, "jid"));
if (jid == NULL)
if ((jid = m_proto->getTStringA(hContact, "ChatRoomID")) == NULL)
continue;
@@ -1837,7 +1837,7 @@ void CJabberDlgPrivacyLists::btnAddList_OnClick(CCtrlButton*) // FIXME: line length is hard coded in dialog procedure
CJabberDlgPrivacyAddList dlgPrivacyAddList(m_proto, m_hwnd);
int nRetVal = dlgPrivacyAddList.DoModal();
- if (nRetVal && mir_tstrlen(dlgPrivacyAddList.szLine)) {
+ if (nRetVal && mir_wstrlen(dlgPrivacyAddList.szLine)) {
mir_cslockfull lck(m_proto->m_privacyListManager.m_cs);
CPrivacyList *pList = m_proto->m_privacyListManager.FindList(dlgPrivacyAddList.szLine);
@@ -1870,8 +1870,8 @@ void CJabberDlgPrivacyLists::btnRemoveList_OnClick(CCtrlButton *) CPrivacyList *pList = GetSelectedList(m_hwnd);
if (pList) {
wchar_t *szListName = pList->GetListName();
- if ((m_proto->m_privacyListManager.GetActiveListName() && !mir_tstrcmp(szListName, m_proto->m_privacyListManager.GetActiveListName())) ||
- (m_proto->m_privacyListManager.GetDefaultListName() && !mir_tstrcmp(szListName, m_proto->m_privacyListManager.GetDefaultListName())))
+ if ((m_proto->m_privacyListManager.GetActiveListName() && !mir_wstrcmp(szListName, m_proto->m_privacyListManager.GetActiveListName())) ||
+ (m_proto->m_privacyListManager.GetDefaultListName() && !mir_wstrcmp(szListName, m_proto->m_privacyListManager.GetDefaultListName())))
{
lck.unlock();
MessageBox(m_hwnd, TranslateT("Can't remove active or default list"), TranslateT("Sorry"), MB_OK | MB_ICONSTOP);
@@ -2148,7 +2148,7 @@ void CJabberProto::BuildPrivacyListsMenu(bool bDeleteOld) mi.position++;
mi.hIcolibItem = Skin_GetIconHandle(
- mir_tstrcmp(m_privacyListManager.GetActiveListName(), pList->GetListName()) ? SKINICON_OTHER_SMALLDOT : SKINICON_OTHER_EMPTYBLOB);
+ mir_wstrcmp(m_privacyListManager.GetActiveListName(), pList->GetListName()) ? SKINICON_OTHER_SMALLDOT : SKINICON_OTHER_EMPTYBLOB);
mi.name.w = pList->GetListName();
m_hPrivacyMenuItems.insert(Menu_AddProtoMenuItem(&mi, m_szModuleName));
}
diff --git a/protocols/JabberG/src/jabber_privacy.h b/protocols/JabberG/src/jabber_privacy.h index 67b8ce7e33..fc04a1d96f 100644 --- a/protocols/JabberG/src/jabber_privacy.h +++ b/protocols/JabberG/src/jabber_privacy.h @@ -61,7 +61,7 @@ public: CPrivacyListRule(CJabberProto *ppro, PrivacyListRuleType type = Else, const wchar_t *szValue = L"", BOOL bAction = TRUE, DWORD dwOrder = 90, DWORD dwPackets = 0)
{
m_proto = ppro;
- m_szValue = mir_tstrdup(szValue);
+ m_szValue = mir_wstrdup(szValue);
m_nType = type;
m_bAction = bAction;
m_dwOrder = dwOrder;
@@ -109,7 +109,7 @@ public: }
__inline BOOL SetValue(wchar_t *szValue)
{
- replaceStrT(m_szValue, szValue);
+ replaceStrW(m_szValue, szValue);
return TRUE;
}
__inline DWORD GetPackets()
@@ -156,7 +156,7 @@ public: CPrivacyList(CJabberProto *ppro, wchar_t *szListName)
{
m_proto = ppro;
- m_szListName = mir_tstrdup(szListName);
+ m_szListName = mir_wstrdup(szListName);
m_pRules = NULL;
m_pNext = NULL;
m_bLoaded = FALSE;
@@ -344,11 +344,11 @@ public: };
void SetActiveListName(const wchar_t *szListName)
{
- replaceStrT(m_szActiveListName, szListName);
+ replaceStrW(m_szActiveListName, szListName);
}
void SetDefaultListName(const wchar_t *szListName)
{
- replaceStrT(m_szDefaultListName, szListName);
+ replaceStrW(m_szDefaultListName, szListName);
}
wchar_t* GetDefaultListName()
{
@@ -369,7 +369,7 @@ public: {
CPrivacyList *pList = m_pLists;
while (pList) {
- if (!mir_tstrcmp(pList->GetListName(), szListName))
+ if (!mir_wstrcmp(pList->GetListName(), szListName))
return pList;
pList = pList->GetNext();
}
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 2f847dd408..198a8231d0 100755 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -32,7 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static int compareTransports(const wchar_t *p1, const wchar_t *p2)
{
- return mir_tstrcmpi(p1, p2);
+ return mir_wstrcmpi(p1, p2);
}
static int compareListItems(const JABBER_LIST_ITEM *p1, const JABBER_LIST_ITEM *p2)
@@ -44,12 +44,12 @@ static int compareListItems(const JABBER_LIST_ITEM *p1, const JABBER_LIST_ITEM * // resource must be used in the comparison
if ((p1->list == LIST_ROSTER && (p1->bUseResource == true || p2->bUseResource == true))
|| (p1->list == LIST_BOOKMARK) || (p1->list == LIST_VCARD_TEMP))
- return mir_tstrcmpi(p1->jid, p2->jid);
+ return mir_wstrcmpi(p1->jid, p2->jid);
wchar_t szp1[JABBER_MAX_JID_LEN], szp2[JABBER_MAX_JID_LEN];
JabberStripJid(p1->jid, szp1, _countof(szp1));
JabberStripJid(p2->jid, szp2, _countof(szp2));
- return mir_tstrcmpi(szp1, szp2);
+ return mir_wstrcmpi(szp1, szp2);
}
CJabberProto::CJabberProto(const char *aProtoName, const wchar_t *aUserName) :
@@ -147,7 +147,7 @@ CJabberProto::CJabberProto(const char *aProtoName, const wchar_t *aUserName) : db_set_resident(m_szModuleName, "Grant");
if ((m_tszSelectedLang = getTStringA("XmlLang")) == NULL)
- m_tszSelectedLang = mir_tstrdup(L"en");
+ m_tszSelectedLang = mir_wstrdup(L"en");
}
CJabberProto::~CJabberProto()
@@ -242,7 +242,7 @@ int CJabberProto::OnModulesLoadedEx(WPARAM, LPARAM) SetContactOfflineStatus(hContact);
if (getByte(hContact, "IsTransport", 0)) {
- ptrT jid(getTStringA(hContact, "jid"));
+ ptrW jid(getTStringA(hContact, "jid"));
if (jid == NULL)
continue;
@@ -250,7 +250,7 @@ int CJabberProto::OnModulesLoadedEx(WPARAM, LPARAM) if (resourcepos != NULL)
*resourcepos = '\0';
- m_lstTransports.insert(mir_tstrdup(jid));
+ m_lstTransports.insert(mir_wstrdup(jid));
}
}
@@ -340,7 +340,7 @@ MCONTACT __cdecl CJabberProto::AddToListByEvent(int flags, int /*iContact*/, MEV char *lastName = firstName + mir_strlen(firstName) + 1;
char *jid = lastName + mir_strlen(lastName) + 1;
- wchar_t *newJid = (dbei.flags & DBEF_UTF) ? mir_utf8decodeT(jid) : mir_a2t(jid);
+ wchar_t *newJid = (dbei.flags & DBEF_UTF) ? mir_utf8decodeW(jid) : mir_a2u(jid);
MCONTACT hContact = (MCONTACT)AddToListByJID(newJid, flags);
mir_free(newJid);
return hContact;
@@ -373,7 +373,7 @@ int CJabberProto::Authorize(MEVENT hDbEvent) debugLog(L"Send 'authorization allowed' to %s", jid);
- wchar_t *newJid = (dbei.flags & DBEF_UTF) ? mir_utf8decodeT(jid) : mir_a2t(jid);
+ wchar_t *newJid = (dbei.flags & DBEF_UTF) ? mir_utf8decodeW(jid) : mir_a2u(jid);
m_ThreadInfo->send(XmlNode(L"presence") << XATTR(L"to", newJid) << XATTR(L"type", L"subscribed"));
@@ -429,7 +429,7 @@ int CJabberProto::AuthDeny(MEVENT hDbEvent, const wchar_t*) debugLogA("Send 'authorization denied' to %s", jid);
- ptrT newJid(dbei.flags & DBEF_UTF ? mir_utf8decodeT(jid) : mir_a2t(jid));
+ ptrW newJid(dbei.flags & DBEF_UTF ? mir_utf8decodeW(jid) : mir_a2u(jid));
m_ThreadInfo->send(XmlNode(L"presence") << XATTR(L"to", newJid) << XATTR(L"type", L"unsubscribed"));
return 0;
}
@@ -443,8 +443,8 @@ HANDLE __cdecl CJabberProto::FileAllow(MCONTACT /*hContact*/, HANDLE hTransfer, return 0;
filetransfer *ft = (filetransfer*)hTransfer;
- ft->std.tszWorkingDir = mir_tstrdup(szPath);
- size_t len = mir_tstrlen(ft->std.tszWorkingDir)-1;
+ ft->std.tszWorkingDir = mir_wstrdup(szPath);
+ size_t len = mir_wstrlen(ft->std.tszWorkingDir)-1;
if (ft->std.tszWorkingDir[len] == '/' || ft->std.tszWorkingDir[len] == '\\')
ft->std.tszWorkingDir[len] = 0;
@@ -528,7 +528,7 @@ int __cdecl CJabberProto::FileResume(HANDLE hTransfer, int *action, const wchar_ return 1;
if (*action == FILERESUME_RENAME)
- replaceStrT(ft->std.tszCurrentFile, *szFilename);
+ replaceStrW(ft->std.tszCurrentFile, *szFilename);
SetEvent(ft->hWaitEvent);
return 0;
@@ -593,10 +593,10 @@ int __cdecl CJabberProto::GetInfo(MCONTACT hContact, int /*infoType*/) item = ListGetItemPtr(LIST_ROSTER, jid);
if (item == NULL) {
- bool bHasResource = mir_tstrcmp(jid, szBareJid) != 0;
+ bool bHasResource = mir_wstrcmp(jid, szBareJid) != 0;
JABBER_LIST_ITEM *tmpItem = NULL;
if (bHasResource && (tmpItem = ListGetItemPtr(LIST_CHATROOM, szBareJid))) {
- pResourceStatus him(tmpItem->findResource(szBareJid+mir_tstrlen(szBareJid)+1));
+ pResourceStatus him(tmpItem->findResource(szBareJid+mir_wstrlen(szBareJid)+1));
if (him) {
item = ListAdd(LIST_VCARD_TEMP, jid, hContact);
ListAddResource(LIST_VCARD_TEMP, jid, him->m_iStatus, him->m_tszStatusMessage, him->m_iPriority);
@@ -610,7 +610,7 @@ int __cdecl CJabberProto::GetInfo(MCONTACT hContact, int /*infoType*/) for (int i = 0; i < item->arResources.getCount(); i++) {
pResourceStatus r(item->arResources[i]);
wchar_t tmp[JABBER_MAX_JID_LEN];
- mir_sntprintf(tmp, L"%s/%s", szBareJid, r->m_tszResourceName);
+ mir_snwprintf(tmp, L"%s/%s", szBareJid, r->m_tszResourceName);
if (r->m_jcbCachedCaps & JABBER_CAPS_DISCO_INFO) {
XmlNodeIq iq5(AddIQ(&CJabberProto::OnIqResultCapsDiscoInfoSI, JABBER_IQ_TYPE_GET, tmp, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_CHILD_TAG_NODE | JABBER_IQ_PARSE_HCONTACT));
@@ -624,7 +624,7 @@ int __cdecl CJabberProto::GetInfo(MCONTACT hContact, int /*infoType*/) m_ThreadInfo->send(iq4);
}
- if (!mir_tstrcmp(tmp, jid)) {
+ if (!mir_wstrcmp(tmp, jid)) {
XmlNodeIq iq3(AddIQ(&CJabberProto::OnIqResultLastActivity, JABBER_IQ_TYPE_GET, tmp, JABBER_IQ_PARSE_FROM));
iq3 << XQUERY(JABBER_FEAT_LAST_ACTIVITY);
m_ThreadInfo->send(iq3);
@@ -679,7 +679,7 @@ HANDLE __cdecl CJabberProto::SearchBasic(const wchar_t *szJid) return 0;
if (wcschr(szJid, '@') == NULL) {
- wchar_t *szServer = mir_a2t(m_ThreadInfo->conn.server);
+ wchar_t *szServer = mir_a2u(m_ThreadInfo->conn.server);
const wchar_t *p = wcsstr(szJid, szServer);
if (p == NULL) {
bool numericjid = true;
@@ -689,12 +689,12 @@ HANDLE __cdecl CJabberProto::SearchBasic(const wchar_t *szJid) mir_free(szServer);
szServer = getTStringA(NULL, "LoginServer");
if (szServer == NULL)
- szServer = mir_tstrdup(L"jabber.org");
- else if (numericjid && !mir_tstrcmpi(szServer, L"S.ms")) {
+ szServer = mir_wstrdup(L"jabber.org");
+ else if (numericjid && !mir_wstrcmpi(szServer, L"S.ms")) {
mir_free(szServer);
- szServer = mir_tstrdup(L"sms");
+ szServer = mir_wstrdup(L"sms");
}
- mir_sntprintf(jsb->jid, L"%s@%s", szJid, szServer);
+ mir_snwprintf(jsb->jid, L"%s@%s", szJid, szServer);
}
else wcsncpy_s(jsb->jid, szJid, _TRUNCATE);
mir_free(szServer);
@@ -802,7 +802,7 @@ int __cdecl CJabberProto::SendContacts(MCONTACT hContact, int, int nContacts, MC HXML x = m << XCHILDNS(L"x", JABBER_FEAT_ROSTER_EXCHANGE);
for (int i = 0; i < nContacts; i++) {
- ptrT jid(getTStringA(hContactsList[i], "jid"));
+ ptrW jid(getTStringA(hContactsList[i], "jid"));
if (jid != NULL)
x << XCHILD(L"item") << XATTR(L"action", L"add") << XATTR(L"jid", jid);
}
@@ -822,7 +822,7 @@ HANDLE __cdecl CJabberProto::SendFile(MCONTACT hContact, const wchar_t *szDescri if (getWord(hContact, "Status", ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE)
return 0;
- ptrT jid(getTStringA(hContact, "jid"));
+ ptrW jid(getTStringA(hContact, "jid"));
if (jid == NULL)
return 0;
@@ -875,7 +875,7 @@ HANDLE __cdecl CJabberProto::SendFile(MCONTACT hContact, const wchar_t *szDescri if (_wstat64(ppszFiles[i], &statbuf))
debugLog(L"'%s' is an invalid filename", ppszFiles[i]);
else {
- ft->std.ptszFiles[j] = mir_tstrdup(ppszFiles[i]);
+ ft->std.ptszFiles[j] = mir_wstrdup(ppszFiles[i]);
ft->fileSize[j] = statbuf.st_size;
j++;
ft->std.totalBytes += statbuf.st_size;
@@ -886,9 +886,9 @@ HANDLE __cdecl CJabberProto::SendFile(MCONTACT hContact, const wchar_t *szDescri return NULL;
}
- ft->std.tszCurrentFile = mir_tstrdup(ppszFiles[0]);
- ft->szDescription = mir_tstrdup(szDescription);
- ft->jid = mir_tstrdup(jid);
+ ft->std.tszCurrentFile = mir_wstrdup(ppszFiles[0]);
+ ft->szDescription = mir_wstrdup(szDescription);
+ ft->jid = mir_wstrdup(jid);
if (jcb & JABBER_CAPS_SI_FT)
FtInitiate(item->jid, ft);
@@ -985,11 +985,11 @@ int __cdecl CJabberProto::SendMsg(MCONTACT hContact, int, const char* pszSrc) // if client knows nothing about delivery
!(jcb & (JABBER_CAPS_MESSAGE_EVENTS | JABBER_CAPS_MESSAGE_RECEIPTS)) ||
// if message sent to groupchat
- !mir_tstrcmp(msgType, L"groupchat") ||
+ !mir_wstrcmp(msgType, L"groupchat") ||
// if message delivery check disabled in settings
!m_options.MsgAck || !getByte(hContact, "MsgAck", TRUE))
{
- if (!mir_tstrcmp(msgType, L"groupchat"))
+ if (!mir_wstrcmp(msgType, L"groupchat"))
XmlAddAttr(m, L"to", szClientJid);
else {
id = SerialNext();
@@ -1031,7 +1031,7 @@ int __cdecl CJabberProto::SetApparentMode(MCONTACT hContact, int mode) if (!m_bJabberOnline)
return 0;
- ptrT jid(getTStringA(hContact, "jid"));
+ ptrW jid(getTStringA(hContact, "jid"));
if (jid == NULL)
return 0;
@@ -1103,7 +1103,7 @@ void __cdecl CJabberProto::GetAwayMsgThread(void *param) MCONTACT hContact = (DWORD_PTR)param;
- ptrT jid(getTStringA(hContact, "jid"));
+ ptrW jid(getTStringA(hContact, "jid"));
if (jid != NULL) {
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, jid);
if (item != NULL) {
@@ -1115,7 +1115,7 @@ void __cdecl CJabberProto::GetAwayMsgThread(void *param) JABBER_RESOURCE_STATUS *r = item->arResources[i];
if (r->m_tszStatusMessage) {
msgCount++;
- len += (mir_tstrlen(r->m_tszResourceName) + mir_tstrlen(r->m_tszStatusMessage) + 8);
+ len += (mir_wstrlen(r->m_tszResourceName) + mir_wstrlen(r->m_tszStatusMessage) + 8);
}
}
@@ -1124,13 +1124,13 @@ void __cdecl CJabberProto::GetAwayMsgThread(void *param) for (int i = 0; i < item->arResources.getCount(); i++) {
JABBER_RESOURCE_STATUS *r = item->arResources[i];
if (r->m_tszStatusMessage) {
- if (str[0] != '\0') mir_tstrcat(str, L"\r\n");
+ if (str[0] != '\0') mir_wstrcat(str, L"\r\n");
if (msgCount > 1) {
- mir_tstrcat(str, L"(");
- mir_tstrcat(str, r->m_tszResourceName);
- mir_tstrcat(str, L"): ");
+ mir_wstrcat(str, L"(");
+ mir_wstrcat(str, r->m_tszResourceName);
+ mir_wstrcat(str, L"): ");
}
- mir_tstrcat(str, r->m_tszStatusMessage);
+ mir_wstrcat(str, r->m_tszStatusMessage);
}
}
@@ -1197,11 +1197,11 @@ int __cdecl CJabberProto::SetAwayMsg(int status, const wchar_t *msg) return 1;
}
- if ((*szMsg == NULL && msg == NULL) || (*szMsg != NULL && msg != NULL && !mir_tstrcmp(*szMsg, msg)))
+ if ((*szMsg == NULL && msg == NULL) || (*szMsg != NULL && msg != NULL && !mir_wstrcmp(*szMsg, msg)))
return 0; // Message is the same, no update needed
// Update with the new mode message
- replaceStrT(*szMsg, msg);
+ replaceStrW(*szMsg, msg);
// Send a presence update if needed
lck.unlock();
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h index d1ee6abe76..f0e36b64ff 100644 --- a/protocols/JabberG/src/jabber_proto.h +++ b/protocols/JabberG/src/jabber_proto.h @@ -675,7 +675,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface //---- jabber_thread.c ----------------------------------------------
- ptrT m_savedPassword;
+ ptrW m_savedPassword;
typedef struct {
bool isPlainAvailable;
diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp index c4bd0161b9..6cfb672dd0 100644 --- a/protocols/JabberG/src/jabber_rc.cpp +++ b/protocols/JabberG/src/jabber_rc.cpp @@ -71,7 +71,7 @@ BOOL CJabberAdhocManager::HandleItemsRequest(HXML, CJabberIqInfo *pInfo, const w if (!szNode || !m_pProto->m_options.EnableRemoteControl || !m_pProto->IsRcRequestAllowedByACL(pInfo))
return FALSE;
- if (!mir_tstrcmp(szNode, JABBER_FEAT_COMMANDS)) {
+ if (!mir_wstrcmp(szNode, JABBER_FEAT_COMMANDS)) {
XmlNodeIq iq(L"result", pInfo);
HXML resultQuery = iq << XQUERY(JABBER_FEAT_DISCO_ITEMS) << XATTR(L"node", JABBER_FEAT_COMMANDS);
{
@@ -102,7 +102,7 @@ BOOL CJabberAdhocManager::HandleInfoRequest(HXML, CJabberIqInfo *pInfo, const wc return FALSE;
// FIXME: same code twice
- if (!mir_tstrcmp(szNode, JABBER_FEAT_COMMANDS)) {
+ if (!mir_wstrcmp(szNode, JABBER_FEAT_COMMANDS)) {
XmlNodeIq iq(L"result", pInfo);
HXML resultQuery = iq << XQUERY(JABBER_FEAT_DISCO_INFO) << XATTR(L"node", JABBER_FEAT_COMMANDS);
resultQuery << XCHILD(L"identity") << XATTR(L"name", L"Ad-hoc commands")
@@ -310,7 +310,7 @@ int CJabberProto::AdhocSetStatusHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhoc // priority
wchar_t szPriority[ 256 ];
- mir_sntprintf(szPriority, L"%d", (int)getDword("Priority", 5));
+ mir_snwprintf(szPriority, L"%d", (int)getDword("Priority", 5));
xNode << XCHILD(L"field") << XATTR(L"label", TranslateT("Priority")) << XATTR(L"type", L"text-single")
<< XATTR(L"var", L"status-priority") << XCHILD(L"value", szPriority);
@@ -322,7 +322,7 @@ int CJabberProto::AdhocSetStatusHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhoc fieldNode = xNode << XCHILD(L"field") << XATTR(L"label", TranslateT("Change global status"))
<< XATTR(L"type", L"boolean") << XATTR(L"var", L"status-global");
- ptrT tszStatusMsg((wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGT, status, 0));
+ ptrW tszStatusMsg((wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGT, status, 0));
if (tszStatusMsg)
fieldNode << XCHILD(L"value", tszStatusMsg);
@@ -346,13 +346,13 @@ int CJabberProto::AdhocSetStatusHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhoc return JABBER_ADHOC_HANDLER_STATUS_CANCEL;
int status;
- if (!mir_tstrcmp(ptszValue, L"away")) status = ID_STATUS_AWAY;
- else if (!mir_tstrcmp(ptszValue, L"xa")) status = ID_STATUS_NA;
- else if (!mir_tstrcmp(ptszValue, L"dnd")) status = ID_STATUS_DND;
- else if (!mir_tstrcmp(ptszValue, L"chat")) status = ID_STATUS_FREECHAT;
- else if (!mir_tstrcmp(ptszValue, L"online")) status = ID_STATUS_ONLINE;
- else if (!mir_tstrcmp(ptszValue, L"invisible")) status = ID_STATUS_INVISIBLE;
- else if (!mir_tstrcmp(ptszValue, L"offline")) status = ID_STATUS_OFFLINE;
+ if (!mir_wstrcmp(ptszValue, L"away")) status = ID_STATUS_AWAY;
+ else if (!mir_wstrcmp(ptszValue, L"xa")) status = ID_STATUS_NA;
+ else if (!mir_wstrcmp(ptszValue, L"dnd")) status = ID_STATUS_DND;
+ else if (!mir_wstrcmp(ptszValue, L"chat")) status = ID_STATUS_FREECHAT;
+ else if (!mir_wstrcmp(ptszValue, L"online")) status = ID_STATUS_ONLINE;
+ else if (!mir_wstrcmp(ptszValue, L"invisible")) status = ID_STATUS_INVISIBLE;
+ else if (!mir_wstrcmp(ptszValue, L"offline")) status = ID_STATUS_OFFLINE;
else
return JABBER_ADHOC_HANDLER_STATUS_CANCEL;
@@ -414,12 +414,12 @@ int CJabberProto::AdhocOptionsHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe // Automatically Accept File Transfers
wchar_t szTmpBuff[ 1024 ];
- mir_sntprintf(szTmpBuff, L"%d", db_get_b(NULL, "SRFile", "AutoAccept", 0));
+ mir_snwprintf(szTmpBuff, L"%d", db_get_b(NULL, "SRFile", "AutoAccept", 0));
xNode << XCHILD(L"field") << XATTR(L"label", TranslateT("Automatically Accept File Transfers"))
<< XATTR(L"type", L"boolean") << XATTR(L"var", L"auto-files") << XCHILD(L"value", szTmpBuff);
// Use sounds
- mir_sntprintf(szTmpBuff, L"%d", db_get_b(NULL, "Skin", "UseSound", 0));
+ mir_snwprintf(szTmpBuff, L"%d", db_get_b(NULL, "Skin", "UseSound", 0));
xNode << XCHILD(L"field") << XATTR(L"label", TranslateT("Play sounds"))
<< XATTR(L"type", L"boolean") << XATTR(L"var", L"sounds") << XCHILD(L"value", szTmpBuff);
@@ -465,7 +465,7 @@ int CJabberProto::RcGetUnreadEventsCount() {
int nEventsSent = 0;
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
- ptrT jid( getTStringA(hContact, "jid"));
+ ptrW jid( getTStringA(hContact, "jid"));
if (jid == NULL) continue;
for (MEVENT hDbEvent = db_event_firstUnread(hContact); hDbEvent; hDbEvent = db_event_next(hContact, hDbEvent)) {
@@ -495,7 +495,7 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe if (pSession->GetStage() == 0) {
int nUnreadEvents = RcGetUnreadEventsCount();
if (!nUnreadEvents) {
- mir_sntprintf(szMsg, TranslateT("There is no messages to forward"));
+ mir_snwprintf(szMsg, TranslateT("There is no messages to forward"));
m_ThreadInfo->send(
XmlNodeIq(L"result", pInfo)
@@ -517,7 +517,7 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe xNode << XCHILD(L"title", TranslateT("Forward options"));
- mir_sntprintf(szMsg, TranslateT("%d message(s) to be forwarded"), nUnreadEvents);
+ mir_snwprintf(szMsg, TranslateT("%d message(s) to be forwarded"), nUnreadEvents);
xNode << XCHILD(L"instructions", szMsg);
xNode << XCHILD(L"field") << XATTR(L"type", L"hidden") << XATTR(L"var", L"FORM_TYPE")
@@ -551,7 +551,7 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe int nEventsSent = 0;
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
- ptrT tszJid( getTStringA(hContact, "jid"));
+ ptrW tszJid( getTStringA(hContact, "jid"));
if (tszJid == NULL)
continue;
@@ -569,7 +569,7 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe if (dbei.eventType != EVENTTYPE_MESSAGE || (dbei.flags & (DBEF_READ | DBEF_SENT)))
continue;
- ptrT szEventText( DbGetEventTextT(&dbei, CP_ACP));
+ ptrW szEventText( DbGetEventTextT(&dbei, CP_ACP));
if (szEventText == NULL)
continue;
@@ -582,8 +582,8 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe size_t cbBlob = mir_strlen((LPSTR)dbei.pBlob)+1;
if (cbBlob < dbei.cbBlob) { // rest of message contains a sender's resource
- ptrT szOResource( mir_utf8decodeT((LPSTR)dbei.pBlob + cbBlob+1));
- mir_sntprintf(szOFrom, L"%s/%s", tszJid, szOResource);
+ ptrW szOResource( mir_utf8decodeW((LPSTR)dbei.pBlob + cbBlob+1));
+ mir_snwprintf(szOFrom, L"%s/%s", tszJid, szOResource);
} else
wcsncpy_s(szOFrom, tszJid, _TRUNCATE);
@@ -593,7 +593,7 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe time_t ltime = (time_t)dbei.timestamp;
struct tm *gmt = gmtime(<ime);
wchar_t stime[512];
- mir_sntprintf(stime, L"%.4i-%.2i-%.2iT%.2i:%.2i:%.2iZ", gmt->tm_year + 1900, gmt->tm_mon + 1, gmt->tm_mday,
+ mir_snwprintf(stime, L"%.4i-%.2i-%.2iT%.2i:%.2i:%.2iZ", gmt->tm_year + 1900, gmt->tm_mon + 1, gmt->tm_mday,
gmt->tm_hour, gmt->tm_min, gmt->tm_sec);
msg << XCHILDNS(L"delay", L"urn:xmpp:delay") << XATTR(L"stamp", stime);
@@ -607,7 +607,7 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe }
}
- mir_sntprintf(szMsg, TranslateT("%d message(s) forwarded"), nEventsSent);
+ mir_snwprintf(szMsg, TranslateT("%d message(s) forwarded"), nEventsSent);
m_ThreadInfo->send(
XmlNodeIq(L"result", pInfo)
@@ -627,9 +627,9 @@ int CJabberProto::AdhocLockWSHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSes wchar_t szMsg[ 1024 ];
if (bOk)
- mir_sntprintf(szMsg, TranslateT("Workstation successfully locked"));
+ mir_snwprintf(szMsg, TranslateT("Workstation successfully locked"));
else
- mir_sntprintf(szMsg, TranslateT("Error %d occurred during workstation lock"), GetLastError());
+ mir_snwprintf(szMsg, TranslateT("Error %d occurred during workstation lock"), GetLastError());
m_ThreadInfo->send(
XmlNodeIq(L"result", pInfo)
@@ -709,7 +709,7 @@ int CJabberProto::AdhocLeaveGroupchatsHandler(HXML, CJabberIqInfo *pInfo, CJabbe if (!nChatsCount) {
wchar_t szMsg[ 1024 ];
- mir_sntprintf(szMsg, TranslateT("There is no group chats to leave"));
+ mir_snwprintf(szMsg, TranslateT("There is no group chats to leave"));
m_ThreadInfo->send(
XmlNodeIq(L"result", pInfo)
@@ -763,7 +763,7 @@ int CJabberProto::AdhocLeaveGroupchatsHandler(HXML, CJabberIqInfo *pInfo, CJabbe if (fieldNode) {
for (i=0; i < XmlGetChildCount(fieldNode); i++) {
HXML valueNode = XmlGetChild(fieldNode, i);
- if (valueNode && XmlGetName(valueNode) && XmlGetText(valueNode) && !mir_tstrcmp(XmlGetName(valueNode), L"value")) {
+ if (valueNode && XmlGetName(valueNode) && XmlGetText(valueNode) && !mir_wstrcmp(XmlGetName(valueNode), L"value")) {
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_CHATROOM, XmlGetText(valueNode));
if (item)
GcQuit(item, 0, NULL);
diff --git a/protocols/JabberG/src/jabber_rc.h b/protocols/JabberG/src/jabber_rc.h index aa5306e381..fd4a6664d9 100644 --- a/protocols/JabberG/src/jabber_rc.h +++ b/protocols/JabberG/src/jabber_rc.h @@ -112,9 +112,9 @@ public: CJabberAdhocNode(CJabberProto* pProto, wchar_t* szJid, wchar_t* szNode, wchar_t* szName, JABBER_ADHOC_HANDLER pHandler)
{
memset(this, 0, sizeof(CJabberAdhocNode));
- replaceStrT(m_szJid, szJid);
- replaceStrT(m_szNode, szNode);
- replaceStrT(m_szName, szName);
+ replaceStrW(m_szJid, szJid);
+ replaceStrW(m_szNode, szNode);
+ replaceStrW(m_szName, szName);
m_pHandler = pHandler;
m_pProto = pProto;
}
@@ -169,7 +169,7 @@ protected: {
CJabberAdhocSession* pSession = m_pSessions;
while (pSession) {
- if (!mir_tstrcmp(pSession->GetSessionId(), szSession))
+ if (!mir_wstrcmp(pSession->GetSessionId(), szSession))
return pSession;
pSession = pSession->GetNext();
}
@@ -192,7 +192,7 @@ protected: {
CJabberAdhocNode* pNode = m_pNodes;
while (pNode) {
- if (!mir_tstrcmp(pNode->GetNode(), szNode))
+ if (!mir_wstrcmp(pNode->GetNode(), szNode))
return pNode;
pNode = pNode->GetNext();
}
diff --git a/protocols/JabberG/src/jabber_search.cpp b/protocols/JabberG/src/jabber_search.cpp index c1d3795688..69f3c6f3ee 100644 --- a/protocols/JabberG/src/jabber_search.cpp +++ b/protocols/JabberG/src/jabber_search.cpp @@ -141,7 +141,7 @@ void CJabberProto::OnIqResultGetSearchFields(HXML iqNode, CJabberIqInfo*) if (type == NULL) return; - if (!mir_tstrcmp(type, L"result")) { + if (!mir_wstrcmp(type, L"result")) { HXML queryNode = XmlGetNthChild(iqNode, L"query", 1); HXML xNode = XmlGetChildByTag(queryNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS); @@ -160,15 +160,15 @@ void CJabberProto::OnIqResultGetSearchFields(HXML iqNode, CJabberIqInfo*) if (!chNode) break; - if (!mir_tstrcmpi(XmlGetName(chNode), L"instructions") && XmlGetText(chNode)) + if (!mir_wstrcmpi(XmlGetName(chNode), L"instructions") && XmlGetText(chNode)) SetDlgItemText(searchHandleDlg, IDC_INSTRUCTIONS, TranslateTS(XmlGetText(chNode))); else if (XmlGetName(chNode)) { Data *MyData = (Data*)malloc(sizeof(Data)); memset(MyData, 0, sizeof(Data)); - MyData->Label = mir_tstrdup(XmlGetName(chNode)); - MyData->Var = mir_tstrdup(XmlGetName(chNode)); - MyData->defValue = mir_tstrdup(XmlGetText(chNode)); + MyData->Label = mir_wstrdup(XmlGetName(chNode)); + MyData->Var = mir_wstrdup(XmlGetName(chNode)); + MyData->defValue = mir_wstrdup(XmlGetText(chNode)); MyData->Order = Order; if (MyData->defValue) MyData->bReadOnly = TRUE; PostMessage(searchHandleDlg, WM_USER + 10, FALSE, (LPARAM)MyData); @@ -183,7 +183,7 @@ void CJabberProto::OnIqResultGetSearchFields(HXML iqNode, CJabberIqInfo*) PostMessage(searchHandleDlg, WM_USER + 10, 0, 0); ShowWindow(searchHandleDlg, SW_SHOW); } - else if (!mir_tstrcmp(type, L"error")) { + else if (!mir_wstrcmp(type, L"error")) { const wchar_t *code = NULL; const wchar_t *description = NULL; wchar_t buff[255]; @@ -192,7 +192,7 @@ void CJabberProto::OnIqResultGetSearchFields(HXML iqNode, CJabberIqInfo*) code = XmlGetAttrValue(errorNode, L"code"); description = XmlGetText(errorNode); } - mir_sntprintf(buff, TranslateT("Error %s %s\r\nPlease select other server"), code ? code : L"", description ? description : L""); + mir_snwprintf(buff, TranslateT("Error %s %s\r\nPlease select other server"), code ? code : L"", description ? description : L""); SetDlgItemText(searchHandleDlg, IDC_INSTRUCTIONS, buff); } else SetDlgItemText(searchHandleDlg, IDC_INSTRUCTIONS, TranslateT("Error: unknown reply received\r\nPlease select other server")); @@ -261,7 +261,7 @@ void CJabberProto::SearchReturnResults(HANDLE id, void * pvUsersInfo, U_TCHAR_M wchar_t *var = ListOfFields[j]; wchar_t *value = pmUserData->operator [](var); Results.pszFields[j] = value ? value : (wchar_t *)L" "; - if (!mir_tstrcmpi(var, L"jid") && value) + if (!mir_wstrcmpi(var, L"jid") && value) Results.psr.id.w = value; } @@ -270,8 +270,8 @@ void CJabberProto::SearchReturnResults(HANDLE id, void * pvUsersInfo, U_TCHAR_M nick = pmUserData->operator [](nickfields[k]); if (nick) { - if (mir_tstrcmpi(nick, Results.psr.id.w)) - mir_sntprintf(buff, L"%s (%s)", nick, Results.psr.id.w); + if (mir_wstrcmpi(nick, Results.psr.id.w)) + mir_snwprintf(buff, L"%s (%s)", nick, Results.psr.id.w); else wcsncpy_s(buff, nick, _TRUNCATE); @@ -293,7 +293,7 @@ void DestroyKey(wchar_t* key) wchar_t* CopyKey(wchar_t* key) { - return mir_tstrdup(key); + return mir_wstrdup(key); } //////////////////////////////////////////////////////////////////////////////// @@ -312,7 +312,7 @@ void CJabberProto::OnIqResultAdvancedSearch(HXML iqNode, CJabberIqInfo*) return; } - if (!mir_tstrcmp(type, L"result")) { + if (!mir_wstrcmp(type, L"result")) { HXML queryNode = XmlGetNthChild(iqNode, L"query", 1); HXML xNode = XmlGetChildByTag(queryNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS); if (xNode) { @@ -379,7 +379,7 @@ void CJabberProto::OnIqResultAdvancedSearch(HXML iqNode, CJabberIqInfo*) } } } - else if (!mir_tstrcmp(type, L"error")) { + else if (!mir_wstrcmp(type, L"error")) { const wchar_t *code = NULL; const wchar_t *description = NULL; wchar_t buff[255]; @@ -389,7 +389,7 @@ void CJabberProto::OnIqResultAdvancedSearch(HXML iqNode, CJabberIqInfo*) description = XmlGetText(errorNode); } - mir_sntprintf(buff, TranslateT("Error %s %s\r\nTry to specify more detailed"), code ? code : L"", description ? description : L""); + mir_snwprintf(buff, TranslateT("Error %s %s\r\nTry to specify more detailed"), code ? code : L"", description ? description : L""); ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0); if (searchHandleDlg) SetDlgItemText(searchHandleDlg, IDC_INSTRUCTIONS, buff); @@ -494,8 +494,8 @@ void CJabberProto::SearchDeleteFromRecent(const wchar_t *szAddr, bool deleteLast for (int i = 0; i < 10; i++) { char key[30]; mir_snprintf(key, "RecentlySearched_%d", i); - ptrT szValue(getTStringA(key)); - if (szValue == NULL || mir_tstrcmpi(szAddr, szValue)) + ptrW szValue(getTStringA(key)); + if (szValue == NULL || mir_wstrcmpi(szAddr, szValue)) continue; for (int j = i; j < 10; j++) { @@ -524,7 +524,7 @@ void CJabberProto::SearchAddToRecent(const wchar_t *szAddr, HWND hwndDialog) for (int j = 9; j > 0; j--) { mir_snprintf(key, "RecentlySearched_%d", j - 1); - ptrT szValue(getTStringA(key)); + ptrW szValue(getTStringA(key)); if (szValue != NULL) { mir_snprintf(key, "RecentlySearched_%d", j); setTString(NULL, key, szValue); @@ -564,7 +564,7 @@ static INT_PTR CALLBACK JabberSearchAdvancedDlgProc(HWND hwndDlg, UINT msg, WPAR for (i = 0; i < 10; i++) { char key[30]; mir_snprintf(key, "RecentlySearched_%d", i); - ptrT szValue(dat->ppro->getTStringA(key)); + ptrW szValue(dat->ppro->getTStringA(key)); if (szValue != NULL) JabberSearchAddUrlToRecentCombo(hwndDlg, szValue); } @@ -714,8 +714,8 @@ static INT_PTR CALLBACK JabberSearchAdvancedDlgProc(HWND hwndDlg, UINT msg, WPAR HWND __cdecl CJabberProto::CreateExtendedSearchUI(HWND parent) { if (parent && hInst) { - ptrT szServer(getTStringA("LoginServer")); - if (szServer == NULL || mir_tstrcmpi(szServer, L"S.ms")) + ptrW szServer(getTStringA("LoginServer")); + if (szServer == NULL || mir_wstrcmpi(szServer, L"S.ms")) return CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_SEARCHUSER), parent, JabberSearchAdvancedDlgProc, (LPARAM)this); } diff --git a/protocols/JabberG/src/jabber_search.h b/protocols/JabberG/src/jabber_search.h index cf3f053728..34eee4d1bc 100644 --- a/protocols/JabberG/src/jabber_search.h +++ b/protocols/JabberG/src/jabber_search.h @@ -262,5 +262,5 @@ public: inline int TCharKeyCmp(wchar_t* a, wchar_t* b)
{
- return (int)(mir_tstrcmpi(a,b));
+ return (int)(mir_wstrcmpi(a,b));
}
diff --git a/protocols/JabberG/src/jabber_secur.cpp b/protocols/JabberG/src/jabber_secur.cpp index 447e15edd1..6508672e41 100644 --- a/protocols/JabberG/src/jabber_secur.cpp +++ b/protocols/JabberG/src/jabber_secur.cpp @@ -78,8 +78,8 @@ bool TNtlmAuth::getSpn(wchar_t* szSpn, size_t dwSpnLen) else return false;
if (szHostName && szHostName[0]) {
- wchar_t *szFullUserNameU = wcsupr(mir_tstrdup(szFullUserName));
- mir_sntprintf(szSpn, dwSpnLen, L"xmpp/%s/%s@%s", szHostName, szFullUserName, szFullUserNameU);
+ wchar_t *szFullUserNameU = wcsupr(mir_wstrdup(szFullUserName));
+ mir_snwprintf(szSpn, dwSpnLen, L"xmpp/%s/%s@%s", szHostName, szFullUserName, szFullUserNameU);
mir_free(szFullUserNameU);
}
else {
@@ -90,8 +90,8 @@ bool TNtlmAuth::getSpn(wchar_t* szSpn, size_t dwSpnLen) if (host && host->h_name)
connectHost = host->h_name;
- wchar_t *connectHostT = mir_a2t(connectHost);
- mir_sntprintf(szSpn, dwSpnLen, L"xmpp/%s@%s", connectHostT, wcsupr(szFullUserName));
+ wchar_t *connectHostT = mir_a2u(connectHost);
+ mir_snwprintf(szSpn, dwSpnLen, L"xmpp/%s@%s", connectHostT, wcsupr(szFullUserName));
mir_free(connectHostT);
}
@@ -116,7 +116,7 @@ char* TNtlmAuth::getChallenge(const wchar_t *challenge) if (!hProvider)
return NULL;
- ptrA text((!mir_tstrcmp(challenge, L"=")) ? mir_strdup("") : mir_t2a(challenge));
+ ptrA text((!mir_wstrcmp(challenge, L"=")) ? mir_strdup("") : mir_u2a(challenge));
if (info->conn.password[0] != 0)
return Netlib_NtlmCreateResponse2(hProvider, text, info->conn.username, info->conn.password, &complete);
@@ -261,7 +261,7 @@ char* TScramAuth::getChallenge(const wchar_t *challenge) if (snonce == NULL || salt == NULL || ind == -1)
return NULL;
- ptrA passw(mir_utf8encodeT(info->conn.password));
+ ptrA passw(mir_utf8encodeW(info->conn.password));
size_t passwLen = mir_strlen(passw);
BYTE saltedPassw[MIR_SHA1_HASH_SIZE];
diff --git a/protocols/JabberG/src/jabber_svc.cpp b/protocols/JabberG/src/jabber_svc.cpp index 521d4eaa08..9d5553db8f 100644 --- a/protocols/JabberG/src/jabber_svc.cpp +++ b/protocols/JabberG/src/jabber_svc.cpp @@ -65,7 +65,7 @@ INT_PTR __cdecl CJabberProto::GetMyAwayMsg(WPARAM wParam, LPARAM lParam) }
if (szStatus)
- return (lParam & SGMA_UNICODE) ? (INT_PTR)mir_t2u(szStatus) : (INT_PTR)mir_t2a(szStatus);
+ return (lParam & SGMA_UNICODE) ? (INT_PTR)mir_wstrdup(szStatus) : (INT_PTR)mir_u2a(szStatus);
return 0;
}
@@ -144,7 +144,7 @@ INT_PTR __cdecl CJabberProto::JabberGetAvatarInfo(WPARAM wParam, LPARAM lParam) }
if ((wParam & GAIF_FORCE) != 0 && pai->hContact != NULL && m_bJabberOnline) {
- ptrT tszJid( getTStringA(pai->hContact, "jid"));
+ ptrW tszJid( getTStringA(pai->hContact, "jid"));
if (tszJid != NULL) {
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, tszJid);
if (item != NULL) {
@@ -153,7 +153,7 @@ INT_PTR __cdecl CJabberProto::JabberGetAvatarInfo(WPARAM wParam, LPARAM lParam) wchar_t szJid[JABBER_MAX_JID_LEN]; szJid[0] = 0;
if (item->arResources.getCount() != NULL && !isXVcard)
if (wchar_t *bestResName = ListGetBestClientResourceNamePtr(tszJid))
- mir_sntprintf(szJid, L"%s/%s", tszJid, bestResName);
+ mir_snwprintf(szJid, L"%s/%s", tszJid, bestResName);
if (szJid[0] == 0)
wcsncpy_s(szJid, tszJid, _TRUNCATE);
@@ -181,7 +181,7 @@ INT_PTR __cdecl CJabberProto::OnGetEventTextChatStates(WPARAM, LPARAM lParam) if (pdbEvent->dbei->cbBlob > 0) {
if (pdbEvent->dbei->pBlob[0] == JABBER_DB_EVENT_CHATSTATES_GONE) {
if (pdbEvent->datatype == DBVT_WCHAR)
- return (INT_PTR)mir_tstrdup(TranslateT("closed chat session"));
+ return (INT_PTR)mir_wstrdup(TranslateT("closed chat session"));
else if (pdbEvent->datatype == DBVT_ASCIIZ)
return (INT_PTR)mir_strdup(Translate("closed chat session"));
}
@@ -200,42 +200,42 @@ INT_PTR __cdecl CJabberProto::OnGetEventTextPresence(WPARAM, LPARAM lParam) switch (pdbEvent->dbei->pBlob[0]) {
case JABBER_DB_EVENT_PRESENCE_SUBSCRIBE:
if (pdbEvent->datatype == DBVT_WCHAR)
- return (INT_PTR)mir_tstrdup(TranslateT("sent subscription request"));
+ return (INT_PTR)mir_wstrdup(TranslateT("sent subscription request"));
else if (pdbEvent->datatype == DBVT_ASCIIZ)
return (INT_PTR)mir_strdup(Translate("sent subscription request"));
break;
case JABBER_DB_EVENT_PRESENCE_SUBSCRIBED:
if (pdbEvent->datatype == DBVT_WCHAR)
- return (INT_PTR)mir_tstrdup(TranslateT("approved subscription request"));
+ return (INT_PTR)mir_wstrdup(TranslateT("approved subscription request"));
else if (pdbEvent->datatype == DBVT_ASCIIZ)
return (INT_PTR)mir_strdup(Translate("approved subscription request"));
break;
case JABBER_DB_EVENT_PRESENCE_UNSUBSCRIBE:
if (pdbEvent->datatype == DBVT_WCHAR)
- return (INT_PTR)mir_tstrdup(TranslateT("declined subscription"));
+ return (INT_PTR)mir_wstrdup(TranslateT("declined subscription"));
else if (pdbEvent->datatype == DBVT_ASCIIZ)
return (INT_PTR)mir_strdup(Translate("declined subscription"));
break;
case JABBER_DB_EVENT_PRESENCE_UNSUBSCRIBED:
if (pdbEvent->datatype == DBVT_WCHAR)
- return (INT_PTR)mir_tstrdup(TranslateT("declined subscription"));
+ return (INT_PTR)mir_wstrdup(TranslateT("declined subscription"));
else if (pdbEvent->datatype == DBVT_ASCIIZ)
return (INT_PTR)mir_strdup(Translate("declined subscription"));
break;
case JABBER_DB_EVENT_PRESENCE_ERROR:
if (pdbEvent->datatype == DBVT_WCHAR)
- return (INT_PTR)mir_tstrdup(TranslateT("sent error presence"));
+ return (INT_PTR)mir_wstrdup(TranslateT("sent error presence"));
else if (pdbEvent->datatype == DBVT_ASCIIZ)
return (INT_PTR)mir_strdup(Translate("sent error presence"));
break;
default:
if (pdbEvent->datatype == DBVT_WCHAR)
- return (INT_PTR)mir_tstrdup(TranslateT("sent unknown presence type"));
+ return (INT_PTR)mir_wstrdup(TranslateT("sent unknown presence type"));
else if (pdbEvent->datatype == DBVT_ASCIIZ)
return (INT_PTR)mir_strdup(Translate("sent unknown presence type"));
break;
@@ -317,7 +317,7 @@ INT_PTR __cdecl CJabberProto::JabberSetAvatar(WPARAM, LPARAM lParam) INT_PTR __cdecl CJabberProto::JabberSetNickname(WPARAM wParam, LPARAM lParam)
{
- wchar_t *nickname = (wParam & SMNN_UNICODE) ? mir_u2t((WCHAR*)lParam) : mir_a2t((char*)lParam);
+ wchar_t *nickname = (wParam & SMNN_UNICODE) ? mir_wstrdup((WCHAR*)lParam) : mir_a2u((char*)lParam);
setTString("Nick", nickname);
SetServerVcard(FALSE, L"");
@@ -347,7 +347,7 @@ static void appendString(bool bIsTipper, const wchar_t *tszTitle, const wchar_t out.AppendFormat(L"<b>%s</b>\t%s", TranslateTS(tszTitle), tszValue);
else {
wchar_t *p = TranslateTS(tszTitle);
- out.AppendFormat(L"%s%s\t%s", p, mir_tstrlen(p) <= 7 ? L"\t" : L"", tszValue);
+ out.AppendFormat(L"%s%s\t%s", p, mir_wstrlen(p) <= 7 ? L"\t" : L"", tszValue);
}
}
@@ -398,7 +398,7 @@ INT_PTR __cdecl CJabberProto::JabberGCGetToolTipText(WPARAM wParam, LPARAM lPara if (info->m_tszRealJid)
appendString(bIsTipper, LPGENW("Real JID:"), info->m_tszRealJid, outBuf);
- return (outBuf.IsEmpty() ? NULL : (INT_PTR)mir_tstrdup(outBuf));
+ return (outBuf.IsEmpty() ? NULL : (INT_PTR)mir_wstrdup(outBuf));
}
// File Association Manager plugin support
@@ -434,7 +434,7 @@ INT_PTR __cdecl CJabberProto::JabberServiceParseXmppURI(WPARAM, LPARAM lParam) *(szSecondParam++) = 0;
// no command or message command
- if (!szCommand || (szCommand && !mir_tstrcmpi(szCommand, L"message"))) {
+ if (!szCommand || (szCommand && !mir_wstrcmpi(szCommand, L"message"))) {
// message
if (!ServiceExists(MS_MSG_SENDMESSAGEW))
return 1;
@@ -461,7 +461,7 @@ INT_PTR __cdecl CJabberProto::JabberServiceParseXmppURI(WPARAM, LPARAM lParam) return 0;
}
- if (!mir_tstrcmpi(szCommand, L"roster")) {
+ if (!mir_wstrcmpi(szCommand, L"roster")) {
if (!HContactFromJID(szJid)) {
PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
@@ -479,19 +479,19 @@ INT_PTR __cdecl CJabberProto::JabberServiceParseXmppURI(WPARAM, LPARAM lParam) }
// chat join invitation
- if (!mir_tstrcmpi(szCommand, L"join")) {
+ if (!mir_wstrcmpi(szCommand, L"join")) {
GroupchatJoinRoomByJid(NULL, szJid);
return 0;
}
// service discovery request
- if (!mir_tstrcmpi(szCommand, L"disco")) {
+ if (!mir_wstrcmpi(szCommand, L"disco")) {
OnMenuHandleServiceDiscovery(0, (LPARAM)szJid);
return 0;
}
// ad-hoc commands
- if (!mir_tstrcmpi(szCommand, L"command")) {
+ if (!mir_wstrcmpi(szCommand, L"command")) {
if (szSecondParam) {
if (!wcsnicmp(szSecondParam, L"node=", 5)) {
szSecondParam += 5;
@@ -506,7 +506,7 @@ INT_PTR __cdecl CJabberProto::JabberServiceParseXmppURI(WPARAM, LPARAM lParam) }
// send file
- if (!mir_tstrcmpi(szCommand, L"sendfile")) {
+ if (!mir_wstrcmpi(szCommand, L"sendfile")) {
MCONTACT hContact = HContactFromJID(szJid, false);
if (hContact == NULL)
hContact = DBCreateContact(szJid, szJid, true, true);
@@ -525,14 +525,14 @@ INT_PTR __cdecl CJabberProto::JabberSendNudge(WPARAM hContact, LPARAM) if (!m_bJabberOnline)
return 0;
- ptrT jid( getTStringA(hContact, "jid"));
+ ptrW jid( getTStringA(hContact, "jid"));
if (jid == NULL)
return 0;
wchar_t tszJid[JABBER_MAX_JID_LEN];
wchar_t *szResource = ListGetBestClientResourceNamePtr(jid);
if (szResource)
- mir_sntprintf(tszJid, L"%s/%s", jid, szResource);
+ mir_snwprintf(tszJid, L"%s/%s", jid, szResource);
else
wcsncpy_s(tszJid, jid, _TRUNCATE);
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index 074476651f..bc3486fdf5 100755 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -77,7 +77,7 @@ static INT_PTR CALLBACK JabberPasswordDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
wchar_t text[512];
- mir_sntprintf(text, TranslateT("Enter password for %s"), param->ptszJid);
+ mir_snwprintf(text, TranslateT("Enter password for %s"), param->ptszJid);
SetDlgItemText(hwndDlg, IDC_JID, text);
CheckDlgButton(hwndDlg, IDC_SAVEPASSWORD, param->pro->getByte("SaveSessionPassword", 0) ? BST_CHECKED : BST_UNCHECKED);
@@ -217,7 +217,7 @@ void CJabberProto::xmlStreamInitializeNow(ThreadData *info) void CJabberProto::ServerThread(JABBER_CONN_DATA *pParam)
{
- ptrT tszValue;
+ ptrW tszValue;
ThreadData info(this, pParam);
@@ -248,7 +248,7 @@ void CJabberProto::ServerThread(JABBER_CONN_DATA *pParam) if ((tszValue = getTStringA("LoginName")) != NULL)
wcsncpy_s(info.conn.username, tszValue, _TRUNCATE);
- if (*rtrimt(info.conn.username) == '\0') {
+ if (*rtrimw(info.conn.username) == '\0') {
DWORD dwSize = _countof(info.conn.username);
if (GetUserName(info.conn.username, &dwSize))
setTString("LoginName", info.conn.username);
@@ -256,7 +256,7 @@ void CJabberProto::ServerThread(JABBER_CONN_DATA *pParam) info.conn.username[0] = 0;
}
- if (*rtrimt(info.conn.username) == '\0') {
+ if (*rtrimw(info.conn.username) == '\0') {
debugLogA("Thread ended, login name is not configured");
JLoginFailed(LOGINERR_BADUSERID);
@@ -279,17 +279,17 @@ LBL_FatalError: if (m_options.HostNameAsResource) {
DWORD dwCompNameLen = _countof(info.resource) - 1;
if (!GetComputerName(info.resource, &dwCompNameLen))
- mir_tstrcpy(info.resource, L"Miranda");
+ mir_wstrcpy(info.resource, L"Miranda");
}
else {
if ((tszValue = getTStringA("Resource")) != NULL)
wcsncpy_s(info.resource, tszValue, _TRUNCATE);
else
- mir_tstrcpy(info.resource, L"Miranda");
+ mir_wstrcpy(info.resource, L"Miranda");
}
wchar_t jidStr[512];
- mir_sntprintf(jidStr, L"%s@%S/%s", info.conn.username, info.conn.server, info.resource);
+ mir_snwprintf(jidStr, L"%s@%S/%s", info.conn.username, info.conn.server, info.resource);
wcsncpy_s(info.fullJID, jidStr, _TRUNCATE);
if (m_options.UseDomainLogin) // in the case of NTLM auth we have no need in password
@@ -298,7 +298,7 @@ LBL_FatalError: if (m_savedPassword != NULL)
wcsncpy_s(info.conn.password, m_savedPassword, _TRUNCATE);
else {
- mir_sntprintf(jidStr, L"%s@%S", info.conn.username, info.conn.server);
+ mir_snwprintf(jidStr, L"%s@%S", info.conn.username, info.conn.server);
JabberPasswordDlgParam param;
param.pro = this;
@@ -314,12 +314,12 @@ LBL_FatalError: goto LBL_FatalError;
}
- m_savedPassword = (param.saveOnlinePassword) ? mir_tstrdup(param.onlinePassword) : NULL;
+ m_savedPassword = (param.saveOnlinePassword) ? mir_wstrdup(param.onlinePassword) : NULL;
wcsncpy_s(info.conn.password, param.onlinePassword, _TRUNCATE);
}
}
else {
- ptrT tszPassw(getTStringA(NULL, "Password"));
+ ptrW tszPassw(getTStringA(NULL, "Password"));
if (tszPassw == NULL) {
JLoginFailed(LOGINERR_BADUSERID);
debugLogA("Thread ended, password is not configured");
@@ -390,9 +390,9 @@ LBL_FatalError: // User may change status to OFFLINE while we are connecting above
if (m_iDesiredStatus != ID_STATUS_OFFLINE || info.bIsReg) {
if (!info.bIsReg) {
- size_t len = mir_tstrlen(info.conn.username) + mir_strlen(info.conn.server) + 1;
+ size_t len = mir_wstrlen(info.conn.username) + mir_strlen(info.conn.server) + 1;
m_szJabberJID = (wchar_t*)mir_alloc(sizeof(wchar_t)*(len + 1));
- mir_sntprintf(m_szJabberJID, len + 1, L"%s@%S", info.conn.username, info.conn.server);
+ mir_snwprintf(m_szJabberJID, len + 1, L"%s@%S", info.conn.username, info.conn.server);
m_bSendKeepAlive = m_options.KeepAlive != 0;
setTString("jid", m_szJabberJID); // store jid in database
@@ -439,7 +439,7 @@ LBL_FatalError: recvRest:
info.buffer[datalen] = '\0';
- ptrT str(mir_utf8decodeW(info.buffer));
+ ptrW str(mir_utf8decodeW(info.buffer));
int bytesParsed = 0;
XmlNode root(str, &bytesParsed, tag);
@@ -569,13 +569,13 @@ void CJabberProto::PerformIqAuth(ThreadData *info) void CJabberProto::OnProcessStreamOpening(HXML node, ThreadData *info)
{
- if (mir_tstrcmp(XmlGetName(node), L"stream:stream"))
+ if (mir_wstrcmp(XmlGetName(node), L"stream:stream"))
return;
if (!info->bIsReg) {
const wchar_t *sid = XmlGetAttrValue(node, L"id");
if (sid != NULL)
- info->szStreamId = mir_t2a(sid);
+ info->szStreamId = mir_u2a(sid);
}
// old server - disable SASL then
@@ -654,7 +654,7 @@ void CJabberProto::PerformAuthentication(ThreadData *info) }
wchar_t text[1024];
- mir_sntprintf(text, TranslateT("Authentication failed for %s@%S."), info->conn.username, info->conn.server);
+ mir_snwprintf(text, TranslateT("Authentication failed for %s@%S."), info->conn.username, info->conn.server);
MsgPopup(NULL, text, TranslateT("Jabber Authentication"));
JLoginFailed(LOGINERR_WRONGPASSWORD);
info->send("</stream:stream>");
@@ -682,29 +682,29 @@ void CJabberProto::OnProcessFeatures(HXML node, ThreadData *info) if (!n)
break;
- if (!mir_tstrcmp(XmlGetName(n), L"starttls")) {
+ if (!mir_wstrcmp(XmlGetName(n), L"starttls")) {
if (!info->conn.useSSL && m_options.UseTLS) {
debugLogA("Requesting TLS");
info->send(XmlNode(XmlGetName(n)) << XATTR(L"xmlns", L"urn:ietf:params:xml:ns:xmpp-tls"));
return;
} }
- if (!mir_tstrcmp(XmlGetName(n), L"compression") && m_options.EnableZlib == TRUE) {
+ if (!mir_wstrcmp(XmlGetName(n), L"compression") && m_options.EnableZlib == TRUE) {
debugLogA("Server compression available");
for (int k = 0;; k++) {
HXML c = XmlGetChild(n, k);
if (!c)
break;
- if (!mir_tstrcmp(XmlGetName(c), L"method")) {
- if (!mir_tstrcmp(XmlGetText(c), L"zlib") && info->zlibInit() == TRUE) {
+ if (!mir_wstrcmp(XmlGetName(c), L"method")) {
+ if (!mir_wstrcmp(XmlGetText(c), L"zlib") && info->zlibInit() == TRUE) {
debugLogA("Requesting Zlib compression");
info->send(XmlNode(L"compress") << XATTR(L"xmlns", L"http://jabber.org/protocol/compress")
<< XCHILD(L"method", L"zlib"));
return;
} } } }
- if (!mir_tstrcmp(XmlGetName(n), L"mechanisms")) {
+ if (!mir_wstrcmp(XmlGetName(n), L"mechanisms")) {
m_AuthMechs.isPlainAvailable = false;
m_AuthMechs.isPlainOldAvailable = false;
m_AuthMechs.isMd5Available = false;
@@ -721,26 +721,26 @@ void CJabberProto::OnProcessFeatures(HXML node, ThreadData *info) if (!c)
break;
- if (!mir_tstrcmp(XmlGetName(c), L"mechanism")) {
+ if (!mir_wstrcmp(XmlGetName(c), L"mechanism")) {
LPCTSTR ptszMechanism = XmlGetText(c);
- if (!mir_tstrcmp(ptszMechanism, L"PLAIN")) m_AuthMechs.isPlainOldAvailable = m_AuthMechs.isPlainAvailable = true;
- else if (!mir_tstrcmp(ptszMechanism, L"DIGEST-MD5")) m_AuthMechs.isMd5Available = true;
- else if (!mir_tstrcmp(ptszMechanism, L"SCRAM-SHA-1")) m_AuthMechs.isScramAvailable = true;
- else if (!mir_tstrcmp(ptszMechanism, L"NTLM")) m_AuthMechs.isNtlmAvailable = true;
- else if (!mir_tstrcmp(ptszMechanism, L"GSS-SPNEGO")) m_AuthMechs.isSpnegoAvailable = true;
- else if (!mir_tstrcmp(ptszMechanism, L"GSSAPI")) m_AuthMechs.isKerberosAvailable = true;
+ if (!mir_wstrcmp(ptszMechanism, L"PLAIN")) m_AuthMechs.isPlainOldAvailable = m_AuthMechs.isPlainAvailable = true;
+ else if (!mir_wstrcmp(ptszMechanism, L"DIGEST-MD5")) m_AuthMechs.isMd5Available = true;
+ else if (!mir_wstrcmp(ptszMechanism, L"SCRAM-SHA-1")) m_AuthMechs.isScramAvailable = true;
+ else if (!mir_wstrcmp(ptszMechanism, L"NTLM")) m_AuthMechs.isNtlmAvailable = true;
+ else if (!mir_wstrcmp(ptszMechanism, L"GSS-SPNEGO")) m_AuthMechs.isSpnegoAvailable = true;
+ else if (!mir_wstrcmp(ptszMechanism, L"GSSAPI")) m_AuthMechs.isKerberosAvailable = true;
}
- else if (!mir_tstrcmp(XmlGetName(c), L"hostname")) {
+ else if (!mir_wstrcmp(XmlGetName(c), L"hostname")) {
const wchar_t *mech = XmlGetAttrValue(c, L"mechanism");
- if (mech && mir_tstrcmpi(mech, L"GSSAPI") == 0) {
- m_AuthMechs.m_gssapiHostName = mir_tstrdup(XmlGetText(c));
+ if (mech && mir_wstrcmpi(mech, L"GSSAPI") == 0) {
+ m_AuthMechs.m_gssapiHostName = mir_wstrdup(XmlGetText(c));
}
}
}
}
- else if (!mir_tstrcmp(XmlGetName(n), L"register")) isRegisterAvailable = true;
- else if (!mir_tstrcmp(XmlGetName(n), L"auth")) m_AuthMechs.isAuthAvailable = true;
- else if (!mir_tstrcmp(XmlGetName(n), L"session")) m_AuthMechs.isSessionAvailable = true;
+ else if (!mir_wstrcmp(XmlGetName(n), L"register")) isRegisterAvailable = true;
+ else if (!mir_wstrcmp(XmlGetName(n), L"auth")) m_AuthMechs.isAuthAvailable = true;
+ else if (!mir_wstrcmp(XmlGetName(n), L"session")) m_AuthMechs.isSessionAvailable = true;
}
if (areMechanismsDefined) {
@@ -773,7 +773,7 @@ void CJabberProto::OnProcessFailure(HXML node, ThreadData *info) const wchar_t *type;
//failure xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\"
if ((type = XmlGetAttrValue(node, L"xmlns")) == NULL) return;
- if (!mir_tstrcmp(type, L"urn:ietf:params:xml:ns:xmpp-sasl")) {
+ if (!mir_wstrcmp(type, L"urn:ietf:params:xml:ns:xmpp-sasl")) {
PerformAuthentication(info);
}
}
@@ -799,13 +799,13 @@ void CJabberProto::OnProcessError(HXML node, ThreadData *info) const wchar_t *name = XmlGetName(n);
const wchar_t *desc = XmlGetText(n);
if (desc)
- pos += mir_sntprintf(buff + pos, 1024 - pos, L"%s: %s\r\n", name, desc);
+ pos += mir_snwprintf(buff + pos, 1024 - pos, L"%s: %s\r\n", name, desc);
else
- pos += mir_sntprintf(buff + pos, 1024 - pos, L"%s\r\n", name);
+ pos += mir_snwprintf(buff + pos, 1024 - pos, L"%s\r\n", name);
- if (!mir_tstrcmp(name, L"conflict"))
+ if (!mir_wstrcmp(name, L"conflict"))
ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_OTHERLOCATION);
- else if (!mir_tstrcmp(name, L"see-other-host")) {
+ else if (!mir_wstrcmp(name, L"see-other-host")) {
skipMsg = true;
}
}
@@ -823,14 +823,14 @@ void CJabberProto::OnProcessSuccess(HXML node, ThreadData *info) if ((type = XmlGetAttrValue(node, L"xmlns")) == NULL)
return;
- if (!mir_tstrcmp(type, L"urn:ietf:params:xml:ns:xmpp-sasl")) {
+ if (!mir_wstrcmp(type, L"urn:ietf:params:xml:ns:xmpp-sasl")) {
if (!info->auth->validateLogin(XmlGetText(node))) {
info->send("</stream:stream>");
return;
}
debugLogA("Success: Logged-in.");
- ptrT tszNick(getTStringA("Nick"));
+ ptrW tszNick(getTStringA("Nick"));
if (tszNick == NULL)
setTString("Nick", info->conn.username);
@@ -846,7 +846,7 @@ void CJabberProto::OnProcessChallenge(HXML node, ThreadData *info) return;
}
- if (mir_tstrcmp(XmlGetAttrValue(node, L"xmlns"), L"urn:ietf:params:xml:ns:xmpp-sasl"))
+ if (mir_wstrcmp(XmlGetAttrValue(node, L"xmlns"), L"urn:ietf:params:xml:ns:xmpp-sasl"))
return;
char* challenge = info->auth->getChallenge(XmlGetText(node));
@@ -858,34 +858,34 @@ void CJabberProto::OnProcessProtocol(HXML node, ThreadData *info) {
OnConsoleProcessXml(node, JCPF_IN);
- if (!mir_tstrcmp(XmlGetName(node), L"proceed"))
+ if (!mir_wstrcmp(XmlGetName(node), L"proceed"))
OnProcessProceed(node, info);
- else if (!mir_tstrcmp(XmlGetName(node), L"compressed"))
+ else if (!mir_wstrcmp(XmlGetName(node), L"compressed"))
OnProcessCompressed(node, info);
- else if (!mir_tstrcmp(XmlGetName(node), L"stream:features"))
+ else if (!mir_wstrcmp(XmlGetName(node), L"stream:features"))
OnProcessFeatures(node, info);
- else if (!mir_tstrcmp(XmlGetName(node), L"stream:stream"))
+ else if (!mir_wstrcmp(XmlGetName(node), L"stream:stream"))
OnProcessStreamOpening(node, info);
- else if (!mir_tstrcmp(XmlGetName(node), L"success"))
+ else if (!mir_wstrcmp(XmlGetName(node), L"success"))
OnProcessSuccess(node, info);
- else if (!mir_tstrcmp(XmlGetName(node), L"failure"))
+ else if (!mir_wstrcmp(XmlGetName(node), L"failure"))
OnProcessFailure(node, info);
- else if (!mir_tstrcmp(XmlGetName(node), L"stream:error"))
+ else if (!mir_wstrcmp(XmlGetName(node), L"stream:error"))
OnProcessError(node, info);
- else if (!mir_tstrcmp(XmlGetName(node), L"challenge"))
+ else if (!mir_wstrcmp(XmlGetName(node), L"challenge"))
OnProcessChallenge(node, info);
else if (!info->bIsReg) {
- if (!mir_tstrcmp(XmlGetName(node), L"message"))
+ if (!mir_wstrcmp(XmlGetName(node), L"message"))
OnProcessMessage(node, info);
- else if (!mir_tstrcmp(XmlGetName(node), L"presence"))
+ else if (!mir_wstrcmp(XmlGetName(node), L"presence"))
OnProcessPresence(node, info);
- else if (!mir_tstrcmp(XmlGetName(node), L"iq"))
+ else if (!mir_wstrcmp(XmlGetName(node), L"iq"))
OnProcessIq(node);
else
debugLogA("Invalid top-level tag (only <message/> <presence/> and <iq/> allowed)");
}
else {
- if (!mir_tstrcmp(XmlGetName(node), L"iq"))
+ if (!mir_wstrcmp(XmlGetName(node), L"iq"))
OnProcessRegIq(node, info);
else
debugLogA("Invalid top-level tag (only <iq/> allowed)");
@@ -895,10 +895,10 @@ void CJabberProto::OnProcessProtocol(HXML node, ThreadData *info) void CJabberProto::OnProcessProceed(HXML node, ThreadData *info)
{
const wchar_t *type;
- if ((type = XmlGetAttrValue(node, L"xmlns")) != NULL && !mir_tstrcmp(type, L"error"))
+ if ((type = XmlGetAttrValue(node, L"xmlns")) != NULL && !mir_wstrcmp(type, L"error"))
return;
- if (!mir_tstrcmp(type, L"urn:ietf:params:xml:ns:xmpp-tls")) {
+ if (!mir_wstrcmp(type, L"urn:ietf:params:xml:ns:xmpp-tls")) {
debugLogA("Starting TLS...");
char* gtlk = strstr(info->conn.manualHost, "google.com");
@@ -923,9 +923,9 @@ void CJabberProto::OnProcessCompressed(HXML node, ThreadData *info) debugLogA("Compression confirmed");
const wchar_t *type = XmlGetAttrValue(node, L"xmlns");
- if (type != NULL && !mir_tstrcmp(type, L"error"))
+ if (type != NULL && !mir_wstrcmp(type, L"error"))
return;
- if (mir_tstrcmp(type, L"http://jabber.org/protocol/compress"))
+ if (mir_wstrcmp(type, L"http://jabber.org/protocol/compress"))
return;
debugLogA("Starting Zlib stream compression...");
@@ -974,7 +974,7 @@ void CJabberProto::OnProcessPubsubEvent(HXML node) szLengthInTime[0] = 0;
if (szLength) {
int nLength = _wtoi(szLength);
- mir_sntprintf(szLengthInTime, L"%02d:%02d:%02d", nLength / 3600, (nLength / 60) % 60, nLength % 60);
+ mir_snwprintf(szLengthInTime, L"%02d:%02d:%02d", nLength / 3600, (nLength / 60) % 60, nLength % 60);
}
SetContactTune(hContact, szArtist, szLength ? szLengthInTime : NULL, szSource, szTitle, szTrack);
@@ -1006,7 +1006,7 @@ DWORD JabberGetLastContactMessageTime(MCONTACT hContact) MCONTACT CJabberProto::CreateTemporaryContact(const wchar_t *szJid, JABBER_LIST_ITEM* chatItem)
{
if (chatItem == NULL)
- return DBCreateContact(szJid, ptrT(JabberNickFromJID(szJid)), true, true);
+ return DBCreateContact(szJid, ptrW(JabberNickFromJID(szJid)), true, true);
const wchar_t *p = wcschr(szJid, '/');
if (p != NULL && p[1] != '\0')
@@ -1026,7 +1026,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info) {
HXML xNode, n;
- if (!XmlGetName(node) || mir_tstrcmp(XmlGetName(node), L"message"))
+ if (!XmlGetName(node) || mir_wstrcmp(XmlGetName(node), L"message"))
return;
LPCTSTR from, type = XmlGetAttrValue(node, L"type");
@@ -1037,7 +1037,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info) pResourceStatus pFromResource(ResourceInfoFromJID(from));
// Message receipts delivery request. Reply here, before a call to HandleMessagePermanent() to make sure message receipts are handled for external plugins too.
- if ((!type || mir_tstrcmpi(type, L"error")) && XmlGetChildByTag(node, "request", "xmlns", JABBER_FEAT_MESSAGE_RECEIPTS)) {
+ if ((!type || mir_wstrcmpi(type, L"error")) && XmlGetChildByTag(node, "request", "xmlns", JABBER_FEAT_MESSAGE_RECEIPTS)) {
info->send(
XmlNode(L"message") << XATTR(L"to", from) << XATTR(L"id", idStr)
<< XCHILDNS(L"received", JABBER_FEAT_MESSAGE_RECEIPTS) << XATTR(L"id", idStr));
@@ -1067,15 +1067,15 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info) LPCTSTR ptszSubject = XmlGetText(XmlGetChild(node, "subject"));
if (ptszSubject && *ptszSubject) {
- size_t cbLen = (szMessage ? mir_tstrlen(szMessage) : 0) + mir_tstrlen(ptszSubject) + 128;
+ size_t cbLen = (szMessage ? mir_wstrlen(szMessage) : 0) + mir_wstrlen(ptszSubject) + 128;
wchar_t *szTmp = (wchar_t *)alloca(sizeof(wchar_t) * cbLen);
szTmp[0] = 0;
if (szMessage)
- mir_tstrcat(szTmp, L"Subject: ");
- mir_tstrcat(szTmp, ptszSubject);
+ mir_wstrcat(szTmp, L"Subject: ");
+ mir_wstrcat(szTmp, ptszSubject);
if (szMessage) {
- mir_tstrcat(szTmp, L"\r\n");
- mir_tstrcat(szTmp, szMessage);
+ mir_wstrcat(szTmp, L"\r\n");
+ mir_wstrcat(szTmp, szMessage);
}
szMessage = szTmp;
}
@@ -1085,9 +1085,9 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info) if (addressNode) {
const wchar_t *szJid = XmlGetAttrValue(addressNode, L"jid");
if (szJid) {
- size_t cbLen = mir_tstrlen(szMessage) + 1000;
+ size_t cbLen = mir_wstrlen(szMessage) + 1000;
wchar_t *p = (wchar_t*)alloca(sizeof(wchar_t) * cbLen);
- mir_sntprintf(p, cbLen, TranslateT("Message redirected from: %s\r\n%s"), from, szMessage);
+ mir_snwprintf(p, cbLen, TranslateT("Message redirected from: %s\r\n%s"), from, szMessage);
szMessage = p;
from = szJid;
// rewrite hContact
@@ -1173,13 +1173,13 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info) memset(pParams, 0, sizeof(CJabberHttpAuthParams));
pParams->m_nType = CJabberHttpAuthParams::MSG;
- pParams->m_szFrom = mir_tstrdup(from);
+ pParams->m_szFrom = mir_wstrdup(from);
LPCTSTR ptszThread = XmlGetText(XmlGetChild(node, "thread"));
if (ptszThread && *ptszThread)
- pParams->m_szThreadId = mir_tstrdup(ptszThread);
- pParams->m_szId = mir_tstrdup(szId);
- pParams->m_szMethod = mir_tstrdup(szMethod);
- pParams->m_szUrl = mir_tstrdup(szUrl);
+ pParams->m_szThreadId = mir_wstrdup(ptszThread);
+ pParams->m_szId = mir_wstrdup(szId);
+ pParams->m_szMethod = mir_wstrdup(szMethod);
+ pParams->m_szUrl = mir_wstrdup(szUrl);
AddClistHttpAuthEvent(pParams);
return;
@@ -1194,11 +1194,11 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info) if (ptszXmlns == NULL)
continue;
- if (!mir_tstrcmp(ptszXmlns, JABBER_FEAT_MIRANDA_NOTES)) {
+ if (!mir_wstrcmp(ptszXmlns, JABBER_FEAT_MIRANDA_NOTES)) {
if (OnIncomingNote(from, XmlGetChild(xNode, "note")))
return;
}
- else if (!mir_tstrcmp(ptszXmlns, L"jabber:x:encrypted")) {
+ else if (!mir_wstrcmp(ptszXmlns, L"jabber:x:encrypted")) {
LPCTSTR ptszText = XmlGetText(xNode);
if (ptszText == NULL)
return;
@@ -1213,25 +1213,25 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info) wchar_t *tempstring = nullptr;
if(!wcsstr(ptszText, prolog))
{
- len = mir_tstrlen(prolog) + mir_tstrlen(prolog_newline) + mir_tstrlen(ptszText) + mir_tstrlen(epilog) + 3;
+ len = mir_wstrlen(prolog) + mir_wstrlen(prolog_newline) + mir_wstrlen(ptszText) + mir_wstrlen(epilog) + 3;
tempstring = (wchar_t*)_alloca(sizeof(wchar_t)*len);
- mir_sntprintf(tempstring, len, L"%s%s%s%s", prolog, prolog_newline, ptszText, epilog);
+ mir_snwprintf(tempstring, len, L"%s%s%s%s", prolog, prolog_newline, ptszText, epilog);
}
else
{
- len = mir_tstrlen(ptszText) + 3;
+ len = mir_wstrlen(ptszText) + 3;
tempstring = (wchar_t*)_alloca(sizeof(wchar_t)*len);
- mir_sntprintf(tempstring, len, L"%s", ptszText);
+ mir_snwprintf(tempstring, len, L"%s", ptszText);
}
szMessage = tempstring;
}
- else if (!mir_tstrcmp(ptszXmlns, JABBER_FEAT_DELAY) && msgTime == 0) {
+ else if (!mir_wstrcmp(ptszXmlns, JABBER_FEAT_DELAY) && msgTime == 0) {
const wchar_t *ptszTimeStamp = XmlGetAttrValue(xNode, L"stamp");
if (ptszTimeStamp != NULL)
msgTime = JabberIsoToUnixTime(ptszTimeStamp);
}
- else if (!mir_tstrcmp(ptszXmlns, JABBER_FEAT_MESSAGE_EVENTS)) {
+ else if (!mir_wstrcmp(ptszXmlns, JABBER_FEAT_MESSAGE_EVENTS)) {
// set events support only if we discovered caps and if events not already set
JabberCapsBits jcbCaps = GetResourceCapabilites(from, TRUE);
@@ -1275,24 +1275,24 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info) if (item != NULL && XmlGetChild(xNode, "composing") != NULL) {
if (item->messageEventIdStr)
mir_free(item->messageEventIdStr);
- item->messageEventIdStr = (idStr == NULL) ? NULL : mir_tstrdup(idStr);
+ item->messageEventIdStr = (idStr == NULL) ? NULL : mir_wstrdup(idStr);
}
}
}
- else if (!mir_tstrcmp(ptszXmlns, JABBER_FEAT_OOB2)) {
+ else if (!mir_wstrcmp(ptszXmlns, JABBER_FEAT_OOB2)) {
LPCTSTR ptszUrl = XmlGetText(XmlGetChild(xNode, "url"));
if (ptszUrl != NULL && *ptszUrl) {
- size_t cbLen = (szMessage ? mir_tstrlen(szMessage) : 0) + mir_tstrlen(ptszUrl) + 32;
+ size_t cbLen = (szMessage ? mir_wstrlen(szMessage) : 0) + mir_wstrlen(ptszUrl) + 32;
wchar_t *szTmp = (wchar_t *)alloca(sizeof(wchar_t)* cbLen);
- mir_tstrcpy(szTmp, ptszUrl);
+ mir_wstrcpy(szTmp, ptszUrl);
if (szMessage) {
- mir_tstrcat(szTmp, L"\r\n");
- mir_tstrcat(szTmp, szMessage);
+ mir_wstrcat(szTmp, L"\r\n");
+ mir_wstrcat(szTmp, szMessage);
}
szMessage = szTmp;
}
}
- else if (!mir_tstrcmp(ptszXmlns, JABBER_FEAT_MUC_USER)) {
+ else if (!mir_wstrcmp(ptszXmlns, JABBER_FEAT_MUC_USER)) {
HXML inviteNode = XmlGetChild(xNode, L"invite");
if (inviteNode != NULL) {
inviteFromJid = XmlGetAttrValue(inviteNode, L"from");
@@ -1304,7 +1304,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info) invitePassword = XmlGetText(XmlGetChild(xNode, "password"));
}
}
- else if (!mir_tstrcmp(ptszXmlns, JABBER_FEAT_ROSTER_EXCHANGE) &&
+ else if (!mir_wstrcmp(ptszXmlns, JABBER_FEAT_ROSTER_EXCHANGE) &&
item != NULL && (item->subscription == SUB_BOTH || item->subscription == SUB_TO)) {
wchar_t chkJID[JABBER_MAX_JID_LEN] = L"@";
JabberStripJid(from, chkJID + 1, _countof(chkJID) - 1);
@@ -1318,12 +1318,12 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info) const wchar_t *nick = XmlGetAttrValue(iNode, L"name");
const wchar_t *group = XmlGetText(XmlGetChild(iNode, L"group"));
if (action && jid && wcsstr(jid, chkJID)) {
- if (!mir_tstrcmp(action, L"add")) {
+ if (!mir_wstrcmp(action, L"add")) {
MCONTACT cc = DBCreateContact(jid, nick, false, false);
if (group)
db_set_ts(cc, "CList", "Group", group);
}
- else if (!mir_tstrcmp(action, L"delete")) {
+ else if (!mir_wstrcmp(action, L"delete")) {
MCONTACT cc = HContactFromJID(jid);
if (cc)
CallService(MS_DB_CONTACT_DELETE, cc, 0);
@@ -1331,7 +1331,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info) }
}
}
- else if (!isChatRoomInvitation && !mir_tstrcmp(ptszXmlns, JABBER_FEAT_DIRECT_MUC_INVITE)) {
+ else if (!isChatRoomInvitation && !mir_wstrcmp(ptszXmlns, JABBER_FEAT_DIRECT_MUC_INVITE)) {
inviteRoomJid = XmlGetAttrValue(xNode, L"jid");
inviteFromJid = from;
if (inviteReason == NULL)
@@ -1422,9 +1422,9 @@ void CJabberProto::OnProcessPresenceCapabilites(HXML node) const wchar_t *szVer = XmlGetAttrValue(n, L"ver");
const wchar_t *szExt = XmlGetAttrValue(n, L"ext");
if (szNode && szVer) {
- r->m_tszCapsNode = mir_tstrdup(szNode);
- r->m_tszCapsVer = mir_tstrdup(szVer);
- r->m_tszCapsExt = mir_tstrdup(szExt);
+ r->m_tszCapsNode = mir_wstrdup(szNode);
+ r->m_tszCapsVer = mir_wstrdup(szVer);
+ r->m_tszCapsExt = mir_wstrdup(szExt);
MCONTACT hContact = HContactFromJID(from);
if (hContact)
UpdateMirVer(hContact, r);
@@ -1497,7 +1497,7 @@ void CJabberProto::UpdateJidDbSettings(const wchar_t *jid) void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
{
- if (!node || !XmlGetName(node) || mir_tstrcmp(XmlGetName(node), L"presence"))
+ if (!node || !XmlGetName(node) || mir_wstrcmp(XmlGetName(node), L"presence"))
return;
LPCTSTR from = XmlGetAttrValue(node, L"from");
@@ -1519,17 +1519,17 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info) wchar_t szBareOurJid[JABBER_MAX_JID_LEN];
JabberStripJid(info->fullJID, szBareOurJid, _countof(szBareOurJid));
- if (!mir_tstrcmpi(szBareFrom, szBareOurJid))
+ if (!mir_wstrcmpi(szBareFrom, szBareOurJid))
bSelfPresence = true;
LPCTSTR type = XmlGetAttrValue(node, L"type");
- if (type == NULL || !mir_tstrcmp(type, L"available")) {
- ptrT nick(JabberNickFromJID(from));
+ if (type == NULL || !mir_wstrcmp(type, L"available")) {
+ ptrW nick(JabberNickFromJID(from));
if (nick == NULL)
return;
if ((hContact = HContactFromJID(from)) == NULL) {
- if (!mir_tstrcmpi(info->fullJID, from) || (!bSelfPresence && !ListGetItemPtr(LIST_ROSTER, from))) {
+ if (!mir_wstrcmpi(info->fullJID, from) || (!bSelfPresence && !ListGetItemPtr(LIST_ROSTER, from))) {
debugLog(L"SKIP Receive presence online from %s (who is not in my roster and not in list - skiping)", from);
return;
}
@@ -1543,10 +1543,10 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info) int status = ID_STATUS_ONLINE;
if (HXML showNode = XmlGetChild(node, "show")) {
if (LPCTSTR show = XmlGetText(showNode)) {
- if (!mir_tstrcmp(show, L"away")) status = ID_STATUS_AWAY;
- else if (!mir_tstrcmp(show, L"xa")) status = ID_STATUS_NA;
- else if (!mir_tstrcmp(show, L"dnd")) status = ID_STATUS_DND;
- else if (!mir_tstrcmp(show, L"chat")) status = ID_STATUS_FREECHAT;
+ if (!mir_wstrcmp(show, L"away")) status = ID_STATUS_AWAY;
+ else if (!mir_wstrcmp(show, L"xa")) status = ID_STATUS_NA;
+ else if (!mir_wstrcmp(show, L"dnd")) status = ID_STATUS_DND;
+ else if (!mir_wstrcmp(show, L"chat")) status = ID_STATUS_FREECHAT;
}
}
@@ -1572,15 +1572,15 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info) debugLogA("Avatar enabled");
for (int i = 1; (xNode = XmlGetNthChild(node, L"x", i)) != NULL; i++) {
- if (!mir_tstrcmp(XmlGetAttrValue(xNode, L"xmlns"), L"jabber:x:avatar")) {
+ if (!mir_wstrcmp(XmlGetAttrValue(xNode, L"xmlns"), L"jabber:x:avatar")) {
LPCTSTR ptszHash = XmlGetText(XmlGetChild(xNode, "hash"));
if (ptszHash != NULL) {
delSetting(hContact, "AvatarXVcard");
debugLogA("AvatarXVcard deleted");
setTString(hContact, "AvatarHash", ptszHash);
bHasAvatar = true;
- ptrT saved(getTStringA(hContact, "AvatarSaved"));
- if (saved == NULL || mir_tstrcmp(saved, ptszHash)) {
+ ptrW saved(getTStringA(hContact, "AvatarSaved"));
+ if (saved == NULL || mir_wstrcmp(saved, ptszHash)) {
debugLogA("Avatar was changed");
ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, NULL);
}
@@ -1591,7 +1591,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info) if (!bHasAvatar) { //no jabber:x:avatar. try vcard-temp:x:update
debugLogA("Not hasXAvatar");
for (int i = 1; (xNode = XmlGetNthChild(node, L"x", i)) != NULL; i++) {
- if (!mir_tstrcmp(XmlGetAttrValue(xNode, L"xmlns"), L"vcard-temp:x:update")) {
+ if (!mir_wstrcmp(XmlGetAttrValue(xNode, L"xmlns"), L"vcard-temp:x:update")) {
if ((xNode = XmlGetChild(xNode, "photo")) != NULL) {
LPCTSTR txt = XmlGetText(xNode);
if (txt != NULL && txt[0] != 0) {
@@ -1599,8 +1599,8 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info) debugLogA("AvatarXVcard set");
setTString(hContact, "AvatarHash", txt);
bHasAvatar = true;
- ptrT saved(getTStringA(hContact, "AvatarSaved"));
- if (saved == NULL || mir_tstrcmp(saved, txt)) {
+ ptrW saved(getTStringA(hContact, "AvatarSaved"));
+ if (saved == NULL || mir_wstrcmp(saved, txt)) {
debugLogA("Avatar was changed. Using vcard-temp:x:update");
ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, NULL);
}
@@ -1612,14 +1612,14 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info) debugLogA("Has no avatar");
delSetting(hContact, "AvatarHash");
- if (ptrT(getTStringA(hContact, "AvatarSaved")) != NULL) {
+ if (ptrW(getTStringA(hContact, "AvatarSaved")) != NULL) {
delSetting(hContact, "AvatarSaved");
ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, NULL, NULL);
} } }
return;
}
- if (!mir_tstrcmp(type, L"unavailable")) {
+ if (!mir_wstrcmp(type, L"unavailable")) {
hContact = HContactFromJID(from);
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, from);
if (item != NULL) {
@@ -1636,7 +1636,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info) // set status only if no more available resources
if (!item->arResources.getCount()) {
item->getTemp()->m_iStatus = ID_STATUS_OFFLINE;
- item->getTemp()->m_tszStatusMessage = mir_tstrdup(XmlGetText(XmlGetChild(node, "status")));
+ item->getTemp()->m_tszStatusMessage = mir_wstrdup(XmlGetText(XmlGetChild(node, "status")));
}
}
else debugLog(L"SKIP Receive presence offline from %s (who is not in my roster)", from);
@@ -1650,17 +1650,17 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info) return;
}
- if (!mir_tstrcmp(type, L"subscribe")) {
+ if (!mir_wstrcmp(type, L"subscribe")) {
if (hContact = HContactFromJID(from))
AddDbPresenceEvent(hContact, JABBER_DB_EVENT_PRESENCE_SUBSCRIBE);
- ptrT tszNick(JabberNickFromJID(from));
+ ptrW tszNick(JabberNickFromJID(from));
HXML xNick = XmlGetChildByTag(node, "nick", "xmlns", JABBER_FEAT_NICK);
if (xNick != NULL) {
LPCTSTR xszNick = XmlGetText(xNick);
if (xszNick != NULL && *xszNick) {
debugLog(L"Grabbed nick from presence: %s", xszNick);
- tszNick = mir_tstrdup(xszNick);
+ tszNick = mir_wstrdup(xszNick);
}
}
@@ -1690,19 +1690,19 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info) return;
}
- if (!mir_tstrcmp(type, L"unsubscribe"))
+ if (!mir_wstrcmp(type, L"unsubscribe"))
if (hContact = HContactFromJID(from))
AddDbPresenceEvent(hContact, JABBER_DB_EVENT_PRESENCE_UNSUBSCRIBE);
- if (!mir_tstrcmp(type, L"unsubscribed"))
+ if (!mir_wstrcmp(type, L"unsubscribed"))
if (hContact = HContactFromJID(from))
AddDbPresenceEvent(hContact, JABBER_DB_EVENT_PRESENCE_UNSUBSCRIBED);
- if (!mir_tstrcmp(type, L"error"))
+ if (!mir_wstrcmp(type, L"error"))
if (hContact = HContactFromJID(from))
AddDbPresenceEvent(hContact, JABBER_DB_EVENT_PRESENCE_ERROR);
- if (!mir_tstrcmp(type, L"subscribed")) {
+ if (!mir_wstrcmp(type, L"subscribed")) {
if (hContact = HContactFromJID(from))
AddDbPresenceEvent(hContact, JABBER_DB_EVENT_PRESENCE_SUBSCRIBED);
@@ -1736,11 +1736,11 @@ void CJabberProto::OnIqResultVersion(HXML /*node*/, CJabberIqInfo *pInfo) if (pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT && queryNode) {
HXML n;
if ((n = XmlGetChild(queryNode, "name")) != NULL && XmlGetText(n))
- r->m_tszSoftware = mir_tstrdup(XmlGetText(n));
+ r->m_tszSoftware = mir_wstrdup(XmlGetText(n));
if ((n = XmlGetChild(queryNode, "version")) != NULL && XmlGetText(n))
- r->m_tszSoftwareVersion = mir_tstrdup(XmlGetText(n));
+ r->m_tszSoftwareVersion = mir_wstrdup(XmlGetText(n));
if ((n = XmlGetChild(queryNode, "os")) != NULL && XmlGetText(n))
- r->m_tszOs = mir_tstrdup(XmlGetText(n));
+ r->m_tszOs = mir_wstrdup(XmlGetText(n));
}
GetResourceCapabilites(pInfo->GetFrom(), TRUE);
@@ -1757,11 +1757,11 @@ BOOL CJabberProto::OnProcessJingle(HXML node) if (child) {
if ((type = XmlGetAttrValue(node, L"type")) == NULL) return FALSE;
- if ((!mir_tstrcmp(type, L"get") || !mir_tstrcmp(type, L"set"))) {
+ if ((!mir_wstrcmp(type, L"get") || !mir_wstrcmp(type, L"set"))) {
LPCTSTR szAction = XmlGetAttrValue(child, L"action");
LPCTSTR idStr = XmlGetAttrValue(node, L"id");
LPCTSTR from = XmlGetAttrValue(node, L"from");
- if (szAction && !mir_tstrcmp(szAction, L"session-initiate")) {
+ if (szAction && !mir_wstrcmp(szAction, L"session-initiate")) {
// if this is a Jingle 'session-initiate' and noone processed it yet, reply with "unsupported-applications"
m_ThreadInfo->send(XmlNodeIq(L"result", idStr, from));
@@ -1801,7 +1801,7 @@ void CJabberProto::OnProcessIq(HXML node) HXML queryNode;
const wchar_t *type, *xmlns;
- if (!XmlGetName(node) || mir_tstrcmp(XmlGetName(node), L"iq")) return;
+ if (!XmlGetName(node) || mir_wstrcmp(XmlGetName(node), L"iq")) return;
if ((type = XmlGetAttrValue(node, L"type")) == NULL) return;
int id = JabberGetPacketID(node);
@@ -1822,7 +1822,7 @@ void CJabberProto::OnProcessIq(HXML node) return;
// RECVED: <iq type='error'> ...
- if (!mir_tstrcmp(type, L"error")) {
+ if (!mir_wstrcmp(type, L"error")) {
wchar_t tszBuf[20];
_itow(id, tszBuf, 10);
@@ -1831,7 +1831,7 @@ void CJabberProto::OnProcessIq(HXML node) LISTFOREACH(i, this, LIST_FILE)
{
JABBER_LIST_ITEM *item = ListGetItemPtrFromIndex(i);
- if (item->ft != NULL && item->ft->state == FT_CONNECTING && !mir_tstrcmp(tszBuf, item->ft->szId)) {
+ if (item->ft != NULL && item->ft->state == FT_CONNECTING && !mir_wstrcmp(tszBuf, item->ft->szId)) {
debugLogA("Denying file sending request");
item->ft->state = FT_DENIED;
if (item->ft->hFileEvent != NULL)
@@ -1839,7 +1839,7 @@ void CJabberProto::OnProcessIq(HXML node) }
}
}
- else if ((!mir_tstrcmp(type, L"get") || !mir_tstrcmp(type, L"set"))) {
+ else if ((!mir_wstrcmp(type, L"get") || !mir_wstrcmp(type, L"set"))) {
XmlNodeIq iq(L"error", id, XmlGetAttrValue(node, L"from"));
HXML pFirstChild = XmlGetChild(node, 0);
@@ -1857,7 +1857,7 @@ void CJabberProto::SetRegConfig(HXML node, void *from) {
if (m_regInfo && from) {
wchar_t text[MAX_PATH];
- mir_sntprintf(text, L"%s@%S", m_regInfo->conn.username, m_regInfo->conn.server);
+ mir_snwprintf(text, L"%s@%S", m_regInfo->conn.username, m_regInfo->conn.server);
XmlNodeIq iq(L"set", SerialNext(), (wchar_t*)from);
iq << XATTR(L"from", text);
HXML query = iq << XQUERY(JABBER_FEAT_REGISTER);
@@ -1868,7 +1868,7 @@ void CJabberProto::SetRegConfig(HXML node, void *from) void CJabberProto::OnProcessRegIq(HXML node, ThreadData *info)
{
- if (!XmlGetName(node) || mir_tstrcmp(XmlGetName(node), L"iq")) return;
+ if (!XmlGetName(node) || mir_wstrcmp(XmlGetName(node), L"iq")) return;
LPCTSTR type = XmlGetAttrValue(node, L"type");
if (type == NULL)
return;
@@ -1879,17 +1879,17 @@ void CJabberProto::OnProcessRegIq(HXML node, ThreadData *info) if (from == NULL)
return;
- if (!mir_tstrcmp(type, L"result")) {
+ if (!mir_wstrcmp(type, L"result")) {
HXML queryNode = XmlGetChild(node, L"query");
if (queryNode != NULL) {
LPCTSTR str = XmlGetAttrValue(queryNode, L"xmlns");
- if (!mir_tstrcmp(str, JABBER_FEAT_REGISTER)) {
+ if (!mir_wstrcmp(str, JABBER_FEAT_REGISTER)) {
HXML xNode = XmlGetChild(queryNode, L"x");
if (xNode != NULL) {
str = XmlGetAttrValue(xNode, L"xmlns");
- if (!mir_tstrcmp(str, JABBER_FEAT_DATA_FORMS)) {
+ if (!mir_wstrcmp(str, JABBER_FEAT_DATA_FORMS)) {
m_regInfo = info;
- FormCreateDialog(xNode, L"Jabber register new user", &CJabberProto::SetRegConfig, mir_tstrdup(from));
+ FormCreateDialog(xNode, L"Jabber register new user", &CJabberProto::SetRegConfig, mir_wstrdup(from));
return;
}
}
@@ -1917,7 +1917,7 @@ void CJabberProto::OnProcessRegIq(HXML node, ThreadData *info) }
}
- else if (!mir_tstrcmp(type, L"error")) {
+ else if (!mir_wstrcmp(type, L"error")) {
wchar_t *str = JabberErrorMsg(XmlGetChild(node, "error"));
SendMessage(info->conn.reg_hwndDlg, WM_JABBER_REGDLG_UPDATE, 100, (LPARAM)str);
mir_free(str);
diff --git a/protocols/JabberG/src/jabber_treelist.cpp b/protocols/JabberG/src/jabber_treelist.cpp index c3d2bdb878..2321ee9b3f 100644 --- a/protocols/JabberG/src/jabber_treelist.cpp +++ b/protocols/JabberG/src/jabber_treelist.cpp @@ -183,7 +183,7 @@ void TreeList_SetFilter(HWND hwnd, wchar_t *filter) TTreeList_Data *data = (TTreeList_Data *)sttTreeList_GeWindowData(hwnd);
if (data->filter) mir_free(data->filter);
data->filter = NULL;
- if (filter) data->filter = mir_tstrdup(filter);
+ if (filter) data->filter = mir_wstrdup(filter);
TreeList_Update(hwnd);
}
@@ -207,7 +207,7 @@ HTREELISTITEM TreeList_AddItem(HWND hwnd, HTREELISTITEM hParent, wchar_t *text, TTreeList_ItemInfo *item = new TTreeList_ItemInfo;
item->data = nodeDdata;
item->parent = hParent;
- item->text.insert(mir_tstrdup(text));
+ item->text.insert(mir_wstrdup(text));
item->flags |= TLIF_MODIFIED;
if (hParent->flags & TLIF_ROOT) {
item->flags |= TLIF_EXPANDED;
@@ -241,7 +241,7 @@ void TreeList_MakeFakeParent(HTREELISTITEM hItem, BOOL flag) void TreeList_AppendColumn(HTREELISTITEM hItem, wchar_t *text)
{
- hItem->text.insert(mir_tstrdup(text));
+ hItem->text.insert(mir_wstrdup(text));
hItem->flags |= TLIF_MODIFIED;
}
@@ -469,12 +469,12 @@ BOOL TreeList_ProcessMessage(HWND hwnd, UINT msg, WPARAM, LPARAM lparam, UINT id }
///////////////////////////////////////////////////////////////////////////
-static int sttTreeList_SortItems_Cmp0(const void *p1, const void *p2) { return mir_tstrcmp((*(HTREELISTITEM *)p1)->text[0], (*(HTREELISTITEM *)p2)->text[0]); }
-static int sttTreeList_SortItems_Cmp1(const void *p1, const void *p2) { return -mir_tstrcmp((*(HTREELISTITEM *)p1)->text[0], (*(HTREELISTITEM *)p2)->text[0]); }
-static int sttTreeList_SortItems_Cmp2(const void *p1, const void *p2) { return mir_tstrcmp((*(HTREELISTITEM *)p1)->text[1], (*(HTREELISTITEM *)p2)->text[1]); }
-static int sttTreeList_SortItems_Cmp3(const void *p1, const void *p2) { return -mir_tstrcmp((*(HTREELISTITEM *)p1)->text[1], (*(HTREELISTITEM *)p2)->text[1]); }
-static int sttTreeList_SortItems_Cmp4(const void *p1, const void *p2) { return mir_tstrcmp((*(HTREELISTITEM *)p1)->text[2], (*(HTREELISTITEM *)p2)->text[2]); }
-static int sttTreeList_SortItems_Cmp5(const void *p1, const void *p2) { return -mir_tstrcmp((*(HTREELISTITEM *)p1)->text[2], (*(HTREELISTITEM *)p2)->text[2]); }
+static int sttTreeList_SortItems_Cmp0(const void *p1, const void *p2) { return mir_wstrcmp((*(HTREELISTITEM *)p1)->text[0], (*(HTREELISTITEM *)p2)->text[0]); }
+static int sttTreeList_SortItems_Cmp1(const void *p1, const void *p2) { return -mir_wstrcmp((*(HTREELISTITEM *)p1)->text[0], (*(HTREELISTITEM *)p2)->text[0]); }
+static int sttTreeList_SortItems_Cmp2(const void *p1, const void *p2) { return mir_wstrcmp((*(HTREELISTITEM *)p1)->text[1], (*(HTREELISTITEM *)p2)->text[1]); }
+static int sttTreeList_SortItems_Cmp3(const void *p1, const void *p2) { return -mir_wstrcmp((*(HTREELISTITEM *)p1)->text[1], (*(HTREELISTITEM *)p2)->text[1]); }
+static int sttTreeList_SortItems_Cmp4(const void *p1, const void *p2) { return mir_wstrcmp((*(HTREELISTITEM *)p1)->text[2], (*(HTREELISTITEM *)p2)->text[2]); }
+static int sttTreeList_SortItems_Cmp5(const void *p1, const void *p2) { return -mir_wstrcmp((*(HTREELISTITEM *)p1)->text[2], (*(HTREELISTITEM *)p2)->text[2]); }
static void sttTreeList_SortItems(HTREELISTITEM hItem, LPARAM data)
{
diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp index 6b0907a7b3..4a0f6e0046 100644 --- a/protocols/JabberG/src/jabber_userinfo.cpp +++ b/protocols/JabberG/src/jabber_userinfo.cpp @@ -46,12 +46,12 @@ struct UserInfoStringBuf void append(wchar_t *str) { if (!str) return; - size_t length = mir_tstrlen(str); + size_t length = mir_wstrlen(str); if (size - offset < length + 1) { size += (length + STRINGBUF_INCREMENT); buf = (wchar_t *)mir_realloc(buf, size * sizeof(wchar_t)); } - mir_tstrcpy(buf + offset, str); + mir_wstrcpy(buf + offset, str); offset += length; } @@ -64,7 +64,7 @@ struct UserInfoStringBuf } void actualize() { - if (buf) offset = mir_tstrlen(buf); + if (buf) offset = mir_wstrlen(buf); } }; @@ -174,9 +174,9 @@ static HTREEITEM sttFillInfoLine(HWND hwndTree, HTREEITEM htiRoot, HICON hIcon, wchar_t buf[256]; if (title) - mir_sntprintf(buf, L"%s: %s", title, value); + mir_snwprintf(buf, L"%s: %s", title, value); else - mir_tstrncpy(buf, value, _countof(buf)); + mir_wstrncpy(buf, value, _countof(buf)); TVINSERTSTRUCT tvis = {0}; tvis.hParent = htiRoot; @@ -227,7 +227,7 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti HICON hIcon = NULL; if ( ServiceExists(MS_FP_GETCLIENTICONT)) { if (r->m_tszSoftware != NULL) { - mir_sntprintf(buf, L"%s %s", r->m_tszSoftware, r->m_tszSoftwareVersion); + mir_snwprintf(buf, L"%s %s", r->m_tszSoftware, r->m_tszSoftwareVersion); hIcon = Finger_GetClientIcon(buf, 0); } } @@ -251,25 +251,25 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti // Resource priority wchar_t szPriority[128]; - mir_sntprintf(szPriority, L"%d", (int)r->m_iPriority); + mir_snwprintf(szPriority, L"%d", (int)r->m_iPriority); sttFillInfoLine(hwndTree, htiResource, NULL, TranslateT("Resource priority"), szPriority, sttInfoLineId(resource, INFOLINE_PRIORITY)); // Idle if (r->m_dwIdleStartTime > 0) { - mir_tstrncpy(buf, _wctime(&r->m_dwIdleStartTime), _countof(buf)); - size_t len = mir_tstrlen(buf); + mir_wstrncpy(buf, _wctime(&r->m_dwIdleStartTime), _countof(buf)); + size_t len = mir_wstrlen(buf); if (len > 0) buf[len-1] = 0; } else if (!r->m_dwIdleStartTime) - mir_tstrncpy(buf, TranslateT("unknown"), _countof(buf)); + mir_wstrncpy(buf, TranslateT("unknown"), _countof(buf)); else - mir_tstrncpy(buf, TranslateT("<not specified>"), _countof(buf)); + mir_wstrncpy(buf, TranslateT("<not specified>"), _countof(buf)); sttFillInfoLine(hwndTree, htiResource, NULL, TranslateT("Idle since"), buf, sttInfoLineId(resource, INFOLINE_IDLE)); // caps - mir_sntprintf(buf, L"%s/%s", item->jid, r->m_tszResourceName); + mir_snwprintf(buf, L"%s/%s", item->jid, r->m_tszResourceName); JabberCapsBits jcb = ppro->GetResourceCapabilites(buf, TRUE); if (!(jcb & JABBER_RESOURCE_CAPS_ERROR)) { @@ -279,7 +279,7 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti if (jcb & g_JabberFeatCapPairs[i].jcbCap) { wchar_t szDescription[ 1024 ]; if (g_JabberFeatCapPairs[i].tszDescription) - mir_sntprintf(szDescription, L"%s (%s)", TranslateTS(g_JabberFeatCapPairs[i].tszDescription), g_JabberFeatCapPairs[i].szFeature); + mir_snwprintf(szDescription, L"%s (%s)", TranslateTS(g_JabberFeatCapPairs[i].tszDescription), g_JabberFeatCapPairs[i].szFeature); else wcsncpy_s(szDescription, g_JabberFeatCapPairs[i].szFeature, _TRUNCATE); sttFillInfoLine(hwndTree, htiCaps, NULL, NULL, szDescription, sttInfoLineId(resource, INFOLINE_CAPS, i)); @@ -289,7 +289,7 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti if (jcb & ppro->m_lstJabberFeatCapPairsDynamic[j]->jcbCap) { wchar_t szDescription[ 1024 ]; if (ppro->m_lstJabberFeatCapPairsDynamic[j]->szDescription) - mir_sntprintf(szDescription, L"%s (%s)", TranslateTS(ppro->m_lstJabberFeatCapPairsDynamic[j]->szDescription), ppro->m_lstJabberFeatCapPairsDynamic[j]->szFeature); + mir_snwprintf(szDescription, L"%s (%s)", TranslateTS(ppro->m_lstJabberFeatCapPairsDynamic[j]->szDescription), ppro->m_lstJabberFeatCapPairsDynamic[j]->szFeature); else wcsncpy_s(szDescription, ppro->m_lstJabberFeatCapPairsDynamic[j]->szFeature, _TRUNCATE); sttFillInfoLine(hwndTree, htiCaps, NULL, NULL, szDescription, sttInfoLineId(resource, INFOLINE_CAPS, i)); @@ -320,7 +320,7 @@ static void sttFillAdvStatusInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM ht if (szAdvStatusIcon && szAdvStatusTitle && *szAdvStatusTitle) { wchar_t szText[2048]; if (szAdvStatusText && *szAdvStatusText) - mir_sntprintf(szText, L"%s (%s)", TranslateTS(szAdvStatusTitle), szAdvStatusText); + mir_snwprintf(szText, L"%s (%s)", TranslateTS(szAdvStatusTitle), szAdvStatusText); else wcsncpy_s(szText, TranslateTS(szAdvStatusTitle), _TRUNCATE); sttFillInfoLine(hwndTree, htiRoot, IcoLib_GetIcon(szAdvStatusIcon), szTitle, szText, dwInfoLine); @@ -365,15 +365,15 @@ static void sttFillUserInfo(CJabberProto *ppro, HWND hwndTree, JABBER_LIST_ITEM // logoff JABBER_RESOURCE_STATUS *r = item->getTemp(); if (r->m_dwIdleStartTime > 0) { - mir_tstrncpy(buf, _wctime(&r->m_dwIdleStartTime), _countof(buf)); - size_t len = mir_tstrlen(buf); + mir_wstrncpy(buf, _wctime(&r->m_dwIdleStartTime), _countof(buf)); + size_t len = mir_wstrlen(buf); if (len > 0) buf[len-1] = 0; } else if (!r->m_dwIdleStartTime) - mir_tstrncpy(buf, TranslateT("unknown"), _countof(buf)); + mir_wstrncpy(buf, TranslateT("unknown"), _countof(buf)); else - mir_tstrncpy(buf, TranslateT("<not specified>"), _countof(buf)); + mir_wstrncpy(buf, TranslateT("<not specified>"), _countof(buf)); sttFillInfoLine(hwndTree, htiRoot, NULL, (item->jid && wcschr(item->jid, '@')) ? TranslateT("Last logoff time") : TranslateT("Uptime"), buf, @@ -384,9 +384,9 @@ static void sttFillUserInfo(CJabberProto *ppro, HWND hwndTree, JABBER_LIST_ITEM // activity if (item->m_pLastSeenResource) - mir_tstrncpy(buf, item->m_pLastSeenResource->m_tszResourceName, _countof(buf)); + mir_wstrncpy(buf, item->m_pLastSeenResource->m_tszResourceName, _countof(buf)); else - mir_tstrncpy(buf, TranslateT("<no information available>"), _countof(buf)); + mir_wstrncpy(buf, TranslateT("<no information available>"), _countof(buf)); sttFillInfoLine(hwndTree, htiRoot, NULL, TranslateT("Last active resource"), buf, sttInfoLineId(0, INFOLINE_LASTACTIVE)); @@ -470,7 +470,7 @@ static INT_PTR CALLBACK JabberUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa if (dat == NULL) break; if (dat->item == NULL) { - ptrT jid(dat->ppro->getTStringA(dat->hContact, "jid")); + ptrW jid(dat->ppro->getTStringA(dat->hContact, "jid")); if (jid == NULL) break; @@ -560,7 +560,7 @@ static INT_PTR CALLBACK JabberUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa case PSN_PARAMCHANGED: dat->ppro = (CJabberProto*)((PSHNOTIFY*)lParam)->lParam; if (dat->hContact != NULL) { - ptrT jid(dat->ppro->getTStringA(dat->hContact, "jid")); + ptrW jid(dat->ppro->getTStringA(dat->hContact, "jid")); if (jid != NULL) if (!(dat->item = dat->ppro->ListGetItemPtr(LIST_VCARD_TEMP, jid))) dat->item = dat->ppro->ListGetItemPtr(LIST_ROSTER, jid); @@ -642,7 +642,7 @@ static INT_PTR CALLBACK JabberUserPhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wP } ShowWindow(GetDlgItem(hwndDlg, IDC_SAVE), SW_HIDE); { - ptrT jid(photoInfo->ppro->getTStringA(photoInfo->hContact, "jid")); + ptrW jid(photoInfo->ppro->getTStringA(photoInfo->hContact, "jid")); if (jid != NULL) { JABBER_LIST_ITEM *item = photoInfo->ppro->ListGetItemPtr(LIST_VCARD_TEMP, jid); if (item == NULL) @@ -666,7 +666,7 @@ static INT_PTR CALLBACK JabberUserPhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wP case IDC_SAVE: static wchar_t szFilter[512]; - ptrT jid(photoInfo->ppro->getTStringA(photoInfo->hContact, "jid")); + ptrW jid(photoInfo->ppro->getTStringA(photoInfo->hContact, "jid")); if (jid == NULL) break; @@ -677,19 +677,19 @@ static INT_PTR CALLBACK JabberUserPhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wP switch (ProtoGetAvatarFileFormat(item->photoFileName)) { case PA_FORMAT_BMP: - mir_sntprintf(szFilter, L"BMP %s (*.bmp)%c*.BMP", TranslateT("format"), 0); + mir_snwprintf(szFilter, L"BMP %s (*.bmp)%c*.BMP", TranslateT("format"), 0); break; case PA_FORMAT_GIF: - mir_sntprintf(szFilter, L"GIF %s (*.gif)%c*.GIF", TranslateT("format"), 0); + mir_snwprintf(szFilter, L"GIF %s (*.gif)%c*.GIF", TranslateT("format"), 0); break; case PA_FORMAT_JPEG: - mir_sntprintf(szFilter, L"JPEG %s (*.jpg;*.jpeg)%c*.JPG;*.JPEG", TranslateT("format"), 0); + mir_snwprintf(szFilter, L"JPEG %s (*.jpg;*.jpeg)%c*.JPG;*.JPEG", TranslateT("format"), 0); break; default: - mir_sntprintf(szFilter, L"%s (*.*)%c*.*", TranslateT("Unknown format"), 0); + mir_snwprintf(szFilter, L"%s (*.*)%c*.*", TranslateT("Unknown format"), 0); } wchar_t szFileName[MAX_PATH]; szFileName[0] = '\0'; diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index 610790fe63..c607e10c26 100644 --- a/protocols/JabberG/src/jabber_util.cpp +++ b/protocols/JabberG/src/jabber_util.cpp @@ -69,13 +69,13 @@ MCONTACT CJabberProto::HContactFromJID(const wchar_t *jid, bool bStripResource) wchar_t* __stdcall JabberNickFromJID(const wchar_t *jid)
{
if (jid == NULL)
- return mir_tstrdup(L"");
+ return mir_wstrdup(L"");
const wchar_t *p = wcschr(jid, '@');
if (p == NULL)
p = wcschr(jid, '/');
- return (p != NULL) ? mir_tstrndup(jid, p - jid) : mir_tstrdup(jid);
+ return (p != NULL) ? mir_wstrndup(jid, p - jid) : mir_wstrdup(jid);
}
pResourceStatus CJabberProto::ResourceInfoFromJID(const wchar_t *jid)
@@ -99,7 +99,7 @@ pResourceStatus CJabberProto::ResourceInfoFromJID(const wchar_t *jid) wchar_t* JabberPrepareJid(LPCTSTR jid)
{
if (jid == NULL) return NULL;
- wchar_t *szNewJid = mir_tstrdup(jid);
+ wchar_t *szNewJid = mir_wstrdup(jid);
if (!szNewJid) return NULL;
wchar_t *pDelimiter = wcschr(szNewJid, '/');
if (pDelimiter) *pDelimiter = 0;
@@ -156,7 +156,7 @@ wchar_t* __stdcall JabberStrFixLines(const wchar_t *str) if (*p == '\r' || *p == '\n')
++add;
- wchar_t *buf = (wchar_t *)mir_alloc((mir_tstrlen(str) + add + 1) * sizeof(wchar_t));
+ wchar_t *buf = (wchar_t *)mir_alloc((mir_wstrlen(str) + add + 1) * sizeof(wchar_t));
wchar_t *res = buf;
for (p = str; p && *p; ++p) {
@@ -258,7 +258,7 @@ wchar_t* __stdcall JabberErrorMsg(HXML errorNode, int* pErrorCode) if (errorNode == NULL) {
if (pErrorCode)
*pErrorCode = -1;
- mir_sntprintf(errorStr, 256, L"%s -1: %s", TranslateT("Error"), TranslateT("Unknown error message"));
+ mir_snwprintf(errorStr, 256, L"%s -1: %s", TranslateT("Error"), TranslateT("Unknown error message"));
return errorStr;
}
@@ -275,7 +275,7 @@ wchar_t* __stdcall JabberErrorMsg(HXML errorNode, int* pErrorCode) HXML c = XmlGetChild(errorNode, i);
if (c == NULL) break;
const wchar_t *attr = XmlGetAttrValue(c, L"xmlns");
- if (attr && !mir_tstrcmp(attr, L"urn:ietf:params:xml:ns:xmpp-stanzas")) {
+ if (attr && !mir_wstrcmp(attr, L"urn:ietf:params:xml:ns:xmpp-stanzas")) {
str = XmlGetName(c);
break;
}
@@ -283,9 +283,9 @@ wchar_t* __stdcall JabberErrorMsg(HXML errorNode, int* pErrorCode) }
if (str != NULL)
- mir_sntprintf(errorStr, 256, L"%s %d: %s\r\n%s", TranslateT("Error"), errorCode, TranslateTS(JabberErrorStr(errorCode)), str);
+ mir_snwprintf(errorStr, 256, L"%s %d: %s\r\n%s", TranslateT("Error"), errorCode, TranslateTS(JabberErrorStr(errorCode)), str);
else
- mir_sntprintf(errorStr, 256, L"%s %d: %s", TranslateT("Error"), errorCode, TranslateTS(JabberErrorStr(errorCode)));
+ mir_snwprintf(errorStr, 256, L"%s %d: %s", TranslateT("Error"), errorCode, TranslateTS(JabberErrorStr(errorCode)));
if (pErrorCode)
*pErrorCode = errorCode;
@@ -493,7 +493,7 @@ void CJabberProto::SendPresence(int status, bool bSendToAll) JABBER_LIST_ITEM *item = ListGetItemPtrFromIndex(i);
if (item != NULL && item->nick != NULL) {
wchar_t text[1024];
- mir_sntprintf(text, L"%s/%s", item->jid, item->nick);
+ mir_snwprintf(text, L"%s/%s", item->jid, item->nick);
SendPresenceTo(status == ID_STATUS_INVISIBLE ? ID_STATUS_ONLINE : status, text, NULL);
}
}
@@ -516,8 +516,8 @@ int __stdcall JabberGetPacketID(HXML n) wchar_t* __stdcall JabberId2string(int id)
{
wchar_t text[100];
- mir_sntprintf(text, _T(JABBER_IQID) L"%d", id);
- return mir_tstrdup(text);
+ mir_snwprintf(text, _T(JABBER_IQID) L"%d", id);
+ return mir_wstrdup(text);
}
///////////////////////////////////////////////////////////////////////////////
@@ -528,7 +528,7 @@ wchar_t* CJabberProto::GetClientJID(MCONTACT hContact, wchar_t *dest, size_t des if (hContact == NULL)
return NULL;
- ptrT jid(getTStringA(hContact, "jid"));
+ ptrW jid(getTStringA(hContact, "jid"));
return GetClientJID(jid, dest, destLen);
}
@@ -543,7 +543,7 @@ wchar_t* CJabberProto::GetClientJID(const wchar_t *jid, wchar_t *dest, size_t de mir_cslock lck(m_csLists);
JABBER_LIST_ITEM *LI = ListGetItemPtr(LIST_ROSTER, jid);
if (LI != NULL) {
- if (LI->arResources.getCount() == 1 && !mir_tstrcmp(LI->arResources[0]->m_tszCapsNode, L"http://talk.google.com/xmpp/bot/caps")) {
+ if (LI->arResources.getCount() == 1 && !mir_wstrcmp(LI->arResources[0]->m_tszCapsNode, L"http://talk.google.com/xmpp/bot/caps")) {
if (p) *p = 0;
return dest;
}
@@ -551,7 +551,7 @@ wchar_t* CJabberProto::GetClientJID(const wchar_t *jid, wchar_t *dest, size_t de if (p == NULL) {
pResourceStatus r(LI->getBestResource());
if (r != NULL)
- mir_sntprintf(dest, destLen, L"%s/%s", jid, r->m_tszResourceName);
+ mir_snwprintf(dest, destLen, L"%s/%s", jid, r->m_tszResourceName);
}
}
@@ -582,10 +582,10 @@ wchar_t* __stdcall JabberStripJid(const wchar_t *jid, wchar_t *dest, size_t dest LPCTSTR __stdcall JabberGetPictureType(HXML node, const char *picBuf)
{
if (LPCTSTR ptszType = XmlGetText(XmlGetChild(node, "TYPE")))
- if (!mir_tstrcmp(ptszType, L"image/jpeg") ||
- !mir_tstrcmp(ptszType, L"image/png") ||
- !mir_tstrcmp(ptszType, L"image/gif") ||
- !mir_tstrcmp(ptszType, L"image/bmp"))
+ if (!mir_wstrcmp(ptszType, L"image/jpeg") ||
+ !mir_wstrcmp(ptszType, L"image/png") ||
+ !mir_wstrcmp(ptszType, L"image/gif") ||
+ !mir_wstrcmp(ptszType, L"image/bmp"))
return ptszType;
switch (ProtoGetBufferFormat(picBuf)) {
@@ -658,7 +658,7 @@ void CJabberProto::ComboLoadRecentStrings(HWND hwndDlg, UINT idcCombo, char *par for (int i = 0; i < recentCount; i++) {
char setting[MAXMODULELABELLENGTH];
mir_snprintf(setting, "%s%d", param, i);
- ptrT tszRecent(getTStringA(setting));
+ ptrW tszRecent(getTStringA(setting));
if (tszRecent != NULL)
SendDlgItemMessage(hwndDlg, idcCombo, CB_ADDSTRING, 0, tszRecent);
}
@@ -733,7 +733,7 @@ static VOID CALLBACK sttRebuildInfoFrameApcProc(void* param) if (hContact == NULL) continue;
char name[128];
- char *jid_copy = mir_t2a(item->jid);
+ char *jid_copy = mir_u2a(item->jid);
mir_snprintf(name, "$/Transports/%s", jid_copy);
ppro->m_pInfoFrame->CreateInfoItem(name, true, hContact);
ppro->m_pInfoFrame->UpdateInfoItem(name, ppro->GetIconHandle(IDI_TRANSPORTL), (wchar_t *)item->jid);
@@ -758,7 +758,7 @@ void CJabberProto::RebuildInfoFrame() wchar_t* time2str(time_t _time, wchar_t *buf, size_t bufLen)
{
struct tm* T = gmtime(&_time);
- mir_sntprintf(buf, bufLen, L"%04d-%02d-%02dT%02d:%02d:%02dZ",
+ mir_snwprintf(buf, bufLen, L"%04d-%02d-%02dT%02d:%02d:%02dZ",
T->tm_year + 1900, T->tm_mon + 1, T->tm_mday, T->tm_hour, T->tm_min, T->tm_sec);
return buf;
}
@@ -784,8 +784,8 @@ const wchar_t *JabberStrIStr(const wchar_t *str, const wchar_t *substr) wchar_t *str_up = NEWWSTR_ALLOCA(str);
wchar_t *substr_up = NEWWSTR_ALLOCA(substr);
- CharUpperBuff(str_up, (DWORD)mir_tstrlen(str_up));
- CharUpperBuff(substr_up, (DWORD)mir_tstrlen(substr_up));
+ CharUpperBuff(str_up, (DWORD)mir_wstrlen(str_up));
+ CharUpperBuff(substr_up, (DWORD)mir_wstrlen(substr_up));
wchar_t *p = wcsstr(str_up, substr_up);
return p ? (str + (p - str_up)) : NULL;
@@ -800,9 +800,9 @@ void JabberCopyText(HWND hwnd, const wchar_t *text) if (OpenClipboard(hwnd)) {
EmptyClipboard();
- HGLOBAL hMem = GlobalAlloc(GMEM_MOVEABLE, sizeof(wchar_t)*(mir_tstrlen(text) + 1));
+ HGLOBAL hMem = GlobalAlloc(GMEM_MOVEABLE, sizeof(wchar_t)*(mir_wstrlen(text) + 1));
wchar_t *s = (wchar_t *)GlobalLock(hMem);
- mir_tstrcpy(s, text);
+ mir_wstrcpy(s, text);
GlobalUnlock(hMem);
SetClipboardData(CF_UNICODETEXT, hMem);
CloseClipboard();
@@ -863,11 +863,11 @@ bool CJabberProto::IsMyOwnJID(LPCTSTR szJID) if (m_ThreadInfo == NULL)
return false;
- ptrT szFrom(JabberPrepareJid(szJID));
+ ptrW szFrom(JabberPrepareJid(szJID));
if (szFrom == NULL)
return false;
- ptrT szTo(JabberPrepareJid(m_ThreadInfo->fullJID));
+ ptrW szTo(JabberPrepareJid(m_ThreadInfo->fullJID));
if (szTo == NULL)
return false;
@@ -879,7 +879,7 @@ bool CJabberProto::IsMyOwnJID(LPCTSTR szJID) if (pDelimiter)
*pDelimiter = 0;
- return mir_tstrcmp(szFrom, szTo) == 0;
+ return mir_wstrcmp(szFrom, szTo) == 0;
}
void __cdecl CJabberProto::LoadHttpAvatars(void* param)
diff --git a/protocols/JabberG/src/jabber_vcard.cpp b/protocols/JabberG/src/jabber_vcard.cpp index 6d1ae5d239..f48503739d 100644 --- a/protocols/JabberG/src/jabber_vcard.cpp +++ b/protocols/JabberG/src/jabber_vcard.cpp @@ -46,7 +46,7 @@ int CJabberProto::SendGetVcard(const wchar_t *jid) static void SetDialogField(CJabberProto *ppro, HWND hwndDlg, int nDlgItem, char* key, bool bTranslate = false)
{
- ptrT tszValue(ppro->getTStringA(key));
+ ptrW tszValue(ppro->getTStringA(key));
if (tszValue != NULL)
SetDlgItemText(hwndDlg, nDlgItem, (bTranslate) ? TranslateTS(tszValue) : tszValue);
else
@@ -126,7 +126,7 @@ static INT_PTR CALLBACK HomeDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA TranslateDialogDefault(hwndDlg);
for (int i = 0; i < g_cbCountries; i++) {
if (g_countries[i].id != 0xFFFF && g_countries[i].id != 0) {
- wchar_t *country = mir_a2t(g_countries[i].szName);
+ wchar_t *country = mir_a2u(g_countries[i].szName);
SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_ADDSTRING, 0, (LPARAM)TranslateTS(country));
mir_free(country);
}
@@ -190,7 +190,7 @@ static INT_PTR CALLBACK WorkDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA TranslateDialogDefault(hwndDlg);
for (int i = 0; i < g_cbCountries; i++) {
if (g_countries[i].id != 0xFFFF && g_countries[i].id != 0) {
- wchar_t *country = mir_a2t(g_countries[i].szName);
+ wchar_t *country = mir_a2u(g_countries[i].szName);
SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_ADDSTRING, 0, (LPARAM)TranslateTS(country));
mir_free(country);
}
@@ -291,13 +291,13 @@ static INT_PTR CALLBACK PhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR dat->ppro->GetAvatarFileName(NULL, szAvatarFileName, _countof(szAvatarFileName));
if (_waccess(szAvatarFileName, 0) == 0) {
if (GetTempPath(_countof(szTempPath), szTempPath) <= 0)
- mir_tstrcpy(szTempPath, L".\\");
+ mir_wstrcpy(szTempPath, L".\\");
if (GetTempFileName(szTempPath, L"jab", 0, szTempFileName) > 0) {
dat->ppro->debugLog(L"Temp file = %s", szTempFileName);
if (CopyFile(szAvatarFileName, szTempFileName, FALSE) == TRUE) {
if ((dat->hBitmap = Bitmap_Load(szTempFileName)) != NULL) {
FIP->FI_Premultiply(dat->hBitmap);
- mir_tstrcpy(dat->ppro->m_szPhotoFileName, szTempFileName);
+ mir_wstrcpy(dat->ppro->m_szPhotoFileName, szTempFileName);
EnableWindow(GetDlgItem(hwndDlg, IDC_DELETE), TRUE);
}
else DeleteFile(szTempFileName);
@@ -355,7 +355,7 @@ static INT_PTR CALLBACK PhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR break;
}
if (GetTempPath(_countof(szTempPath), szTempPath) <= 0)
- mir_tstrcpy(szTempPath, L".\\");
+ mir_wstrcpy(szTempPath, L".\\");
if (GetTempFileName(szTempPath, L"jab", 0, szTempFileName) > 0) {
dat->ppro->debugLog(L"Temp file = %s", szTempFileName);
@@ -367,7 +367,7 @@ static INT_PTR CALLBACK PhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR }
dat->hBitmap = hNewBitmap;
- mir_tstrcpy(dat->ppro->m_szPhotoFileName, szTempFileName);
+ mir_wstrcpy(dat->ppro->m_szPhotoFileName, szTempFileName);
dat->ppro->m_bPhotoChanged = TRUE;
EnableWindow(GetDlgItem(hwndDlg, IDC_DELETE), TRUE);
InvalidateRect(hwndDlg, NULL, TRUE);
@@ -730,10 +730,10 @@ static INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM, LPARAM lP lvi.iItem = 0;
for (i=0;;i++) {
mir_snprintf(idstr, "e-mail%d", i);
- ptrT email( ppro->getTStringA(idstr));
+ ptrW email( ppro->getTStringA(idstr));
if (email == NULL) break;
- mir_sntprintf(number, L"%d", i+1);
+ mir_snwprintf(number, L"%d", i+1);
lvi.pszText = number;
lvi.lParam = (LPARAM)i;
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_EMAILS), &lvi);
@@ -751,10 +751,10 @@ static INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM, LPARAM lP lvi.iItem = 0;
for (i=0;;i++) {
mir_snprintf(idstr, "Phone%d", i);
- ptrT phone( ppro->getTStringA(idstr));
+ ptrW phone( ppro->getTStringA(idstr));
if (phone == NULL) break;
- mir_sntprintf(number, L"%d", i+1);
+ mir_snwprintf(number, L"%d", i+1);
lvi.pszText = number;
lvi.lParam = (LPARAM)i;
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
@@ -958,7 +958,7 @@ void CJabberProto::SaveVcardToDB(HWND hwndPage, int iPage) setTString("ZIP", text);
{
int i = SendDlgItemMessage(hwndPage, IDC_COUNTRY, CB_GETCURSEL, 0, 0);
- wchar_t *country = mir_a2t((i) ? g_countries[i + 2].szName : g_countries[1].szName);
+ wchar_t *country = mir_a2u((i) ? g_countries[i + 2].szName : g_countries[1].szName);
setTString("Country", country);
mir_free(country);
}
@@ -984,7 +984,7 @@ void CJabberProto::SaveVcardToDB(HWND hwndPage, int iPage) setTString("CompanyZIP", text);
{
int i = SendDlgItemMessage(hwndPage, IDC_COUNTRY, CB_GETCURSEL, 0, 0);
- wchar_t *country = mir_a2t((i) ? g_countries[i + 2].szName : g_countries[1].szName);
+ wchar_t *country = mir_a2u((i) ? g_countries[i + 2].szName : g_countries[1].szName);
setTString("CompanyCountry", country);
mir_free(country);
}
@@ -1006,7 +1006,7 @@ void CJabberProto::AppendVcardFromDB(HXML n, char *tag, char *key) if (n == NULL || tag == NULL || key == NULL)
return;
- ptrT tszValue(getTStringA(key));
+ ptrW tszValue(getTStringA(key));
n << XCHILD(_A2T(tag), tszValue);
}
@@ -1033,7 +1033,7 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, wchar_t* szPhotoFileName) for (i = 0;; i++) {
mir_snprintf(idstr, "e-mail%d", i);
- ptrT email(getTStringA(idstr));
+ ptrW email(getTStringA(idstr));
if (email == NULL)
break;
@@ -1081,7 +1081,7 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, wchar_t* szPhotoFileName) for (i = 0;; i++) {
mir_snprintf(idstr, "Phone%d", i);
- ptrT phone(getTStringA(idstr));
+ ptrW phone(getTStringA(idstr));
if (phone == NULL)
break;
diff --git a/protocols/JabberG/src/jabber_ws.cpp b/protocols/JabberG/src/jabber_ws.cpp index 201b1fbbd4..739fd07362 100644 --- a/protocols/JabberG/src/jabber_ws.cpp +++ b/protocols/JabberG/src/jabber_ws.cpp @@ -29,7 +29,7 @@ BOOL CJabberProto::WsInit(void) m_lastTicks = ::GetTickCount();
wchar_t name[128];
- mir_sntprintf(name, TranslateT("%s connection"), m_tszUserName);
+ mir_snwprintf(name, TranslateT("%s connection"), m_tszUserName);
NETLIBUSER nlu = { sizeof(nlu) };
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_TCHAR; // | NUF_HTTPGATEWAY;
diff --git a/protocols/JabberG/src/jabber_xml.cpp b/protocols/JabberG/src/jabber_xml.cpp index 32b1b6194e..71f6697e2d 100644 --- a/protocols/JabberG/src/jabber_xml.cpp +++ b/protocols/JabberG/src/jabber_xml.cpp @@ -154,7 +154,7 @@ void __fastcall XmlAddAttr(HXML hXml, LPCTSTR pszName, unsigned __int64 value) void __fastcall XmlAddAttrID(HXML hXml, int id)
{
wchar_t text[100];
- mir_sntprintf(text, _T(JABBER_IQID) L"%d", id);
+ mir_snwprintf(text, _T(JABBER_IQID) L"%d", id);
XmlAddAttr(hXml, L"id", text);
}
@@ -218,7 +218,7 @@ HXML __fastcall XmlGetChild(HXML hXml, LPCTSTR key) HXML __fastcall XmlGetChild(HXML hXml, LPCSTR key)
{
- LPTSTR wszKey = mir_a2t(key);
+ LPTSTR wszKey = mir_a2u(key);
HXML result = xmlGetNthChild(hXml, wszKey, 0);
mir_free(wszKey);
return result;
@@ -231,7 +231,7 @@ HXML __fastcall XmlGetChildByTag(HXML hXml, LPCTSTR key, LPCTSTR attrName, LPCTS HXML __fastcall XmlGetChildByTag(HXML hXml, LPCSTR key, LPCSTR attrName, LPCTSTR attrValue)
{
- LPTSTR wszKey = mir_a2t(key), wszName = mir_a2t(attrName);
+ LPTSTR wszKey = mir_a2u(key), wszName = mir_a2u(attrName);
HXML result = xmlGetChildByAttrValue(hXml, wszKey, wszName, attrValue);
mir_free(wszKey), mir_free(wszName);
return result;
@@ -246,7 +246,7 @@ HXML __fastcall XmlGetNthChild(HXML hXml, LPCTSTR tag, int nth) {
int i, num;
- if (!hXml || tag == NULL || mir_tstrlen(tag) <= 0 || nth < 1)
+ if (!hXml || tag == NULL || mir_wstrlen(tag) <= 0 || nth < 1)
return NULL;
num = 1;
@@ -254,7 +254,7 @@ HXML __fastcall XmlGetNthChild(HXML hXml, LPCTSTR tag, int nth) HXML n = xmlGetChild(hXml, i);
if (!n)
break;
- if (!mir_tstrcmp(tag, XmlGetName(n))) {
+ if (!mir_wstrcmp(tag, XmlGetName(n))) {
if (num == nth)
return n;
@@ -281,20 +281,20 @@ void XPath::ProcessPath(LookupInfo &info, bool bCreate) if (!info.nodeName) return;
wchar_t *nodeName = (wchar_t *)alloca(sizeof(wchar_t) * (info.nodeName.length+1));
- mir_tstrncpy(nodeName, info.nodeName.p, info.nodeName.length+1);
+ mir_wstrncpy(nodeName, info.nodeName.p, info.nodeName.length+1);
if (info.attrName && info.attrValue) {
wchar_t *attrName = (wchar_t *)alloca(sizeof(wchar_t)* (info.attrName.length + 1));
- mir_tstrncpy(attrName, info.attrName.p, info.attrName.length + 1);
+ mir_wstrncpy(attrName, info.attrName.p, info.attrName.length + 1);
wchar_t *attrValue = (wchar_t *)alloca(sizeof(wchar_t)* (info.attrValue.length + 1));
- mir_tstrncpy(attrValue, info.attrValue.p, info.attrValue.length + 1);
+ mir_wstrncpy(attrValue, info.attrValue.p, info.attrValue.length + 1);
HXML hXml = XmlGetChildByTag(m_hXml, nodeName, attrName, attrValue);
m_hXml = (hXml || !bCreate) ? hXml : (m_hXml << XCHILD(nodeName) << XATTR(attrName, attrValue));
}
else if (info.nodeIndex) {
int idx = _wtoi(info.nodeIndex.p);
- m_hXml = mir_tstrcmp(nodeName, L"*") ? XmlGetNthChild(m_hXml, nodeName, idx) : XmlGetChild(m_hXml, idx - 1);
+ m_hXml = mir_wstrcmp(nodeName, L"*") ? XmlGetNthChild(m_hXml, nodeName, idx) : XmlGetChild(m_hXml, idx - 1);
}
else {
HXML hXml = XmlGetChild(m_hXml, nodeName);
diff --git a/protocols/JabberG/src/jabber_xml.h b/protocols/JabberG/src/jabber_xml.h index 739ba708db..0102cac006 100644 --- a/protocols/JabberG/src/jabber_xml.h +++ b/protocols/JabberG/src/jabber_xml.h @@ -258,11 +258,11 @@ public: }
__forceinline bool operator== (wchar_t *str)
{
- return !mir_tstrcmp((LPCTSTR)*this, str);
+ return !mir_wstrcmp((LPCTSTR)*this, str);
}
__forceinline bool operator!= (wchar_t *str)
{
- return mir_tstrcmp((LPCTSTR)*this, str) ? true : false;
+ return mir_wstrcmp((LPCTSTR)*this, str) ? true : false;
}
HXML operator[] (int idx)
{
@@ -359,7 +359,7 @@ public: va_list args;
va_start(args, path);
- mir_vsntprintf(m_buf, BUFSIZE, path, args);
+ mir_vsnwprintf(m_buf, BUFSIZE, path, args);
m_buf[BUFSIZE-1] = 0;
va_end(args);
}
diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp index 4e0b3b521b..7a0c229662 100644 --- a/protocols/JabberG/src/jabber_xstatus.cpp +++ b/protocols/JabberG/src/jabber_xstatus.cpp @@ -68,7 +68,7 @@ void CJabberDlgPepBase::OnInitDialog() SetTimer(m_hwnd, 1, 1000, NULL);
wchar_t buf[128];
- mir_sntprintf(buf, TranslateT("OK (%d)"), m_time);
+ mir_snwprintf(buf, TranslateT("OK (%d)"), m_time);
m_btnOk.SetText(buf);
}
@@ -89,7 +89,7 @@ INT_PTR CJabberDlgPepBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) case WM_TIMER:
if (wParam == 1) {
wchar_t buf[128];
- mir_sntprintf(buf, TranslateT("OK (%d)"), --m_time);
+ mir_snwprintf(buf, TranslateT("OK (%d)"), --m_time);
m_btnOk.SetText(buf);
if (m_time < 0) {
@@ -285,7 +285,7 @@ void CJabberDlgPepSimple::cbModes_OnChange(CCtrlData *) if ((m_prevSelected >= 0) && (m_modes[m_cbModes.GetItemData(m_prevSelected)].m_id >= 0)) {
mir_snprintf(szSetting, "PepMsg_%s", m_modes[m_cbModes.GetItemData(m_prevSelected)].m_name);
- ptrT szDescr( m_proto->getTStringA(szSetting));
+ ptrW szDescr( m_proto->getTStringA(szSetting));
m_txtDescription.SetText((szDescr != NULL) ? szDescr : L"");
m_txtDescription.Enable(true);
}
@@ -341,20 +341,20 @@ BOOL CJabberDlgPepSimple::OnWmDrawItem(UINT, WPARAM, LPARAM lParam) if (mode->m_subitem) {
for (int i = lpdis->itemData; i >= 0; --i)
if (!m_modes[i].m_subitem) {
- mir_sntprintf(text, L"%s [%s]", m_modes[i].m_title, mode->m_title);
+ mir_snwprintf(text, L"%s [%s]", m_modes[i].m_title, mode->m_title);
break;
}
}
- else mir_tstrncpy(text, mode->m_title, _countof(text));
+ else mir_wstrncpy(text, mode->m_title, _countof(text));
DrawIconEx(lpdis->hDC, lpdis->rcItem.left + 2, (lpdis->rcItem.top + lpdis->rcItem.bottom - 16) / 2, mode->m_hIcon, 16, 16, 0, NULL, DI_NORMAL);
- TextOut(lpdis->hDC, lpdis->rcItem.left + 23, (lpdis->rcItem.top + lpdis->rcItem.bottom - tm.tmHeight) / 2, text, (int)mir_tstrlen(text));
+ TextOut(lpdis->hDC, lpdis->rcItem.left + 23, (lpdis->rcItem.top + lpdis->rcItem.bottom - tm.tmHeight) / 2, text, (int)mir_wstrlen(text));
}
else {
wchar_t text[128];
- mir_sntprintf(text, L"...%s", mode->m_title);
+ mir_snwprintf(text, L"...%s", mode->m_title);
DrawIconEx(lpdis->hDC, lpdis->rcItem.left + 23, (lpdis->rcItem.top + lpdis->rcItem.bottom - 16) / 2, mode->m_hIcon, 16, 16, 0, NULL, DI_NORMAL);
- TextOut(lpdis->hDC, lpdis->rcItem.left + 44, (lpdis->rcItem.top + lpdis->rcItem.bottom - tm.tmHeight) / 2, text, (int)mir_tstrlen(text));
+ TextOut(lpdis->hDC, lpdis->rcItem.left + 44, (lpdis->rcItem.top + lpdis->rcItem.bottom - tm.tmHeight) / 2, text, (int)mir_wstrlen(text));
}
return TRUE;
@@ -398,7 +398,7 @@ void CPepService::Publish() void CPepService::Retract()
{
- wchar_t *tempName = mir_a2t(m_name);
+ wchar_t *tempName = mir_a2u(m_name);
wcslwr(tempName);
m_proto->m_ThreadInfo->send(
@@ -489,7 +489,7 @@ bool CPepGuiService::LaunchSetGui(BYTE bQuiet) void CPepGuiService::UpdateMenuItem(HANDLE hIcolibIcon, wchar_t *text)
{
m_hIcolibItem = hIcolibIcon;
- replaceStrT(m_szText, text);
+ replaceStrW(m_szText, text);
if (m_hMenuItem)
Menu_ModifyItem(m_hMenuItem, m_szText ? m_szText : TranslateT("<advanced status slot>"), m_hIcolibItem, CMIF_KEEPUNTRANSLATED);
@@ -632,7 +632,7 @@ void CPepMood::ProcessItems(const wchar_t *from, HXML itemsNode) LPCTSTR moodType = NULL, moodText = NULL;
for (int i=0; n = XmlGetChild(moodNode, i); i++) {
- if (!mir_tstrcmp(XmlGetName(n), L"text"))
+ if (!mir_wstrcmp(XmlGetName(n), L"text"))
moodText = XmlGetText(n);
else
moodType = XmlGetName(n);
@@ -672,7 +672,7 @@ void CPepMood::SetMood(MCONTACT hContact, const wchar_t *szMood, const wchar_t * {
int mood = -1;
if (szMood) {
- char* p = mir_t2a(szMood);
+ char* p = mir_u2a(szMood);
for (int i = 1; i < _countof(g_arrMoods); i++)
if (!mir_strcmp(g_arrMoods[i].szTag, p)) {
@@ -688,16 +688,16 @@ void CPepMood::SetMood(MCONTACT hContact, const wchar_t *szMood, const wchar_t * if (!hContact) {
m_mode = mood;
- replaceStrT(m_text, szText);
+ replaceStrW(m_text, szText);
HANDLE hIcon;
wchar_t title[128];
if (mood >= 0) {
- mir_sntprintf(title, TranslateT("Mood: %s"), TranslateTS(g_arrMoods[mood].szName));
+ mir_snwprintf(title, TranslateT("Mood: %s"), TranslateTS(g_arrMoods[mood].szName));
hIcon = g_MoodIcons.GetIcolibHandle(g_arrMoods[mood].szTag);
}
else {
- mir_tstrcpy(title, TranslateT("Set mood..."));
+ mir_wstrcpy(title, TranslateT("Set mood..."));
hIcon = Skin_GetIconHandle(SKINICON_OTHER_SMALLDOT);
}
@@ -741,7 +741,7 @@ void CPepMood::ShowSetDialog(BYTE bQuiet) return;
m_mode = dlg.GetStatusMode();
- replaceStrT(m_text, dlg.GetStatusText());
+ replaceStrW(m_text, dlg.GetStatusText());
}
HANDLE hIcon;
@@ -865,7 +865,7 @@ static int ActivityCheck(LPCTSTR szFirstNode, LPCTSTR szSecondNode) {
if (!szFirstNode) return 0;
- char *s1 = mir_t2a(szFirstNode), *s2 = mir_t2a(szSecondNode);
+ char *s1 = mir_u2a(szFirstNode), *s2 = mir_u2a(szSecondNode);
int i = 0, nFirst = -1, nSecond = -1;
while (g_arrActivities[i].szFirst || g_arrActivities[i].szSecond) {
@@ -971,9 +971,9 @@ void ActivityBuildTitle(int id, wchar_t *buf, int size) if (szFirst) {
if (szSecond)
- mir_sntprintf(buf, size, L"%s [%s]", TranslateTS(szFirst), TranslateTS(szSecond));
+ mir_snwprintf(buf, size, L"%s [%s]", TranslateTS(szFirst), TranslateTS(szSecond));
else
- mir_tstrncpy(buf, TranslateTS(szFirst), size);
+ mir_wstrncpy(buf, TranslateTS(szFirst), size);
}
else *buf = 0;
}
@@ -1016,7 +1016,7 @@ void CPepActivity::ProcessItems(const wchar_t *from, HXML itemsNode) HXML n;
for (int i=0; n = XmlGetChild(actNode, i); i++) {
- if (mir_tstrcmp(XmlGetName(n), L"text")) {
+ if (mir_wstrcmp(XmlGetName(n), L"text")) {
szFirstNode = XmlGetName(n);
HXML secondNode = XmlGetChild(n, 0);
if (szFirstNode && secondNode && XmlGetName(secondNode))
@@ -1076,17 +1076,17 @@ void CPepActivity::SetActivity(MCONTACT hContact, LPCTSTR szFirst, LPCTSTR szSec if (!hContact) {
m_mode = activity;
- replaceStrT(m_text, szText);
+ replaceStrW(m_text, szText);
HANDLE hIcon;
wchar_t title[128];
if (activity >= 0) {
- mir_sntprintf(title, TranslateT("Activity: %s"), activityTitle);
+ mir_snwprintf(title, TranslateT("Activity: %s"), activityTitle);
hIcon = g_ActivityIcons.GetIcolibHandle(returnActivity(activity));
}
else {
- mir_tstrcpy(title, TranslateT("Set activity..."));
+ mir_wstrcpy(title, TranslateT("Set activity..."));
hIcon = Skin_GetIconHandle(SKINICON_OTHER_SMALLDOT);
}
@@ -1097,7 +1097,7 @@ void CPepActivity::SetActivity(MCONTACT hContact, LPCTSTR szFirst, LPCTSTR szSec else SetExtraIcon(hContact, activity < 0 ? NULL : returnActivity(activity));
if (activity >= 0) {
- wchar_t *p = mir_a2t(ActivityGetId(activity));
+ wchar_t *p = mir_a2u(ActivityGetId(activity));
m_proto->WriteAdvStatus(hContact, ADVSTATUS_ACTIVITY, p, g_ActivityIcons.GetIcolibName(returnActivity(activity)), activityTitle, szText);
mir_free(p);
}
@@ -1118,7 +1118,7 @@ void CPepActivity::ShowSetDialog(BYTE) m_mode = dlg.GetStatusMode();
if (m_mode >= 0) {
- replaceStrT(m_text, dlg.GetStatusText());
+ replaceStrW(m_text, dlg.GetStatusText());
Publish();
UpdateMenuItem(g_ActivityIcons.GetIcolibHandle(returnActivity(m_mode)), g_arrActivities[m_mode].szTitle);
@@ -1215,7 +1215,7 @@ void CJabberProto::SetContactTune(MCONTACT hContact, LPCTSTR szArtist, LPCTSTR s }
else {
szListeningTo = (wchar_t*)mir_alloc(2048 * sizeof(wchar_t));
- mir_sntprintf(szListeningTo, 2047, L"%s - %s", szTitle ? szTitle : L"", szArtist ? szArtist : L"");
+ mir_snwprintf(szListeningTo, 2047, L"%s - %s", szTitle ? szTitle : L"", szArtist ? szArtist : L"");
}
setTString(hContact, "ListeningTo", szListeningTo);
@@ -1232,7 +1232,7 @@ 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 = NULL)
@@ -1245,7 +1245,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);
}
INT_PTR __cdecl CJabberProto::OnSetListeningTo(WPARAM, LPARAM lParam)
@@ -1286,7 +1286,7 @@ INT_PTR __cdecl CJabberProto::OnSetListeningTo(WPARAM, LPARAM lParam) szTmp++;
}
}
- mir_sntprintf(szLengthInSec, L"%d", result);
+ mir_snwprintf(szLengthInSec, L"%d", result);
}
SendPepTune(szArtist, szLength ? szLengthInSec : NULL, szSource, szTitle, szTrack, NULL);
@@ -1365,7 +1365,7 @@ INT_PTR __cdecl CJabberProto::OnGetXStatusEx(WPARAM hContact, LPARAM lParam) else {
*pData->ptszName = 0;
if (pData->flags & CSSF_UNICODE) {
- ptrT title(ReadAdvStatusT(hContact, ADVSTATUS_MOOD, ADVSTATUS_VAL_TITLE));
+ ptrW title(ReadAdvStatusT(hContact, ADVSTATUS_MOOD, ADVSTATUS_VAL_TITLE));
if (title)
wcsncpy_s(pData->ptszName, STATUS_TITLE_MAX, title, _TRUNCATE);
}
@@ -1381,7 +1381,7 @@ INT_PTR __cdecl CJabberProto::OnGetXStatusEx(WPARAM hContact, LPARAM lParam) if (pData->flags & CSSF_MASK_MESSAGE) {
*pData->pszMessage = 0;
if (pData->flags & CSSF_UNICODE) {
- ptrT title(ReadAdvStatusT(hContact, ADVSTATUS_MOOD, ADVSTATUS_VAL_TEXT));
+ ptrW title(ReadAdvStatusT(hContact, ADVSTATUS_MOOD, ADVSTATUS_VAL_TEXT));
if (title)
wcsncpy_s(pData->ptszMessage, STATUS_TITLE_MAX, title, _TRUNCATE);
}
@@ -1505,15 +1505,15 @@ void g_XstatusIconsInit() wchar_t szFile[MAX_PATH];
GetModuleFileName(hInst, szFile, _countof(szFile));
if (wchar_t *p = wcsrchr(szFile, '\\'))
- mir_tstrcpy(p + 1, L"..\\Icons\\xstatus_jabber.dll");
+ mir_wstrcpy(p + 1, L"..\\Icons\\xstatus_jabber.dll");
wchar_t szSection[100];
- mir_tstrcpy(szSection, L"Protocols/Jabber/" LPGENW("Moods"));
+ mir_wstrcpy(szSection, L"Protocols/Jabber/" LPGENW("Moods"));
for (int i = 1; i < _countof(g_arrMoods); i++)
g_MoodIcons.RegisterIcon(g_arrMoods[i].szTag, szFile, -(200 + i), szSection, TranslateTS(g_arrMoods[i].szName));
- mir_tstrcpy(szSection, L"Protocols/Jabber/" LPGENW("Activities"));
+ mir_wstrcpy(szSection, L"Protocols/Jabber/" LPGENW("Activities"));
for (int k = 0; k < _countof(g_arrActivities); k++) {
if (g_arrActivities[k].szFirst)
g_ActivityIcons.RegisterIcon(g_arrActivities[k].szFirst, szFile, g_arrActivities[k].iconid, szSection, TranslateTS(g_arrActivities[k].szTitle));
diff --git a/protocols/JabberG/src/jabber_xstatus.h b/protocols/JabberG/src/jabber_xstatus.h index ccda5b0886..dae7929b38 100644 --- a/protocols/JabberG/src/jabber_xstatus.h +++ b/protocols/JabberG/src/jabber_xstatus.h @@ -114,7 +114,7 @@ public: CPepService *Find(wchar_t *node)
{
for (int i=0; i < getCount(); i++)
- if (!mir_tstrcmp((*this)[i].GetNode(), node))
+ if (!mir_wstrcmp((*this)[i].GetNode(), node))
return &((*this)[i]);
return NULL;
}
diff --git a/protocols/JabberG/src/stdafx.h b/protocols/JabberG/src/stdafx.h index 56f199f509..f445c93799 100644 --- a/protocols/JabberG/src/stdafx.h +++ b/protocols/JabberG/src/stdafx.h @@ -403,7 +403,7 @@ struct ThreadData JABBER_CONN_DATA conn;
wchar_t resource[128];
wchar_t fullJID[JABBER_MAX_JID_LEN];
- ptrT tszNewPassword;
+ ptrW tszNewPassword;
class TJabberAuth *auth;
JabberCapsBits jabberServerCaps;
@@ -683,8 +683,8 @@ struct CJabberAdhocStartupParams CJabberAdhocStartupParams(CJabberProto *proto, wchar_t* szJid, wchar_t* szNode = NULL)
{
m_pProto = proto;
- m_szJid = mir_tstrdup(szJid);
- m_szNode = szNode ? mir_tstrdup(szNode) : NULL;
+ m_szJid = mir_wstrdup(szJid);
+ m_szNode = szNode ? mir_wstrdup(szNode) : NULL;
}
~CJabberAdhocStartupParams()
{
|