summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/JabberG/src')
-rw-r--r--protocols/JabberG/src/jabber.cpp22
-rw-r--r--protocols/JabberG/src/jabber_adhoc.cpp78
-rw-r--r--protocols/JabberG/src/jabber_agent.cpp12
-rw-r--r--protocols/JabberG/src/jabber_api.cpp2
-rw-r--r--protocols/JabberG/src/jabber_archive.cpp36
-rw-r--r--protocols/JabberG/src/jabber_bookmarks.cpp12
-rw-r--r--protocols/JabberG/src/jabber_byte.cpp78
-rw-r--r--protocols/JabberG/src/jabber_caps.cpp80
-rw-r--r--protocols/JabberG/src/jabber_caps.h174
-rw-r--r--protocols/JabberG/src/jabber_captcha.cpp38
-rw-r--r--protocols/JabberG/src/jabber_chat.cpp186
-rw-r--r--protocols/JabberG/src/jabber_console.cpp24
-rw-r--r--protocols/JabberG/src/jabber_disco.cpp260
-rw-r--r--protocols/JabberG/src/jabber_disco.h18
-rw-r--r--protocols/JabberG/src/jabber_events.cpp16
-rw-r--r--protocols/JabberG/src/jabber_file.cpp22
-rw-r--r--protocols/JabberG/src/jabber_filterlist.cpp2
-rw-r--r--protocols/JabberG/src/jabber_form.cpp106
-rw-r--r--protocols/JabberG/src/jabber_frame.cpp16
-rw-r--r--protocols/JabberG/src/jabber_ft.cpp130
-rw-r--r--protocols/JabberG/src/jabber_groupchat.cpp116
-rw-r--r--protocols/JabberG/src/jabber_ibb.cpp26
-rw-r--r--protocols/JabberG/src/jabber_icolib.cpp44
-rw-r--r--protocols/JabberG/src/jabber_iq.cpp62
-rw-r--r--protocols/JabberG/src/jabber_iq_handlers.cpp118
-rw-r--r--protocols/JabberG/src/jabber_iqid.cpp326
-rw-r--r--protocols/JabberG/src/jabber_iqid_muc.cpp44
-rw-r--r--protocols/JabberG/src/jabber_menu.cpp20
-rw-r--r--protocols/JabberG/src/jabber_message_handlers.cpp8
-rw-r--r--protocols/JabberG/src/jabber_message_manager.cpp28
-rw-r--r--protocols/JabberG/src/jabber_misc.cpp78
-rw-r--r--protocols/JabberG/src/jabber_notes.cpp38
-rw-r--r--protocols/JabberG/src/jabber_opt.cpp604
-rw-r--r--protocols/JabberG/src/jabber_password.cpp4
-rw-r--r--protocols/JabberG/src/jabber_privacy.cpp142
-rw-r--r--protocols/JabberG/src/jabber_privacy.h2
-rwxr-xr-xprotocols/JabberG/src/jabber_proto.cpp126
-rw-r--r--protocols/JabberG/src/jabber_rc.cpp328
-rw-r--r--protocols/JabberG/src/jabber_search.cpp78
-rw-r--r--protocols/JabberG/src/jabber_search.h2
-rw-r--r--protocols/JabberG/src/jabber_secur.cpp16
-rw-r--r--protocols/JabberG/src/jabber_svc.cpp64
-rwxr-xr-xprotocols/JabberG/src/jabber_thread.cpp386
-rw-r--r--protocols/JabberG/src/jabber_userinfo.cpp36
-rw-r--r--protocols/JabberG/src/jabber_util.cpp94
-rw-r--r--protocols/JabberG/src/jabber_vcard.cpp92
-rw-r--r--protocols/JabberG/src/jabber_xml.cpp50
-rw-r--r--protocols/JabberG/src/jabber_xml.h4
-rw-r--r--protocols/JabberG/src/jabber_xstatus.cpp76
-rw-r--r--protocols/JabberG/src/jabber_xstatus.h2
50 files changed, 2163 insertions, 2163 deletions
diff --git a/protocols/JabberG/src/jabber.cpp b/protocols/JabberG/src/jabber.cpp
index 874b3ecab5..3c5f4e165a 100644
--- a/protocols/JabberG/src/jabber.cpp
+++ b/protocols/JabberG/src/jabber.cpp
@@ -109,8 +109,8 @@ static int OnModulesLoaded(WPARAM, LPARAM)
HookEvent(ME_TTB_MODULELOADED, g_OnToolbarInit);
bSecureIM = ServiceExists("SecureIM/IsContactSecured") != 0;
- bMirOTR = GetModuleHandle(_T("mirotr.dll")) != NULL;
- bNewGPG = GetModuleHandle(_T("new_gpg.dll")) != NULL;
+ bMirOTR = GetModuleHandle(L"mirotr.dll") != NULL;
+ bNewGPG = GetModuleHandle(L"new_gpg.dll") != NULL;
#ifdef _WIN64
bPlatform = 1;
#else
@@ -128,14 +128,14 @@ static int OnModulesLoaded(WPARAM, LPARAM)
fontid.cbSize = sizeof(fontid);
_tcsncpy_s(fontid.group, LPGENT("Jabber"), _TRUNCATE);
strncpy_s(fontid.dbSettingsGroup, GLOBAL_SETTING_MODULE, _TRUNCATE);
- _tcsncpy_s(fontid.backgroundGroup, _T("Jabber"), _TRUNCATE);
- _tcsncpy_s(fontid.backgroundName, _T("Background"), _TRUNCATE);
+ _tcsncpy_s(fontid.backgroundGroup, L"Jabber", _TRUNCATE);
+ _tcsncpy_s(fontid.backgroundName, L"Background", _TRUNCATE);
fontid.flags = FIDF_DEFAULTVALID;
fontid.deffontsettings.charset = DEFAULT_CHARSET;
fontid.deffontsettings.colour = GetSysColor(COLOR_WINDOWTEXT);
fontid.deffontsettings.size = -11;
- mir_tstrncpy(fontid.deffontsettings.szFace, _T("MS Shell Dlg"), _countof(fontid.deffontsettings.szFace));
+ mir_tstrncpy(fontid.deffontsettings.szFace, L"MS Shell Dlg", _countof(fontid.deffontsettings.szFace));
fontid.deffontsettings.style = 0;
_tcsncpy_s(fontid.name, LPGENT("Frame title"), _TRUNCATE);
@@ -150,10 +150,10 @@ static int OnModulesLoaded(WPARAM, LPARAM)
ColourIDT colourid = {0};
colourid.cbSize = sizeof(colourid);
- _tcsncpy_s(colourid.group, _T("Jabber"), _TRUNCATE);
+ _tcsncpy_s(colourid.group, L"Jabber", _TRUNCATE);
strncpy_s(colourid.dbSettingsGroup, GLOBAL_SETTING_MODULE, _TRUNCATE);
- _tcsncpy_s(colourid.name, _T("Background"), _TRUNCATE);
+ _tcsncpy_s(colourid.name, L"Background", _TRUNCATE);
strncpy_s(colourid.setting, "clFrameBack", _TRUNCATE);
colourid.defcolour = GetSysColor(COLOR_WINDOW);
ColourRegisterT(&colourid);
@@ -188,14 +188,14 @@ extern "C" int __declspec(dllexport) Load()
{
INT_PTR result = CallService(MS_IMG_GETINTERFACE, FI_IF_VERSION, (LPARAM)&FIP);
if (FIP == NULL || result != S_OK) {
- MessageBoxEx(NULL, TranslateT("Fatal error, image services not found. Jabber Protocol will be disabled."), _T("Error"), MB_OK | MB_ICONERROR | MB_APPLMODAL, 0);
+ MessageBoxEx(NULL, TranslateT("Fatal error, image services not found. Jabber Protocol will be disabled."), L"Error", MB_OK | MB_ICONERROR | MB_APPLMODAL, 0);
return 1;
}
}
WORD v[4];
CallService(MS_SYSTEM_GETFILEVERSION, 0, (LPARAM)v);
- mir_sntprintf(szCoreVersion, _T("%d.%d.%d.%d"), v[0], v[1], v[2], v[3]);
+ mir_sntprintf(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) {
TCHAR tszTempPath[MAX_PATH], tszFilePath[MAX_PATH];
GetTempPath(_countof(tszTempPath), tszTempPath);
- mir_sntprintf(tszFilePath, _T("%sjab*.tmp.*"), tszTempPath);
+ mir_sntprintf(tszFilePath, L"%sjab*.tmp.*", tszTempPath);
WIN32_FIND_DATA findData;
HANDLE hFind = FindFirstFile(tszFilePath, &findData);
if (hFind != INVALID_HANDLE_VALUE) {
do {
- mir_sntprintf(tszFilePath, _T("%s%s"), tszTempPath, findData.cFileName);
+ mir_sntprintf(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 5186d2241e..045c72c092 100644
--- a/protocols/JabberG/src/jabber_adhoc.cpp
+++ b/protocols/JabberG/src/jabber_adhoc.cpp
@@ -109,25 +109,25 @@ void CJabberProto::OnIqResult_CommandExecution(HXML iqNode, CJabberIqInfo *pInfo
void CJabberProto::AdHoc_RequestListOfCommands(TCHAR * szResponder, HWND hwndDlg)
{
m_ThreadInfo->send(XmlNodeIq(AddIQ(&CJabberProto::OnIqResult_ListOfCommands, JABBER_IQ_TYPE_GET, szResponder, 0, -1, hwndDlg))
- << XQUERY(JABBER_FEAT_DISCO_ITEMS) << XATTR(_T("node"), JABBER_FEAT_COMMANDS));
+ << XQUERY(JABBER_FEAT_DISCO_ITEMS) << XATTR(L"node", JABBER_FEAT_COMMANDS));
}
int CJabberProto::AdHoc_ExecuteCommand(HWND hwndDlg, TCHAR*, JabberAdHocData* dat)
{
for (int i = 1;; i++) {
- HXML itemNode = XmlGetNthChild(dat->CommandsNode, _T("item"), i);
+ HXML itemNode = XmlGetNthChild(dat->CommandsNode, L"item", i);
if (!itemNode)
break;
if (BST_UNCHECKED == IsDlgButtonChecked(GetDlgItem(hwndDlg, IDC_FRAME), i))
continue;
- const TCHAR *node = XmlGetAttrValue(itemNode, _T("node"));
+ const TCHAR *node = XmlGetAttrValue(itemNode, L"node");
if (node) {
- const TCHAR *jid2 = XmlGetAttrValue(itemNode, _T("jid"));
+ const TCHAR *jid2 = XmlGetAttrValue(itemNode, L"jid");
m_ThreadInfo->send(
XmlNodeIq(AddIQ(&CJabberProto::OnIqResult_CommandExecution, JABBER_IQ_TYPE_SET, jid2, 0, -1, hwndDlg))
- << XCHILDNS(_T("command"), JABBER_FEAT_COMMANDS) << XATTR(_T("node"), node) << XATTR(_T("action"), _T("execute")));
+ << XCHILDNS(L"command", JABBER_FEAT_COMMANDS) << XATTR(L"node", node) << XATTR(L"action", L"execute"));
EnableDlgItem(hwndDlg, IDC_SUBMIT, FALSE);
SetDlgItemText(hwndDlg, IDC_SUBMIT, TranslateT("OK"));
@@ -142,8 +142,8 @@ int CJabberProto::AdHoc_ExecuteCommand(HWND hwndDlg, TCHAR*, JabberAdHocData* da
int CJabberProto::AdHoc_OnJAHMCommandListResult(HWND hwndDlg, HXML iqNode, JabberAdHocData* dat)
{
int nodeIdx = 0;
- const TCHAR * type = XmlGetAttrValue(iqNode, _T("type"));
- if (!type || !mir_tstrcmp(type, _T("error"))) {
+ const TCHAR * type = XmlGetAttrValue(iqNode, L"type");
+ if (!type || !mir_tstrcmp(type, L"error")) {
// error occurred here
TCHAR buff[255];
const TCHAR *code = NULL;
@@ -151,13 +151,13 @@ int CJabberProto::AdHoc_OnJAHMCommandListResult(HWND hwndDlg, HXML iqNode, Jabbe
HXML errorNode = XmlGetChild(iqNode, "error");
if (errorNode) {
- code = XmlGetAttrValue(errorNode, _T("code"));
+ code = XmlGetAttrValue(errorNode, L"code");
description = XmlGetText(errorNode);
}
- mir_sntprintf(buff, TranslateT("Error %s %s"), (code) ? code : _T(""), (description) ? description : _T(""));
+ mir_sntprintf(buff, TranslateT("Error %s %s"), (code) ? code : L"", (description) ? description : L"");
JabberFormSetInstruction(hwndDlg, buff);
}
- else if (!mir_tstrcmp(type, _T("result"))) {
+ else if (!mir_tstrcmp(type, L"result")) {
BOOL validResponse = FALSE;
EnumChildWindows(GetDlgItem(hwndDlg, IDC_FRAME), sttDeleteChildWindowsProc, 0);
dat->CurrentHeight = 0;
@@ -165,8 +165,8 @@ int CJabberProto::AdHoc_OnJAHMCommandListResult(HWND hwndDlg, HXML iqNode, Jabbe
SetScrollPos(GetDlgItem(hwndDlg, IDC_VSCROLL), SB_CTL, 0, FALSE);
HXML queryNode = XmlGetChild(iqNode, "query");
if (queryNode) {
- const TCHAR *xmlns = XmlGetAttrValue(queryNode, _T("xmlns"));
- const TCHAR *node = XmlGetAttrValue(queryNode, _T("node"));
+ const TCHAR *xmlns = XmlGetAttrValue(queryNode, L"xmlns");
+ const TCHAR *node = XmlGetAttrValue(queryNode, L"node");
if (xmlns && node && !mir_tstrcmp(xmlns, JABBER_FEAT_DISCO_ITEMS) && !mir_tstrcmp(node, JABBER_FEAT_COMMANDS))
validResponse = TRUE;
}
@@ -175,12 +175,12 @@ int CJabberProto::AdHoc_OnJAHMCommandListResult(HWND hwndDlg, HXML iqNode, Jabbe
int ypos = 20;
for (nodeIdx = 1;; nodeIdx++) {
- HXML itemNode = XmlGetNthChild(queryNode, _T("item"), nodeIdx);
+ HXML itemNode = XmlGetNthChild(queryNode, L"item", nodeIdx);
if (!itemNode)
break;
- const TCHAR *name = XmlGetAttrValue(itemNode, _T("name"));
- if (!name) name = XmlGetAttrValue(itemNode, _T("node"));
+ const TCHAR *name = XmlGetAttrValue(itemNode, L"name");
+ if (!name) name = XmlGetAttrValue(itemNode, L"node");
ypos = AdHoc_AddCommandRadio(GetDlgItem(hwndDlg, IDC_FRAME), TranslateTS(name), nodeIdx, ypos, (nodeIdx == 1) ? 1 : 0);
dat->CurrentHeight = ypos;
}
@@ -212,16 +212,16 @@ int CJabberProto::AdHoc_OnJAHMProcessResult(HWND hwndDlg, HXML workNode, JabberA
dat->AdHocNode = xmlCopyNode(workNode);
const TCHAR *type;
- if ((type = XmlGetAttrValue(workNode, _T("type"))) == NULL) return TRUE;
- if (!mir_tstrcmp(type, _T("result"))) {
+ if ((type = XmlGetAttrValue(workNode, L"type")) == NULL) return TRUE;
+ if (!mir_tstrcmp(type, L"result")) {
// wParam = <iq/> node from responder as a result of command execution
HXML commandNode, xNode;
- if ((commandNode = XmlGetChild(dat->AdHocNode, _T("command"))) == NULL)
+ if ((commandNode = XmlGetChild(dat->AdHocNode, L"command")) == NULL)
return TRUE;
- const TCHAR *status = XmlGetAttrValue(commandNode, _T("status"));
+ const TCHAR *status = XmlGetAttrValue(commandNode, L"status");
if (!status)
- status = _T("completed");
+ status = L"completed";
if ((xNode = XmlGetChild(commandNode, "x"))) {
// use jabber:x:data form
@@ -264,12 +264,12 @@ int CJabberProto::AdHoc_OnJAHMProcessResult(HWND hwndDlg, HXML workNode, JabberA
EnableDlgItem(hwndDlg, IDC_SUBMIT, TRUE);
}
- if (!status || mir_tstrcmp(status, _T("executing"))) {
+ if (!status || mir_tstrcmp(status, L"executing")) {
ShowDlgItem(hwndDlg, IDC_SUBMIT, SW_HIDE);
SetDlgItemText(hwndDlg, IDCANCEL, TranslateT("Done"));
}
}
- else if (!mir_tstrcmp(type, _T("error"))) {
+ else if (!mir_tstrcmp(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);
@@ -279,10 +279,10 @@ int CJabberProto::AdHoc_OnJAHMProcessResult(HWND hwndDlg, HXML workNode, JabberA
TCHAR buff[255];
HXML errorNode = XmlGetChild(workNode , "error");
if (errorNode) {
- code = XmlGetAttrValue(errorNode, _T("code"));
+ code = XmlGetAttrValue(errorNode, L"code");
description = XmlGetText(errorNode);
}
- mir_sntprintf(buff, TranslateT("Error %s %s"), code ? code : _T(""), description ? description : _T(""));
+ mir_sntprintf(buff, TranslateT("Error %s %s"), code ? code : L"", description ? description : L"");
JabberFormSetInstruction(hwndDlg,buff);
}
JabberAdHoc_RefreshFrameScroll(hwndDlg, dat);
@@ -295,20 +295,20 @@ int CJabberProto::AdHoc_SubmitCommandForm(HWND hwndDlg, JabberAdHocData* dat, TC
HXML xNode = XmlGetChild(commandNode, "x");
HXML dataNode = JabberFormGetData(GetDlgItem(hwndDlg, IDC_FRAME), xNode);
- LPCTSTR jid2 = XmlGetAttrValue(dat->AdHocNode, _T("from"));
+ LPCTSTR jid2 = XmlGetAttrValue(dat->AdHocNode, L"from");
XmlNodeIq iq(AddIQ(&CJabberProto::OnIqResult_CommandExecution, JABBER_IQ_TYPE_SET, jid2, 0, -1, hwndDlg));
- HXML command = iq << XCHILDNS(_T("command"), JABBER_FEAT_COMMANDS);
+ HXML command = iq << XCHILDNS(L"command", JABBER_FEAT_COMMANDS);
- const TCHAR *sessionId = XmlGetAttrValue(commandNode, _T("sessionid"));
+ const TCHAR *sessionId = XmlGetAttrValue(commandNode, L"sessionid");
if (sessionId)
- command << XATTR(_T("sessionid"), sessionId);
+ command << XATTR(L"sessionid", sessionId);
- const TCHAR *node = XmlGetAttrValue(commandNode, _T("node"));
+ const TCHAR *node = XmlGetAttrValue(commandNode, L"node");
if (node)
- command << XATTR(_T("node"), node);
+ command << XATTR(L"node", node);
if (action)
- command << XATTR(_T("action"), action);
+ command << XATTR(L"action", action);
XmlAddChild(command, dataNode);
m_ThreadInfo->send(iq);
@@ -339,7 +339,7 @@ int CJabberProto::AdHoc_AddCommandRadio(HWND hFrame, TCHAR * labelStr, int id, i
ctrlWidth = min(ctrlWidth, strRect.right - strRect.left + 20);
ReleaseDC(hFrame, hdc);
- HWND hCtrl = CreateWindowEx(0, _T("button"), labelStr, WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_AUTORADIOBUTTON, ctrlOffset, ypos, ctrlWidth, labelHeight, hFrame, (HMENU)id, hInst, NULL);
+ HWND hCtrl = CreateWindowEx(0, L"button", labelStr, WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_AUTORADIOBUTTON, ctrlOffset, ypos, ctrlWidth, labelHeight, hFrame, (HMENU)id, hInst, NULL);
SendMessage(hCtrl, WM_SETFONT, (WPARAM)SendMessage(GetParent(hFrame), WM_GETFONT, 0, 0), 0);
SendMessage(hCtrl, BM_SETCHECK, value, 0);
return (ypos + labelHeight + verticalStep);
@@ -391,8 +391,8 @@ static INT_PTR CALLBACK JabberAdHoc_CommandDlgProc(HWND hwndDlg, UINT msg, WPARA
else {
dat->proto->m_ThreadInfo->send(
XmlNodeIq(dat->proto->AddIQ(&CJabberProto::OnIqResult_CommandExecution, JABBER_IQ_TYPE_SET, pStartupParams->m_szJid, 0, -1, hwndDlg))
- << XCHILDNS(_T("command"), JABBER_FEAT_COMMANDS)
- << XATTR(_T("node"), pStartupParams->m_szNode) << XATTR(_T("action"), _T("execute")));
+ << XCHILDNS(L"command", JABBER_FEAT_COMMANDS)
+ << XATTR(L"node", pStartupParams->m_szNode) << XATTR(L"action", L"execute"));
EnableDlgItem(hwndDlg, IDC_SUBMIT, FALSE);
SetDlgItemText(hwndDlg, IDC_SUBMIT, TranslateT("OK"));
@@ -416,11 +416,11 @@ static INT_PTR CALLBACK JabberAdHoc_CommandDlgProc(HWND hwndDlg, UINT msg, WPARA
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDC_PREV:
- return dat->proto->AdHoc_SubmitCommandForm(hwndDlg, dat, _T("prev"));
+ return dat->proto->AdHoc_SubmitCommandForm(hwndDlg, dat, L"prev");
case IDC_NEXT:
- return dat->proto->AdHoc_SubmitCommandForm(hwndDlg, dat, _T("next"));
+ return dat->proto->AdHoc_SubmitCommandForm(hwndDlg, dat, L"next");
case IDC_COMPLETE:
- return dat->proto->AdHoc_SubmitCommandForm(hwndDlg, dat, _T("complete"));
+ return dat->proto->AdHoc_SubmitCommandForm(hwndDlg, dat, L"complete");
case IDC_SUBMIT:
if (!dat->AdHocNode && dat->CommandsNode && LOWORD(wParam) == IDC_SUBMIT)
return dat->proto->AdHoc_ExecuteCommand(hwndDlg, dat->ResponderJID, dat);
@@ -527,7 +527,7 @@ int __cdecl CJabberProto::ContactMenuRunCommands(WPARAM hContact, LPARAM lParam)
HMENU hMenu = CreatePopupMenu();
for (int i = 0; i < item->arResources.getCount(); i++)
AppendMenu(hMenu, MF_STRING, i + 1, item->arResources[i]->m_tszResourceName);
- HWND hwndTemp = CreateWindowEx(WS_EX_TOOLWINDOW, _T("button"), _T("PopupMenuHost"), 0, 0, 0, 10, 10, NULL, NULL, hInst, NULL);
+ HWND hwndTemp = CreateWindowEx(WS_EX_TOOLWINDOW, L"button", L"PopupMenuHost", 0, 0, 0, 10, 10, NULL, NULL, hInst, NULL);
SetForegroundWindow(hwndTemp);
RECT rc;
POINT pt;
@@ -541,7 +541,7 @@ int __cdecl CJabberProto::ContactMenuRunCommands(WPARAM hContact, LPARAM lParam)
if (selected > 0) {
JABBER_RESOURCE_STATUS *r = item->arResources[selected - 1];
if (r) {
- mir_tstrncat(jid, _T("/"), _countof(jid) - mir_tstrlen(jid));
+ mir_tstrncat(jid, L"/", _countof(jid) - mir_tstrlen(jid));
mir_tstrncat(jid, r->m_tszResourceName, _countof(jid) - mir_tstrlen(jid));
}
selected = 1;
diff --git a/protocols/JabberG/src/jabber_agent.cpp b/protocols/JabberG/src/jabber_agent.cpp
index 43b4ff0c60..f7c2b64a45 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), _T("instructions"))) {
+ if (!mir_tstrcmp(XmlGetName(n), L"instructions")) {
JabberFormSetInstruction(m_hwnd, XmlGetText(n));
}
- else if (!mir_tstrcmp(XmlGetName(n), _T("key")) || !mir_tstrcmp(XmlGetName(n), _T("registered"))) {
+ else if (!mir_tstrcmp(XmlGetName(n), L"key") || !mir_tstrcmp(XmlGetName(n), L"registered")) {
// do nothing
}
- else if (!mir_tstrcmp(XmlGetName(n), _T("password")))
+ else if (!mir_tstrcmp(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));
@@ -229,7 +229,7 @@ public:
const TCHAR *from;
if (m_agentRegIqNode == NULL) return;
- if ((from = XmlGetAttrValue(m_agentRegIqNode, _T("from"))) == NULL) return;
+ if ((from = XmlGetAttrValue(m_agentRegIqNode, L"from")) == NULL) return;
if ((queryNode = XmlGetChild(m_agentRegIqNode , "query")) == NULL) return;
HWND hFrame = GetDlgItem(m_hwnd, IDC_FRAME);
@@ -253,14 +253,14 @@ public:
break;
if (XmlGetName(n)) {
- if (!mir_tstrcmp(XmlGetName(n), _T("key"))) {
+ if (!mir_tstrcmp(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), _T("registered")) || !mir_tstrcmp(XmlGetName(n), _T("instructions"))) {
+ else if (!mir_tstrcmp(XmlGetName(n), L"registered") || !mir_tstrcmp(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 4c4b93c27c..97850e9336 100644
--- a/protocols/JabberG/src/jabber_api.cpp
+++ b/protocols/JabberG/src/jabber_api.cpp
@@ -240,7 +240,7 @@ int CJabberProto::RegisterFeature(LPCTSTR szFeature, LPCTSTR szDescription)
LPTSTR szExt = mir_tstrdup(szFeature);
LPTSTR pSrc, pDst;
for (pSrc = szExt, pDst = szExt; *pSrc; pSrc++)
- if (_tcschr(_T("bcdfghjklmnpqrstvwxz0123456789"), *pSrc))
+ if (_tcschr(L"bcdfghjklmnpqrstvwxz0123456789", *pSrc))
*pDst++ = *pSrc;
*pDst = 0;
m_clientCapsManager.SetClientCaps(JABBER_CAPS_MIRANDA_NODE, szExt, jcb);
diff --git a/protocols/JabberG/src/jabber_archive.cpp b/protocols/JabberG/src/jabber_archive.cpp
index e532302a42..5d9d101ee6 100644
--- a/protocols/JabberG/src/jabber_archive.cpp
+++ b/protocols/JabberG/src/jabber_archive.cpp
@@ -33,8 +33,8 @@ bool operator==(const DBEVENTINFO &ev1, const DBEVENTINFO &ev2)
void CJabberProto::EnableArchive(bool bEnable)
{
- m_ThreadInfo->send(XmlNodeIq(_T("set"), SerialNext())
- << XCHILDNS(_T("auto"), JABBER_FEAT_ARCHIVE) << XATTR(_T("save"), (bEnable) ? _T("true") : _T("false")));
+ m_ThreadInfo->send(XmlNodeIq(L"set", SerialNext())
+ << XCHILDNS(L"auto", JABBER_FEAT_ARCHIVE) << XATTR(L"save", (bEnable) ? L"true" : L"false"));
}
void CJabberProto::RetrieveMessageArchive(MCONTACT hContact, JABBER_LIST_ITEM *pItem)
@@ -45,38 +45,38 @@ void CJabberProto::RetrieveMessageArchive(MCONTACT hContact, JABBER_LIST_ITEM *p
pItem->bHistoryRead = true;
XmlNodeIq iq(AddIQ(&CJabberProto::OnIqResultGetCollectionList, JABBER_IQ_TYPE_GET));
- HXML list = iq << XCHILDNS(_T("list"), JABBER_FEAT_ARCHIVE) << XATTR(_T("with"), pItem->jid);
+ HXML list = iq << XCHILDNS(L"list", JABBER_FEAT_ARCHIVE) << XATTR(L"with", pItem->jid);
time_t tmLast = getDword(hContact, "LastCollection", 0);
if (tmLast) {
TCHAR buf[40];
- list << XATTR(_T("start"), time2str(tmLast, buf, _countof(buf)));
+ list << XATTR(L"start", time2str(tmLast, buf, _countof(buf)));
}
m_ThreadInfo->send(iq);
}
void CJabberProto::OnIqResultGetCollectionList(HXML iqNode, CJabberIqInfo*)
{
- const TCHAR *to = XmlGetAttrValue(iqNode, _T("to"));
- if (to == NULL || mir_tstrcmp(XmlGetAttrValue(iqNode, _T("type")), _T("result")))
+ const TCHAR *to = XmlGetAttrValue(iqNode, L"to");
+ if (to == NULL || mir_tstrcmp(XmlGetAttrValue(iqNode, L"type"), L"result"))
return;
HXML list = XmlGetChild(iqNode, "list");
- if (!list || mir_tstrcmp(XmlGetAttrValue(list, _T("xmlns")), JABBER_FEAT_ARCHIVE))
+ if (!list || mir_tstrcmp(XmlGetAttrValue(list, L"xmlns"), JABBER_FEAT_ARCHIVE))
return;
for (int nodeIdx = 1;; nodeIdx++) {
- HXML itemNode = XmlGetNthChild(list, _T("chat"), nodeIdx);
+ HXML itemNode = XmlGetNthChild(list, L"chat", nodeIdx);
if (!itemNode)
break;
- const TCHAR* start = XmlGetAttrValue(itemNode, _T("start"));
- const TCHAR* with = XmlGetAttrValue(itemNode, _T("with"));
+ const TCHAR* start = XmlGetAttrValue(itemNode, L"start");
+ const TCHAR* with = XmlGetAttrValue(itemNode, L"with");
if (!start || !with)
continue;
m_ThreadInfo->send(XmlNodeIq(AddIQ(&CJabberProto::OnIqResultGetCollection, JABBER_IQ_TYPE_GET))
- << XCHILDNS(_T("retrieve"), JABBER_FEAT_ARCHIVE) << XATTR(_T("with"), with) << XATTR(_T("start"), start));
+ << XCHILDNS(L"retrieve", JABBER_FEAT_ARCHIVE) << XATTR(L"with", with) << XATTR(L"start", start));
}
}
@@ -221,15 +221,15 @@ BOOL IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO& dbei)
void CJabberProto::OnIqResultGetCollection(HXML iqNode, CJabberIqInfo*)
{
- if (mir_tstrcmp(XmlGetAttrValue(iqNode, _T("type")), _T("result")))
+ if (mir_tstrcmp(XmlGetAttrValue(iqNode, L"type"), L"result"))
return;
HXML chatNode = XmlGetChild(iqNode, "chat");
- if (!chatNode || mir_tstrcmp(XmlGetAttrValue(chatNode, _T("xmlns")), JABBER_FEAT_ARCHIVE))
+ if (!chatNode || mir_tstrcmp(XmlGetAttrValue(chatNode, L"xmlns"), JABBER_FEAT_ARCHIVE))
return;
- const TCHAR* start = XmlGetAttrValue(chatNode, _T("start"));
- const TCHAR* with = XmlGetAttrValue(chatNode, _T("with"));
+ const TCHAR* start = XmlGetAttrValue(chatNode, L"start");
+ const TCHAR* with = XmlGetAttrValue(chatNode, L"with");
if (!start || !with)
return;
@@ -249,9 +249,9 @@ void CJabberProto::OnIqResultGetCollection(HXML iqNode, CJabberIqInfo*)
int from;
const TCHAR *itemName = XmlGetName(itemNode);
- if (!mir_tstrcmp(itemName, _T("to")))
+ if (!mir_tstrcmp(itemName, L"to"))
from = DBEF_SENT;
- else if (!mir_tstrcmp(itemName, _T("from")))
+ else if (!mir_tstrcmp(itemName, L"from"))
from = 0;
else
continue;
@@ -261,7 +261,7 @@ void CJabberProto::OnIqResultGetCollection(HXML iqNode, CJabberIqInfo*)
continue;
const TCHAR *tszBody = XmlGetText(body);
- const TCHAR *tszSecs = XmlGetAttrValue(itemNode, _T("secs"));
+ const TCHAR *tszSecs = XmlGetAttrValue(itemNode, L"secs");
if (!tszBody || !tszSecs)
continue;
diff --git a/protocols/JabberG/src/jabber_bookmarks.cpp b/protocols/JabberG/src/jabber_bookmarks.cpp
index 2106a4b2c7..362e300e89 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, _T("conference"))) {
+ if (!mir_tstrcmp(item->type, L"conference")) {
if (!_tcschr(item->jid, _T('@'))) { //no room name - consider it is transport
CheckDlgButton(hwndDlg, IDC_AGENT_RADIO, BST_CHECKED);
EnableWindow(GetDlgItem(hwndDlg, IDC_NICK), FALSE);
@@ -118,9 +118,9 @@ 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, _T("url"));
+ replaceStrT(item->type, L"url");
else
- replaceStrT(item->type, _T("conference"));
+ replaceStrT(item->type, L"conference");
GetDlgItemText(hwndDlg, IDC_NICK, text, _countof(text));
replaceStrT(item->nick, text);
@@ -265,7 +265,7 @@ void CJabberDlgBookmarks::UpdateData()
m_proto->m_ThreadInfo->send(
XmlNodeIq( m_proto->AddIQ(&CJabberProto::OnIqResultDiscoBookmarks, JABBER_IQ_TYPE_GET))
- << XQUERY(JABBER_FEAT_PRIVATE_STORAGE) << XCHILDNS(_T("storage"), _T("storage:bookmarks")));
+ << XQUERY(JABBER_FEAT_PRIVATE_STORAGE) << XCHILDNS(L"storage", L"storage:bookmarks"));
}
void CJabberDlgBookmarks::OnInitDialog()
@@ -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, _T("conference"))) {
+ if (!mir_tstrcmpi(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 */
@@ -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, _T("conference")) ? 1 : 0;
+ int itemType = mir_tstrcmpi(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 02c7e6b611..8059f3a1bd 100644
--- a/protocols/JabberG/src/jabber_byte.cpp
+++ b/protocols/JabberG/src/jabber_byte.cpp
@@ -60,13 +60,13 @@ void CJabberProto::IqResultProxyDiscovery(HXML iqNode, CJabberIqInfo *pInfo)
if (pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT) {
HXML queryNode = XmlGetChild(iqNode , "query");
if (queryNode) {
- const TCHAR *queryXmlns = XmlGetAttrValue(queryNode, _T("xmlns"));
+ const TCHAR *queryXmlns = XmlGetAttrValue(queryNode, L"xmlns");
if (queryXmlns && !mir_tstrcmp(queryXmlns, JABBER_FEAT_BYTESTREAMS)) {
HXML streamHostNode = XmlGetChild(queryNode , "streamhost");
if (streamHostNode) {
- const TCHAR *streamJid = XmlGetAttrValue(streamHostNode, _T("jid"));
- const TCHAR *streamHost = XmlGetAttrValue(streamHostNode, _T("host"));
- const TCHAR *streamPort = XmlGetAttrValue(streamHostNode, _T("port"));
+ const TCHAR *streamJid = XmlGetAttrValue(streamHostNode, L"jid");
+ const TCHAR *streamHost = XmlGetAttrValue(streamHostNode, L"host");
+ const TCHAR *streamPort = XmlGetAttrValue(streamHostNode, L"port");
if (streamJid && streamHost && streamPort) {
jbt->szProxyHost = mir_tstrdup(streamHost);
jbt->szProxyJid = mir_tstrdup(streamJid);
@@ -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, _T("%u"), connInfo.wPort);
+ mir_sntprintf(szPort, L"%u", connInfo.wPort);
ppro->debugLogA("bytestream_send_connection incoming connection accepted: %s", connInfo.szIpPort);
if ((item = ppro->ListGetItemPtr(LIST_BYTE, szPort)) == NULL) {
@@ -187,7 +187,7 @@ void CJabberProto::ByteSendThread(JABBER_BYTE_TRANSFER *jbt)
nIqId = pInfo->GetIqId();
{
XmlNodeIq iq(pInfo);
- HXML query = iq << XQUERY(JABBER_FEAT_BYTESTREAMS) << XATTR(_T("sid"), jbt->sid);
+ HXML query = iq << XQUERY(JABBER_FEAT_BYTESTREAMS) << XATTR(L"sid", jbt->sid);
if (bDirect) {
ptrA localAddr;
@@ -209,24 +209,24 @@ void CJabberProto::ByteSendThread(JABBER_BYTE_TRANSFER *jbt)
if (localAddr == NULL)
localAddr = (char*)CallService(MS_NETLIB_ADDRESSTOSTRING, 1, nlb.dwExternalIP);
- mir_sntprintf(szPort, _T("%d"), nlb.wPort);
+ mir_sntprintf(szPort, L"%d", nlb.wPort);
JABBER_LIST_ITEM *item = ListAdd(LIST_BYTE, szPort);
item->jbt = jbt;
hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
jbt->hEvent = hEvent;
jbt->hSendEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
- query << XCHILD(_T("streamhost")) << XATTR(_T("jid"), m_ThreadInfo->fullJID) << XATTR(_T("host"), _A2T(localAddr)) << XATTRI(_T("port"), nlb.wPort);
+ query << XCHILD(L"streamhost") << XATTR(L"jid", m_ThreadInfo->fullJID) << XATTR(L"host", _A2T(localAddr)) << XATTRI(L"port", nlb.wPort);
NETLIBIPLIST* ihaddr = (NETLIBIPLIST*)CallService(MS_NETLIB_GETMYIP, 1, 0);
for (unsigned i=0; i < ihaddr->cbNum; i++)
if (mir_strcmp(localAddr, ihaddr->szIp[i]))
- query << XCHILD(_T("streamhost")) << XATTR(_T("jid"), m_ThreadInfo->fullJID) << XATTR(_T("host"), _A2T(ihaddr->szIp[i])) << XATTRI(_T("port"), nlb.wPort);
+ query << XCHILD(L"streamhost") << XATTR(L"jid", m_ThreadInfo->fullJID) << XATTR(L"host", _A2T(ihaddr->szIp[i])) << XATTRI(L"port", nlb.wPort);
mir_free(ihaddr);
}
if (jbt->bProxyDiscovered)
- query << XCHILD(_T("streamhost")) << XATTR(_T("jid"), jbt->szProxyJid) << XATTR(_T("host"), jbt->szProxyHost) << XATTR(_T("port"), jbt->szProxyPort);
+ query << XCHILD(L"streamhost") << XATTR(L"jid", jbt->szProxyJid) << XATTR(L"host", jbt->szProxyHost) << XATTR(L"port", jbt->szProxyPort);
jbt->hProxyEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
jbt->szStreamhostUsed = NULL;
@@ -299,11 +299,11 @@ void CJabberProto::ByteInitiateResult(HXML iqNode, CJabberIqInfo *pInfo)
if (pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT) {
HXML queryNode = XmlGetChild(iqNode , "query");
if (queryNode) {
- const TCHAR *queryXmlns = XmlGetAttrValue(queryNode, _T("xmlns"));
+ const TCHAR *queryXmlns = XmlGetAttrValue(queryNode, L"xmlns");
if (queryXmlns && !mir_tstrcmp(queryXmlns, JABBER_FEAT_BYTESTREAMS)) {
HXML streamHostNode = XmlGetChild(queryNode , "streamhost-used");
if (streamHostNode) {
- const TCHAR *streamJid = XmlGetAttrValue(streamHostNode, _T("jid"));
+ const TCHAR *streamJid = XmlGetAttrValue(streamHostNode, L"jid");
if (streamJid)
jbt->szStreamhostUsed = mir_tstrdup(streamJid);
} } } }
@@ -364,7 +364,7 @@ int CJabberProto::ByteSendParse(HANDLE hConn, JABBER_BYTE_TRANSFER *jbt, char* b
TCHAR *szInitiatorJid = JabberPrepareJid(jbt->srcJID);
TCHAR *szTargetJid = JabberPrepareJid(jbt->dstJID);
- mir_sntprintf(text, _T("%s%s%s"), jbt->sid, szInitiatorJid, szTargetJid);
+ mir_sntprintf(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);
TCHAR listJid[JABBER_MAX_JID_LEN];
- mir_sntprintf(listJid, _T("ftproxy_%d"), id);
+ mir_sntprintf(listJid, L"ftproxy_%d", id);
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_FTIQID, listJid);
if (item == NULL)
return;
- if (!mir_tstrcmp(XmlGetAttrValue(iqNode, _T("type")), _T("result")))
+ if (!mir_tstrcmp(XmlGetAttrValue(iqNode, L"type"), L"result"))
item->jbt->bStreamActivated = TRUE;
if (item->jbt->hProxyEvent)
@@ -433,9 +433,9 @@ void CJabberProto::ByteSendViaProxy(JABBER_BYTE_TRANSFER *jbt)
if (jbt == NULL) return;
if ((buffer=(char*)mir_alloc(JABBER_NETWORK_BUFFER_SIZE)) == NULL) {
- m_ThreadInfo->send( XmlNodeIq(_T("error"), jbt->iqId, jbt->srcJID)
- << XCHILD(_T("error")) << XATTRI(_T("code"), 406) << XATTR(_T("type"), _T("auth"))
- << XCHILDNS(_T("not-acceptable"), _T("urn:ietf:params:xml:ns:xmpp-stanzas")));
+ m_ThreadInfo->send( XmlNodeIq(L"error", jbt->iqId, jbt->srcJID)
+ << XCHILD(L"error") << XATTRI(L"code", 406) << XATTR(L"type", L"auth")
+ << XCHILDNS(L"not-acceptable", L"urn:ietf:params:xml:ns:xmpp-stanzas"));
return;
}
@@ -482,9 +482,9 @@ void CJabberProto::ByteSendViaProxy(JABBER_BYTE_TRANSFER *jbt)
(this->*jbt->pfnFinal)((jbt->state == JBT_DONE) ? TRUE : FALSE, jbt->ft);
jbt->ft = NULL;
if (!validStreamhost)
- m_ThreadInfo->send( XmlNodeIq(_T("error"), jbt->iqId, jbt->srcJID)
- << XCHILD(_T("error")) << XATTRI(_T("code"), 404) << XATTR(_T("type"), _T("cancel"))
- << XCHILDNS(_T("item-not-found"), _T("urn:ietf:params:xml:ns:xmpp-stanzas")));
+ m_ThreadInfo->send( XmlNodeIq(L"error", jbt->iqId, jbt->srcJID)
+ << XCHILD(L"error") << XATTRI(L"code", 404) << XATTR(L"type", L"cancel")
+ << XCHILDNS(L"item-not-found", L"urn:ietf:params:xml:ns:xmpp-stanzas"));
}
int CJabberProto::ByteSendProxyParse(HANDLE hConn, JABBER_BYTE_TRANSFER *jbt, char* buffer, int datalen)
@@ -513,7 +513,7 @@ int CJabberProto::ByteSendProxyParse(HANDLE hConn, JABBER_BYTE_TRANSFER *jbt, ch
TCHAR *szInitiatorJid = JabberPrepareJid(jbt->srcJID);
TCHAR *szTargetJid = JabberPrepareJid(jbt->dstJID);
- mir_sntprintf(text, _T("%s%s%s"), jbt->sid, szInitiatorJid, szTargetJid);
+ mir_sntprintf(text, L"%s%s%s", jbt->sid, szInitiatorJid, szTargetJid);
mir_free(szInitiatorJid);
mir_free(szTargetJid);
@@ -556,14 +556,14 @@ int CJabberProto::ByteSendProxyParse(HANDLE hConn, JABBER_BYTE_TRANSFER *jbt, ch
int iqId = SerialNext();
TCHAR listJid[256];
- mir_sntprintf(listJid, _T("ftproxy_%d"), iqId);
+ mir_sntprintf(listJid, L"ftproxy_%d", iqId);
JABBER_LIST_ITEM *item = ListAdd(LIST_FTIQID, listJid);
item->jbt = jbt;
m_ThreadInfo->send(
XmlNodeIq(AddIQ(&CJabberProto::IqResultStreamActivate, JABBER_IQ_TYPE_SET, jbt->streamhostJID, 0, iqId))
- << XQUERY(JABBER_FEAT_BYTESTREAMS) << XATTR(_T("sid"), jbt->sid) << XCHILD(_T("activate"), jbt->dstJID));
+ << XQUERY(JABBER_FEAT_BYTESTREAMS) << XATTR(L"sid", jbt->sid) << XCHILD(L"activate", jbt->dstJID));
WaitForSingleObject(jbt->hProxyEvent, INFINITE);
@@ -602,13 +602,13 @@ void __cdecl CJabberProto::ByteReceiveThread(JABBER_BYTE_TRANSFER *jbt)
jbt->state = JBT_INIT;
if (iqNode = jbt->iqNode) {
- from = XmlGetAttrValue(iqNode, _T("from"));
- to = XmlGetAttrValue(iqNode, _T("to"));
- szId = XmlGetAttrValue(iqNode, _T("id"));
+ from = XmlGetAttrValue(iqNode, L"from");
+ to = XmlGetAttrValue(iqNode, L"to");
+ szId = XmlGetAttrValue(iqNode, L"id");
queryNode = XmlGetChild(iqNode, "query");
if (queryNode)
- sid = XmlGetAttrValue(queryNode, _T("sid"));
+ sid = XmlGetAttrValue(queryNode, L"sid");
}
if (szId && from && to && sid && (n = XmlGetChild(queryNode, "streamhost")) != NULL) {
@@ -618,15 +618,15 @@ void __cdecl CJabberProto::ByteReceiveThread(JABBER_BYTE_TRANSFER *jbt)
jbt->sid = mir_tstrdup(sid);
if ((buffer = (char*)mir_alloc(JABBER_NETWORK_BUFFER_SIZE))) {
- for (i = 1; (n = XmlGetNthChild(queryNode, _T("streamhost"), i)) != NULL; i++) {
- if ((szHost = XmlGetAttrValue(n, _T("host"))) != NULL &&
- (szPort = XmlGetAttrValue(n, _T("port"))) != NULL &&
- (str = XmlGetAttrValue(n, _T("jid"))) != NULL) {
+ for (i = 1; (n = XmlGetNthChild(queryNode, L"streamhost", i)) != NULL; i++) {
+ if ((szHost = XmlGetAttrValue(n, L"host")) != NULL &&
+ (szPort = XmlGetAttrValue(n, L"port")) != NULL &&
+ (str = XmlGetAttrValue(n, L"jid")) != NULL) {
port = (WORD)_ttoi(szPort);
replaceStrT(jbt->streamhostJID, str);
- debugLog(_T("bytestream_recv connecting to %s:%d"), szHost, port);
+ debugLog(L"bytestream_recv connecting to %s:%d", szHost, port);
NETLIBOPENCONNECTION nloc = { 0 };
nloc.cbSize = sizeof(nloc);
nloc.szHost = mir_t2a(szHost);
@@ -674,9 +674,9 @@ void __cdecl CJabberProto::ByteReceiveThread(JABBER_BYTE_TRANSFER *jbt)
if (!validStreamhost && szId && from) {
debugLogA("bytestream_recv_connection session not completed");
- m_ThreadInfo->send(XmlNodeIq(_T("error"), szId, from)
- << XCHILD(_T("error")) << XATTRI(_T("code"), 404) << XATTR(_T("type"), _T("cancel"))
- << XCHILDNS(_T("item-not-found"), _T("urn:ietf:params:xml:ns:xmpp-stanzas")));
+ m_ThreadInfo->send(XmlNodeIq(L"error", szId, from)
+ << XCHILD(L"error") << XATTRI(L"code", 404) << XATTR(L"type", L"cancel")
+ << XCHILDNS(L"item-not-found", L"urn:ietf:params:xml:ns:xmpp-stanzas"));
}
delete jbt;
@@ -709,7 +709,7 @@ int CJabberProto::ByteReceiveParse(HANDLE hConn, JABBER_BYTE_TRANSFER *jbt, char
{
ptrT szInitiatorJid(JabberPrepareJid(jbt->srcJID));
ptrT szTargetJid(JabberPrepareJid(jbt->dstJID));
- mir_sntprintf(text, _T("%s%s%s"), jbt->sid, szInitiatorJid, szTargetJid);
+ mir_sntprintf(text, L"%s%s%s", jbt->sid, szInitiatorJid, szTargetJid);
}
T2Utf szAuthString(text);
@@ -746,8 +746,8 @@ int CJabberProto::ByteReceiveParse(HANDLE hConn, JABBER_BYTE_TRANSFER *jbt, char
jbt->state = JBT_RECVING;
m_ThreadInfo->send(
- XmlNodeIq(_T("result"), jbt->iqId, jbt->srcJID) << XQUERY(JABBER_FEAT_BYTESTREAMS)
- << XCHILD(_T("streamhost-used")) << XATTR(_T("jid"), jbt->streamhostJID));
+ XmlNodeIq(L"result", jbt->iqId, jbt->srcJID) << XQUERY(JABBER_FEAT_BYTESTREAMS)
+ << XCHILD(L"streamhost-used") << XATTR(L"jid", jbt->streamhostJID));
}
else jbt->state = JBT_SOCKSERR;
break;
diff --git a/protocols/JabberG/src/jabber_caps.cpp b/protocols/JabberG/src/jabber_caps.cpp
index 602b47f7a7..eb859e524b 100644
--- a/protocols/JabberG/src/jabber_caps.cpp
+++ b/protocols/JabberG/src/jabber_caps.cpp
@@ -109,22 +109,22 @@ void CJabberProto::OnIqResultCapsDiscoInfoSI(HXML, CJabberIqInfo *pInfo)
if (pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT && query) {
// XEP-0232 support
HXML xform;
- for (int i = 1; (xform = XmlGetNthChild(query, _T("x"), i)) != NULL; i++) {
- TCHAR *szFormTypeValue = XPath(xform, _T("field[@var='FORM_TYPE']/value"));
- if (szFormTypeValue && !mir_tstrcmp(szFormTypeValue, _T("urn:xmpp:dataforms:softwareinfo"))) {
- TCHAR *szTmp = XPath(xform, _T("field[@var='os']/value"));
+ for (int i = 1; (xform = XmlGetNthChild(query, L"x", i)) != NULL; i++) {
+ TCHAR *szFormTypeValue = XPath(xform, L"field[@var='FORM_TYPE']/value");
+ if (szFormTypeValue && !mir_tstrcmp(szFormTypeValue, L"urn:xmpp:dataforms:softwareinfo")) {
+ TCHAR *szTmp = XPath(xform, L"field[@var='os']/value");
if (szTmp)
r->m_tszOs = mir_tstrdup(szTmp);
- szTmp = XPath(xform, _T("field[@var='os_version']/value"));
+ szTmp = XPath(xform, L"field[@var='os_version']/value");
if (szTmp)
r->m_tszOsVersion = mir_tstrdup(szTmp);
- szTmp = XPath(xform, _T("field[@var='software']/value"));
+ szTmp = XPath(xform, L"field[@var='software']/value");
if (szTmp)
r->m_tszSoftware = mir_tstrdup(szTmp);
- szTmp = XPath(xform, _T("field[@var='software_version']/value"));
+ szTmp = XPath(xform, L"field[@var='software_version']/value");
if (szTmp)
r->m_tszSoftwareVersion = mir_tstrdup(szTmp);
- szTmp = XPath(xform, _T("field[@var='x-miranda-core-version']/value"));
+ szTmp = XPath(xform, L"field[@var='x-miranda-core-version']/value");
if (szTmp)
r->m_tszXMirandaCoreVersion = mir_tstrdup(szTmp);
@@ -142,8 +142,8 @@ void CJabberProto::OnIqResultCapsDiscoInfo(HXML, CJabberIqInfo *pInfo)
if (pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT && query) {
JabberCapsBits jcbCaps = 0;
HXML feature;
- for (int i = 1; (feature = XmlGetNthChild(query, _T("feature"), i)) != NULL; i++) {
- const TCHAR *featureName = XmlGetAttrValue(feature, _T("var"));
+ for (int i = 1; (feature = XmlGetNthChild(query, L"feature", i)) != NULL; i++) {
+ const TCHAR *featureName = XmlGetAttrValue(feature, L"var");
if (!featureName)
continue;
@@ -201,7 +201,7 @@ JabberCapsBits CJabberProto::GetTotalJidCapabilites(const TCHAR *jid)
if (item) {
for (int i = 0; i < item->arResources.getCount(); i++) {
TCHAR szFullJid[JABBER_MAX_JID_LEN];
- mir_sntprintf(szFullJid, _T("%s/%s"), szBareJid, item->arResources[i]->m_tszResourceName);
+ mir_sntprintf(szFullJid, L"%s/%s", szBareJid, item->arResources[i]->m_tszResourceName);
JabberCapsBits jcb = GetResourceCapabilites(szFullJid, FALSE);
if (!(jcb & JABBER_RESOURCE_CAPS_ERROR))
jcbToReturn |= jcb;
@@ -240,8 +240,8 @@ JabberCapsBits CJabberProto::GetResourceCapabilites(const TCHAR *jid, BOOL appen
r->m_dwDiscoInfoRequestTime = pInfo->GetRequestTime();
TCHAR queryNode[512];
- mir_sntprintf(queryNode, _T("%s#%s"), r->m_tszCapsNode, r->m_tszCapsVer);
- m_ThreadInfo->send(XmlNodeIq(pInfo) << XQUERY(JABBER_FEAT_DISCO_INFO) << XATTR(_T("node"), queryNode));
+ mir_sntprintf(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;
}
@@ -253,7 +253,7 @@ JabberCapsBits CJabberProto::GetResourceCapabilites(const TCHAR *jid, BOOL appen
if (jcbMainCaps != JABBER_RESOURCE_CAPS_TIMEOUT && r->m_tszCapsExt) {
TCHAR *caps = mir_tstrdup(r->m_tszCapsExt);
- TCHAR *token = _tcstok(caps, _T(" "));
+ TCHAR *token = _tcstok(caps, L" ");
while (token) {
switch (jcbExtCaps = m_clientCapsManager.GetClientCaps(r->m_tszCapsNode, token)) {
case JABBER_RESOURCE_CAPS_ERROR:
@@ -268,7 +268,7 @@ JabberCapsBits CJabberProto::GetResourceCapabilites(const TCHAR *jid, BOOL appen
m_clientCapsManager.SetClientCaps(r->m_tszCapsNode, token, JABBER_RESOURCE_CAPS_IN_PROGRESS, pInfo->GetIqId());
m_ThreadInfo->send(
- XmlNodeIq(pInfo) << XQUERY(JABBER_FEAT_DISCO_INFO) << XATTR(_T("node"), CMString(FORMAT, _T("%s#%s"), r->m_tszCapsNode, token)));
+ XmlNodeIq(pInfo) << XQUERY(JABBER_FEAT_DISCO_INFO) << XATTR(L"node", CMString(FORMAT, L"%s#%s", r->m_tszCapsNode, token)));
bRequestSent = TRUE;
}
@@ -282,7 +282,7 @@ JabberCapsBits CJabberProto::GetResourceCapabilites(const TCHAR *jid, BOOL appen
jcbCaps |= jcbExtCaps;
}
- token = _tcstok(NULL, _T(" "));
+ token = _tcstok(NULL, L" ");
}
mir_free(caps);
@@ -349,17 +349,17 @@ JabberCapsBits CJabberProto::GetResourceCapabilites(const TCHAR *jid, BOOL appen
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, _T("Bombus")) || !mir_tstrcmp(r->m_tszSoftware, _T("BombusMod"))) {
+ if (!mir_tstrcmp(r->m_tszSoftware, L"Bombus") || !mir_tstrcmp(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, _T("neos"))) {
+ else if (!mir_tstrcmp(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, _T("sim"))) {
+ else if (!mir_tstrcmp(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);
}
@@ -558,12 +558,12 @@ JabberCapsBits CJabberClientCapsManager::GetClientCaps(TCHAR *szNode, TCHAR *szV
CJabberClientCaps *pClient = FindClient(szNode);
if (!pClient) {
lck.unlock();
- ppro->debugLog(_T("CAPS: get no caps for: %s, %s"), szNode, szVer);
+ ppro->debugLog(L"CAPS: get no caps for: %s, %s", szNode, szVer);
return JABBER_RESOURCE_CAPS_UNINIT;
}
JabberCapsBits jcbCaps = pClient->GetPartialCaps(szVer);
lck.unlock();
- ppro->debugLog(_T("CAPS: get caps %I64x for: %s, %s"), jcbCaps, szNode, szVer);
+ ppro->debugLog(L"CAPS: get caps %I64x for: %s, %s", jcbCaps, szNode, szVer);
return jcbCaps;
}
@@ -581,7 +581,7 @@ BOOL CJabberClientCapsManager::SetClientCaps(const TCHAR *szNode, const TCHAR *s
}
BOOL bOk = pClient->SetPartialCaps(szVer, jcbCaps, nIqId);
lck.unlock();
- ppro->debugLog(_T("CAPS: set caps %I64x for: %s, %s"), jcbCaps, szNode, szVer);
+ ppro->debugLog(L"CAPS: set caps %I64x for: %s, %s", jcbCaps, szNode, szVer);
return bOk;
}
@@ -615,7 +615,7 @@ BOOL CJabberClientCapsManager::HandleInfoRequest(HXML, CJabberIqInfo *pInfo, con
continue;
TCHAR szExtCap[ 512 ];
- mir_sntprintf(szExtCap, _T("%s#%s"), JABBER_CAPS_MIRANDA_NODE, g_JabberFeatCapPairsExt[i].szFeature);
+ mir_sntprintf(szExtCap, L"%s#%s", JABBER_CAPS_MIRANDA_NODE, g_JabberFeatCapPairsExt[i].szFeature);
if (!mir_tstrcmp(szNode, szExtCap)) {
jcb = g_JabberFeatCapPairsExt[i].jcbCap;
break;
@@ -625,7 +625,7 @@ 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++) {
TCHAR szExtCap[ 512 ];
- mir_sntprintf(szExtCap, _T("%s#%s"), JABBER_CAPS_MIRANDA_NODE, ppro->m_lstJabberFeatCapPairsDynamic[i]->szExt);
+ mir_sntprintf(szExtCap, L"%s#%s", JABBER_CAPS_MIRANDA_NODE, ppro->m_lstJabberFeatCapPairsDynamic[i]->szExt);
if (!mir_tstrcmp(szNode, szExtCap)) {
jcb = ppro->m_lstJabberFeatCapPairsDynamic[i]->jcbCap;
break;
@@ -645,22 +645,22 @@ BOOL CJabberClientCapsManager::HandleInfoRequest(HXML, CJabberIqInfo *pInfo, con
if (!ppro->m_options.AllowVersionRequests)
jcb &= ~JABBER_CAPS_VERSION;
- XmlNodeIq iq(_T("result"), pInfo);
+ XmlNodeIq iq(L"result", pInfo);
HXML query = iq << XQUERY(JABBER_FEAT_DISCO_INFO);
if (szNode)
- query << XATTR(_T("node"), szNode);
+ query << XATTR(L"node", szNode);
- query << XCHILD(_T("identity")) << XATTR(_T("category"), _T("client"))
- << XATTR(_T("type"), _T("pc")) << XATTR(_T("name"), _T("Miranda"));
+ query << XCHILD(L"identity") << XATTR(L"category", L"client")
+ << XATTR(L"type", L"pc") << XATTR(L"name", L"Miranda");
for (i=0; g_JabberFeatCapPairs[i].szFeature; i++)
if (jcb & g_JabberFeatCapPairs[i].jcbCap)
- query << XCHILD(_T("feature")) << XATTR(_T("var"), g_JabberFeatCapPairs[i].szFeature);
+ query << XCHILD(L"feature") << XATTR(L"var", g_JabberFeatCapPairs[i].szFeature);
for (i=0; i < ppro->m_lstJabberFeatCapPairsDynamic.getCount(); i++)
if (jcb & ppro->m_lstJabberFeatCapPairsDynamic[i]->jcbCap)
- query << XCHILD(_T("feature")) << XATTR(_T("var"), ppro->m_lstJabberFeatCapPairsDynamic[i]->szFeature);
+ query << XCHILD(L"feature") << XATTR(L"var", ppro->m_lstJabberFeatCapPairsDynamic[i]->szFeature);
if (ppro->m_options.AllowVersionRequests && !szNode) {
TCHAR szOsBuffer[256] = {0};
@@ -668,26 +668,26 @@ BOOL CJabberClientCapsManager::HandleInfoRequest(HXML, CJabberIqInfo *pInfo, con
if (ppro->m_options.ShowOSVersion) {
if (!GetOSDisplayString(szOsBuffer, _countof(szOsBuffer)))
- mir_tstrncpy(szOsBuffer, _T(""), _countof(szOsBuffer));
+ mir_tstrncpy(szOsBuffer, L"", _countof(szOsBuffer));
else {
- TCHAR *szOsWindows = _T("Microsoft Windows");
+ TCHAR *szOsWindows = L"Microsoft Windows";
size_t nOsWindowsLength = mir_tstrlen(szOsWindows);
if (!_tcsnicmp(szOsBuffer, szOsWindows, nOsWindowsLength))
os += nOsWindowsLength + 1;
}
}
- HXML form = query << XCHILDNS(_T("x"), JABBER_FEAT_DATA_FORMS) << XATTR(_T("type"), _T("result"));
- form << XCHILD(_T("field")) << XATTR(_T("var"), _T("FORM_TYPE")) << XATTR(_T("type"), _T("hidden"))
- << XCHILD(_T("value"), _T("urn:xmpp:dataforms:softwareinfo"));
+ HXML form = query << XCHILDNS(L"x", JABBER_FEAT_DATA_FORMS) << XATTR(L"type", L"result");
+ form << XCHILD(L"field") << XATTR(L"var", L"FORM_TYPE") << XATTR(L"type", L"hidden")
+ << XCHILD(L"value", L"urn:xmpp:dataforms:softwareinfo");
if (ppro->m_options.ShowOSVersion) {
- form << XCHILD(_T("field")) << XATTR(_T("var"), _T("os")) << XCHILD(_T("value"), _T("Microsoft Windows"));
- form << XCHILD(_T("field")) << XATTR(_T("var"), _T("os_version")) << XCHILD(_T("value"), os);
+ form << XCHILD(L"field") << XATTR(L"var", L"os") << XCHILD(L"value", L"Microsoft Windows");
+ form << XCHILD(L"field") << XATTR(L"var", L"os_version") << XCHILD(L"value", os);
}
- form << XCHILD(_T("field")) << XATTR(_T("var"), _T("software")) << XCHILD(_T("value"), _T("Miranda NG Jabber Protocol"));
- form << XCHILD(_T("field")) << XATTR(_T("var"), _T("software_version")) << XCHILD(_T("value"), _T(__VERSION_STRING_DOTS));
- form << XCHILD(_T("field")) << XATTR(_T("var"), _T("x-miranda-core-version")) << XCHILD(_T("value"), szCoreVersion);
+ form << XCHILD(L"field") << XATTR(L"var", L"software") << XCHILD(L"value", L"Miranda NG Jabber Protocol");
+ form << XCHILD(L"field") << XATTR(L"var", L"software_version") << XCHILD(L"value", _T(__VERSION_STRING_DOTS));
+ form << XCHILD(L"field") << XATTR(L"var", L"x-miranda-core-version") << XCHILD(L"value", szCoreVersion);
}
ppro->m_ThreadInfo->send(iq);
diff --git a/protocols/JabberG/src/jabber_caps.h b/protocols/JabberG/src/jabber_caps.h
index 6546d9e0f6..d9ed0422c4 100644
--- a/protocols/JabberG/src/jabber_caps.h
+++ b/protocols/JabberG/src/jabber_caps.h
@@ -46,116 +46,116 @@ typedef unsigned __int64 JabberCapsBits;
#define JABBER_RESOURCE_CAPS_NONE 0x0000000000000000
#endif
-#define JABBER_FEAT_DISCO_INFO _T("http://jabber.org/protocol/disco#info")
+#define JABBER_FEAT_DISCO_INFO L"http://jabber.org/protocol/disco#info"
#define JABBER_CAPS_DISCO_INFO ((JabberCapsBits)1)
-#define JABBER_FEAT_DISCO_ITEMS _T("http://jabber.org/protocol/disco#items")
+#define JABBER_FEAT_DISCO_ITEMS L"http://jabber.org/protocol/disco#items"
#define JABBER_CAPS_DISCO_ITEMS ((JabberCapsBits)1<<1)
-#define JABBER_FEAT_ENTITY_CAPS _T("http://jabber.org/protocol/caps")
+#define JABBER_FEAT_ENTITY_CAPS L"http://jabber.org/protocol/caps"
#define JABBER_CAPS_ENTITY_CAPS ((JabberCapsBits)1<<2)
-#define JABBER_FEAT_SI _T("http://jabber.org/protocol/si")
+#define JABBER_FEAT_SI L"http://jabber.org/protocol/si"
#define JABBER_CAPS_SI ((JabberCapsBits)1<<3)
-#define JABBER_FEAT_SI_FT _T("http://jabber.org/protocol/si/profile/file-transfer")
+#define JABBER_FEAT_SI_FT L"http://jabber.org/protocol/si/profile/file-transfer"
#define JABBER_CAPS_SI_FT ((JabberCapsBits)1<<4)
-#define JABBER_FEAT_BYTESTREAMS _T("http://jabber.org/protocol/bytestreams")
+#define JABBER_FEAT_BYTESTREAMS L"http://jabber.org/protocol/bytestreams"
#define JABBER_CAPS_BYTESTREAMS ((JabberCapsBits)1<<5)
-#define JABBER_FEAT_IBB _T("http://jabber.org/protocol/ibb")
+#define JABBER_FEAT_IBB L"http://jabber.org/protocol/ibb"
#define JABBER_CAPS_IBB ((JabberCapsBits)1<<6)
-#define JABBER_FEAT_OOB _T("jabber:iq:oob")
-#define JABBER_FEAT_OOB2 _T("jabber:x:oob")
+#define JABBER_FEAT_OOB L"jabber:iq:oob"
+#define JABBER_FEAT_OOB2 L"jabber:x:oob"
#define JABBER_CAPS_OOB ((JabberCapsBits)1<<7)
-#define JABBER_FEAT_COMMANDS _T("http://jabber.org/protocol/commands")
+#define JABBER_FEAT_COMMANDS L"http://jabber.org/protocol/commands"
#define JABBER_CAPS_COMMANDS ((JabberCapsBits)1<<8)
-#define JABBER_FEAT_REGISTER _T("jabber:iq:register")
+#define JABBER_FEAT_REGISTER L"jabber:iq:register"
#define JABBER_CAPS_REGISTER ((JabberCapsBits)1<<9)
-#define JABBER_FEAT_MUC _T("http://jabber.org/protocol/muc")
+#define JABBER_FEAT_MUC L"http://jabber.org/protocol/muc"
#define JABBER_CAPS_MUC ((JabberCapsBits)1<<10)
-#define JABBER_FEAT_CHATSTATES _T("http://jabber.org/protocol/chatstates")
+#define JABBER_FEAT_CHATSTATES L"http://jabber.org/protocol/chatstates"
#define JABBER_CAPS_CHATSTATES ((JabberCapsBits)1<<11)
-#define JABBER_FEAT_LAST_ACTIVITY _T("jabber:iq:last")
+#define JABBER_FEAT_LAST_ACTIVITY L"jabber:iq:last"
#define JABBER_CAPS_LAST_ACTIVITY ((JabberCapsBits)1<<12)
-#define JABBER_FEAT_VERSION _T("jabber:iq:version")
+#define JABBER_FEAT_VERSION L"jabber:iq:version"
#define JABBER_CAPS_VERSION ((JabberCapsBits)1<<13)
-#define JABBER_FEAT_ENTITY_TIME _T("urn:xmpp:time")
+#define JABBER_FEAT_ENTITY_TIME L"urn:xmpp:time"
#define JABBER_CAPS_ENTITY_TIME ((JabberCapsBits)1<<14)
-#define JABBER_FEAT_PING _T("urn:xmpp:ping")
+#define JABBER_FEAT_PING L"urn:xmpp:ping"
#define JABBER_CAPS_PING ((JabberCapsBits)1<<15)
-#define JABBER_FEAT_DATA_FORMS _T("jabber:x:data")
+#define JABBER_FEAT_DATA_FORMS L"jabber:x:data"
#define JABBER_CAPS_DATA_FORMS ((JabberCapsBits)1<<16)
-#define JABBER_FEAT_MESSAGE_EVENTS _T("jabber:x:event")
+#define JABBER_FEAT_MESSAGE_EVENTS L"jabber:x:event"
#define JABBER_CAPS_MESSAGE_EVENTS ((JabberCapsBits)1<<17)
-#define JABBER_FEAT_VCARD_TEMP _T("vcard-temp")
+#define JABBER_FEAT_VCARD_TEMP L"vcard-temp"
#define JABBER_CAPS_VCARD_TEMP ((JabberCapsBits)1<<18)
-#define JABBER_FEAT_AVATAR _T("jabber:iq:avatar")
-#define JABBER_FEAT_SERVER_AVATAR _T("storage:client:avatar")
+#define JABBER_FEAT_AVATAR L"jabber:iq:avatar"
+#define JABBER_FEAT_SERVER_AVATAR L"storage:client:avatar"
#define JABBER_CAPS_AVATAR ((JabberCapsBits)1<<19)
-#define JABBER_FEAT_XHTML _T("http://jabber.org/protocol/xhtml-im")
+#define JABBER_FEAT_XHTML L"http://jabber.org/protocol/xhtml-im"
#define JABBER_CAPS_XHTML ((JabberCapsBits)1<<20)
-#define JABBER_FEAT_AGENTS _T("jabber:iq:agents")
+#define JABBER_FEAT_AGENTS L"jabber:iq:agents"
#define JABBER_CAPS_AGENTS ((JabberCapsBits)1<<21)
-#define JABBER_FEAT_BROWSE _T("jabber:iq:browse")
+#define JABBER_FEAT_BROWSE L"jabber:iq:browse"
#define JABBER_CAPS_BROWSE ((JabberCapsBits)1<<22)
-#define JABBER_FEAT_FEATURE_NEG _T("http://jabber.org/protocol/feature-neg")
+#define JABBER_FEAT_FEATURE_NEG L"http://jabber.org/protocol/feature-neg"
#define JABBER_CAPS_FEATURE_NEG ((JabberCapsBits)1<<23)
-#define JABBER_FEAT_AMP _T("http://jabber.org/protocol/amp")
+#define JABBER_FEAT_AMP L"http://jabber.org/protocol/amp"
#define JABBER_CAPS_AMP ((JabberCapsBits)1<<24)
-#define JABBER_FEAT_USER_MOOD _T("http://jabber.org/protocol/mood")
+#define JABBER_FEAT_USER_MOOD L"http://jabber.org/protocol/mood"
#define JABBER_CAPS_USER_MOOD ((JabberCapsBits)1<<25)
-#define JABBER_FEAT_USER_MOOD_NOTIFY _T("http://jabber.org/protocol/mood+notify")
+#define JABBER_FEAT_USER_MOOD_NOTIFY L"http://jabber.org/protocol/mood+notify"
#define JABBER_CAPS_USER_MOOD_NOTIFY ((JabberCapsBits)1<<26)
-#define JABBER_FEAT_PUBSUB _T("http://jabber.org/protocol/pubsub")
+#define JABBER_FEAT_PUBSUB L"http://jabber.org/protocol/pubsub"
#define JABBER_CAPS_PUBSUB ((JabberCapsBits)1<<27)
-#define JABBER_FEAT_SECUREIM _T("http://miranda-ng.org/caps/secureim")
+#define JABBER_FEAT_SECUREIM L"http://miranda-ng.org/caps/secureim"
#define JABBER_CAPS_SECUREIM ((JabberCapsBits)1<<28)
-#define JABBER_FEAT_MIROTR _T("http://miranda-ng.org/caps/mirotr")
+#define JABBER_FEAT_MIROTR L"http://miranda-ng.org/caps/mirotr"
#define JABBER_CAPS_MIROTR ((JabberCapsBits)1<<42)
-#define JABBER_FEAT_NEWGPG _T("http://miranda-ng.org/caps/new_gpg")
+#define JABBER_FEAT_NEWGPG L"http://miranda-ng.org/caps/new_gpg"
#define JABBER_CAPS_NEWGPG ((JabberCapsBits)1<<43)
#define JABBER_CAPS_PLATFORMX86 ((JabberCapsBits)1<<44)
#define JABBER_CAPS_PLATFORMX64 ((JabberCapsBits)1<<45)
-#define JABBER_FEAT_PRIVACY_LISTS _T("jabber:iq:privacy")
+#define JABBER_FEAT_PRIVACY_LISTS L"jabber:iq:privacy"
#define JABBER_CAPS_PRIVACY_LISTS ((JabberCapsBits)1<<29)
-#define JABBER_FEAT_MESSAGE_RECEIPTS _T("urn:xmpp:receipts")
+#define JABBER_FEAT_MESSAGE_RECEIPTS L"urn:xmpp:receipts"
#define JABBER_CAPS_MESSAGE_RECEIPTS ((JabberCapsBits)1<<30)
-#define JABBER_FEAT_USER_TUNE _T("http://jabber.org/protocol/tune")
+#define JABBER_FEAT_USER_TUNE L"http://jabber.org/protocol/tune"
#define JABBER_CAPS_USER_TUNE ((JabberCapsBits)1<<31)
-#define JABBER_FEAT_USER_TUNE_NOTIFY _T("http://jabber.org/protocol/tune+notify")
+#define JABBER_FEAT_USER_TUNE_NOTIFY L"http://jabber.org/protocol/tune+notify"
#define JABBER_CAPS_USER_TUNE_NOTIFY ((JabberCapsBits)1<<32)
-#define JABBER_FEAT_PRIVATE_STORAGE _T("jabber:iq:private")
+#define JABBER_FEAT_PRIVATE_STORAGE L"jabber:iq:private"
#define JABBER_CAPS_PRIVATE_STORAGE ((JabberCapsBits)1<<33)
-#define JABBER_FEAT_ARCHIVE _T("urn:xmpp:archive")
-#define JABBER_FEAT_ARCHIVE_AUTO _T("urn:xmpp:archive:auto")
+#define JABBER_FEAT_ARCHIVE L"urn:xmpp:archive"
+#define JABBER_FEAT_ARCHIVE_AUTO L"urn:xmpp:archive:auto"
#define JABBER_CAPS_ARCHIVE_AUTO ((JabberCapsBits)1<<34)
-#define JABBER_FEAT_ARCHIVE_MANAGE _T("urn:xmpp:archive:manage")
+#define JABBER_FEAT_ARCHIVE_MANAGE L"urn:xmpp:archive:manage"
#define JABBER_CAPS_ARCHIVE_MANAGE ((JabberCapsBits)1<<35)
-#define JABBER_FEAT_CAPTCHA _T("urn:xmpp:captcha")
+#define JABBER_FEAT_CAPTCHA L"urn:xmpp:captcha"
-#define JABBER_FEAT_ATTENTION _T("urn:xmpp:attention:0")
+#define JABBER_FEAT_ATTENTION L"urn:xmpp:attention:0"
#define JABBER_CAPS_ATTENTION ((JabberCapsBits)1<<36)
// deferred
-#define JABBER_FEAT_USER_ACTIVITY _T("http://jabber.org/protocol/activity")
+#define JABBER_FEAT_USER_ACTIVITY L"http://jabber.org/protocol/activity"
#define JABBER_CAPS_USER_ACTIVITY ((JabberCapsBits)1<<37)
-#define JABBER_FEAT_USER_ACTIVITY_NOTIFY _T("http://jabber.org/protocol/activity+notify")
+#define JABBER_FEAT_USER_ACTIVITY_NOTIFY L"http://jabber.org/protocol/activity+notify"
#define JABBER_CAPS_USER_ACTIVITY_NOTIFY ((JabberCapsBits)1<<38)
-#define JABBER_FEAT_MIRANDA_NOTES _T("http://miranda-ng.org/storage#notes")
+#define JABBER_FEAT_MIRANDA_NOTES L"http://miranda-ng.org/storage#notes"
#define JABBER_CAPS_MIRANDA_NOTES ((JabberCapsBits)1<<39)
-#define JABBER_FEAT_JINGLE _T("urn:xmpp:jingle:1")
+#define JABBER_FEAT_JINGLE L"urn:xmpp:jingle:1"
#define JABBER_CAPS_JINGLE ((JabberCapsBits)1<<40)
-#define JABBER_FEAT_ROSTER_EXCHANGE _T("http://jabber.org/protocol/rosterx")
+#define JABBER_FEAT_ROSTER_EXCHANGE L"http://jabber.org/protocol/rosterx"
#define JABBER_CAPS_ROSTER_EXCHANGE ((JabberCapsBits)1<<41)
-#define JABBER_FEAT_DIRECT_MUC_INVITE _T("jabber:x:conference")
+#define JABBER_FEAT_DIRECT_MUC_INVITE L"jabber:x:conference"
#define JABBER_CAPS_DIRECT_MUC_INVITE ((JabberCapsBits)1<<42)
-#define JABBER_FEAT_PUBSUB_EVENT _T("http://jabber.org/protocol/pubsub#event")
-#define JABBER_FEAT_PUBSUB_NODE_CONFIG _T("http://jabber.org/protocol/pubsub#node_config")
+#define JABBER_FEAT_PUBSUB_EVENT L"http://jabber.org/protocol/pubsub#event"
+#define JABBER_FEAT_PUBSUB_NODE_CONFIG L"http://jabber.org/protocol/pubsub#node_config"
#define JABBER_CAPS_MESSAGE_EVENTS_NO_DELIVERY ((JabberCapsBits)1<<62)
#define JABBER_CAPS_OTHER_SPECIAL (JABBER_CAPS_MESSAGE_EVENTS_NO_DELIVERY|JABBER_RESOURCE_CAPS_ERROR) // must contain all the caps not listed in g_JabberFeatCapPairs, to prevent using these bits for features registered through IJabberNetInterface::RegisterFeature()
-#define JABBER_CAPS_MIRANDA_NODE _T("http://miranda-ng.org/caps")
+#define JABBER_CAPS_MIRANDA_NODE L"http://miranda-ng.org/caps"
#define JABBER_CAPS_MIRANDA_PARTIAL (JABBER_CAPS_DISCO_INFO | JABBER_CAPS_DISCO_ITEMS | JABBER_CAPS_MUC | JABBER_CAPS_ENTITY_CAPS | JABBER_CAPS_SI | JABBER_CAPS_SI_FT | \
JABBER_CAPS_BYTESTREAMS | JABBER_CAPS_IBB | JABBER_CAPS_OOB | JABBER_CAPS_CHATSTATES | JABBER_CAPS_AGENTS | JABBER_CAPS_BROWSE | \
JABBER_CAPS_VERSION | JABBER_CAPS_LAST_ACTIVITY | JABBER_CAPS_DATA_FORMS | JABBER_CAPS_MESSAGE_EVENTS | JABBER_CAPS_VCARD_TEMP | \
@@ -166,41 +166,41 @@ typedef unsigned __int64 JabberCapsBits;
JABBER_CAPS_USER_MOOD_NOTIFY | JABBER_CAPS_USER_TUNE_NOTIFY | JABBER_CAPS_USER_ACTIVITY_NOTIFY | JABBER_CAPS_PLATFORMX86 | JABBER_CAPS_PLATFORMX64)
-#define JABBER_EXT_SECUREIM _T("secureim")
-#define JABBER_EXT_MIROTR _T("mirotr")
-#define JABBER_EXT_JINGLE _T("jingle")
-#define JABBER_EXT_NEWGPG _T("new_gpg")
-#define JABBER_EXT_NUDGE _T("nudge")
-#define JABBER_EXT_COMMANDS _T("cmds")
-#define JABBER_EXT_USER_MOOD _T("mood")
-#define JABBER_EXT_USER_TUNE _T("tune")
-#define JABBER_EXT_USER_ACTIVITY _T("activity")
-#define JABBER_EXT_MIR_NOTES _T("mir_notes")
-#define JABBER_EXT_PLATFORMX86 _T("x86")
-#define JABBER_EXT_PLATFORMX64 _T("x64")
-
-#define JABBER_FEAT_EXT_ADDRESSING _T("http://jabber.org/protocol/address")
-#define JABBER_FEAT_NESTED_ROSTER_GROUPS _T("roster:delimiter")
-
-#define JABBER_FEAT_RC _T("http://jabber.org/protocol/rc")
-#define JABBER_FEAT_RC_SET_STATUS _T("http://jabber.org/protocol/rc#set-status")
-#define JABBER_FEAT_RC_SET_OPTIONS _T("http://jabber.org/protocol/rc#set-options")
-#define JABBER_FEAT_RC_FORWARD _T("http://jabber.org/protocol/rc#forward")
-#define JABBER_FEAT_RC_LEAVE_GROUPCHATS _T("http://jabber.org/protocol/rc#leave-groupchats")
-#define JABBER_FEAT_RC_WS_LOCK _T("http://miranda-ng.org/rc#lock_workstation")
-#define JABBER_FEAT_RC_QUIT_MIRANDA _T("http://miranda-ng.org/rc#quit")
-
-#define JABBER_FEAT_IQ_ROSTER _T("jabber:iq:roster")
-#define JABBER_FEAT_DELAY _T("jabber:x:delay")
-#define JABBER_FEAT_ENTITY_TIME_OLD _T("jabber:iq:time")
-
-#define JABBER_FEAT_MUC_ADMIN _T("http://jabber.org/protocol/muc#admin")
-#define JABBER_FEAT_MUC_OWNER _T("http://jabber.org/protocol/muc#owner")
-#define JABBER_FEAT_MUC_USER _T("http://jabber.org/protocol/muc#user")
-
-#define JABBER_FEAT_NICK _T("http://jabber.org/protocol/nick")
-
-#define JABBER_FEAT_HTTP_AUTH _T("http://jabber.org/protocol/http-auth")
+#define JABBER_EXT_SECUREIM L"secureim"
+#define JABBER_EXT_MIROTR L"mirotr"
+#define JABBER_EXT_JINGLE L"jingle"
+#define JABBER_EXT_NEWGPG L"new_gpg"
+#define JABBER_EXT_NUDGE L"nudge"
+#define JABBER_EXT_COMMANDS L"cmds"
+#define JABBER_EXT_USER_MOOD L"mood"
+#define JABBER_EXT_USER_TUNE L"tune"
+#define JABBER_EXT_USER_ACTIVITY L"activity"
+#define JABBER_EXT_MIR_NOTES L"mir_notes"
+#define JABBER_EXT_PLATFORMX86 L"x86"
+#define JABBER_EXT_PLATFORMX64 L"x64"
+
+#define JABBER_FEAT_EXT_ADDRESSING L"http://jabber.org/protocol/address"
+#define JABBER_FEAT_NESTED_ROSTER_GROUPS L"roster:delimiter"
+
+#define JABBER_FEAT_RC L"http://jabber.org/protocol/rc"
+#define JABBER_FEAT_RC_SET_STATUS L"http://jabber.org/protocol/rc#set-status"
+#define JABBER_FEAT_RC_SET_OPTIONS L"http://jabber.org/protocol/rc#set-options"
+#define JABBER_FEAT_RC_FORWARD L"http://jabber.org/protocol/rc#forward"
+#define JABBER_FEAT_RC_LEAVE_GROUPCHATS L"http://jabber.org/protocol/rc#leave-groupchats"
+#define JABBER_FEAT_RC_WS_LOCK L"http://miranda-ng.org/rc#lock_workstation"
+#define JABBER_FEAT_RC_QUIT_MIRANDA L"http://miranda-ng.org/rc#quit"
+
+#define JABBER_FEAT_IQ_ROSTER L"jabber:iq:roster"
+#define JABBER_FEAT_DELAY L"jabber:x:delay"
+#define JABBER_FEAT_ENTITY_TIME_OLD L"jabber:iq:time"
+
+#define JABBER_FEAT_MUC_ADMIN L"http://jabber.org/protocol/muc#admin"
+#define JABBER_FEAT_MUC_OWNER L"http://jabber.org/protocol/muc#owner"
+#define JABBER_FEAT_MUC_USER L"http://jabber.org/protocol/muc#user"
+
+#define JABBER_FEAT_NICK L"http://jabber.org/protocol/nick"
+
+#define JABBER_FEAT_HTTP_AUTH L"http://jabber.org/protocol/http-auth"
class CJabberClientPartialCaps
diff --git a/protocols/JabberG/src/jabber_captcha.cpp b/protocols/JabberG/src/jabber_captcha.cpp
index 5119579a86..53edb29bbf 100644
--- a/protocols/JabberG/src/jabber_captcha.cpp
+++ b/protocols/JabberG/src/jabber_captcha.cpp
@@ -115,7 +115,7 @@ bool CJabberProto::ProcessCaptcha(HXML node, HXML parentNode, ThreadData *info)
if (x == NULL)
return false;
- HXML y = XmlGetChildByTag(x, _T("field"), _T("var"), _T("from"));
+ HXML y = XmlGetChildByTag(x, L"field", L"var", L"from");
if (y == NULL)
return false;
if ((y = XmlGetChild(y, "value")) == NULL)
@@ -124,19 +124,19 @@ bool CJabberProto::ProcessCaptcha(HXML node, HXML parentNode, ThreadData *info)
CAPTCHA_FORM_PARAMS param;
param.fromjid = XmlGetText(y);
- if ((y = XmlGetChildByTag(x, _T("field"), _T("var"), _T("sid"))) == NULL)
+ if ((y = XmlGetChildByTag(x, L"field", L"var", L"sid")) == NULL)
return false;
if ((y = XmlGetChild(y, "value")) == NULL)
return false;
param.sid = XmlGetText(y);
- if ((y = XmlGetChildByTag(x, _T("field"), _T("var"), _T("ocr"))) == NULL)
+ if ((y = XmlGetChildByTag(x, L"field", L"var", L"ocr")) == NULL)
return false;
- param.hint = XmlGetAttrValue (y, _T("label"));
+ param.hint = XmlGetAttrValue (y, L"label");
- param.from = XmlGetAttrValue(parentNode, _T("from"));
- param.to = XmlGetAttrValue(parentNode, _T("to"));
- param.challenge = XmlGetAttrValue(parentNode, _T("id"));
+ param.from = XmlGetAttrValue(parentNode, L"from");
+ param.to = XmlGetAttrValue(parentNode, L"to");
+ param.challenge = XmlGetAttrValue(parentNode, L"id");
HXML o = XmlGetChild(parentNode, "data");
if (o == NULL || XmlGetText(o) == NULL)
return false;
@@ -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)&param);
- if (mir_tstrcmp(param.Result, _T("")) == 0 || !res)
+ if (mir_tstrcmp(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);
@@ -167,21 +167,21 @@ bool CJabberProto::ProcessCaptcha(HXML node, HXML parentNode, ThreadData *info)
void CJabberProto::sendCaptchaResult(TCHAR* buf, ThreadData *info, LPCTSTR from, LPCTSTR challenge, LPCTSTR fromjid, LPCTSTR sid)
{
- XmlNodeIq iq(_T("set"), SerialNext());
- HXML query= iq <<XATTR(_T("to"), from) << XCHILD(_T("captcha")) << XATTR(_T("xmlns"), _T("urn:xmpp:captcha")) << XCHILD (_T("x")) << XATTR(_T("xmlns"), JABBER_FEAT_DATA_FORMS) << XATTR(_T("type"), _T("submit"));
- query << XCHILD(_T("field")) << XATTR (_T("var"), _T("FORM_TYPE")) << XCHILD(_T("value"), _T("urn:xmpp:captcha"));
- query << XCHILD(_T("field")) << XATTR (_T("var"), _T("from")) << XCHILD(_T("value"), fromjid);
- query << XCHILD(_T("field")) << XATTR (_T("var"), _T("challenge")) << XCHILD(_T("value"), challenge);
- query << XCHILD(_T("field")) << XATTR (_T("var"), _T("sid")) << XCHILD(_T("value"), sid);
- query << XCHILD(_T("field")) << XATTR (_T("var"), _T("ocr")) << XCHILD(_T("value"), buf);
+ XmlNodeIq iq(L"set", SerialNext());
+ HXML query= iq <<XATTR(L"to", from) << XCHILD(L"captcha") << XATTR(L"xmlns", L"urn:xmpp:captcha") << XCHILD (L"x") << XATTR(L"xmlns", JABBER_FEAT_DATA_FORMS) << XATTR(L"type", L"submit");
+ query << XCHILD(L"field") << XATTR (L"var", L"FORM_TYPE") << XCHILD(L"value", L"urn:xmpp:captcha");
+ query << XCHILD(L"field") << XATTR (L"var", L"from") << XCHILD(L"value", fromjid);
+ query << XCHILD(L"field") << XATTR (L"var", L"challenge") << XCHILD(L"value", challenge);
+ query << XCHILD(L"field") << XATTR (L"var", L"sid") << XCHILD(L"value", sid);
+ query << XCHILD(L"field") << XATTR (L"var", L"ocr") << XCHILD(L"value", buf);
info -> send (iq);
}
void CJabberProto::sendCaptchaError(ThreadData *info, LPCTSTR from, LPCTSTR to, LPCTSTR challenge)
{
- XmlNode message(_T("message"));
- message << XATTR(_T("type"), _T("error")) << XATTR(_T("to"), from) << XATTR(_T("id"), challenge) << XATTR(_T("from"), to)
- << XCHILD(_T("error")) << XATTR(_T("type"), _T("modify"))
- << XCHILD(_T("not-acceptable")) << XATTR(_T("xmlns"), _T("urn:ietf:params:xml:ns:xmpp-stanzas"));
+ XmlNode message(L"message");
+ message << XATTR(L"type", L"error") << XATTR(L"to", from) << XATTR(L"id", challenge) << XATTR(L"from", to)
+ << XCHILD(L"error") << XATTR(L"type", L"modify")
+ << XCHILD(L"not-acceptable") << XATTR(L"xmlns", L"urn:ietf:params:xml:ns:xmpp-stanzas");
info->send(message);
}
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp
index 321bdd97f9..40cdb9168c 100644
--- a/protocols/JabberG/src/jabber_chat.cpp
+++ b/protocols/JabberG/src/jabber_chat.cpp
@@ -240,7 +240,7 @@ void CJabberProto::GcLogShowInformation(JABBER_LIST_ITEM *item, pResourceStatus
}
if (!buf.IsEmpty()) {
- buf.Replace(_T("%"), _T("%%"));
+ buf.Replace(L"%", L"%%");
GCDEST gcd = { m_szModuleName, item->jid, GC_EVENT_INFORMATION };
GCEVENT gce = { sizeof(gce), &gcd };
@@ -353,11 +353,11 @@ void CJabberProto::GcQuit(JABBER_LIST_ITEM *item, int code, HXML reason)
if (m_bJabberOnline) {
TCHAR szPresenceTo[JABBER_MAX_JID_LEN];
- mir_sntprintf(szPresenceTo, _T("%s/%s"), item->jid, item->nick);
+ mir_sntprintf(szPresenceTo, L"%s/%s", item->jid, item->nick);
m_ThreadInfo->send(
- XmlNode(_T("presence")) << XATTR(_T("to"), szPresenceTo) << XATTR(_T("type"), _T("unavailable"))
- << XCHILD(_T("status"), szMessage));
+ XmlNode(L"presence") << XATTR(L"to", szPresenceTo) << XATTR(L"type", L"unavailable")
+ << XCHILD(L"status", szMessage));
ListRemove(LIST_CHATROOM, item->jid);
}
@@ -535,8 +535,8 @@ int CJabberProto::JabberGcMenuHook(WPARAM, LPARAM lParam)
TCHAR *ptszStatusMsg = item->getTemp()->m_tszStatusMessage;
if (ptszStatusMsg && *ptszStatusMsg) {
TCHAR *bufPtr = url_buf;
- for (TCHAR *p = _tcsstr(ptszStatusMsg, _T("http")); p && *p; p = _tcsstr(p + 1, _T("http"))) {
- if (!_tcsncmp(p, _T("http://"), 7) || !_tcsncmp(p, _T("https://"), 8)) {
+ for (TCHAR *p = _tcsstr(ptszStatusMsg, L"http"); p && *p; p = _tcsstr(p + 1, L"http")) {
+ if (!_tcsncmp(p, L"http://", 7) || !_tcsncmp(p, L"https://", 8)) {
mir_tstrncpy(bufPtr, p, _countof(url_buf) - (bufPtr - url_buf));
gc_item *pItem = sttFindGcMenuItem(gcmi, idx);
pItem->pszDesc = bufPtr;
@@ -690,12 +690,12 @@ class CGroupchatInviteDlg : public CJabberDlgBase
void InviteUser(TCHAR *pUser, TCHAR *text)
{
- XmlNode msg(_T("message"));
- HXML invite = msg << XATTR(_T("to"), m_room) << XATTRID(m_proto->SerialNext())
- << XCHILDNS(_T("x"), JABBER_FEAT_MUC_USER)
- << XCHILD(_T("invite")) << XATTR(_T("to"), pUser);
+ XmlNode msg(L"message");
+ HXML invite = msg << XATTR(L"to", m_room) << XATTRID(m_proto->SerialNext())
+ << XCHILDNS(L"x", JABBER_FEAT_MUC_USER)
+ << XCHILD(L"invite") << XATTR(L"to", pUser);
if (text)
- invite << XCHILD(_T("reason"), text);
+ invite << XCHILD(L"reason", text);
m_proto->m_ThreadInfo->send(msg);
}
@@ -807,18 +807,18 @@ public:
void CJabberProto::AdminSet(const TCHAR *to, const TCHAR *ns, const TCHAR *szItem, const TCHAR *itemVal, const TCHAR *var, const TCHAR *varVal)
{
- m_ThreadInfo->send(XmlNodeIq(_T("set"), SerialNext(), to) << XQUERY(ns) << XCHILD(_T("item")) << XATTR(szItem, itemVal) << XATTR(var, varVal));
+ m_ThreadInfo->send(XmlNodeIq(L"set", SerialNext(), to) << XQUERY(ns) << XCHILD(L"item") << XATTR(szItem, itemVal) << XATTR(var, varVal));
}
void CJabberProto::AdminSetReason(const TCHAR *to, const TCHAR *ns, const TCHAR *szItem, const TCHAR *itemVal, const TCHAR *var, const TCHAR *varVal, const TCHAR *rsn)
{
- m_ThreadInfo->send(XmlNodeIq(_T("set"), SerialNext(), to) << XQUERY(ns) << XCHILD(_T("item")) << XATTR(szItem, itemVal) << XATTR(var, varVal) << XCHILD(_T("reason"), rsn));
+ m_ThreadInfo->send(XmlNodeIq(L"set", SerialNext(), to) << XQUERY(ns) << XCHILD(L"item") << XATTR(szItem, itemVal) << XATTR(var, varVal) << XCHILD(L"reason", rsn));
}
void CJabberProto::AdminGet(const TCHAR *to, const TCHAR *ns, const TCHAR *var, const TCHAR *varVal, JABBER_IQ_HANDLER foo)
{
m_ThreadInfo->send(XmlNodeIq(AddIQ(foo, JABBER_IQ_TYPE_GET, to))
- << XQUERY(ns) << XCHILD(_T("item")) << XATTR(var, varVal));
+ << XQUERY(ns) << XCHILD(L"item") << XATTR(var, varVal));
}
// Member info dialog
@@ -919,27 +919,27 @@ static INT_PTR CALLBACK sttUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam
switch (value) {
case AFFILIATION_NONE:
if (dat->him->m_tszRealJid)
- dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("jid"), szBareJid, _T("affiliation"), _T("none"));
+ dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, L"jid", szBareJid, L"affiliation", L"none");
else
- dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), dat->him->m_tszResourceName, _T("affiliation"), _T("none"));
+ dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, L"nick", dat->him->m_tszResourceName, L"affiliation", L"none");
break;
case AFFILIATION_MEMBER:
if (dat->him->m_tszRealJid)
- dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("jid"), szBareJid, _T("affiliation"), _T("member"));
+ dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, L"jid", szBareJid, L"affiliation", L"member");
else
- dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), dat->him->m_tszResourceName, _T("affiliation"), _T("member"));
+ dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, L"nick", dat->him->m_tszResourceName, L"affiliation", L"member");
break;
case AFFILIATION_ADMIN:
if (dat->him->m_tszRealJid)
- dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("jid"), szBareJid, _T("affiliation"), _T("admin"));
+ dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, L"jid", szBareJid, L"affiliation", L"admin");
else
- dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), dat->him->m_tszResourceName, _T("affiliation"), _T("admin"));
+ dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, L"nick", dat->him->m_tszResourceName, L"affiliation", L"admin");
break;
case AFFILIATION_OWNER:
if (dat->him->m_tszRealJid)
- dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("jid"), szBareJid, _T("affiliation"), _T("owner"));
+ dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, L"jid", szBareJid, L"affiliation", L"owner");
else
- dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), dat->him->m_tszResourceName, _T("affiliation"), _T("owner"));
+ dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, L"nick", dat->him->m_tszResourceName, L"affiliation", L"owner");
}
break;
@@ -959,13 +959,13 @@ static INT_PTR CALLBACK sttUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam
switch (value) {
case ROLE_VISITOR:
- dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), dat->him->m_tszResourceName, _T("role"), _T("visitor"));
+ dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, L"nick", dat->him->m_tszResourceName, L"role", L"visitor");
break;
case ROLE_PARTICIPANT:
- dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), dat->him->m_tszResourceName, _T("role"), _T("participant"));
+ dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, L"nick", dat->him->m_tszResourceName, L"role", L"participant");
break;
case ROLE_MODERATOR:
- dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), dat->him->m_tszResourceName, _T("role"), _T("moderator"));
+ dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, L"nick", dat->him->m_tszResourceName, L"role", L"moderator");
break;
}
}
@@ -1016,22 +1016,22 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
TCHAR buf[256];
// do not use snprintf to avoid possible problems with % symbol
- if (TCHAR *p = _tcsstr(szMessage, _T("%s"))) {
+ if (TCHAR *p = _tcsstr(szMessage, L"%s")) {
*p = 0;
- mir_sntprintf(buf, _T("%s%s%s"), szMessage, him->m_tszResourceName, p + 2);
+ mir_sntprintf(buf, L"%s%s%s", szMessage, him->m_tszResourceName, p + 2);
}
else mir_tstrncpy(buf, szMessage, _countof(buf));
UnEscapeChatTags(buf);
ppro->m_ThreadInfo->send(
- XmlNode(_T("message")) << XATTR(_T("to"), item->jid) << XATTR(_T("type"), _T("groupchat"))
- << XCHILD(_T("body"), buf));
+ XmlNode(L"message") << XATTR(L"to", item->jid) << XATTR(L"type", L"groupchat")
+ << XCHILD(L"body", buf));
}
break;
case IDM_VCARD:
{
- CMString jid(FORMAT, _T("%s/%s"), item->jid, him->m_tszResourceName);
+ CMString jid(FORMAT, L"%s/%s", item->jid, him->m_tszResourceName);
MCONTACT hContact = ppro->AddToListByJID(jid, PALF_TEMPORARY);
ppro->setTString(hContact, "Nick", him->m_tszResourceName);
@@ -1058,14 +1058,14 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
case IDM_KICK:
if ((GetTickCount() - dwLastBanKickTime) > BAN_KICK_INTERVAL) {
dwLastBanKickTime = GetTickCount();
- szBuffer.Format(_T("%s: "), me->m_tszResourceName);
+ szBuffer.Format(L"%s: ", me->m_tszResourceName);
szTitle.Format(TranslateT("Reason to kick %s"), him->m_tszResourceName);
TCHAR *resourceName_copy = mir_tstrdup(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(_T("set"), ppro->SerialNext(), item->jid) << XQUERY(JABBER_FEAT_MUC_ADMIN)
- << XCHILD(_T("item")) << XATTR(_T("nick"), resourceName_copy) << XATTR(_T("role"), _T("none"))
- << XCHILD(_T("reason"), szBuffer));
+ XmlNodeIq(L"set", ppro->SerialNext(), item->jid) << XQUERY(JABBER_FEAT_MUC_ADMIN)
+ << XCHILD(L"item") << XATTR(L"nick", resourceName_copy) << XATTR(L"role", L"none")
+ << XCHILD(L"reason", szBuffer));
mir_free(resourceName_copy);
}
@@ -1074,17 +1074,17 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
case IDM_SET_VISITOR:
if (him->m_role != ROLE_VISITOR)
- ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), him->m_tszResourceName, _T("role"), _T("visitor"));
+ ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, L"nick", him->m_tszResourceName, L"role", L"visitor");
break;
case IDM_SET_PARTICIPANT:
if (him->m_role != ROLE_PARTICIPANT)
- ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), him->m_tszResourceName, _T("role"), _T("participant"));
+ ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, L"nick", him->m_tszResourceName, L"role", L"participant");
break;
case IDM_SET_MODERATOR:
if (him->m_role != ROLE_MODERATOR)
- ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), him->m_tszResourceName, _T("role"), _T("moderator"));
+ ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, L"nick", him->m_tszResourceName, L"role", L"moderator");
break;
case IDM_SET_NONE:
@@ -1092,9 +1092,9 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
if (him->m_tszRealJid) {
TCHAR szBareJid[JABBER_MAX_JID_LEN];
JabberStripJid(him->m_tszRealJid, szBareJid, _countof(szBareJid));
- ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("jid"), szBareJid, _T("affiliation"), _T("none"));
+ ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, L"jid", szBareJid, L"affiliation", L"none");
}
- else ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), him->m_tszResourceName, _T("affiliation"), _T("none"));
+ else ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, L"nick", him->m_tszResourceName, L"affiliation", L"none");
}
break;
@@ -1103,9 +1103,9 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
if (him->m_tszRealJid) {
TCHAR szBareJid[JABBER_MAX_JID_LEN];
JabberStripJid(him->m_tszRealJid, szBareJid, _countof(szBareJid));
- ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("jid"), szBareJid, _T("affiliation"), _T("member"));
+ ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, L"jid", szBareJid, L"affiliation", L"member");
}
- else ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), him->m_tszResourceName, _T("affiliation"), _T("member"));
+ else ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, L"nick", him->m_tszResourceName, L"affiliation", L"member");
}
break;
@@ -1114,9 +1114,9 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
if (him->m_tszRealJid) {
TCHAR szBareJid[JABBER_MAX_JID_LEN];
JabberStripJid(him->m_tszRealJid, szBareJid, _countof(szBareJid));
- ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("jid"), szBareJid, _T("affiliation"), _T("admin"));
+ ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, L"jid", szBareJid, L"affiliation", L"admin");
}
- else ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), him->m_tszResourceName, _T("affiliation"), _T("admin"));
+ else ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, L"nick", him->m_tszResourceName, L"affiliation", L"admin");
}
break;
@@ -1125,9 +1125,9 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
if (him->m_tszRealJid) {
TCHAR szBareJid[JABBER_MAX_JID_LEN];
JabberStripJid(him->m_tszRealJid, szBareJid, _countof(szBareJid));
- ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("jid"), szBareJid, _T("affiliation"), _T("owner"));
+ ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, L"jid", szBareJid, L"affiliation", L"owner");
}
- else ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), him->m_tszResourceName, _T("affiliation"), _T("owner"));
+ else ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, L"nick", him->m_tszResourceName, L"affiliation", L"owner");
}
break;
@@ -1137,14 +1137,14 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
TCHAR szVictimBareJid[JABBER_MAX_JID_LEN];
JabberStripJid(him->m_tszRealJid, szVictimBareJid, _countof(szVictimBareJid));
- szBuffer.Format(_T("%s: "), me->m_tszResourceName);
+ szBuffer.Format(L"%s: ", me->m_tszResourceName);
szTitle.Format(TranslateT("Reason to ban %s"), him->m_tszResourceName);
if (ppro->EnterString(szBuffer, szTitle, ESF_MULTILINE, "gcReason_"))
ppro->m_ThreadInfo->send(
- XmlNodeIq(_T("set"), ppro->SerialNext(), item->jid) << XQUERY(JABBER_FEAT_MUC_ADMIN)
- << XCHILD(_T("item")) << XATTR(_T("jid"), szVictimBareJid) << XATTR(_T("affiliation"), _T("outcast"))
- << XCHILD(_T("reason"), szBuffer));
+ XmlNodeIq(L"set", ppro->SerialNext(), item->jid) << XQUERY(JABBER_FEAT_MUC_ADMIN)
+ << XCHILD(L"item") << XATTR(L"jid", szVictimBareJid) << XATTR(L"affiliation", L"outcast")
+ << XCHILD(L"reason", szBuffer));
}
}
dwLastBanKickTime = GetTickCount();
@@ -1174,12 +1174,12 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
if (!ppro->EnterString(szBuffer, szTitle, ESF_MULTILINE))
break;
- szTitle.Format(_T("%s/%s"), item->jid, resourceName_copy);
+ szTitle.Format(L"%s/%s", item->jid, resourceName_copy);
- XmlNode msg(_T("message"));
- msg << XATTR(_T("to"), szTitle) << XATTRID(ppro->SerialNext())
- << XCHILD(_T("x"), szBuffer) << XATTR(_T("xmlns"), JABBER_FEAT_DIRECT_MUC_INVITE) << XATTR(_T("jid"), szInviteTo)
- << XCHILD(_T("invite")) << XATTR(_T("from"), item->nick);
+ XmlNode msg(L"message");
+ msg << XATTR(L"to", szTitle) << XATTRID(ppro->SerialNext())
+ << XCHILD(L"x", szBuffer) << XATTR(L"xmlns", JABBER_FEAT_DIRECT_MUC_INVITE) << XATTR(L"jid", szInviteTo)
+ << XCHILD(L"invite") << XATTR(L"from", item->nick);
ppro->m_ThreadInfo->send(msg);
}
dwLastBanKickTime = GetTickCount();
@@ -1195,7 +1195,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
break;
case IDM_CPY_INROOMJID:
- szBuffer.Format(_T("%s/%s"), item->jid, him->m_tszResourceName);
+ szBuffer.Format(L"%s/%s", item->jid, him->m_tszResourceName);
JabberCopyText(pcli->hwndContactList, szBuffer);
break;
@@ -1239,37 +1239,37 @@ static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* g
switch (gch->dwData) {
case IDM_LST_PARTICIPANT:
- ppro->AdminGet(gch->pDest->ptszID, JABBER_FEAT_MUC_ADMIN, _T("role"), _T("participant"), &CJabberProto::OnIqResultMucGetVoiceList);
+ ppro->AdminGet(gch->pDest->ptszID, JABBER_FEAT_MUC_ADMIN, L"role", L"participant", &CJabberProto::OnIqResultMucGetVoiceList);
break;
case IDM_LST_MEMBER:
- ppro->AdminGet(gch->pDest->ptszID, JABBER_FEAT_MUC_ADMIN, _T("affiliation"), _T("member"), &CJabberProto::OnIqResultMucGetMemberList);
+ ppro->AdminGet(gch->pDest->ptszID, JABBER_FEAT_MUC_ADMIN, L"affiliation", L"member", &CJabberProto::OnIqResultMucGetMemberList);
break;
case IDM_LST_MODERATOR:
- ppro->AdminGet(gch->pDest->ptszID, JABBER_FEAT_MUC_ADMIN, _T("role"), _T("moderator"), &CJabberProto::OnIqResultMucGetModeratorList);
+ ppro->AdminGet(gch->pDest->ptszID, JABBER_FEAT_MUC_ADMIN, L"role", L"moderator", &CJabberProto::OnIqResultMucGetModeratorList);
break;
case IDM_LST_BAN:
- ppro->AdminGet(gch->pDest->ptszID, JABBER_FEAT_MUC_ADMIN, _T("affiliation"), _T("outcast"), &CJabberProto::OnIqResultMucGetBanList);
+ ppro->AdminGet(gch->pDest->ptszID, JABBER_FEAT_MUC_ADMIN, L"affiliation", L"outcast", &CJabberProto::OnIqResultMucGetBanList);
break;
case IDM_LST_ADMIN:
- ppro->AdminGet(gch->pDest->ptszID, JABBER_FEAT_MUC_ADMIN, _T("affiliation"), _T("admin"), &CJabberProto::OnIqResultMucGetAdminList);
+ ppro->AdminGet(gch->pDest->ptszID, JABBER_FEAT_MUC_ADMIN, L"affiliation", L"admin", &CJabberProto::OnIqResultMucGetAdminList);
break;
case IDM_LST_OWNER:
- ppro->AdminGet(gch->pDest->ptszID, JABBER_FEAT_MUC_ADMIN, _T("affiliation"), _T("owner"), &CJabberProto::OnIqResultMucGetOwnerList);
+ ppro->AdminGet(gch->pDest->ptszID, JABBER_FEAT_MUC_ADMIN, L"affiliation", L"owner", &CJabberProto::OnIqResultMucGetOwnerList);
break;
case IDM_TOPIC:
szTitle.Format(TranslateT("Set topic for %s"), gch->pDest->ptszID);
szBuffer = item->getTemp()->m_tszStatusMessage;
- szBuffer.Replace(_T("\n"), _T("\r\n"));
+ szBuffer.Replace(L"\n", L"\r\n");
if (ppro->EnterString(szBuffer, szTitle, ESF_RICHEDIT, "gcTopic_"))
ppro->m_ThreadInfo->send(
- XmlNode(_T("message")) << XATTR(_T("to"), gch->pDest->ptszID) << XATTR(_T("type"), _T("groupchat"))
- << XCHILD(_T("subject"), szBuffer));
+ XmlNode(L"message") << XATTR(L"to", gch->pDest->ptszID) << XATTR(L"type", L"groupchat")
+ << XCHILD(L"subject", szBuffer));
break;
case IDM_NICK:
@@ -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) {
TCHAR text[1024];
- mir_sntprintf(text, _T("%s/%s"), gch->pDest->ptszID, szBuffer);
+ mir_sntprintf(text, L"%s/%s", gch->pDest->ptszID, szBuffer);
ppro->SendPresenceTo(ppro->m_iStatus == ID_STATUS_INVISIBLE ? ID_STATUS_ONLINE : ppro->m_iStatus, text, NULL);
}
}
@@ -1300,7 +1300,7 @@ static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* g
if (item == NULL) {
item = ppro->ListGetItemPtr(LIST_CHATROOM, gch->pDest->ptszID);
if (item != NULL) {
- item->type = _T("conference");
+ item->type = L"conference";
MCONTACT hContact = ppro->HContactFromJID(item->jid);
item->name = pcli->pfnGetContactDisplayName(hContact, 0);
ppro->AddEditBookmark(item);
@@ -1312,8 +1312,8 @@ static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* g
szTitle.Format(TranslateT("Reason to destroy %s"), gch->pDest->ptszID);
if (ppro->EnterString(szBuffer, szTitle, ESF_MULTILINE, "gcReason_"))
ppro->m_ThreadInfo->send(
- XmlNodeIq(_T("set"), ppro->SerialNext(), gch->pDest->ptszID) << XQUERY(JABBER_FEAT_MUC_OWNER)
- << XCHILD(_T("destroy")) << XCHILD(_T("reason"), szBuffer));
+ XmlNodeIq(L"set", ppro->SerialNext(), gch->pDest->ptszID) << XQUERY(JABBER_FEAT_MUC_OWNER)
+ << XCHILD(L"destroy") << XCHILD(L"reason", szBuffer));
// fall through
case IDM_LEAVE:
@@ -1333,7 +1333,7 @@ static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* g
case IDM_LINK5: case IDM_LINK6: case IDM_LINK7: case IDM_LINK8: case IDM_LINK9:
{
int idx = IDM_LINK0;
- for (TCHAR *p = _tcsstr(item->getTemp()->m_tszStatusMessage, _T("http://")); p && *p; p = _tcsstr(p + 1, _T("http://"))) {
+ for (TCHAR *p = _tcsstr(item->getTemp()->m_tszStatusMessage, L"http://"); p && *p; p = _tcsstr(p + 1, L"http://")) {
if (idx == gch->dwData) {
char *bufPtr, *url = mir_t2a(p);
for (bufPtr = url; *bufPtr && !isspace(*bufPtr); ++bufPtr);
@@ -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 TCHAR *nick)
{
TCHAR szFullJid[JABBER_MAX_JID_LEN];
- mir_sntprintf(szFullJid, _T("%s/%s"), item->jid, nick);
+ mir_sntprintf(szFullJid, L"%s/%s", item->jid, nick);
MCONTACT hContact = ppro->DBCreateContact(szFullJid, NULL, true, false);
if (hContact != NULL) {
pResourceStatus r(item->findResource(nick));
@@ -1406,8 +1406,8 @@ int CJabberProto::JabberGcEventHook(WPARAM, LPARAM lParam)
TCHAR *buf = NEWTSTR_ALLOCA(gch->ptszText);
UnEscapeChatTags(buf);
m_ThreadInfo->send(
- XmlNode(_T("message")) << XATTR(_T("id"), _i64tot(id, tszID, 36)) << XATTR(_T("to"), item->jid) << XATTR(_T("type"), _T("groupchat"))
- << XCHILD(_T("body"), buf));
+ XmlNode(L"message") << XATTR(L"id", _i64tot(id, tszID, 36)) << XATTR(L"to", item->jid) << XATTR(L"type", L"groupchat")
+ << XCHILD(L"body", buf));
}
}
break;
@@ -1438,43 +1438,43 @@ int CJabberProto::JabberGcEventHook(WPARAM, LPARAM lParam)
void CJabberProto::AddMucListItem(JABBER_MUC_JIDLIST_INFO* jidListInfo, const TCHAR* str, const TCHAR* rsn)
{
- const TCHAR *field = (jidListInfo->type == MUC_BANLIST || _tcschr(str, '@')) ? _T("jid") : _T("nick");
+ const TCHAR *field = (jidListInfo->type == MUC_BANLIST || _tcschr(str, '@')) ? L"jid" : L"nick";
TCHAR *roomJid = jidListInfo->roomJid;
if (jidListInfo->type == MUC_BANLIST) {
- AdminSetReason(roomJid, JABBER_FEAT_MUC_ADMIN, field, str, _T("affiliation"), _T("outcast"), rsn);
- AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, _T("affiliation"), _T("outcast"), &CJabberProto::OnIqResultMucGetBanList);
+ AdminSetReason(roomJid, JABBER_FEAT_MUC_ADMIN, field, str, L"affiliation", L"outcast", rsn);
+ AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, L"affiliation", L"outcast", &CJabberProto::OnIqResultMucGetBanList);
}
}
void CJabberProto::AddMucListItem(JABBER_MUC_JIDLIST_INFO* jidListInfo, const TCHAR* str)
{
- const TCHAR *field = (jidListInfo->type == MUC_BANLIST || _tcschr(str, '@')) ? _T("jid") : _T("nick");
+ const TCHAR *field = (jidListInfo->type == MUC_BANLIST || _tcschr(str, '@')) ? L"jid" : L"nick";
TCHAR *roomJid = jidListInfo->roomJid;
switch (jidListInfo->type) {
case MUC_VOICELIST:
- AdminSet(roomJid, JABBER_FEAT_MUC_ADMIN, field, str, _T("role"), _T("participant"));
- AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, _T("role"), _T("participant"), &CJabberProto::OnIqResultMucGetVoiceList);
+ AdminSet(roomJid, JABBER_FEAT_MUC_ADMIN, field, str, L"role", L"participant");
+ AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, L"role", L"participant", &CJabberProto::OnIqResultMucGetVoiceList);
break;
case MUC_MEMBERLIST:
- AdminSet(roomJid, JABBER_FEAT_MUC_ADMIN, field, str, _T("affiliation"), _T("member"));
- AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, _T("affiliation"), _T("member"), &CJabberProto::OnIqResultMucGetMemberList);
+ AdminSet(roomJid, JABBER_FEAT_MUC_ADMIN, field, str, L"affiliation", L"member");
+ AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, L"affiliation", L"member", &CJabberProto::OnIqResultMucGetMemberList);
break;
case MUC_MODERATORLIST:
- AdminSet(roomJid, JABBER_FEAT_MUC_ADMIN, field, str, _T("role"), _T("moderator"));
- AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, _T("role"), _T("moderator"), &CJabberProto::OnIqResultMucGetModeratorList);
+ AdminSet(roomJid, JABBER_FEAT_MUC_ADMIN, field, str, L"role", L"moderator");
+ AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, L"role", L"moderator", &CJabberProto::OnIqResultMucGetModeratorList);
break;
case MUC_BANLIST:
- AdminSet(roomJid, JABBER_FEAT_MUC_ADMIN, field, str, _T("affiliation"), _T("outcast"));
- AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, _T("affiliation"), _T("outcast"), &CJabberProto::OnIqResultMucGetBanList);
+ AdminSet(roomJid, JABBER_FEAT_MUC_ADMIN, field, str, L"affiliation", L"outcast");
+ AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, L"affiliation", L"outcast", &CJabberProto::OnIqResultMucGetBanList);
break;
case MUC_ADMINLIST:
- AdminSet(roomJid, JABBER_FEAT_MUC_ADMIN, field, str, _T("affiliation"), _T("admin"));
- AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, _T("affiliation"), _T("admin"), &CJabberProto::OnIqResultMucGetAdminList);
+ AdminSet(roomJid, JABBER_FEAT_MUC_ADMIN, field, str, L"affiliation", L"admin");
+ AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, L"affiliation", L"admin", &CJabberProto::OnIqResultMucGetAdminList);
break;
case MUC_OWNERLIST:
- AdminSet(roomJid, JABBER_FEAT_MUC_ADMIN, field, str, _T("affiliation"), _T("owner"));
- AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, _T("affiliation"), _T("owner"), &CJabberProto::OnIqResultMucGetOwnerList);
+ AdminSet(roomJid, JABBER_FEAT_MUC_ADMIN, field, str, L"affiliation", L"owner");
+ AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, L"affiliation", L"owner", &CJabberProto::OnIqResultMucGetOwnerList);
break;
}
}
@@ -1485,20 +1485,20 @@ void CJabberProto::DeleteMucListItem(JABBER_MUC_JIDLIST_INFO *jidListInfo, const
switch (jidListInfo->type) {
case MUC_VOICELIST: // change role to visitor (from participant)
- AdminSet(roomJid, JABBER_FEAT_MUC_ADMIN, _T("jid"), jid, _T("role"), _T("visitor"));
+ AdminSet(roomJid, JABBER_FEAT_MUC_ADMIN, L"jid", jid, L"role", L"visitor");
break;
case MUC_BANLIST: // change affiliation to none (from outcast)
case MUC_MEMBERLIST: // change affiliation to none (from member)
- AdminSet(roomJid, JABBER_FEAT_MUC_ADMIN, _T("jid"), jid, _T("affiliation"), _T("none"));
+ AdminSet(roomJid, JABBER_FEAT_MUC_ADMIN, L"jid", jid, L"affiliation", L"none");
break;
case MUC_MODERATORLIST: // change role to participant (from moderator)
- AdminSet(roomJid, JABBER_FEAT_MUC_ADMIN, _T("jid"), jid, _T("role"), _T("participant"));
+ AdminSet(roomJid, JABBER_FEAT_MUC_ADMIN, L"jid", jid, L"role", L"participant");
break;
case MUC_ADMINLIST: // change affiliation to member (from admin)
- AdminSet(roomJid, JABBER_FEAT_MUC_ADMIN, _T("jid"), jid, _T("affiliation"), _T("member"));
+ AdminSet(roomJid, JABBER_FEAT_MUC_ADMIN, L"jid", jid, L"affiliation", L"member");
break;
case MUC_OWNERLIST: // change affiliation to admin (from owner)
- AdminSet(roomJid, JABBER_FEAT_MUC_ADMIN, _T("jid"), jid, _T("affiliation"), _T("admin"));
+ AdminSet(roomJid, JABBER_FEAT_MUC_ADMIN, L"jid", jid, L"affiliation", L"admin");
break;
}
}
diff --git a/protocols/JabberG/src/jabber_console.cpp b/protocols/JabberG/src/jabber_console.cpp
index f0306b9ec4..2d1250eb88 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), _T("message"))) return false;
- if (!m_filterInfo.presence && !mir_tstrcmp(XmlGetName(node), _T("presence"))) return false;
- if (!m_filterInfo.iq && !mir_tstrcmp(XmlGetName(node), _T("iq"))) return false;
+ 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.type == TFilterInfo::T_OFF) return true;
mir_cslock lck(m_filterInfo.csPatternLock);
@@ -126,14 +126,14 @@ bool CJabberProto::FilterXml(HXML node, DWORD flags)
const TCHAR *attrValue;
switch (m_filterInfo.type) {
case TFilterInfo::T_JID:
- attrValue = XmlGetAttrValue(node, (flags & JCPF_OUT) ? _T("to") : _T("from"));
+ attrValue = XmlGetAttrValue(node, (flags & JCPF_OUT) ? L"to" : L"from");
if (attrValue)
return JabberStrIStr(attrValue, m_filterInfo.pattern) != NULL;
break;
case TFilterInfo::T_XMLNS:
if (XmlGetChildCount(node)) {
- attrValue = XmlGetAttrValue(XmlGetChild(node, 0), _T("xmlns"));
+ attrValue = XmlGetAttrValue(XmlGetChild(node, 0), L"xmlns");
if (attrValue)
return JabberStrIStr(attrValue, m_filterInfo.pattern) != NULL;
}
@@ -305,10 +305,10 @@ struct
}
static filter_modes[] =
{
- { TFilterInfo::T_JID, _T("JID"), "main" },
- { TFilterInfo::T_XMLNS, _T("xmlns"), "xmlconsole" },
- { TFilterInfo::T_ANY, _T("all attributes"), "sd_filter_apply" },
- { TFilterInfo::T_OFF, _T("disabled"), "sd_filter_reset" },
+ { TFilterInfo::T_JID, L"JID", "main" },
+ { TFilterInfo::T_XMLNS, L"xmlns", "xmlconsole" },
+ { TFilterInfo::T_ANY, L"all attributes", "sd_filter_apply" },
+ { TFilterInfo::T_OFF, L"disabled", "sd_filter_reset" },
};
class CJabberDlgConsole: public CJabberDlgBase
@@ -522,12 +522,12 @@ INT_PTR CJabberDlgConsole::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
mir_free(textToSend);
- SetDlgItemText(m_hwnd, IDC_CONSOLEIN, _T(""));
+ SetDlgItemText(m_hwnd, IDC_CONSOLEIN, L"");
}
return TRUE;
case IDC_RESET:
- SetDlgItemText(m_hwnd, IDC_CONSOLE, _T(""));
+ SetDlgItemText(m_hwnd, IDC_CONSOLE, L"");
break;
case IDC_BTN_MSG:
@@ -615,7 +615,7 @@ void __cdecl CJabberProto::ConsoleThread(void*)
HMODULE hMsftedit;
void CJabberProto::ConsoleInit()
{
- hMsftedit = LoadLibrary(_T("Msftedit.dll"));
+ hMsftedit = LoadLibrary(L"Msftedit.dll");
m_hThreadConsole = ForkThreadEx(&CJabberProto::ConsoleThread, 0, &m_dwConsoleThreadId);
}
diff --git a/protocols/JabberG/src/jabber_disco.cpp b/protocols/JabberG/src/jabber_disco.cpp
index e5f6df0342..7d49935abc 100644
--- a/protocols/JabberG/src/jabber_disco.cpp
+++ b/protocols/JabberG/src/jabber_disco.cpp
@@ -63,104 +63,104 @@ static struct
} sttNodeIcons[] =
{
// standard identities: http://www.xmpp.org/registrar/disco-categories.html#directory
- // {NULL, _T("account"), _T("admin"), NULL, 0},
- // {NULL, _T("account"), _T("anonymous"), NULL, 0},
- // {NULL, _T("account"), _T("registered"), NULL, 0},
- {NULL, _T("account"), NULL, NULL, SKINICON_STATUS_ONLINE},
-
- // {NULL, _T("auth"), _T("cert"), NULL, 0},
- // {NULL, _T("auth"), _T("generic"), NULL, 0},
- // {NULL, _T("auth"), _T("ldap"), NULL, 0},
- // {NULL, _T("auth"), _T("ntlm"), NULL, 0},
- // {NULL, _T("auth"), _T("pam"), NULL, 0},
- // {NULL, _T("auth"), _T("radius"), NULL, 0},
- {NULL, _T("auth"), NULL, "key", 0},
-
- /// {NULL, _T("automation"), _T("command-list"), NULL, 0},
- /// {NULL, _T("automation"), _T("command-node"), NULL, 0},
- // {NULL, _T("automation"), _T("rpc"), NULL, 0},
- // {NULL, _T("automation"), _T("soap"), NULL, 0},
- {NULL, _T("automation"), NULL, "adhoc", 0},
-
- // {NULL, _T("client"), _T("bot"), NULL, 0},
- // {NULL, _T("client"), _T("console"), NULL, 0},
- // {NULL, _T("client"), _T("handheld"), NULL, 0},
- // {NULL, _T("client"), _T("pc"), NULL, 0},
- // {NULL, _T("client"), _T("phone"), NULL, 0},
- // {NULL, _T("client"), _T("web"), NULL, 0},
- {NULL, _T("client"), NULL, NULL, SKINICON_STATUS_ONLINE},
-
- // {NULL, _T("collaboration"), _T("whiteboard"), NULL, 0},
- {NULL, _T("collaboration"), NULL, "group", 0},
-
- // {NULL, _T("component"), _T("archive"), NULL, 0},
- // {NULL, _T("component"), _T("c2s"), NULL, 0},
- // {NULL, _T("component"), _T("generic"), NULL, 0},
- // {NULL, _T("component"), _T("load"), NULL, 0},
- // {NULL, _T("component"), _T("log"), NULL, 0},
- // {NULL, _T("component"), _T("presence"), NULL, 0},
- // {NULL, _T("component"), _T("router"), NULL, 0},
- // {NULL, _T("component"), _T("s2s"), NULL, 0},
- // {NULL, _T("component"), _T("sm"), NULL, 0},
- // {NULL, _T("component"), _T("stats"), NULL, 0},
-
- // {NULL, _T("conference"), _T("irc"), NULL, 0},
- // {NULL, _T("conference"), _T("text"), NULL, 0},
- {NULL, _T("conference"), NULL, "group", 0},
-
- {NULL, _T("directory"), _T("chatroom"), "group", 0},
- {NULL, _T("directory"), _T("group"), "group", 0},
- {NULL, _T("directory"), _T("user"), NULL, SKINICON_OTHER_FINDUSER},
- // {NULL, _T("directory"), _T("waitinglist"), NULL, 0},
- {NULL, _T("directory"), NULL, NULL, SKINICON_OTHER_SEARCHALL},
-
- {NULL, _T("gateway"), _T("aim"), "AIM", SKINICON_STATUS_ONLINE},
- {NULL, _T("gateway"), _T("gadu-gadu"), "GG", SKINICON_STATUS_ONLINE},
- // {NULL, _T("gateway"), _T("http-ws"), NUL, 0},
- {NULL, _T("gateway"), _T("icq"), "ICQ", SKINICON_STATUS_ONLINE},
- {NULL, _T("gateway"), _T("msn"), "MSN", SKINICON_STATUS_ONLINE},
- {NULL, _T("gateway"), _T("qq"), "QQ", SKINICON_STATUS_ONLINE},
- // {NULL, _T("gateway"), _T("sms"), NULL, 0},
- // {NULL, _T("gateway"), _T("smtp"), NULL, 0},
- {NULL, _T("gateway"), _T("tlen"), "TLEN", SKINICON_STATUS_ONLINE},
- {NULL, _T("gateway"), _T("yahoo"), "YAHOO", SKINICON_STATUS_ONLINE},
- {NULL, _T("gateway"), NULL, "Agents", 0},
-
- // {NULL, _T("headline"), _T("newmail"), NULL, 0},
- {NULL, _T("headline"), _T("rss"), "node_rss", 0},
- {NULL, _T("headline"), _T("weather"), "node_weather", 0},
-
- // {NULL, _T("hierarchy"), _T("branch"), NULL, 0},
- // {NULL, _T("hierarchy"), _T("leaf"), NULL, 0},
-
- // {NULL, _T("proxy"), _T("bytestreams"), NULL, 0},
- {NULL, _T("proxy"), NULL, NULL, SKINICON_EVENT_FILE},
-
- // {NULL, _T("pubsub"), _T("collection"), NULL, 0},
- // {NULL, _T("pubsub"), _T("leaf"), NULL, 0},
- // {NULL, _T("pubsub"), _T("pep"), NULL, 0},
- // {NULL, _T("pubsub"), _T("service"), NULL, 0},
-
- // {NULL, _T("server"), _T("im"), NULL, 0},
- {NULL, _T("server"), NULL, "node_server", 0},
-
- // {NULL, _T("store"), _T("berkeley"), NULL, 0},
- /// {NULL, _T("store"), _T("file"), NULL, 0},
- // {NULL, _T("store"), _T("generic"), NULL, 0},
- // {NULL, _T("store"), _T("ldap"), NULL, 0},
- // {NULL, _T("store"), _T("mysql"), NULL, 0},
- // {NULL, _T("store"), _T("oracle"), NULL, 0},
- // {NULL, _T("store"), _T("postgres"), NULL, 0},
- {NULL, _T("store"), NULL, "node_store", 0},
+ // {NULL, L"account", L"admin", NULL, 0},
+ // {NULL, L"account", L"anonymous", NULL, 0},
+ // {NULL, L"account", L"registered", NULL, 0},
+ {NULL, L"account", NULL, NULL, SKINICON_STATUS_ONLINE},
+
+ // {NULL, L"auth", L"cert", NULL, 0},
+ // {NULL, L"auth", L"generic", NULL, 0},
+ // {NULL, L"auth", L"ldap", NULL, 0},
+ // {NULL, L"auth", L"ntlm", NULL, 0},
+ // {NULL, L"auth", L"pam", NULL, 0},
+ // {NULL, L"auth", L"radius", NULL, 0},
+ {NULL, L"auth", NULL, "key", 0},
+
+ /// {NULL, L"automation", L"command-list", NULL, 0},
+ /// {NULL, L"automation", L"command-node", NULL, 0},
+ // {NULL, L"automation", L"rpc", NULL, 0},
+ // {NULL, L"automation", L"soap", NULL, 0},
+ {NULL, L"automation", NULL, "adhoc", 0},
+
+ // {NULL, L"client", L"bot", NULL, 0},
+ // {NULL, L"client", L"console", NULL, 0},
+ // {NULL, L"client", L"handheld", NULL, 0},
+ // {NULL, L"client", L"pc", NULL, 0},
+ // {NULL, L"client", L"phone", NULL, 0},
+ // {NULL, L"client", L"web", NULL, 0},
+ {NULL, L"client", NULL, NULL, SKINICON_STATUS_ONLINE},
+
+ // {NULL, L"collaboration", L"whiteboard", NULL, 0},
+ {NULL, L"collaboration", NULL, "group", 0},
+
+ // {NULL, L"component", L"archive", NULL, 0},
+ // {NULL, L"component", L"c2s", NULL, 0},
+ // {NULL, L"component", L"generic", NULL, 0},
+ // {NULL, L"component", L"load", NULL, 0},
+ // {NULL, L"component", L"log", NULL, 0},
+ // {NULL, L"component", L"presence", NULL, 0},
+ // {NULL, L"component", L"router", NULL, 0},
+ // {NULL, L"component", L"s2s", NULL, 0},
+ // {NULL, L"component", L"sm", NULL, 0},
+ // {NULL, L"component", L"stats", NULL, 0},
+
+ // {NULL, L"conference", L"irc", NULL, 0},
+ // {NULL, L"conference", L"text", NULL, 0},
+ {NULL, L"conference", NULL, "group", 0},
+
+ {NULL, L"directory", L"chatroom", "group", 0},
+ {NULL, L"directory", L"group", "group", 0},
+ {NULL, L"directory", L"user", NULL, SKINICON_OTHER_FINDUSER},
+ // {NULL, L"directory", L"waitinglist", NULL, 0},
+ {NULL, L"directory", NULL, NULL, SKINICON_OTHER_SEARCHALL},
+
+ {NULL, L"gateway", L"aim", "AIM", SKINICON_STATUS_ONLINE},
+ {NULL, L"gateway", L"gadu-gadu", "GG", SKINICON_STATUS_ONLINE},
+ // {NULL, L"gateway", L"http-ws", NUL, 0},
+ {NULL, L"gateway", L"icq", "ICQ", SKINICON_STATUS_ONLINE},
+ {NULL, L"gateway", L"msn", "MSN", SKINICON_STATUS_ONLINE},
+ {NULL, L"gateway", L"qq", "QQ", SKINICON_STATUS_ONLINE},
+ // {NULL, L"gateway", L"sms", NULL, 0},
+ // {NULL, L"gateway", L"smtp", NULL, 0},
+ {NULL, L"gateway", L"tlen", "TLEN", SKINICON_STATUS_ONLINE},
+ {NULL, L"gateway", L"yahoo", "YAHOO", SKINICON_STATUS_ONLINE},
+ {NULL, L"gateway", NULL, "Agents", 0},
+
+ // {NULL, L"headline", L"newmail", NULL, 0},
+ {NULL, L"headline", L"rss", "node_rss", 0},
+ {NULL, L"headline", L"weather", "node_weather", 0},
+
+ // {NULL, L"hierarchy", L"branch", NULL, 0},
+ // {NULL, L"hierarchy", L"leaf", NULL, 0},
+
+ // {NULL, L"proxy", L"bytestreams", NULL, 0},
+ {NULL, L"proxy", NULL, NULL, SKINICON_EVENT_FILE},
+
+ // {NULL, L"pubsub", L"collection", NULL, 0},
+ // {NULL, L"pubsub", L"leaf", NULL, 0},
+ // {NULL, L"pubsub", L"pep", NULL, 0},
+ // {NULL, L"pubsub", L"service", NULL, 0},
+
+ // {NULL, L"server", L"im", NULL, 0},
+ {NULL, L"server", NULL, "node_server", 0},
+
+ // {NULL, L"store", L"berkeley", NULL, 0},
+ /// {NULL, L"store", L"file", NULL, 0},
+ // {NULL, L"store", L"generic", NULL, 0},
+ // {NULL, L"store", L"ldap", NULL, 0},
+ // {NULL, L"store", L"mysql", NULL, 0},
+ // {NULL, L"store", L"oracle", NULL, 0},
+ // {NULL, L"store", L"postgres", NULL, 0},
+ {NULL, L"store", NULL, "node_store", 0},
// icons for non-standard identities
- {NULL, _T("x-service"), _T("x-rss"), "node_rss", 0},
- {NULL, _T("application"), _T("x-weather"), "node_weather", 0},
- {NULL, _T("user"), NULL, NULL, SKINICON_STATUS_ONLINE},
+ {NULL, L"x-service", L"x-rss", "node_rss", 0},
+ {NULL, L"application", L"x-weather", "node_weather", 0},
+ {NULL, L"user", NULL, NULL, SKINICON_STATUS_ONLINE},
// icon suggestions based on supported features
- {_T("jabber:iq:gateway"), NULL, NULL, "Agents", 0},
- {_T("jabber:iq:search"), NULL, NULL, NULL, SKINICON_OTHER_FINDUSER},
+ {L"jabber:iq:gateway", NULL, NULL, "Agents", 0},
+ {L"jabber:iq:search", NULL, NULL, NULL, SKINICON_OTHER_FINDUSER},
{ JABBER_FEAT_COMMANDS, NULL, NULL, "adhoc", 0},
{ JABBER_FEAT_REGISTER, NULL, NULL, "key", 0},
};
@@ -181,11 +181,11 @@ void CJabberProto::OnIqResultServiceDiscoveryInfo(HXML iqNode, CJabberIqInfo *pI
else {
HXML feature;
int i;
- for (i = 1; (feature = XmlGetNthChild(query, _T("feature"), i)) != NULL; i++)
- pNode->AddFeature(XmlGetAttrValue(feature, _T("var")));
+ for (i = 1; (feature = XmlGetNthChild(query, L"feature", i)) != NULL; i++)
+ pNode->AddFeature(XmlGetAttrValue(feature, L"var"));
HXML identity;
- for (i = 1; (identity = XmlGetNthChild(query, _T("identity"), i)) != NULL; i++)
- pNode->AddIdentity(XmlGetAttrValue(identity, _T("category")), XmlGetAttrValue(identity, _T("type")), XmlGetAttrValue(identity, _T("name")));
+ for (i = 1; (identity = XmlGetNthChild(query, L"identity", i)) != NULL; i++)
+ pNode->AddIdentity(XmlGetAttrValue(identity, L"category"), XmlGetAttrValue(identity, L"type"), XmlGetAttrValue(identity, L"name"));
pNode->SetInfoRequestId(JABBER_DISCO_RESULT_OK);
pNode->SetInfoRequestErrorText(NULL);
@@ -224,8 +224,8 @@ void CJabberProto::OnIqResultServiceDiscoveryItems(HXML iqNode, CJabberIqInfo *p
pNode->SetItemsRequestId(JABBER_DISCO_RESULT_ERROR);
else {
HXML item;
- for (int i = 1; (item = XmlGetNthChild(query, _T("item"), i)) != NULL; i++)
- pNode->AddChildNode(XmlGetAttrValue(item, _T("jid")), XmlGetAttrValue(item, _T("node")), XmlGetAttrValue(item, _T("name")));
+ for (int i = 1; (item = XmlGetNthChild(query, L"item", i)) != NULL; i++)
+ pNode->AddChildNode(XmlGetAttrValue(item, L"jid"), XmlGetAttrValue(item, L"node"), XmlGetAttrValue(item, L"name"));
pNode->SetItemsRequestId(JABBER_DISCO_RESULT_OK);
pNode->SetItemsRequestErrorText(NULL);
@@ -239,7 +239,7 @@ void CJabberProto::OnIqResultServiceDiscoveryItems(HXML iqNode, CJabberIqInfo *p
mir_free(str);
}
else {
- pNode->SetItemsRequestErrorText(_T("request timeout."));
+ pNode->SetItemsRequestErrorText(L"request timeout.");
}
pNode->SetItemsRequestId(JABBER_DISCO_RESULT_ERROR);
}
@@ -261,9 +261,9 @@ void CJabberProto::OnIqResultServiceDiscoveryRootInfo(HXML iqNode, CJabberIqInfo
HXML query = XmlGetChild(iqNode, "query");
if (query) {
HXML feature;
- for (int i = 1; (feature = XmlGetNthChild(query, _T("feature"), i)) != NULL; i++) {
- if (!mir_tstrcmp(XmlGetAttrValue(feature, _T("var")), (TCHAR *)pInfo->m_pUserData)) {
- CJabberSDNode *pNode = m_SDManager.AddPrimaryNode(pInfo->GetReceiver(), XmlGetAttrValue(iqNode, _T("node")), NULL);
+ for (int i = 1; (feature = XmlGetNthChild(query, L"feature", i)) != NULL; i++) {
+ if (!mir_tstrcmp(XmlGetAttrValue(feature, L"var"), (TCHAR *)pInfo->m_pUserData)) {
+ CJabberSDNode *pNode = m_SDManager.AddPrimaryNode(pInfo->GetReceiver(), XmlGetAttrValue(iqNode, L"node"), NULL);
SendBothRequests(pNode, NULL);
break;
}
@@ -286,15 +286,15 @@ void CJabberProto::OnIqResultServiceDiscoveryRootItems(HXML iqNode, CJabberIqInf
HXML query = XmlGetChild(iqNode, "query");
if (query) {
HXML item;
- for (int i = 1; (item = XmlGetNthChild(query, _T("item"), i)) != NULL; i++) {
- const TCHAR *szJid = XmlGetAttrValue(item, _T("jid"));
- const TCHAR *szNode = XmlGetAttrValue(item, _T("node"));
+ for (int i = 1; (item = XmlGetNthChild(query, L"item", i)) != NULL; i++) {
+ const TCHAR *szJid = XmlGetAttrValue(item, L"jid");
+ const TCHAR *szNode = XmlGetAttrValue(item, L"node");
CJabberIqInfo *pNewInfo = AddIQ(&CJabberProto::OnIqResultServiceDiscoveryRootInfo, JABBER_IQ_TYPE_GET, szJid);
pNewInfo->m_pUserData = pInfo->m_pUserData;
pNewInfo->SetTimeout(30000);
XmlNodeIq iq(pNewInfo);
- iq << XQUERY(JABBER_FEAT_DISCO_INFO) << XATTR(_T("node"), szNode);
+ iq << XQUERY(JABBER_FEAT_DISCO_INFO) << XATTR(L"node", szNode);
XmlAddChild(packet, iq);
}
}
@@ -319,7 +319,7 @@ BOOL CJabberProto::SendInfoRequest(CJabberSDNode *pNode, HXML parent)
XmlNodeIq iq(pInfo);
HXML query = iq << XQUERY(JABBER_FEAT_DISCO_INFO);
if (pNode->GetNode())
- XmlAddAttr(query, _T("node"), pNode->GetNode());
+ XmlAddAttr(query, L"node", pNode->GetNode());
if (parent)
XmlAddChild(parent, iq);
@@ -349,7 +349,7 @@ BOOL CJabberProto::SendBothRequests(CJabberSDNode *pNode, HXML parent)
XmlNodeIq iq(pInfo);
HXML query = iq << XQUERY(JABBER_FEAT_DISCO_INFO);
if (pNode->GetNode())
- XmlAddAttr(query, _T("node"), pNode->GetNode());
+ XmlAddAttr(query, L"node", pNode->GetNode());
if (parent)
XmlAddChild(parent, iq);
@@ -366,7 +366,7 @@ BOOL CJabberProto::SendBothRequests(CJabberSDNode *pNode, HXML parent)
XmlNodeIq iq(pInfo);
HXML query = iq << XQUERY(JABBER_FEAT_DISCO_ITEMS);
if (pNode->GetNode())
- XmlAddAttr(query, _T("node"), pNode->GetNode());
+ XmlAddAttr(query, L"node", pNode->GetNode());
if (parent)
XmlAddChild(parent, iq);
@@ -437,7 +437,7 @@ void CJabberProto::PerformBrowse(HWND hwndDlg)
sttBrowseMode = SD_BROWSE_AGENTS;
TCHAR *szServerJid = mir_a2t(m_ThreadInfo->conn.server);
CJabberIqInfo *pInfo = AddIQ(&CJabberProto::OnIqResultServiceDiscoveryRootItems, JABBER_IQ_TYPE_GET, szServerJid);
- pInfo->m_pUserData = (void*)_T("jabber:iq:gateway");
+ pInfo->m_pUserData = (void*)L"jabber:iq:gateway";
pInfo->SetTimeout(30000);
XmlNodeIq iq(pInfo);
iq << XQUERY(JABBER_FEAT_DISCO_ITEMS);
@@ -635,12 +635,12 @@ void CJabberDlgDiscovery::OnInitDialog()
if (m_jid) {
SetDlgItemText(m_hwnd, IDC_COMBO_JID, m_jid);
- SetDlgItemText(m_hwnd, IDC_COMBO_NODE, _T(""));
+ SetDlgItemText(m_hwnd, IDC_COMBO_NODE, L"");
m_focusEditAfterBrowse = false;
}
else {
SetDlgItemTextA(m_hwnd, IDC_COMBO_JID, m_proto->m_ThreadInfo->conn.server);
- SetDlgItemText(m_hwnd, IDC_COMBO_NODE, _T(""));
+ SetDlgItemText(m_hwnd, IDC_COMBO_NODE, L"");
m_focusEditAfterBrowse = true;
}
@@ -668,7 +668,7 @@ void CJabberDlgDiscovery::OnInitDialog()
ListView_InsertColumn(hwndList, 0, &lvc);
lvc.cx = m_proto->getWord("discoWnd_cx1", 200);
lvc.iSubItem = 1;
- lvc.pszText = _T("JID");
+ lvc.pszText = L"JID";
ListView_InsertColumn(hwndList, 1, &lvc);
lvc.cx = m_proto->getWord("discoWnd_cx2", 200);
lvc.iSubItem = 2;
@@ -790,7 +790,7 @@ void CJabberDlgDiscovery::btnViewAsList_OnClick(CCtrlButton *)
void CJabberDlgDiscovery::btnGoHome_OnClick(CCtrlButton *)
{
SetDlgItemTextA(m_hwnd, IDC_COMBO_JID, m_proto->m_ThreadInfo->conn.server);
- SetDlgItemText(m_hwnd, IDC_COMBO_NODE, _T(""));
+ SetDlgItemText(m_hwnd, IDC_COMBO_NODE, L"");
PostMessage(m_hwnd, WM_COMMAND, MAKEWPARAM(IDC_BUTTON_BROWSE, 0), 0);
}
@@ -846,8 +846,8 @@ void CJabberDlgDiscovery::btnBookmarks_OnClick(CCtrlButton *)
else {
res /= 10;
- SetDlgItemText(m_hwnd, IDC_COMBO_JID, _T(""));
- SetDlgItemText(m_hwnd, IDC_COMBO_NODE, _T(""));
+ SetDlgItemText(m_hwnd, IDC_COMBO_JID, L"");
+ SetDlgItemText(m_hwnd, IDC_COMBO_NODE, L"");
char setting[MAXMODULELABELLENGTH];
mir_snprintf(setting, "discoWnd_favJID_%d", res);
@@ -889,7 +889,7 @@ void CJabberDlgDiscovery::btnBookmarks_OnClick(CCtrlButton *)
SetDlgItemText(m_hwnd, IDC_COMBO_JID, _T(SD_FAKEJID_CONFERENCES));
break;
}
- SetDlgItemText(m_hwnd, IDC_COMBO_NODE, _T(""));
+ SetDlgItemText(m_hwnd, IDC_COMBO_NODE, L"");
PostMessage(m_hwnd, WM_COMMAND, MAKEWPARAM(IDC_BUTTON_BROWSE, 0), 0);
}
@@ -948,7 +948,7 @@ INT_PTR CJabberDlgDiscovery::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
case WM_JABBER_TRANSPORT_REFRESH:
if (m_proto->m_nSDBrowseMode == SD_BROWSE_MYAGENTS) {
SetDlgItemText(m_hwnd, IDC_COMBO_JID, _T(SD_FAKEJID_MYAGENTS));
- SetDlgItemText(m_hwnd, IDC_COMBO_NODE, _T(""));
+ SetDlgItemText(m_hwnd, IDC_COMBO_NODE, L"");
PostMessage(m_hwnd, WM_COMMAND, MAKEWPARAM(IDC_BUTTON_BROWSE, 0), 0);
}
break;
@@ -1189,15 +1189,15 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM
{ NULL, LPGENT("Add to favorites"), SD_ACT_FAVORITE},
{ NULL, LPGENT("Add to roster"), SD_ACT_ROSTER, SD_FLG_NONODE | SD_FLG_NOTONROSTER},
{ JABBER_FEAT_MUC, LPGENT("Bookmark chatroom"), SD_ACT_BOOKMARK, SD_FLG_NORESOURCE | SD_FLG_HASUSER},
- { _T("jabber:iq:search"), LPGENT("Add search directory"), SD_ACT_ADDDIRECTORY},
+ { L"jabber:iq:search", LPGENT("Add search directory"), SD_ACT_ADDDIRECTORY},
{ JABBER_FEAT_BYTESTREAMS, LPGENT("Use this proxy"), SD_ACT_PROXY},
{0},
{ JABBER_FEAT_REGISTER, LPGENT("Register"), SD_ACT_REGISTER},
- { _T("jabber:iq:gateway"), LPGENT("Unregister"), SD_ACT_UNREGISTER, SD_FLG_ONROSTER | SD_FLG_SUBSCRIBED},
+ { L"jabber:iq:gateway", LPGENT("Unregister"), SD_ACT_UNREGISTER, SD_FLG_ONROSTER | SD_FLG_SUBSCRIBED},
{ JABBER_FEAT_COMMANDS, LPGENT("Commands..."), SD_ACT_ADHOC},
{0},
- { _T("jabber:iq:gateway"), LPGENT("Logon"), SD_ACT_LOGON, SD_FLG_ONROSTER | SD_FLG_SUBSCRIBED | SD_FLG_ONLINE},
- { _T("jabber:iq:gateway"), LPGENT("Logoff"), SD_ACT_LOGOFF, SD_FLG_ONROSTER | SD_FLG_SUBSCRIBED | SD_FLG_NOTONLINE},
+ { L"jabber:iq:gateway", LPGENT("Logon"), SD_ACT_LOGON, SD_FLG_ONROSTER | SD_FLG_SUBSCRIBED | SD_FLG_ONLINE},
+ { L"jabber:iq:gateway", LPGENT("Logoff"), SD_ACT_LOGOFF, SD_FLG_ONROSTER | SD_FLG_SUBSCRIBED | SD_FLG_NOTONLINE},
{0},
{ NULL, LPGENT("Copy JID"), SD_ACT_COPYJID},
{ NULL, LPGENT("Copy node name"), SD_ACT_COPYNODE},
@@ -1345,7 +1345,7 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM
mir_snprintf(setting, "discoWnd_favJID_%d", count);
setTString(setting, pNode->GetJid());
mir_snprintf(setting, "discoWnd_favNode_%d", count);
- setTString(setting, pNode->GetNode() ? pNode->GetNode() : _T(""));
+ setTString(setting, pNode->GetNode() ? pNode->GetNode() : L"");
setDword("discoWnd_favCount", ++count);
}
break;
@@ -1384,7 +1384,7 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM
item->name = mir_tstrdup(pNode->GetName());
}
- item->type = _T("conference");
+ item->type = L"conference";
AddEditBookmark(item);
}
}
@@ -1433,14 +1433,14 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM
case SD_ACT_LOGON:
case SD_ACT_LOGOFF:
- m_ThreadInfo->send(XmlNode(_T("presence")) << XATTR(_T("to"), pNode->GetJid()) << XATTR(_T("type"), (res != SD_ACT_LOGON) ? _T("unavailable") : NULL));
+ m_ThreadInfo->send(XmlNode(L"presence") << XATTR(L"to", pNode->GetJid()) << XATTR(L"type", (res != SD_ACT_LOGON) ? L"unavailable" : NULL));
break;
case SD_ACT_UNREGISTER:
- m_ThreadInfo->send(XmlNodeIq(_T("set"), SerialNext(), pNode->GetJid()) << XQUERY(JABBER_FEAT_REGISTER) << XCHILD(_T("remove")));
+ m_ThreadInfo->send(XmlNodeIq(L"set", SerialNext(), pNode->GetJid()) << XQUERY(JABBER_FEAT_REGISTER) << XCHILD(L"remove"));
- m_ThreadInfo->send(XmlNodeIq(_T("set"), SerialNext()) << XQUERY(JABBER_FEAT_IQ_ROSTER)
- << XCHILD(_T("item")) << XATTR(_T("jid"), pNode->GetJid()) << XATTR(_T("subscription"), _T("remove")));
+ m_ThreadInfo->send(XmlNodeIq(L"set", SerialNext()) << XQUERY(JABBER_FEAT_IQ_ROSTER)
+ << XCHILD(L"item") << XATTR(L"jid", pNode->GetJid()) << XATTR(L"subscription", L"remove"));
break;
default:
diff --git a/protocols/JabberG/src/jabber_disco.h b/protocols/JabberG/src/jabber_disco.h
index 55422f9358..9c327a60f4 100644
--- a/protocols/JabberG/src/jabber_disco.h
+++ b/protocols/JabberG/src/jabber_disco.h
@@ -349,23 +349,23 @@ public:
{
CMString tszTmp;
- tszTmp.AppendFormat(_T("Jid: %s\r\n"), m_szJid);
+ tszTmp.AppendFormat(L"Jid: %s\r\n", m_szJid);
if (m_szNode)
- tszTmp.AppendFormat(_T("%s: %s\r\n"), TranslateT("Node"), m_szNode);
+ tszTmp.AppendFormat(L"%s: %s\r\n", TranslateT("Node"), m_szNode);
if (m_pIdentities) {
- tszTmp.AppendFormat(_T("\r\n%s:\r\n"), TranslateT("Identities"));
+ tszTmp.AppendFormat(L"\r\n%s:\r\n", TranslateT("Identities"));
CJabberSDIdentity *pIdentity = m_pIdentities;
while (pIdentity) {
if (pIdentity->GetName())
- tszTmp.AppendFormat(_T(" %c %s (%s: %s, %s: %s)\r\n"),
+ tszTmp.AppendFormat(L" %c %s (%s: %s, %s: %s)\r\n",
CHR_BULLET, pIdentity->GetName(),
TranslateT("category"), pIdentity->GetCategory(),
TranslateT("type"), pIdentity->GetType());
else
- tszTmp.AppendFormat(_T(" %c %s: %s, %s: %s\r\n"),
+ tszTmp.AppendFormat(L" %c %s: %s, %s: %s\r\n",
CHR_BULLET,
TranslateT("Category"), pIdentity->GetCategory(),
TranslateT("Type"), pIdentity->GetType());
@@ -375,17 +375,17 @@ public:
}
if (m_pFeatures) {
- tszTmp.AppendFormat(_T("\r\n%s:\r\n"), TranslateT("Supported features"));
+ tszTmp.AppendFormat(L"\r\n%s:\r\n", TranslateT("Supported features"));
for (CJabberSDFeature *pFeature = m_pFeatures; pFeature; pFeature = pFeature->GetNext())
- tszTmp.AppendFormat(_T(" %c %s\r\n"), CHR_BULLET, pFeature->GetVar());
+ tszTmp.AppendFormat(L" %c %s\r\n", CHR_BULLET, pFeature->GetVar());
}
if (m_szInfoError)
- tszTmp.AppendFormat(_T("\r\n%s: %s\r\n"), TranslateT("Info request error"), m_szInfoError);
+ tszTmp.AppendFormat(L"\r\n%s: %s\r\n", TranslateT("Info request error"), m_szInfoError);
if (m_szItemsError)
- tszTmp.AppendFormat(_T("\r\n%s: %s\r\n"), TranslateT("Items request error"), m_szItemsError);
+ tszTmp.AppendFormat(L"\r\n%s: %s\r\n", TranslateT("Items request error"), m_szItemsError);
tszTmp.TrimRight();
_tcsncpy_s(szText, nMaxLength, tszTmp, _TRUNCATE);
diff --git a/protocols/JabberG/src/jabber_events.cpp b/protocols/JabberG/src/jabber_events.cpp
index 5c293e4f79..b78c31f4c0 100644
--- a/protocols/JabberG/src/jabber_events.cpp
+++ b/protocols/JabberG/src/jabber_events.cpp
@@ -46,12 +46,12 @@ int CJabberProto::OnContactDeleted(WPARAM hContact, LPARAM)
JabberStripJid(m_ThreadInfo->fullJID, szStrippedJid, _countof(szStrippedJid));
TCHAR *szDog = _tcschr(szStrippedJid, _T('@'));
if (szDog && mir_tstrcmpi(szDog + 1, jid))
- m_ThreadInfo->send(XmlNodeIq(_T("set"), SerialNext(), jid) << XQUERY(JABBER_FEAT_REGISTER) << XCHILD(_T("remove")));
+ m_ThreadInfo->send(XmlNodeIq(L"set", SerialNext(), jid) << XQUERY(JABBER_FEAT_REGISTER) << XCHILD(L"remove"));
}
// Remove from roster, server also handles the presence unsubscription process.
- m_ThreadInfo->send(XmlNodeIq(_T("set"), SerialNext()) << XQUERY(JABBER_FEAT_IQ_ROSTER)
- << XCHILD(_T("item")) << XATTR(_T("jid"), jid) << XATTR(_T("subscription"), _T("remove")));
+ m_ThreadInfo->send(XmlNodeIq(L"set", SerialNext()) << XQUERY(JABBER_FEAT_IQ_ROSTER)
+ << XCHILD(L"item") << XATTR(L"jid", jid) << XATTR(L"subscription", L"remove"));
}
return 0;
}
@@ -97,7 +97,7 @@ void __cdecl CJabberProto::OnRenameGroup(DBCONTACTWRITESETTING *cws, MCONTACT hC
else {
TCHAR *p = sttSettingToTchar(cws);
if (cws->value.pszVal != NULL && mir_tstrcmp(p, item->group)) {
- debugLog(_T("Group set to %s"), p);
+ debugLog(L"Group set to %s", p);
if (p)
AddContactToRoster(item->jid, tszNick, p);
}
@@ -120,7 +120,7 @@ void __cdecl CJabberProto::OnRenameContact(DBCONTACTWRITESETTING *cws, MCONTACT
ptrT newNick( sttSettingToTchar(cws));
if (newNick && mir_tstrcmp(item->nick, newNick)) {
- debugLog(_T("Renaming contact %s: %s -> %s"), item->jid, item->nick, newNick);
+ debugLog(L"Renaming contact %s: %s -> %s", item->jid, item->nick, newNick);
AddContactToRoster(item->jid, newNick, item->group);
}
}
@@ -134,7 +134,7 @@ void __cdecl CJabberProto::OnAddContactForever(DBCONTACTWRITESETTING *cws, MCONT
if (jid == NULL)
return;
- debugLog(_T("Add %s permanently to list"), jid);
+ debugLog(L"Add %s permanently to list", jid);
ptrT nick(db_get_tsa(hContact, "CList", "MyHandle"));
if (nick == NULL)
nick = getTStringA(hContact, "Nick");
@@ -145,10 +145,10 @@ void __cdecl CJabberProto::OnAddContactForever(DBCONTACTWRITESETTING *cws, MCONT
AddContactToRoster(jid, nick, ptrT(db_get_tsa(hContact, "CList", "Group")));
- XmlNode xPresence(_T("presence")); xPresence << XATTR(_T("to"), LPCTSTR(jid)) << XATTR(_T("type"), _T("subscribe"));
+ XmlNode xPresence(L"presence"); xPresence << XATTR(L"to", LPCTSTR(jid)) << XATTR(L"type", L"subscribe");
ptrT myNick(getTStringA(NULL, "Nick"));
if (myNick != NULL)
- xPresence << XCHILD(_T("nick"), LPCTSTR(myNick)) << XATTR(_T("xmlns"), JABBER_FEAT_NICK);
+ xPresence << XCHILD(L"nick", LPCTSTR(myNick)) << XATTR(L"xmlns", JABBER_FEAT_NICK);
m_ThreadInfo->send(xPresence);
SendGetVcard(jid);
diff --git a/protocols/JabberG/src/jabber_file.cpp b/protocols/JabberG/src/jabber_file.cpp
index 69951806b0..aef5167c73 100644
--- a/protocols/JabberG/src/jabber_file.cpp
+++ b/protocols/JabberG/src/jabber_file.cpp
@@ -179,7 +179,7 @@ void JabberFileServerConnection(JABBER_SOCKET hConnection, DWORD /*dwRemoteIP*/,
CallService(MS_NETLIB_GETCONNECTIONINFO, (WPARAM)hConnection, (LPARAM)&connInfo);
TCHAR szPort[10];
- mir_sntprintf(szPort, _T("%d"), connInfo.wPort);
+ mir_sntprintf(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;
TCHAR szPort[20];
- mir_sntprintf(szPort, _T("%d"), nlb.wPort);
+ mir_sntprintf(szPort, L"%d", nlb.wPort);
JABBER_LIST_ITEM *item = ListAdd(LIST_FILE, szPort);
item->ft = ft;
@@ -294,12 +294,12 @@ void __cdecl CJabberProto::FileServerThread(filetransfer *ft)
size_t len = mir_tstrlen(ptszResource) + mir_tstrlen(ft->jid) + 2;
TCHAR *fulljid = (TCHAR *)alloca(sizeof(TCHAR) * len);
- mir_sntprintf(fulljid, len, _T("%s/%s"), ft->jid, ptszResource);
+ mir_sntprintf(fulljid, len, L"%s/%s", ft->jid, ptszResource);
- XmlNodeIq iq(_T("set"), ft->szId, fulljid);
+ XmlNodeIq iq(L"set", ft->szId, fulljid);
HXML query = iq << XQUERY(JABBER_FEAT_OOB);
- query << XCHILD(_T("url"), _A2T(szAddr));
- query << XCHILD(_T("desc"), ft->szDescription);
+ query << XCHILD(L"url", _A2T(szAddr));
+ query << XCHILD(L"desc", ft->szDescription);
m_ThreadInfo->send(iq);
debugLogA("Waiting for the file to be sent...");
@@ -390,11 +390,11 @@ int CJabberProto::FileSendParse(JABBER_SOCKET s, filetransfer *ft, char* buffer,
if (ft->httpPath == NULL)
debugLogA("Requested file name does not matched (httpPath == NULL)");
else
- debugLog(_T("Requested file name does not matched ('%s' vs. '%s')"), ft->httpPath, t);
+ debugLog(L"Requested file name does not matched ('%s' vs. '%s')", ft->httpPath, t);
ft->state = FT_ERROR;
break;
}
- debugLog(_T("Sending [%s]"), ft->std.ptszFiles[currentFile]);
+ debugLog(L"Sending [%s]", ft->std.ptszFiles[currentFile]);
_tstati64(ft->std.ptszFiles[currentFile], &statbuf); // file size in statbuf.st_size
if ((fileId = _topen(ft->std.ptszFiles[currentFile], _O_BINARY | _O_RDONLY)) < 0) {
debugLogA("File cannot be opened");
@@ -501,7 +501,7 @@ int filetransfer::create()
return fileId;
TCHAR filefull[MAX_PATH];
- mir_sntprintf(filefull, _T("%s\\%s"), std.tszWorkingDir, std.tszCurrentFile);
+ mir_sntprintf(filefull, L"%s\\%s", std.tszWorkingDir, std.tszCurrentFile);
replaceStrT(std.tszCurrentFile, filefull);
if (hWaitEvent != INVALID_HANDLE_VALUE)
@@ -512,12 +512,12 @@ int filetransfer::create()
WaitForSingleObject(hWaitEvent, INFINITE);
if (fileId == -1) {
- ppro->debugLog(_T("Saving to [%s]"), std.tszCurrentFile);
+ ppro->debugLog(L"Saving to [%s]", std.tszCurrentFile);
fileId = _topen(std.tszCurrentFile, _O_BINARY | _O_CREAT | _O_TRUNC | _O_WRONLY, _S_IREAD | _S_IWRITE);
}
if (fileId == -1)
- ppro->debugLog(_T("Cannot create file '%s' during a file transfer"), filefull);
+ ppro->debugLog(L"Cannot create file '%s' during a file transfer", filefull);
else if (std.currentFileSize != 0)
_chsize(fileId, std.currentFileSize);
diff --git a/protocols/JabberG/src/jabber_filterlist.cpp b/protocols/JabberG/src/jabber_filterlist.cpp
index ad79a42e9a..f03bf49ee1 100644
--- a/protocols/JabberG/src/jabber_filterlist.cpp
+++ b/protocols/JabberG/src/jabber_filterlist.cpp
@@ -180,7 +180,7 @@ LRESULT CCtrlFilterListView::CustomWndProc(UINT msg, WPARAM wParam, LPARAM lPara
case 2:
fdat->m_hwndOwner = m_hwnd;
- fdat->m_hwndEditBox = CreateWindow(_T("edit"), fdat->m_filterText,
+ fdat->m_hwndEditBox = CreateWindow(L"edit", fdat->m_filterText,
WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_LEFT|ES_AUTOHSCROLL,
0, 0, 0, 0,
::GetParent(m_hwnd), (HMENU)-1, hInst, NULL);
diff --git a/protocols/JabberG/src/jabber_form.cpp b/protocols/JabberG/src/jabber_form.cpp
index c8ad8a03b7..6965e989da 100644
--- a/protocols/JabberG/src/jabber_form.cpp
+++ b/protocols/JabberG/src/jabber_form.cpp
@@ -108,7 +108,7 @@ void JabberFormCenterContent(HWND hwndStatic)
void JabberFormSetInstruction(HWND hwndForm, const TCHAR *text)
{
- if (!text) text = _T("");
+ if (!text) text = L"";
size_t len = mir_tstrlen(text);
size_t fixedLen = len;
@@ -205,19 +205,19 @@ void JabberFormSetInstruction(HWND hwndForm, const TCHAR *text)
static TJabberFormControlType JabberFormTypeNameToId(const TCHAR *type)
{
- if (!mir_tstrcmp(type, _T("text-private")))
+ if (!mir_tstrcmp(type, L"text-private"))
return JFORM_CTYPE_TEXT_PRIVATE;
- if (!mir_tstrcmp(type, _T("text-multi")) || !mir_tstrcmp(type, _T("jid-multi")))
+ if (!mir_tstrcmp(type, L"text-multi") || !mir_tstrcmp(type, L"jid-multi"))
return JFORM_CTYPE_TEXT_MULTI;
- if (!mir_tstrcmp(type, _T("boolean")))
+ if (!mir_tstrcmp(type, L"boolean"))
return JFORM_CTYPE_BOOLEAN;
- if (!mir_tstrcmp(type, _T("list-single")))
+ if (!mir_tstrcmp(type, L"list-single"))
return JFORM_CTYPE_LIST_SINGLE;
- if (!mir_tstrcmp(type, _T("list-multi")))
+ if (!mir_tstrcmp(type, L"list-multi"))
return JFORM_CTYPE_LIST_MULTI;
- if (!mir_tstrcmp(type, _T("fixed")))
+ if (!mir_tstrcmp(type, L"fixed"))
return JFORM_CTYPE_FIXED;
- if (!mir_tstrcmp(type, _T("hidden")))
+ if (!mir_tstrcmp(type, L"hidden"))
return JFORM_CTYPE_HIDDEN;
return JFORM_CTYPE_TEXT_SINGLE;
@@ -283,7 +283,7 @@ void JabberFormLayoutSingleControl(TJabberFormControlInfo *item, TJabberFormLayo
}
#define JabberFormCreateLabel() \
- CreateWindow(_T("static"), labelStr, WS_CHILD|WS_VISIBLE|SS_CENTERIMAGE, \
+ CreateWindow(L"static", labelStr, WS_CHILD|WS_VISIBLE|SS_CENTERIMAGE, \
0, 0, 0, 0, hwndStatic, (HMENU)-1, hInst, NULL)
TJabberFormControlInfo *JabberFormAppendControl(HWND hwndStatic, TJabberFormLayoutInfo *layout_info, TJabberFormControlType type, const TCHAR *labelStr, const TCHAR *valueStr)
@@ -301,7 +301,7 @@ TJabberFormControlInfo *JabberFormAppendControl(HWND hwndStatic, TJabberFormLayo
switch (type) {
case JFORM_CTYPE_TEXT_PRIVATE:
item->hLabel = JabberFormCreateLabel();
- item->hCtrl = CreateWindowEx(WS_EX_CLIENTEDGE, _T("edit"), valueStr,
+ item->hCtrl = CreateWindowEx(WS_EX_CLIENTEDGE, L"edit", valueStr,
WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_LEFT | ES_AUTOHSCROLL | ES_PASSWORD,
0, 0, 0, 0,
hwndStatic, (HMENU)layout_info->id, hInst, NULL);
@@ -310,7 +310,7 @@ TJabberFormControlInfo *JabberFormAppendControl(HWND hwndStatic, TJabberFormLayo
case JFORM_CTYPE_TEXT_MULTI:
item->hLabel = JabberFormCreateLabel();
- item->hCtrl = CreateWindowEx(WS_EX_CLIENTEDGE, _T("edit"), valueStr,
+ item->hCtrl = CreateWindowEx(WS_EX_CLIENTEDGE, L"edit", valueStr,
WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL | ES_LEFT | ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN,
0, 0, 0, 0,
hwndStatic, (HMENU)layout_info->id, hInst, NULL);
@@ -319,11 +319,11 @@ TJabberFormControlInfo *JabberFormAppendControl(HWND hwndStatic, TJabberFormLayo
break;
case JFORM_CTYPE_BOOLEAN:
- item->hCtrl = CreateWindowEx(0, _T("button"), labelStr,
+ item->hCtrl = CreateWindowEx(0, L"button", labelStr,
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, _T("1")))
+ if (valueStr && !mir_tstrcmp(valueStr, L"1"))
SendMessage(item->hCtrl, BM_SETCHECK, 1, 0);
++layout_info->id;
break;
@@ -347,7 +347,7 @@ TJabberFormControlInfo *JabberFormAppendControl(HWND hwndStatic, TJabberFormLayo
break;
case JFORM_CTYPE_FIXED:
- item->hCtrl = CreateWindow(_T("edit"), valueStr,
+ item->hCtrl = CreateWindow(L"edit", valueStr,
WS_CHILD | WS_VISIBLE | ES_MULTILINE | ES_READONLY | ES_AUTOHSCROLL,
0, 0, 0, 0,
hwndStatic, (HMENU)-1, hInst, NULL);
@@ -358,7 +358,7 @@ TJabberFormControlInfo *JabberFormAppendControl(HWND hwndStatic, TJabberFormLayo
case JFORM_CTYPE_TEXT_SINGLE:
item->hLabel = labelStr ? (JabberFormCreateLabel()) : NULL;
- item->hCtrl = CreateWindowEx(WS_EX_CLIENTEDGE, _T("edit"), valueStr,
+ item->hCtrl = CreateWindowEx(WS_EX_CLIENTEDGE, L"edit", valueStr,
WS_CHILD | WS_VISIBLE | WS_TABSTOP | ES_LEFT | ES_AUTOHSCROLL,
0, 0, 0, 0,
hwndStatic, (HMENU)layout_info->id, hInst, NULL);
@@ -440,7 +440,7 @@ void JabberFormCreateUI(HWND hwndStatic, HXML xNode, int *formHeight, BOOL bComp
TCHAR *labelStr, *valueStr;
RECT frameRect;
- if (xNode == NULL || XmlGetName(xNode) == NULL || mir_tstrcmp(XmlGetName(xNode), _T("x")) || hwndStatic == NULL)
+ if (xNode == NULL || XmlGetName(xNode) == NULL || mir_tstrcmp(XmlGetName(xNode), L"x") || hwndStatic == NULL)
return;
GetClientRect(hwndStatic, &frameRect);
@@ -460,14 +460,14 @@ void JabberFormCreateUI(HWND hwndStatic, HXML xNode, int *formHeight, BOOL bComp
if (!n)
break;
- if (mir_tstrcmp(XmlGetName(n), _T("field")))
+ if (mir_tstrcmp(XmlGetName(n), L"field"))
continue;
- varStr = XmlGetAttrValue(n, _T("var"));
- if ((typeName = XmlGetAttrValue(n, _T("type"))) == NULL)
+ varStr = XmlGetAttrValue(n, L"var");
+ if ((typeName = XmlGetAttrValue(n, L"type")) == NULL)
continue;
- if ((label = XmlGetAttrValue(n, _T("label"))) != NULL)
+ if ((label = XmlGetAttrValue(n, L"label")) != NULL)
labelStr = mir_tstrdup(label);
else
labelStr = mir_tstrdup(varStr);
@@ -484,7 +484,7 @@ void JabberFormCreateUI(HWND hwndStatic, HXML xNode, int *formHeight, BOOL bComp
v = XmlGetChild(n, j);
if (!v)
break;
- if (XmlGetName(v) && !mir_tstrcmp(XmlGetName(v), _T("value")) && XmlGetText(v))
+ if (XmlGetName(v) && !mir_tstrcmp(XmlGetName(v), L"value") && XmlGetText(v))
size += mir_tstrlen(XmlGetText(v)) + 2;
}
valueStr = (TCHAR*)mir_alloc(sizeof(TCHAR)*size);
@@ -493,9 +493,9 @@ void JabberFormCreateUI(HWND hwndStatic, HXML xNode, int *formHeight, BOOL bComp
v = XmlGetChild(n, j);
if (!v)
break;
- if (XmlGetName(v) && !mir_tstrcmp(XmlGetName(v), _T("value")) && XmlGetText(v)) {
+ if (XmlGetName(v) && !mir_tstrcmp(XmlGetName(v), L"value") && XmlGetText(v)) {
if (valueStr[0])
- mir_tstrcat(valueStr, _T("\r\n"));
+ mir_tstrcat(valueStr, L"\r\n");
mir_tstrcat(valueStr, XmlGetText(v));
}
}
@@ -514,11 +514,11 @@ void JabberFormCreateUI(HWND hwndStatic, HXML xNode, int *formHeight, BOOL bComp
if (o == NULL)
break;
- if (mir_tstrcmp(XmlGetName(o), _T("option")))
+ if (mir_tstrcmp(XmlGetName(o), L"option"))
continue;
if ((v = XmlGetChild(o, "value")) == NULL || XmlGetText(v) == NULL)
continue;
- if ((str = XmlGetAttrValue(o, _T("label"))) == NULL)
+ if ((str = XmlGetAttrValue(o, L"label")) == NULL)
str = XmlGetText(v);
if (str == NULL)
continue;
@@ -533,11 +533,11 @@ void JabberFormCreateUI(HWND hwndStatic, HXML xNode, int *formHeight, BOOL bComp
if (o == NULL)
break;
- if (mir_tstrcmp(XmlGetName(o), _T("option")))
+ if (mir_tstrcmp(XmlGetName(o), L"option"))
continue;
if ((v = XmlGetChild(o, "value")) == NULL || XmlGetText(v) == NULL)
continue;
- if ((str = XmlGetAttrValue(o, _T("label"))) == NULL)
+ if ((str = XmlGetAttrValue(o, L"label")) == NULL)
str = XmlGetText(v);
if (str == 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), _T("value")) && !mir_tstrcmp(XmlGetText(vs), XmlGetText(v))) {
+ if (!mir_tstrcmp(XmlGetName(vs), L"value") && !mir_tstrcmp(XmlGetText(vs), XmlGetText(v))) {
selected = true;
break;
}
@@ -579,13 +579,13 @@ HXML JabberFormGetData(HWND hwndStatic, HXML xNode)
const TCHAR *varName, *type, *fieldStr, *labelText, *str2;
TCHAR *p, *q, *str;
- if (xNode == NULL || XmlGetName(xNode) == NULL || mir_tstrcmp(XmlGetName(xNode), _T("x")) || hwndStatic == NULL)
+ if (xNode == NULL || XmlGetName(xNode) == NULL || mir_tstrcmp(XmlGetName(xNode), L"x") || hwndStatic == NULL)
return NULL;
hFrame = hwndStatic;
id = 0;
- XmlNode x(_T("x"));
- x << XATTR(_T("xmlns"), JABBER_FEAT_DATA_FORMS) << XATTR(_T("type"), _T("submit"));
+ XmlNode x(L"x");
+ x << XATTR(L"xmlns", JABBER_FEAT_DATA_FORMS) << XATTR(L"type", L"submit");
for (int i = 0;; i++) {
n = XmlGetChild(xNode, i);
@@ -593,36 +593,36 @@ HXML JabberFormGetData(HWND hwndStatic, HXML xNode)
break;
fieldStr = NULL;
- if (mir_tstrcmp(XmlGetName(n), _T("field")))
+ if (mir_tstrcmp(XmlGetName(n), L"field"))
continue;
- if ((varName = XmlGetAttrValue(n, _T("var"))) == NULL || (type = XmlGetAttrValue(n, _T("type"))) == NULL)
+ if ((varName = XmlGetAttrValue(n, L"var")) == NULL || (type = XmlGetAttrValue(n, L"type")) == NULL)
continue;
hCtrl = GetDlgItem(hFrame, id);
- HXML field = x << XCHILD(_T("field")) << XATTR(_T("var"), varName);
+ HXML field = x << XCHILD(L"field") << XATTR(L"var", varName);
- if (!mir_tstrcmp(type, _T("text-multi")) || !mir_tstrcmp(type, _T("jid-multi"))) {
+ if (!mir_tstrcmp(type, L"text-multi") || !mir_tstrcmp(type, L"jid-multi")) {
len = GetWindowTextLength(GetDlgItem(hFrame, id));
str = (TCHAR*)mir_alloc(sizeof(TCHAR)*(len + 1));
GetDlgItemText(hFrame, id, str, len + 1);
p = str;
while (p != NULL) {
- if ((q = _tcsstr(p, _T("\r\n"))) != NULL)
+ if ((q = _tcsstr(p, L"\r\n")) != NULL)
*q = '\0';
- field << XCHILD(_T("value"), p);
+ field << XCHILD(L"value", p);
p = q ? q + 2 : NULL;
}
mir_free(str);
id++;
}
- else if (!mir_tstrcmp(type, _T("boolean"))) {
+ else if (!mir_tstrcmp(type, L"boolean")) {
TCHAR buf[10];
_itot(IsDlgButtonChecked(hFrame, id) == BST_CHECKED ? 1 : 0, buf, 10);
- field << XCHILD(_T("value"), buf);
+ field << XCHILD(L"value", buf);
id++;
}
- else if (!mir_tstrcmp(type, _T("list-single"))) {
+ else if (!mir_tstrcmp(type, L"list-single")) {
len = GetWindowTextLength(GetDlgItem(hFrame, id));
str = (TCHAR*)mir_alloc(sizeof(TCHAR)*(len + 1));
GetDlgItemText(hFrame, id, str, len + 1);
@@ -632,9 +632,9 @@ HXML JabberFormGetData(HWND hwndStatic, HXML xNode)
if (!o)
break;
- if (!mir_tstrcmp(XmlGetName(o), _T("option"))) {
+ if (!mir_tstrcmp(XmlGetName(o), L"option")) {
if ((v = XmlGetChild(o, "value")) != NULL && XmlGetText(v)) {
- if ((str2 = XmlGetAttrValue(o, _T("label"))) == NULL)
+ if ((str2 = XmlGetAttrValue(o, L"label")) == NULL)
str2 = XmlGetText(v);
if (!mir_tstrcmp(str2, str))
break;
@@ -643,12 +643,12 @@ HXML JabberFormGetData(HWND hwndStatic, HXML xNode)
}
if (o)
- field << XCHILD(_T("value"), XmlGetText(v));
+ field << XCHILD(L"value", XmlGetText(v));
mir_free(str);
id++;
}
- else if (!mir_tstrcmp(type, _T("list-multi"))) {
+ else if (!mir_tstrcmp(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,13 +661,13 @@ HXML JabberFormGetData(HWND hwndStatic, HXML xNode)
if (!o)
break;
- if (XmlGetName(o) && !mir_tstrcmp(XmlGetName(o), _T("option"))) {
+ if (XmlGetName(o) && !mir_tstrcmp(XmlGetName(o), L"option")) {
if ((v = XmlGetChild(o, "value")) != NULL && XmlGetText(v)) {
- if ((labelText = XmlGetAttrValue(o, _T("label"))) == NULL)
+ if ((labelText = XmlGetAttrValue(o, L"label")) == NULL)
labelText = XmlGetText(v);
if (!mir_tstrcmp(labelText, str))
- field << XCHILD(_T("value"), XmlGetText(v));
+ field << XCHILD(L"value", XmlGetText(v));
}
}
}
@@ -677,16 +677,16 @@ HXML JabberFormGetData(HWND hwndStatic, HXML xNode)
}
id++;
}
- else if (!mir_tstrcmp(type, _T("fixed")) || !mir_tstrcmp(type, _T("hidden"))) {
+ else if (!mir_tstrcmp(type, L"fixed") || !mir_tstrcmp(type, L"hidden")) {
v = XmlGetChild(n, "value");
if (v != NULL && XmlGetText(v) != NULL)
- field << XCHILD(_T("value"), XmlGetText(v));
+ field << XCHILD(L"value", XmlGetText(v));
}
else { // everything else is considered "text-single" or "text-private"
len = GetWindowTextLength(GetDlgItem(hFrame, id));
str = (TCHAR*)mir_alloc(sizeof(TCHAR)*(len + 1));
GetDlgItemText(hFrame, id, str, len + 1);
- field << XCHILD(_T("value"), str);
+ field << XCHILD(L"value", str);
mir_free(str);
id++;
}
@@ -724,16 +724,16 @@ static INT_PTR CALLBACK JabberFormDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
HXML n;
LONG frameExStyle;
// Set dialog title
- if (jfi->xNode != NULL && (n = XmlGetChild(jfi->xNode, _T("title"))) != NULL && XmlGetText(n) != NULL)
+ if (jfi->xNode != NULL && (n = XmlGetChild(jfi->xNode, L"title")) != NULL && XmlGetText(n) != NULL)
SetWindowText(hwndDlg, XmlGetText(n));
else
SetWindowText(hwndDlg, TranslateTS(jfi->defTitle));
// Set instruction field
- if (jfi->xNode != NULL && (n = XmlGetChild(jfi->xNode, _T("instructions"))) != NULL && XmlGetText(n) != NULL)
+ if (jfi->xNode != NULL && (n = XmlGetChild(jfi->xNode, L"instructions")) != NULL && XmlGetText(n) != NULL)
JabberFormSetInstruction(hwndDlg, XmlGetText(n));
else {
- if (jfi->xNode != NULL && (n = XmlGetChild(jfi->xNode, _T("title"))) != NULL && XmlGetText(n) != NULL)
+ if (jfi->xNode != NULL && (n = XmlGetChild(jfi->xNode, L"title")) != NULL && XmlGetText(n) != NULL)
JabberFormSetInstruction(hwndDlg, XmlGetText(n));
else
JabberFormSetInstruction(hwndDlg, TranslateTS(jfi->defTitle));
diff --git a/protocols/JabberG/src/jabber_frame.cpp b/protocols/JabberG/src/jabber_frame.cpp
index d6bf5afce7..86faff30b5 100644
--- a/protocols/JabberG/src/jabber_frame.cpp
+++ b/protocols/JabberG/src/jabber_frame.cpp
@@ -79,7 +79,7 @@ CJabberInfoFrame::CJabberInfoFrame(CJabberProto *proto):
CLISTFrame frame = { sizeof(frame) };
HWND hwndClist = pcli->hwndContactList;
- frame.hWnd = CreateWindowEx(0, _T("JabberInfoFrameClass"), NULL, WS_CHILD|WS_VISIBLE, 0, 0, 100, 100, hwndClist, NULL, hInst, this);
+ frame.hWnd = CreateWindowEx(0, L"JabberInfoFrameClass", NULL, WS_CHILD|WS_VISIBLE, 0, 0, 100, 100, hwndClist, NULL, hInst, this);
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;
@@ -105,7 +105,7 @@ CJabberInfoFrame::CJabberInfoFrame(CJabberProto *proto):
UpdateInfoItem("$", proto->GetIconHandle(IDI_JABBER), proto->m_tszUserName);
CreateInfoItem("$/JID", true);
- UpdateInfoItem("$/JID", Skin_GetIconHandle(SKINICON_OTHER_USERDETAILS), _T("Offline"));
+ UpdateInfoItem("$/JID", Skin_GetIconHandle(SKINICON_OTHER_USERDETAILS), L"Offline");
SetInfoItemCallback("$/JID", &CJabberProto::InfoFrame_OnSetup);
}
@@ -137,7 +137,7 @@ void CJabberInfoFrame::InitClass()
wcx.style = CS_DBLCLKS|CS_HREDRAW|CS_VREDRAW;
wcx.lpfnWndProc = GlobalWndProc;
wcx.hInstance = hInst;
- wcx.lpszClassName = _T("JabberInfoFrameClass");
+ wcx.lpszClassName = L"JabberInfoFrameClass";
wcx.hCursor = LoadCursor(NULL, IDC_ARROW);
RegisterClassEx(&wcx);
bClassRegistered = true;
@@ -242,21 +242,21 @@ void CJabberInfoFrame::ReloadFonts()
FontIDT fontid = {0};
fontid.cbSize = sizeof(fontid);
- _tcsncpy_s(fontid.group, _T("Jabber"), _TRUNCATE);
- _tcsncpy_s(fontid.name, _T("Frame title"), _TRUNCATE);
+ _tcsncpy_s(fontid.group, L"Jabber", _TRUNCATE);
+ _tcsncpy_s(fontid.name, L"Frame title", _TRUNCATE);
m_clTitle = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)&lfFont);
DeleteObject(m_hfntTitle);
m_hfntTitle = CreateFontIndirect(&lfFont);
- _tcsncpy_s(fontid.name, _T("Frame text"), _TRUNCATE);
+ _tcsncpy_s(fontid.name, L"Frame text", _TRUNCATE);
m_clText = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)&lfFont);
DeleteObject(m_hfntText);
m_hfntText = CreateFontIndirect(&lfFont);
ColourIDT colourid = {0};
colourid.cbSize = sizeof(colourid);
- _tcsncpy_s(colourid.group, _T("Jabber"), _TRUNCATE);
- _tcsncpy_s(colourid.name, _T("Background"), _TRUNCATE);
+ _tcsncpy_s(colourid.group, L"Jabber", _TRUNCATE);
+ _tcsncpy_s(colourid.name, L"Background", _TRUNCATE);
m_clBack = CallService(MS_COLOUR_GETT, (WPARAM)&colourid, 0);
UpdateSize();
diff --git a/protocols/JabberG/src/jabber_ft.cpp b/protocols/JabberG/src/jabber_ft.cpp
index e6e270159f..0666d4d96c 100644
--- a/protocols/JabberG/src/jabber_ft.cpp
+++ b/protocols/JabberG/src/jabber_ft.cpp
@@ -100,26 +100,26 @@ void CJabberProto::FtInitiate(TCHAR* jid, filetransfer *ft)
filename = p + 1;
TCHAR tszJid[512];
- mir_sntprintf(tszJid, _T("%s/%s"), jid, rs);
+ mir_sntprintf(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(_T("si"), JABBER_FEAT_SI) << XATTR(_T("id"), sid)
- << XATTR(_T("mime-type"), _T("binary/octet-stream")) << XATTR(_T("profile"), JABBER_FEAT_SI_FT);
- si << XCHILDNS(_T("file"), JABBER_FEAT_SI_FT) << XATTR(_T("name"), filename)
- << XATTRI64(_T("size"), ft->fileSize[ft->std.currentFileNumber]) << XCHILD(_T("desc"), ft->szDescription);
+ HXML si = iq << XCHILDNS(L"si", JABBER_FEAT_SI) << XATTR(L"id", sid)
+ << XATTR(L"mime-type", L"binary/octet-stream") << XATTR(L"profile", JABBER_FEAT_SI_FT);
+ si << XCHILDNS(L"file", JABBER_FEAT_SI_FT) << XATTR(L"name", filename)
+ << XATTRI64(L"size", ft->fileSize[ft->std.currentFileNumber]) << XCHILD(L"desc", ft->szDescription);
- HXML field = si << XCHILDNS(_T("feature"), JABBER_FEAT_FEATURE_NEG)
- << XCHILDNS(_T("x"), JABBER_FEAT_DATA_FORMS) << XATTR(_T("type"), _T("form"))
- << XCHILD(_T("field")) << XATTR(_T("var"), _T("stream-method")) << XATTR(_T("type"), _T("list-single"));
+ HXML field = si << XCHILDNS(L"feature", JABBER_FEAT_FEATURE_NEG)
+ << XCHILDNS(L"x", JABBER_FEAT_DATA_FORMS) << XATTR(L"type", L"form")
+ << XCHILD(L"field") << XATTR(L"var", L"stream-method") << XATTR(L"type", L"list-single");
BOOL bDirect = m_options.BsDirect;
BOOL bProxy = m_options.BsProxyManual;
// bytestreams support?
if (bDirect || bProxy)
- field << XCHILD(_T("option")) << XCHILD(_T("value"), JABBER_FEAT_BYTESTREAMS);
+ field << XCHILD(L"option") << XCHILD(L"value", JABBER_FEAT_BYTESTREAMS);
- field << XCHILD(_T("option")) << XCHILD(_T("value"), JABBER_FEAT_IBB);
+ field << XCHILD(L"option") << XCHILD(L"value", JABBER_FEAT_IBB);
m_ThreadInfo->send(iq);
}
@@ -138,7 +138,7 @@ void CJabberProto::OnFtSiResult(HXML iqNode, CJabberIqInfo *pInfo)
if ((featureNode = XmlGetChild(siNode, "feature")) != NULL) {
if ((xNode = XmlGetChildByTag(featureNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS)) != NULL) {
- if ((fieldNode = XmlGetChildByTag(xNode, "field", "var", _T("stream-method"))) != 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)) {
// Start Bytestream session
@@ -187,10 +187,10 @@ BOOL CJabberProto::FtSend(HANDLE hConn, filetransfer *ft)
char* buffer;
int numRead;
- debugLog(_T("Sending [%s]"), ft->std.ptszFiles[ft->std.currentFileNumber]);
+ debugLog(L"Sending [%s]", ft->std.ptszFiles[ft->std.currentFileNumber]);
_tstati64(ft->std.ptszFiles[ft->std.currentFileNumber], &statbuf); // file size in statbuf.st_size
if ((fd = _topen(ft->std.ptszFiles[ft->std.currentFileNumber], _O_BINARY | _O_RDONLY)) < 0) {
- debugLog(_T("File cannot be opened"));
+ debugLog(L"File cannot be opened");
return FALSE;
}
@@ -217,7 +217,7 @@ BOOL CJabberProto::FtSend(HANDLE hConn, filetransfer *ft)
BOOL CJabberProto::FtIbbSend(int blocksize, filetransfer *ft)
{
- debugLog(_T("Sending [%s]"), ft->std.ptszFiles[ft->std.currentFileNumber]);
+ debugLog(L"Sending [%s]", ft->std.ptszFiles[ft->std.currentFileNumber]);
struct _stati64 statbuf;
_tstati64(ft->std.ptszFiles[ft->std.currentFileNumber], &statbuf); // file size in statbuf.st_size
@@ -237,8 +237,8 @@ BOOL CJabberProto::FtIbbSend(int blocksize, filetransfer *ft)
int numRead;
while ((numRead = _read(fd, buffer, blocksize)) > 0) {
int iqId = SerialNext();
- XmlNode msg(_T("message"));
- XmlAddAttr(msg, _T("to"), ft->jibb->dstJID);
+ XmlNode msg(L"message");
+ XmlAddAttr(msg, L"to", ft->jibb->dstJID);
msg << XATTRID(iqId);
// let others send data too
@@ -246,14 +246,14 @@ BOOL CJabberProto::FtIbbSend(int blocksize, filetransfer *ft)
char *encoded = mir_base64_encode((PBYTE)(char*)buffer, numRead);
- msg << XCHILD(_T("data"), _A2T(encoded)) << XATTR(_T("xmlns"), JABBER_FEAT_IBB)
- << XATTR(_T("sid"), ft->jibb->sid) << XATTRI(_T("seq"), ft->jibb->wPacketId);
+ msg << XCHILD(L"data", _A2T(encoded)) << XATTR(L"xmlns", JABBER_FEAT_IBB)
+ << XATTR(L"sid", ft->jibb->sid) << XATTRI(L"seq", ft->jibb->wPacketId);
- HXML ampNode = msg << XCHILDNS(_T("amp"), JABBER_FEAT_AMP);
- ampNode << XCHILD(_T("rule")) << XATTR(_T("condition"), _T("deliver-at"))
- << XATTR(_T("value"), _T("stored")) << XATTR(_T("action"), _T("error"));
- ampNode << XCHILD(_T("rule")) << XATTR(_T("condition"), _T("match-resource"))
- << XATTR(_T("value"), _T("exact")) << XATTR(_T("action"), _T("error"));
+ HXML ampNode = msg << XCHILDNS(L"amp", JABBER_FEAT_AMP);
+ ampNode << XCHILD(L"rule") << XATTR(L"condition", L"deliver-at")
+ << XATTR(L"value", L"stored") << XATTR(L"action", L"error");
+ ampNode << XCHILD(L"rule") << XATTR(L"condition", L"match-resource")
+ << XATTR(L"value", L"exact") << XATTR(L"action", L"error");
ft->jibb->wPacketId++;
mir_free(encoded);
@@ -306,21 +306,21 @@ void CJabberProto::FtHandleSiRequest(HXML iqNode)
unsigned __int64 filesize;
if (!iqNode ||
- (from = XmlGetAttrValue(iqNode, _T("from"))) == NULL ||
- (str = XmlGetAttrValue(iqNode, _T("type"))) == NULL || mir_tstrcmp(str, _T("set")) ||
+ (from = XmlGetAttrValue(iqNode, L"from")) == NULL ||
+ (str = XmlGetAttrValue(iqNode, L"type")) == NULL || mir_tstrcmp(str, L"set") ||
(siNode = XmlGetChildByTag(iqNode, "si", "xmlns", JABBER_FEAT_SI)) == NULL)
return;
- szId = XmlGetAttrValue(iqNode, _T("id"));
- if ((sid = XmlGetAttrValue(siNode, _T("id"))) != NULL &&
+ szId = XmlGetAttrValue(iqNode, L"id");
+ if ((sid = XmlGetAttrValue(siNode, L"id")) != NULL &&
(fileNode = XmlGetChildByTag(siNode, "file", "xmlns", JABBER_FEAT_SI_FT)) != NULL &&
- (filename = XmlGetAttrValue(fileNode, _T("name"))) != NULL &&
- (str = XmlGetAttrValue(fileNode, _T("size"))) != NULL) {
+ (filename = XmlGetAttrValue(fileNode, L"name")) != NULL &&
+ (str = XmlGetAttrValue(fileNode, L"size")) != NULL) {
filesize = _ttoi64(str);
if ((featureNode = XmlGetChildByTag(siNode, "feature", "xmlns", JABBER_FEAT_FEATURE_NEG)) != NULL &&
(xNode = XmlGetChildByTag(featureNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS)) != NULL &&
- (fieldNode = XmlGetChildByTag(xNode, "field", "var", _T("stream-method"))) != NULL) {
+ (fieldNode = XmlGetChildByTag(xNode, "field", "var", L"stream-method")) != NULL) {
BOOL bIbbOnly = m_options.BsOnlyIBB;
HXML optionNode = NULL;
@@ -332,7 +332,7 @@ void CJabberProto::FtHandleSiRequest(HXML iqNode)
if (!optionNode)
break;
- if (!mir_tstrcmp(XmlGetName(optionNode), _T("option"))) {
+ if (!mir_tstrcmp(XmlGetName(optionNode), L"option")) {
if ((n = XmlGetChild(optionNode, "value")) != NULL && XmlGetText(n)) {
if (!mir_tstrcmp(XmlGetText(n), JABBER_FEAT_BYTESTREAMS)) {
ftType = FT_BYTESTREAM;
@@ -350,7 +350,7 @@ void CJabberProto::FtHandleSiRequest(HXML iqNode)
if (!optionNode)
break;
- if (!mir_tstrcmp(XmlGetName(optionNode), _T("option"))) {
+ if (!mir_tstrcmp(XmlGetName(optionNode), L"option")) {
if ((n = XmlGetChild(optionNode, "value")) != NULL && XmlGetText(n)) {
if (!mir_tstrcmp(XmlGetText(n), JABBER_FEAT_IBB)) {
ftType = FT_IBB;
@@ -388,10 +388,10 @@ void CJabberProto::FtHandleSiRequest(HXML iqNode)
}
else {
// Unknown stream mechanism
- XmlNodeIq iq(_T("error"), szId, from);
- HXML e = iq << XCHILD(_T("error")) << XATTRI(_T("code"), 400) << XATTR(_T("type"), _T("cancel"));
- e << XCHILDNS(_T("bad-request"), _T("urn:ietf:params:xml:ns:xmpp-stanzas"));
- e << XCHILDNS(_T("no-valid-streams"), JABBER_FEAT_SI);
+ XmlNodeIq iq(L"error", szId, from);
+ HXML e = iq << XCHILD(L"error") << XATTRI(L"code", 400) << XATTR(L"type", L"cancel");
+ e << XCHILDNS(L"bad-request", L"urn:ietf:params:xml:ns:xmpp-stanzas");
+ e << XCHILDNS(L"no-valid-streams", JABBER_FEAT_SI);
m_ThreadInfo->send(iq);
return;
}
@@ -399,10 +399,10 @@ void CJabberProto::FtHandleSiRequest(HXML iqNode)
}
// Bad stream initiation, reply with bad-profile
- XmlNodeIq iq(_T("error"), szId, from);
- HXML e = iq << XCHILD(_T("error")) << XATTRI(_T("code"), 400) << XATTR(_T("type"), _T("cancel"));
- e << XCHILDNS(_T("bad-request"), _T("urn:ietf:params:xml:ns:xmpp-stanzas"));
- e << XCHILDNS(_T("bad-profile"), JABBER_FEAT_SI);
+ XmlNodeIq iq(L"error", szId, from);
+ HXML e = iq << XCHILD(L"error") << XATTRI(L"code", 400) << XATTR(L"type", L"cancel");
+ e << XCHILDNS(L"bad-request", L"urn:ietf:params:xml:ns:xmpp-stanzas");
+ e << XCHILDNS(L"bad-profile", JABBER_FEAT_SI);
m_ThreadInfo->send(iq);
}
@@ -415,12 +415,12 @@ void CJabberProto::FtAcceptSiRequest(filetransfer *ft)
item->ft = ft;
m_ThreadInfo->send(
- XmlNodeIq(_T("result"), ft->szId, ft->jid)
- << XCHILDNS(_T("si"), JABBER_FEAT_SI)
- << XCHILDNS(_T("feature"), JABBER_FEAT_FEATURE_NEG)
- << XCHILDNS(_T("x"), JABBER_FEAT_DATA_FORMS) << XATTR(_T("type"), _T("submit"))
- << XCHILD(_T("field")) << XATTR(_T("var"), _T("stream-method"))
- << XCHILD(_T("value"), JABBER_FEAT_BYTESTREAMS));
+ XmlNodeIq(L"result", ft->szId, ft->jid)
+ << XCHILDNS(L"si", JABBER_FEAT_SI)
+ << XCHILDNS(L"feature", JABBER_FEAT_FEATURE_NEG)
+ << XCHILDNS(L"x", JABBER_FEAT_DATA_FORMS) << XATTR(L"type", L"submit")
+ << XCHILD(L"field") << XATTR(L"var", L"stream-method")
+ << XCHILD(L"value", JABBER_FEAT_BYTESTREAMS));
}
}
@@ -433,12 +433,12 @@ void CJabberProto::FtAcceptIbbRequest(filetransfer *ft)
item->ft = ft;
m_ThreadInfo->send(
- XmlNodeIq(_T("result"), ft->szId, ft->jid)
- << XCHILDNS(_T("si"), JABBER_FEAT_SI)
- << XCHILDNS(_T("feature"), JABBER_FEAT_FEATURE_NEG)
- << XCHILDNS(_T("x"), JABBER_FEAT_DATA_FORMS) << XATTR(_T("type"), _T("submit"))
- << XCHILD(_T("field")) << XATTR(_T("var"), _T("stream-method"))
- << XCHILD(_T("value"), JABBER_FEAT_IBB));
+ XmlNodeIq(L"result", ft->szId, ft->jid)
+ << XCHILDNS(L"si", JABBER_FEAT_SI)
+ << XCHILDNS(L"feature", JABBER_FEAT_FEATURE_NEG)
+ << XCHILDNS(L"x", JABBER_FEAT_DATA_FORMS) << XATTR(L"type", L"submit")
+ << XCHILD(L"field") << XATTR(L"var", L"stream-method")
+ << XCHILD(L"value", JABBER_FEAT_IBB));
}
}
@@ -449,7 +449,7 @@ BOOL CJabberProto::FtHandleBytestreamRequest(HXML iqNode, CJabberIqInfo *pInfo)
const TCHAR *sid;
JABBER_LIST_ITEM *item;
- if ((sid = XmlGetAttrValue(queryNode, _T("sid"))) != NULL && (item = ListGetItemPtr(LIST_FTRECV, sid)) != NULL) {
+ if ((sid = XmlGetAttrValue(queryNode, L"sid")) != NULL && (item = ListGetItemPtr(LIST_FTRECV, sid)) != NULL) {
// Start Bytestream session
JABBER_BYTE_TRANSFER *jbt = new JABBER_BYTE_TRANSFER;
memset(jbt, 0, sizeof(JABBER_BYTE_TRANSFER));
@@ -471,24 +471,24 @@ BOOL CJabberProto::FtHandleIbbRequest(HXML iqNode, BOOL bOpen)
{
if (iqNode == NULL) return FALSE;
- const TCHAR *id = XmlGetAttrValue(iqNode, _T("id"));
- const TCHAR *from = XmlGetAttrValue(iqNode, _T("from"));
- const TCHAR *to = XmlGetAttrValue(iqNode, _T("to"));
+ const TCHAR *id = XmlGetAttrValue(iqNode, L"id");
+ const TCHAR *from = XmlGetAttrValue(iqNode, L"from");
+ const TCHAR *to = XmlGetAttrValue(iqNode, L"to");
if (!id || !from || !to) return FALSE;
HXML ibbNode = XmlGetChildByTag(iqNode, bOpen ? "open" : "close", "xmlns", JABBER_FEAT_IBB);
if (!ibbNode) return FALSE;
- const TCHAR *sid = XmlGetAttrValue(ibbNode, _T("sid"));
+ const TCHAR *sid = XmlGetAttrValue(ibbNode, L"sid");
if (!sid) return FALSE;
// already closed?
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_FTRECV, sid);
if (item == NULL) {
m_ThreadInfo->send(
- XmlNodeIq(_T("error"), id, from)
- << XCHILD(_T("error")) << XATTRI(_T("code"), 404) << XATTR(_T("type"), _T("cancel"))
- << XCHILDNS(_T("item-not-found"), _T("urn:ietf:params:xml:ns:xmpp-stanzas")));
+ XmlNodeIq(L"error", id, from)
+ << XCHILD(L"error") << XATTRI(L"code", 404) << XATTR(L"type", L"cancel")
+ << XCHILDNS(L"item-not-found", L"urn:ietf:params:xml:ns:xmpp-stanzas"));
return FALSE;
}
@@ -507,14 +507,14 @@ BOOL CJabberProto::FtHandleIbbRequest(HXML iqNode, BOOL bOpen)
item->jibb = jibb;
ForkThread((MyThreadFunc)&CJabberProto::IbbReceiveThread, jibb);
- m_ThreadInfo->send(XmlNodeIq(_T("result"), id, from));
+ m_ThreadInfo->send(XmlNodeIq(L"result", id, from));
return TRUE;
}
// stream already open
m_ThreadInfo->send(
- XmlNodeIq(_T("error"), id, from)
- << XCHILD(_T("error")) << XATTRI(_T("code"), 404) << XATTR(_T("type"), _T("cancel"))
- << XCHILDNS(_T("item-not-found"), _T("urn:ietf:params:xml:ns:xmpp-stanzas")));
+ XmlNodeIq(L"error", id, from)
+ << XCHILD(L"error") << XATTRI(L"code", 404) << XATTR(L"type", L"cancel")
+ << XCHILDNS(L"item-not-found", L"urn:ietf:params:xml:ns:xmpp-stanzas"));
return FALSE;
}
@@ -523,7 +523,7 @@ BOOL CJabberProto::FtHandleIbbRequest(HXML iqNode, BOOL bOpen)
item->jibb->bStreamClosed = TRUE;
SetEvent(item->jibb->hEvent);
- m_ThreadInfo->send(XmlNodeIq(_T("result"), id, from));
+ m_ThreadInfo->send(XmlNodeIq(L"result", id, from));
return TRUE;
}
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp
index e4f81a4d68..6394f8a022 100644
--- a/protocols/JabberG/src/jabber_groupchat.cpp
+++ b/protocols/JabberG/src/jabber_groupchat.cpp
@@ -84,10 +84,10 @@ struct JabberGcRecentInfo
void fillForm(HWND hwndDlg)
{
- SetDlgItemText(hwndDlg, IDC_SERVER, m_server ? m_server : _T(""));
- SetDlgItemText(hwndDlg, IDC_ROOM, m_room ? m_room : _T(""));
- SetDlgItemText(hwndDlg, IDC_NICK, m_nick ? m_nick : _T(""));
- SetDlgItemText(hwndDlg, IDC_PASSWORD, m_password ? m_password : _T(""));
+ SetDlgItemText(hwndDlg, IDC_SERVER, m_server ? m_server : L"");
+ SetDlgItemText(hwndDlg, IDC_ROOM, m_room ? m_room : L"");
+ SetDlgItemText(hwndDlg, IDC_NICK, m_nick ? m_nick : L"");
+ SetDlgItemText(hwndDlg, IDC_PASSWORD, m_password ? m_password : L"");
}
void fillData(const TCHAR *room, const TCHAR *server, const TCHAR *nick = NULL, const TCHAR *password = NULL)
@@ -246,7 +246,7 @@ void CJabberProto::GroupchatJoinRoom(const TCHAR *server, const TCHAR *room, con
}
TCHAR text[JABBER_MAX_JID_LEN + 1];
- mir_sntprintf(text, _T("%s@%s/%s"), room, server, nick);
+ mir_sntprintf(text, L"%s@%s/%s", room, server, nick);
JABBER_LIST_ITEM *item = ListAdd(LIST_CHATROOM, text);
item->bAutoJoin = autojoin;
@@ -254,9 +254,9 @@ void CJabberProto::GroupchatJoinRoom(const TCHAR *server, const TCHAR *room, con
replaceStrT(item->password, info.m_password);
int status = (m_iStatus == ID_STATUS_INVISIBLE) ? ID_STATUS_ONLINE : m_iStatus;
- XmlNode x(_T("x")); x << XATTR(_T("xmlns"), JABBER_FEAT_MUC);
+ XmlNode x(L"x"); x << XATTR(L"xmlns", JABBER_FEAT_MUC);
if (info.m_password && info.m_password[0])
- x << XCHILD(_T("password"), info.m_password);
+ x << XCHILD(L"password", info.m_password);
SendPresenceTo(status, text, x);
}
@@ -301,23 +301,23 @@ void CJabberProto::OnIqResultDiscovery(HXML iqNode, CJabberIqInfo *pInfo)
sttRoomListAppend(hwndList, RoomInfo::ROOM_FAIL,
TranslateT("Jabber Error"),
TranslateT("Failed to retrieve room list from server."),
- _T(""));
+ L"");
}
else {
bool found = false;
HXML item;
- for (int i = 1; item = XmlGetNthChild(query, _T("item"), i); i++) {
- const TCHAR *jid = XmlGetAttrValue(item, _T("jid"));
+ for (int i = 1; item = XmlGetNthChild(query, L"item", i); i++) {
+ const TCHAR *jid = XmlGetAttrValue(item, L"jid");
TCHAR *name = NEWTSTR_ALLOCA(jid);
if (name) {
if (TCHAR *p = _tcschr(name, _T('@')))
*p = 0;
}
- else name = _T("");
+ else name = L"";
sttRoomListAppend(hwndList,
ListGetItemPtr(LIST_BOOKMARK, jid) ? RoomInfo::ROOM_BOOKMARK : RoomInfo::ROOM_DEFAULT,
- XmlGetAttrValue(item, _T("name")),
+ XmlGetAttrValue(item, L"name"),
jid, name);
found = true;
@@ -327,7 +327,7 @@ void CJabberProto::OnIqResultDiscovery(HXML iqNode, CJabberIqInfo *pInfo)
sttRoomListAppend(hwndList, RoomInfo::ROOM_FAIL,
TranslateT("Jabber Error"),
TranslateT("No rooms available on server."),
- _T(""));
+ L"");
}
}
}
@@ -337,14 +337,14 @@ void CJabberProto::OnIqResultDiscovery(HXML iqNode, CJabberIqInfo *pInfo)
sttRoomListAppend(hwndList, RoomInfo::ROOM_FAIL,
TranslateT("Jabber Error"),
str,
- _T(""));
+ L"");
mir_free(str);
}
else
sttRoomListAppend(hwndList, RoomInfo::ROOM_FAIL,
TranslateT("Jabber Error"),
TranslateT("Room list request timed out."),
- _T(""));
+ L"");
SendMessage(hwndList, CB_SHOWDROPDOWN, TRUE, 0);
}
@@ -471,7 +471,7 @@ void CJabberDlgGcJoin::OnInitDialog()
if (!info.loadRecent(i))
break;
- mir_sntprintf(jid, _T("%s@%s (%s)"), info.m_room, info.m_server, info.m_nick ? info.m_nick : TranslateT("<no nick>"));
+ mir_sntprintf(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);
@@ -624,7 +624,7 @@ INT_PTR CJabberDlgGcJoin::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
GetDlgItemText(m_hwnd, IDC_SERVER, server, len);
if (*server) {
- sttRoomListAppend(GetDlgItem(m_hwnd, IDC_ROOM), RoomInfo::ROOM_WAIT, TranslateT("Loading..."), TranslateT("Please wait for room list to download."), _T(""));
+ sttRoomListAppend(GetDlgItem(m_hwnd, IDC_ROOM), RoomInfo::ROOM_WAIT, TranslateT("Loading..."), TranslateT("Please wait for room list to download."), L"");
CJabberIqInfo *pInfo = m_proto->AddIQ(&CJabberProto::OnIqResultDiscovery, JABBER_IQ_TYPE_GET, server, 0, -1, (void*)GetDlgItem(m_hwnd, IDC_ROOM));
pInfo->SetTimeout(30000);
@@ -638,7 +638,7 @@ INT_PTR CJabberDlgGcJoin::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
sttRoomListAppend(GetDlgItem(m_hwnd, IDC_ROOM), RoomInfo::ROOM_FAIL,
TranslateT("Jabber Error"),
TranslateT("Please specify group chat directory first."),
- _T(""));
+ L"");
}
break;
}
@@ -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, _T("conference")))
+ if (!mir_tstrcmp(item->type, L"conference"))
AppendMenu(hMenu, MF_STRING, (UINT_PTR)item, item->name);
}
AppendMenu(hMenu, MF_SEPARATOR, 0, NULL);
@@ -754,7 +754,7 @@ static VOID CALLBACK JabberGroupchatChangeNickname(void* arg)
if (param->ppro->EnterString(szBuffer, szTitle, ESF_COMBO, "gcNick_")) {
replaceStrT(item->nick, szBuffer);
- param->ppro->SendPresenceTo(param->ppro->m_iStatus, CMString(FORMAT, _T("%s/%s"), item->jid, szBuffer), NULL);
+ param->ppro->SendPresenceTo(param->ppro->m_iStatus, CMString(FORMAT, L"%s/%s", item->jid, szBuffer), NULL);
}
}
@@ -767,7 +767,7 @@ static int sttGetStatusCode(HXML node)
if (statusNode == NULL)
return -1;
- const TCHAR *statusCode = XmlGetAttrValue(statusNode, _T("code"));
+ const TCHAR *statusCode = XmlGetAttrValue(statusNode, L"code");
if (statusCode == NULL)
return -1;
@@ -776,8 +776,8 @@ static int sttGetStatusCode(HXML node)
void CJabberProto::RenameParticipantNick(JABBER_LIST_ITEM *item, const TCHAR *oldNick, HXML itemNode)
{
- const TCHAR *jid = XmlGetAttrValue(itemNode, _T("jid"));
- const TCHAR *newNick = XmlGetAttrValue(itemNode, _T("nick"));
+ const TCHAR *jid = XmlGetAttrValue(itemNode, L"jid");
+ const TCHAR *newNick = XmlGetAttrValue(itemNode, L"nick");
if (newNick == NULL)
return;
@@ -815,8 +815,8 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
{
const TCHAR *from;
- if (!node || !XmlGetName(node) || mir_tstrcmp(XmlGetName(node), _T("presence"))) return;
- if ((from = XmlGetAttrValue(node, _T("from"))) == NULL) return;
+ if (!node || !XmlGetName(node) || mir_tstrcmp(XmlGetName(node), L"presence")) return;
+ if ((from = XmlGetAttrValue(node, L"from")) == NULL) return;
const TCHAR *resource = _tcschr(from, '/');
if (resource == NULL || *++resource == '\0')
@@ -839,10 +839,10 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
HXML xNode = XmlGetChildByTag(node, "x", "xmlns", JABBER_FEAT_MUC_USER);
HXML itemNode = XmlGetChild(xNode, "item");
- const TCHAR *type = XmlGetAttrValue(node, _T("type"));
+ const TCHAR *type = XmlGetAttrValue(node, L"type");
// entering room or a usual room presence
- if (type == NULL || !mir_tstrcmp(type, _T("available"))) {
+ if (type == NULL || !mir_tstrcmp(type, L"available")) {
if (ptrT(JabberNickFromJID(from)) == NULL)
return;
@@ -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, _T("away"))) status = ID_STATUS_AWAY;
- else if (!mir_tstrcmp(ptszShow, _T("xa"))) status = ID_STATUS_NA;
- else if (!mir_tstrcmp(ptszShow, _T("dnd"))) status = ID_STATUS_DND;
- else if (!mir_tstrcmp(ptszShow, _T("chat"))) status = ID_STATUS_FREECHAT;
+ 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;
}
LPCTSTR str = XmlGetText(XmlGetChild(node, "status"));
@@ -880,17 +880,17 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
JABBER_GC_AFFILIATION affiliation = r->m_affiliation;
JABBER_GC_ROLE role = r->m_role;
- if ((str = XmlGetAttrValue(itemNode, _T("affiliation"))) != NULL) {
- if (!mir_tstrcmp(str, _T("owner"))) affiliation = AFFILIATION_OWNER;
- else if (!mir_tstrcmp(str, _T("admin"))) affiliation = AFFILIATION_ADMIN;
- else if (!mir_tstrcmp(str, _T("member"))) affiliation = AFFILIATION_MEMBER;
- else if (!mir_tstrcmp(str, _T("none"))) affiliation = AFFILIATION_NONE;
- else if (!mir_tstrcmp(str, _T("outcast"))) affiliation = AFFILIATION_OUTCAST;
+ 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 ((str = XmlGetAttrValue(itemNode, _T("role"))) != NULL) {
- if (!mir_tstrcmp(str, _T("moderator"))) role = ROLE_MODERATOR;
- else if (!mir_tstrcmp(str, _T("participant"))) role = ROLE_PARTICIPANT;
- else if (!mir_tstrcmp(str, _T("visitor"))) role = ROLE_VISITOR;
+ 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;
else role = ROLE_NONE;
}
@@ -910,7 +910,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
bRoleChanged = true;
}
- if (str = XmlGetAttrValue(itemNode, _T("jid")))
+ if (str = XmlGetAttrValue(itemNode, L"jid"))
r->m_tszRealJid = mir_tstrdup(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, _T("xmlns"))) != NULL && !mir_tstrcmp(str, JABBER_FEAT_MUC_OWNER))
+ if (n != NULL && (str = XmlGetAttrValue(n, L"xmlns")) != NULL && !mir_tstrcmp(str, JABBER_FEAT_MUC_OWNER))
// A new room just created by me
// Request room config
m_ThreadInfo->send(
@@ -946,11 +946,11 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
}
// leaving room
- else if (!mir_tstrcmp(type, _T("unavailable"))) {
+ else if (!mir_tstrcmp(type, L"unavailable")) {
const TCHAR *str = 0;
if (xNode != NULL && item->nick != NULL) {
HXML reasonNode = XmlGetChild(itemNode, "reason");
- str = XmlGetAttrValue(itemNode, _T("jid"));
+ str = XmlGetAttrValue(itemNode, L"jid");
int iStatus = sttGetStatusCode(xNode);
if (iStatus == 301 && r != NULL)
@@ -994,7 +994,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
}
// processing room errors
- else if (!mir_tstrcmp(type, _T("error"))) {
+ else if (!mir_tstrcmp(type, L"error")) {
int errorCode = 0;
HXML errorNode = XmlGetChild(node, "error");
ptrT str(JabberErrorMsg(errorNode, &errorCode));
@@ -1004,7 +1004,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
if (++item->iChatState == 1 && newNick != NULL && newNick[0] != 0) {
replaceStrT(item->nick, newNick);
TCHAR text[1024] = { 0 };
- mir_sntprintf(text, _T("%s/%s"), item->jid, newNick);
+ mir_sntprintf(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), _T("message"))) return;
- if ((from = XmlGetAttrValue(node, _T("from"))) == NULL) return;
+ if (!XmlGetName(node) || mir_tstrcmp(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, _T("type"))) == NULL) return;
- if (!mir_tstrcmp(type, _T("error")))
+ if ((type = XmlGetAttrValue(node, L"type")) == NULL) return;
+ if (!mir_tstrcmp(type, L"error"))
return;
GCDEST gcd = { m_szModuleName, item->jid, 0 };
@@ -1056,7 +1056,7 @@ void CJabberProto::GroupchatProcessMessage(HXML node)
if (tmpnick == NULL || *tmpnick == 0)
return;
- const TCHAR *tmptr = _tcsstr(tmpnick, _T("has set the subject to:")); //ejabberd
+ const TCHAR *tmptr = _tcsstr(tmpnick, L"has set the subject to:"); //ejabberd
if (tmptr == NULL)
tmptr = _tcsstr(tmpnick, TranslateT("has set the subject to:")); //ejabberd
if (tmptr != NULL && *tmptr != 0) {
@@ -1079,7 +1079,7 @@ void CJabberProto::GroupchatProcessMessage(HXML node)
if (resource == NULL)
gcd.iType = GC_EVENT_INFORMATION;
- else if (_tcsncmp(msgText, _T("/me "), 4) == 0 && mir_tstrlen(msgText) > 4) {
+ else if (_tcsncmp(msgText, L"/me ", 4) == 0 && mir_tstrlen(msgText) > 4) {
msgText += 4;
gcd.iType = GC_EVENT_ACTION;
}
@@ -1090,8 +1090,8 @@ void CJabberProto::GroupchatProcessMessage(HXML node)
time_t msgTime = 0;
if (!JabberReadXep203delay(node, msgTime)) {
- HXML xDelay = XmlGetChildByTag(node, "x", "xmlns", _T("jabber:x:delay"));
- if (xDelay && (p = XmlGetAttrValue(xDelay, _T("stamp"))) != NULL)
+ HXML xDelay = XmlGetChildByTag(node, "x", "xmlns", L"jabber:x:delay");
+ if (xDelay && (p = XmlGetAttrValue(xDelay, L"stamp")) != NULL)
msgTime = JabberIsoToUnixTime(p);
}
@@ -1107,7 +1107,7 @@ void CJabberProto::GroupchatProcessMessage(HXML node)
else nick = NULL;
CMString tszText(msgText);
- tszText.Replace(_T("%"), _T("%%"));
+ tszText.Replace(L"%", L"%%");
tszText += imgLink;
GCEVENT gce = { sizeof(gce), &gcd };
@@ -1207,7 +1207,7 @@ void CJabberProto::AcceptGroupchatInvite(const TCHAR *roomJid, const TCHAR *reas
{
TCHAR room[256], *server, *p;
_tcsncpy_s(room, roomJid, _TRUNCATE);
- p = _tcstok(room, _T("@"));
- server = _tcstok(NULL, _T("@"));
+ p = _tcstok(room, L"@");
+ server = _tcstok(NULL, L"@");
GroupchatJoinRoom(server, p, reason, password);
}
diff --git a/protocols/JabberG/src/jabber_ibb.cpp b/protocols/JabberG/src/jabber_ibb.cpp
index 0ac2a73150..bec32266dd 100644
--- a/protocols/JabberG/src/jabber_ibb.cpp
+++ b/protocols/JabberG/src/jabber_ibb.cpp
@@ -46,24 +46,24 @@ void JabberIbbFreeJibb(JABBER_IBB_TRANSFER *jibb)
BOOL CJabberProto::OnFtHandleIbbIq(HXML iqNode, CJabberIqInfo *pInfo)
{
- if (!mir_tstrcmp(pInfo->GetChildNodeName(), _T("open")))
+ if (!mir_tstrcmp(pInfo->GetChildNodeName(), L"open"))
FtHandleIbbRequest(iqNode, TRUE);
- else if (!mir_tstrcmp(pInfo->GetChildNodeName(), _T("close")))
+ else if (!mir_tstrcmp(pInfo->GetChildNodeName(), L"close"))
FtHandleIbbRequest(iqNode, FALSE);
- else if (!mir_tstrcmp(pInfo->GetChildNodeName(), _T("data"))) {
+ else if (!mir_tstrcmp(pInfo->GetChildNodeName(), L"data")) {
BOOL bOk = FALSE;
- const TCHAR *sid = XmlGetAttrValue(pInfo->GetChildNode(), _T("sid"));
- const TCHAR *seq = XmlGetAttrValue(pInfo->GetChildNode(), _T("seq"));
+ const TCHAR *sid = XmlGetAttrValue(pInfo->GetChildNode(), L"sid");
+ const TCHAR *seq = XmlGetAttrValue(pInfo->GetChildNode(), L"seq");
if (sid && seq && XmlGetText(pInfo->GetChildNode()))
bOk = OnIbbRecvdData(XmlGetText(pInfo->GetChildNode()), sid, seq);
if (bOk)
- m_ThreadInfo->send( XmlNodeIq(_T("result"), pInfo));
+ m_ThreadInfo->send( XmlNodeIq(L"result", pInfo));
else
m_ThreadInfo->send(
- XmlNodeIq(_T("error"), pInfo)
- << XCHILD(_T("error")) << XATTRI(_T("code"), 404) << XATTR(_T("type"), _T("cancel"))
- << XCHILDNS(_T("item-not-found"), _T("urn:ietf:params:xml:ns:xmpp-stanzas")));
+ XmlNodeIq(L"error", pInfo)
+ << XCHILD(L"error") << XATTRI(L"code", 404) << XATTR(L"type", L"cancel")
+ << XCHILDNS(L"item-not-found", L"urn:ietf:params:xml:ns:xmpp-stanzas"));
}
return TRUE;
}
@@ -98,8 +98,8 @@ void CJabberProto::IbbSendThread(JABBER_IBB_TRANSFER *jibb)
m_ThreadInfo->send(
XmlNodeIq( AddIQ(&CJabberProto::OnIbbInitiateResult, JABBER_IQ_TYPE_SET, jibb->dstJID, 0, -1, jibb))
- << XCHILDNS(_T("open"), JABBER_FEAT_IBB) << XATTR(_T("sid"), jibb->sid) << XATTRI(_T("block-size"), JABBER_IBB_BLOCK_SIZE)
- << XATTR(_T("stanza"), _T("message")));
+ << XCHILDNS(L"open", JABBER_FEAT_IBB) << XATTR(L"sid", jibb->sid) << XATTRI(L"block-size", JABBER_IBB_BLOCK_SIZE)
+ << XATTR(L"stanza", L"message"));
WaitForSingleObject(jibb->hEvent, INFINITE);
CloseHandle(jibb->hEvent);
@@ -115,7 +115,7 @@ void CJabberProto::IbbSendThread(JABBER_IBB_TRANSFER *jibb)
m_ThreadInfo->send(
XmlNodeIq( AddIQ(&CJabberProto::OnIbbCloseResult, JABBER_IQ_TYPE_SET, jibb->dstJID, 0, -1, jibb))
- << XCHILDNS(_T("close"), JABBER_FEAT_IBB) << XATTR(_T("sid"), jibb->sid));
+ << XCHILDNS(L"close", JABBER_FEAT_IBB) << XATTR(L"sid", jibb->sid));
WaitForSingleObject(jibb->hEvent, INFINITE);
CloseHandle(jibb->hEvent);
@@ -151,7 +151,7 @@ void __cdecl CJabberProto::IbbReceiveThread(JABBER_IBB_TRANSFER *jibb)
jibb->hEvent = NULL;
if (jibb->state == JIBB_ERROR)
- m_ThreadInfo->send( XmlNodeIq(_T("set"), SerialNext(), jibb->dstJID) << XCHILDNS(_T("close"), JABBER_FEAT_IBB) << XATTR(_T("sid"), jibb->sid));
+ m_ThreadInfo->send( XmlNodeIq(L"set", SerialNext(), jibb->dstJID) << XCHILDNS(L"close", JABBER_FEAT_IBB) << XATTR(L"sid", jibb->sid));
if (jibb->bStreamClosed && jibb->dwTransferredSize == ft->dwExpectedRecvFileSize)
jibb->state = JIBB_DONE;
diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp
index 82c385c64b..f3739cdece 100644
--- a/protocols/JabberG/src/jabber_icolib.cpp
+++ b/protocols/JabberG/src/jabber_icolib.cpp
@@ -47,32 +47,32 @@ struct CTransportProtoTableItem
static CTransportProtoTableItem TransportProtoTable[] =
{
- { _T("|*icq*|jit*"), "ICQ" },
- { _T("msn*"), "MSN" },
- { _T("yahoo*"), "YAHOO" },
- { _T("mrim*"), "MRA" },
- { _T("aim*"), "AIM" },
+ { L"|*icq*|jit*", "ICQ" },
+ { L"msn*", "MSN" },
+ { L"yahoo*", "YAHOO" },
+ { L"mrim*", "MRA" },
+ { L"aim*", "AIM" },
//request #3094
- { _T("|gg*|gadu*"), "GaduGadu" },
- { _T("tv*"), "TV" },
- { _T("dict*"), "Dictionary" },
- { _T("weather*"), "Weather" },
- { _T("skype*"), "Skype" },
- { _T("sms*"), "SMS" },
- { _T("smtp*"), "SMTP" },
+ { L"|gg*|gadu*", "GaduGadu" },
+ { L"tv*", "TV" },
+ { L"dict*", "Dictionary" },
+ { L"weather*", "Weather" },
+ { L"skype*", "Skype" },
+ { L"sms*", "SMS" },
+ { L"smtp*", "SMTP" },
//j2j
- { _T("gtalk.*.*"), "GTalk" },
- { _T("|xmpp.*.*|j2j.*.*"),"Jabber2Jabber" },
+ { L"gtalk.*.*", "GTalk" },
+ { L"|xmpp.*.*|j2j.*.*","Jabber2Jabber" },
//jabbim.cz - services
- { _T("disk*"), "Jabber Disk" },
- { _T("irc*"), "IRC" },
- { _T("rss*"), "RSS" },
- { _T("tlen*"), "Tlen" },
+ { L"disk*", "Jabber Disk" },
+ { L"irc*", "IRC" },
+ { L"rss*", "RSS" },
+ { L"tlen*", "Tlen" },
// German social networks
- { _T("studivz*"), "StudiVZ" },
- { _T("schuelervz*"), "SchuelerVZ" },
- { _T("meinvz*"), "MeinVZ" },
+ { L"studivz*", "StudiVZ" },
+ { L"schuelervz*", "SchuelerVZ" },
+ { L"meinvz*", "MeinVZ" },
};
static int skinIconStatusToResourceId[] = {IDI_OFFLINE,IDI_ONLINE,IDI_AWAY,IDI_DND,IDI_NA,IDI_NA,/*IDI_OCCUPIED,*/IDI_FREE4CHAT,IDI_INVISIBLE,IDI_ONTHEPHONE,IDI_OUTTOLUNCH};
@@ -307,7 +307,7 @@ int CJabberProto::LoadAdvancedIcons(int iID)
int first = -1;
HICON empty = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
- mir_sntprintf(Group, LPGENT("Status icons")_T("/%s/%S %s"), m_tszUserName, proto, TranslateT("transport"));
+ mir_sntprintf(Group, LPGENT("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);
diff --git a/protocols/JabberG/src/jabber_iq.cpp b/protocols/JabberG/src/jabber_iq.cpp
index 49192e6613..ca7020a25e 100644
--- a/protocols/JabberG/src/jabber_iq.cpp
+++ b/protocols/JabberG/src/jabber_iq.cpp
@@ -83,52 +83,52 @@ void CJabberIqManager::Shutdown()
void CJabberIqManager::FillPermanentHandlers()
{
// version requests (XEP-0092)
- AddPermanentHandler(&CJabberProto::OnIqRequestVersion, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR, JABBER_FEAT_VERSION, FALSE, _T("query"));
+ AddPermanentHandler(&CJabberProto::OnIqRequestVersion, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR, JABBER_FEAT_VERSION, FALSE, L"query");
// last activity (XEP-0012)
- AddPermanentHandler(&CJabberProto::OnIqRequestLastActivity, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR, JABBER_FEAT_LAST_ACTIVITY, FALSE, _T("query"));
+ AddPermanentHandler(&CJabberProto::OnIqRequestLastActivity, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR, JABBER_FEAT_LAST_ACTIVITY, FALSE, L"query");
// ping requests (XEP-0199)
- AddPermanentHandler(&CJabberProto::OnIqRequestPing, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR, JABBER_FEAT_PING, FALSE, _T("ping"));
+ AddPermanentHandler(&CJabberProto::OnIqRequestPing, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR, JABBER_FEAT_PING, FALSE, L"ping");
// entity time (XEP-0202)
- AddPermanentHandler(&CJabberProto::OnIqRequestTime, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR, JABBER_FEAT_ENTITY_TIME, FALSE, _T("time"));
+ AddPermanentHandler(&CJabberProto::OnIqRequestTime, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR, JABBER_FEAT_ENTITY_TIME, FALSE, L"time");
// entity time (XEP-0090)
- AddPermanentHandler(&CJabberProto::OnIqProcessIqOldTime, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR, JABBER_FEAT_ENTITY_TIME_OLD, FALSE, _T("query"));
+ AddPermanentHandler(&CJabberProto::OnIqProcessIqOldTime, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR, JABBER_FEAT_ENTITY_TIME_OLD, FALSE, L"query");
// old avatars support (deprecated XEP-0008)
- AddPermanentHandler(&CJabberProto::OnIqRequestAvatar, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR, JABBER_FEAT_AVATAR, FALSE, _T("query"));
+ AddPermanentHandler(&CJabberProto::OnIqRequestAvatar, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR, JABBER_FEAT_AVATAR, FALSE, L"query");
// privacy lists (XEP-0016)
- AddPermanentHandler(&CJabberProto::OnIqRequestPrivacyLists, JABBER_IQ_TYPE_SET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR, JABBER_FEAT_PRIVACY_LISTS, FALSE, _T("query"));
+ AddPermanentHandler(&CJabberProto::OnIqRequestPrivacyLists, JABBER_IQ_TYPE_SET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR, JABBER_FEAT_PRIVACY_LISTS, FALSE, L"query");
// in band bytestreams (XEP-0047)
AddPermanentHandler(&CJabberProto::OnFtHandleIbbIq, JABBER_IQ_TYPE_SET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_CHILD_TAG_NODE | JABBER_IQ_PARSE_CHILD_TAG_NAME | JABBER_IQ_PARSE_CHILD_TAG_XMLNS, JABBER_FEAT_IBB, FALSE, NULL);
// socks5-bytestreams (XEP-0065)
- AddPermanentHandler(&CJabberProto::FtHandleBytestreamRequest, JABBER_IQ_TYPE_SET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR | JABBER_IQ_PARSE_CHILD_TAG_NODE, JABBER_FEAT_BYTESTREAMS, FALSE, _T("query"));
+ AddPermanentHandler(&CJabberProto::FtHandleBytestreamRequest, JABBER_IQ_TYPE_SET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR | JABBER_IQ_PARSE_CHILD_TAG_NODE, JABBER_FEAT_BYTESTREAMS, FALSE, L"query");
// session initiation (XEP-0095)
- AddPermanentHandler(&CJabberProto::OnSiRequest, JABBER_IQ_TYPE_SET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR | JABBER_IQ_PARSE_CHILD_TAG_NODE, JABBER_FEAT_SI, FALSE, _T("si"));
+ AddPermanentHandler(&CJabberProto::OnSiRequest, JABBER_IQ_TYPE_SET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR | JABBER_IQ_PARSE_CHILD_TAG_NODE, JABBER_FEAT_SI, FALSE, L"si");
// roster push requests
- AddPermanentHandler(&CJabberProto::OnRosterPushRequest, JABBER_IQ_TYPE_SET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR | JABBER_IQ_PARSE_CHILD_TAG_NODE, JABBER_FEAT_IQ_ROSTER, FALSE, _T("query"));
+ AddPermanentHandler(&CJabberProto::OnRosterPushRequest, JABBER_IQ_TYPE_SET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR | JABBER_IQ_PARSE_CHILD_TAG_NODE, JABBER_FEAT_IQ_ROSTER, FALSE, L"query");
// OOB file transfers
- AddPermanentHandler(&CJabberProto::OnIqRequestOOB, JABBER_IQ_TYPE_SET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_HCONTACT | JABBER_IQ_PARSE_ID_STR | JABBER_IQ_PARSE_CHILD_TAG_NODE, JABBER_FEAT_OOB, FALSE, _T("query"));
+ AddPermanentHandler(&CJabberProto::OnIqRequestOOB, JABBER_IQ_TYPE_SET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_HCONTACT | JABBER_IQ_PARSE_ID_STR | JABBER_IQ_PARSE_CHILD_TAG_NODE, JABBER_FEAT_OOB, FALSE, L"query");
// disco#items requests (XEP-0030, XEP-0050)
- AddPermanentHandler(&CJabberProto::OnHandleDiscoItemsRequest, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_TO | JABBER_IQ_PARSE_ID_STR | JABBER_IQ_PARSE_CHILD_TAG_NODE, JABBER_FEAT_DISCO_ITEMS, FALSE, _T("query"));
+ AddPermanentHandler(&CJabberProto::OnHandleDiscoItemsRequest, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_TO | JABBER_IQ_PARSE_ID_STR | JABBER_IQ_PARSE_CHILD_TAG_NODE, JABBER_FEAT_DISCO_ITEMS, FALSE, L"query");
// disco#info requests (XEP-0030, XEP-0050, XEP-0115)
- AddPermanentHandler(&CJabberProto::OnHandleDiscoInfoRequest, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_TO | JABBER_IQ_PARSE_ID_STR | JABBER_IQ_PARSE_CHILD_TAG_NODE, JABBER_FEAT_DISCO_INFO, FALSE, _T("query"));
+ AddPermanentHandler(&CJabberProto::OnHandleDiscoInfoRequest, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_TO | JABBER_IQ_PARSE_ID_STR | JABBER_IQ_PARSE_CHILD_TAG_NODE, JABBER_FEAT_DISCO_INFO, FALSE, L"query");
// ad-hoc commands (XEP-0050) for remote controlling (XEP-0146)
- AddPermanentHandler(&CJabberProto::HandleAdhocCommandRequest, JABBER_IQ_TYPE_SET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_TO | JABBER_IQ_PARSE_ID_STR | JABBER_IQ_PARSE_CHILD_TAG_NODE, JABBER_FEAT_COMMANDS, FALSE, _T("command"));
+ AddPermanentHandler(&CJabberProto::HandleAdhocCommandRequest, JABBER_IQ_TYPE_SET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_TO | JABBER_IQ_PARSE_ID_STR | JABBER_IQ_PARSE_CHILD_TAG_NODE, JABBER_FEAT_COMMANDS, FALSE, L"command");
// http auth (XEP-0070)
- AddPermanentHandler(&CJabberProto::OnIqHttpAuth, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR | JABBER_IQ_PARSE_CHILD_TAG_NODE, JABBER_FEAT_HTTP_AUTH, FALSE, _T("confirm"));
+ AddPermanentHandler(&CJabberProto::OnIqHttpAuth, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR | JABBER_IQ_PARSE_CHILD_TAG_NODE, JABBER_FEAT_HTTP_AUTH, FALSE, L"confirm");
}
void __cdecl CJabberProto::ExpirerThread(void* pParam)
@@ -171,7 +171,7 @@ void CJabberIqManager::ExpireInfo(CJabberIqInfo *pInfo)
if ((pInfo->m_dwParamsToParse & JABBER_IQ_PARSE_HCONTACT) && (pInfo->m_szFrom))
pInfo->m_hContact = ppro->HContactFromJID(pInfo->m_szFrom);
- ppro->debugLog(_T("Expiring iq id %d, sent to %s"), pInfo->m_nIqId, pInfo->m_szReceiver ? pInfo->m_szReceiver : _T("server"));
+ ppro->debugLog(L"Expiring iq id %d, sent to %s", pInfo->m_nIqId, pInfo->m_szReceiver ? pInfo->m_szReceiver : L"server");
pInfo->m_nIqType = JABBER_IQ_TYPE_FAIL;
(ppro->*(pInfo->m_pHandler))(NULL, pInfo);
@@ -243,14 +243,14 @@ bool CJabberIqManager::HandleIq(int nIqId, HXML pNode)
if (nIqId == -1 || pNode == NULL)
return false;
- const TCHAR *szType = XmlGetAttrValue(pNode, _T("type"));
+ const TCHAR *szType = XmlGetAttrValue(pNode, L"type");
if (!szType)
return false;
int nIqType = JABBER_IQ_TYPE_FAIL;
- if (!mir_tstrcmpi(szType, _T("result")))
+ if (!mir_tstrcmpi(szType, L"result"))
nIqType = JABBER_IQ_TYPE_RESULT;
- else if (!mir_tstrcmpi(szType, _T("error")))
+ else if (!mir_tstrcmpi(szType, L"error"))
nIqType = JABBER_IQ_TYPE_ERROR;
else
return false;
@@ -268,19 +268,19 @@ bool CJabberIqManager::HandleIq(int nIqId, HXML pNode)
if (pInfo->m_pChildNode && (pInfo->m_dwParamsToParse & JABBER_IQ_PARSE_CHILD_TAG_NAME))
pInfo->m_szChildTagName = (TCHAR*)XmlGetName(pInfo->m_pChildNode);
if (pInfo->m_pChildNode && (pInfo->m_dwParamsToParse & JABBER_IQ_PARSE_CHILD_TAG_XMLNS))
- pInfo->m_szChildTagXmlns = (TCHAR*)XmlGetAttrValue(pNode, _T("xmlns"));
+ pInfo->m_szChildTagXmlns = (TCHAR*)XmlGetAttrValue(pNode, L"xmlns");
}
if (pInfo->m_dwParamsToParse & JABBER_IQ_PARSE_TO)
- pInfo->m_szTo = (TCHAR*)XmlGetAttrValue(pNode, _T("to"));
+ pInfo->m_szTo = (TCHAR*)XmlGetAttrValue(pNode, L"to");
if (pInfo->m_dwParamsToParse & JABBER_IQ_PARSE_FROM)
- pInfo->m_szFrom = (TCHAR*)XmlGetAttrValue(pNode, _T("from"));
+ pInfo->m_szFrom = (TCHAR*)XmlGetAttrValue(pNode, L"from");
if (pInfo->m_szFrom && (pInfo->m_dwParamsToParse & JABBER_IQ_PARSE_HCONTACT))
pInfo->m_hContact = ppro->HContactFromJID(pInfo->m_szFrom);
if (pInfo->m_dwParamsToParse & JABBER_IQ_PARSE_ID_STR)
- pInfo->m_szId = (TCHAR*)XmlGetAttrValue(pNode, _T("id"));
+ pInfo->m_szId = (TCHAR*)XmlGetAttrValue(pNode, L"id");
(ppro->*(pInfo->m_pHandler))(pNode, pInfo);
delete pInfo;
@@ -294,15 +294,15 @@ bool CJabberIqManager::HandleIqPermanent(HXML pNode)
for (int i = 0; i < m_arHandlers.getCount(); i++) {
CJabberIqPermanentInfo &pInfo = m_arHandlers[i];
// have to get all data here, in the loop, because there's always possibility that previous handler modified it
- const TCHAR *szType = XmlGetAttrValue(pNode, _T("type"));
+ const TCHAR *szType = XmlGetAttrValue(pNode, L"type");
if (!szType)
return FALSE;
CJabberIqInfo iqInfo;
iqInfo.m_nIqType = JABBER_IQ_TYPE_FAIL;
- if (!mir_tstrcmpi(szType, _T("get")))
+ if (!mir_tstrcmpi(szType, L"get"))
iqInfo.m_nIqType = JABBER_IQ_TYPE_GET;
- else if (!mir_tstrcmpi(szType, _T("set")))
+ else if (!mir_tstrcmpi(szType, L"set"))
iqInfo.m_nIqType = JABBER_IQ_TYPE_SET;
else
return FALSE;
@@ -315,7 +315,7 @@ bool CJabberIqManager::HandleIqPermanent(HXML pNode)
return FALSE;
const TCHAR *szTagName = XmlGetName(pFirstChild);
- const TCHAR *szXmlns = XmlGetAttrValue(pFirstChild, _T("xmlns"));
+ const TCHAR *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)))
@@ -324,19 +324,19 @@ bool CJabberIqManager::HandleIqPermanent(HXML pNode)
iqInfo.m_pChildNode = pFirstChild;
iqInfo.m_szChildTagName = (TCHAR*)szTagName;
iqInfo.m_szChildTagXmlns = (TCHAR*)szXmlns;
- iqInfo.m_szId = (TCHAR*)XmlGetAttrValue(pNode, _T("id"));
+ iqInfo.m_szId = (TCHAR*)XmlGetAttrValue(pNode, L"id");
iqInfo.m_pUserData = pInfo.m_pUserData;
if (pInfo.m_dwParamsToParse & JABBER_IQ_PARSE_TO)
- iqInfo.m_szTo = (TCHAR*)XmlGetAttrValue(pNode, _T("to"));
+ iqInfo.m_szTo = (TCHAR*)XmlGetAttrValue(pNode, L"to");
if (pInfo.m_dwParamsToParse & JABBER_IQ_PARSE_FROM)
- iqInfo.m_szFrom = (TCHAR*)XmlGetAttrValue(pNode, _T("from"));
+ iqInfo.m_szFrom = (TCHAR*)XmlGetAttrValue(pNode, L"from");
if ((pInfo.m_dwParamsToParse & JABBER_IQ_PARSE_HCONTACT) && (iqInfo.m_szFrom))
iqInfo.m_hContact = ppro->HContactFromJID(iqInfo.m_szFrom);
- ppro->debugLog(_T("Handling iq id %s, type %s, from %s"), iqInfo.m_szId, szType, iqInfo.m_szFrom);
+ ppro->debugLog(L"Handling iq id %s, type %s, from %s", iqInfo.m_szId, szType, iqInfo.m_szFrom);
if ((ppro->*(pInfo.m_pHandler))(pNode, &iqInfo))
return true;
}
diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp
index 13e3cc5cca..a8f4f31e8f 100644
--- a/protocols/JabberG/src/jabber_iq_handlers.cpp
+++ b/protocols/JabberG/src/jabber_iq_handlers.cpp
@@ -36,16 +36,16 @@ BOOL CJabberProto::OnIqRequestVersion(HXML, CJabberIqInfo *pInfo)
if (!m_options.AllowVersionRequests)
return FALSE;
- XmlNodeIq iq(_T("result"), pInfo);
+ XmlNodeIq iq(L"result", pInfo);
HXML query = iq << XQUERY(JABBER_FEAT_VERSION);
- query << XCHILD(_T("name"), _T("Miranda NG Jabber"));
- query << XCHILD(_T("version"), szCoreVersion);
+ query << XCHILD(L"name", L"Miranda NG Jabber");
+ query << XCHILD(L"version", szCoreVersion);
if (m_options.ShowOSVersion) {
TCHAR os[256] = { 0 };
if (!GetOSDisplayString(os, _countof(os)))
- mir_tstrncpy(os, _T("Microsoft Windows"), _countof(os));
- query << XCHILD(_T("os"), os);
+ mir_tstrncpy(os, L"Microsoft Windows", _countof(os));
+ query << XCHILD(L"os", os);
}
m_ThreadInfo->send(iq);
@@ -56,15 +56,15 @@ BOOL CJabberProto::OnIqRequestVersion(HXML, CJabberIqInfo *pInfo)
BOOL CJabberProto::OnIqRequestLastActivity(HXML, CJabberIqInfo *pInfo)
{
m_ThreadInfo->send(
- XmlNodeIq(_T("result"), pInfo) << XQUERY(JABBER_FEAT_LAST_ACTIVITY)
- << XATTRI(_T("seconds"), m_tmJabberIdleStartTime ? time(0) - m_tmJabberIdleStartTime : 0));
+ XmlNodeIq(L"result", pInfo) << XQUERY(JABBER_FEAT_LAST_ACTIVITY)
+ << XATTRI(L"seconds", m_tmJabberIdleStartTime ? time(0) - m_tmJabberIdleStartTime : 0));
return TRUE;
}
// XEP-0199: XMPP Ping support
BOOL CJabberProto::OnIqRequestPing(HXML, CJabberIqInfo *pInfo)
{
- m_ThreadInfo->send(XmlNodeIq(_T("result"), pInfo) << XATTR(_T("from"), m_ThreadInfo->fullJID));
+ m_ThreadInfo->send(XmlNodeIq(L"result", pInfo) << XATTR(L"from", m_ThreadInfo->fullJID));
return TRUE;
}
@@ -101,17 +101,17 @@ BOOL CJabberProto::OnIqRequestTime(HXML, CJabberIqInfo *pInfo)
TCHAR stime[100];
TCHAR szTZ[10];
- TimeZone_PrintDateTime(UTC_TIME_HANDLE, _T("I"), stime, _countof(stime), 0);
+ TimeZone_PrintDateTime(UTC_TIME_HANDLE, L"I", stime, _countof(stime), 0);
int nGmtOffset = GetGMTOffset();
- mir_sntprintf(szTZ, _T("%+03d:%02d"), nGmtOffset / 60, nGmtOffset % 60);
+ mir_sntprintf(szTZ, L"%+03d:%02d", nGmtOffset / 60, nGmtOffset % 60);
- XmlNodeIq iq(_T("result"), pInfo);
- HXML timeNode = iq << XCHILDNS(_T("time"), JABBER_FEAT_ENTITY_TIME);
- timeNode << XCHILD(_T("utc"), stime); timeNode << XCHILD(_T("tzo"), szTZ);
+ XmlNodeIq iq(L"result", pInfo);
+ HXML timeNode = iq << XCHILDNS(L"time", JABBER_FEAT_ENTITY_TIME);
+ timeNode << XCHILD(L"utc", stime); timeNode << XCHILD(L"tzo", szTZ);
LPCTSTR szTZName = TimeZone_GetName(NULL);
if (szTZName)
- timeNode << XCHILD(_T("tz"), szTZName);
+ timeNode << XCHILD(L"tz", szTZName);
m_ThreadInfo->send(iq);
return TRUE;
}
@@ -125,19 +125,19 @@ BOOL CJabberProto::OnIqProcessIqOldTime(HXML, CJabberIqInfo *pInfo)
_tzset();
time(&ltime);
gmt = gmtime(&ltime);
- mir_sntprintf(stime, _T("%.4i%.2i%.2iT%.2i:%.2i:%.2i"),
+ mir_sntprintf(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 = _tctime(&ltime);
dtime[24] = 0;
- XmlNodeIq iq(_T("result"), pInfo);
+ XmlNodeIq iq(L"result", pInfo);
HXML queryNode = iq << XQUERY(JABBER_FEAT_ENTITY_TIME_OLD);
- queryNode << XCHILD(_T("utc"), stime);
+ queryNode << XCHILD(L"utc", stime);
LPCTSTR szTZName = TimeZone_GetName(NULL);
if (szTZName)
- queryNode << XCHILD(_T("tz"), szTZName);
- queryNode << XCHILD(_T("display"), dtime);
+ queryNode << XCHILD(L"tz", szTZName);
+ queryNode << XCHILD(L"display", dtime);
m_ThreadInfo->send(iq);
return TRUE;
}
@@ -153,17 +153,17 @@ BOOL CJabberProto::OnIqRequestAvatar(HXML, CJabberIqInfo *pInfo)
TCHAR *szMimeType;
switch (pictureType) {
- case PA_FORMAT_JPEG: szMimeType = _T("image/jpeg"); break;
- case PA_FORMAT_GIF: szMimeType = _T("image/gif"); break;
- case PA_FORMAT_PNG: szMimeType = _T("image/png"); break;
- case PA_FORMAT_BMP: szMimeType = _T("image/bmp"); break;
+ case PA_FORMAT_JPEG: szMimeType = L"image/jpeg"; break;
+ case PA_FORMAT_GIF: szMimeType = L"image/gif"; break;
+ case PA_FORMAT_PNG: szMimeType = L"image/png"; break;
+ case PA_FORMAT_BMP: szMimeType = L"image/bmp"; break;
default: return TRUE;
}
TCHAR szFileName[MAX_PATH];
GetAvatarFileName(NULL, szFileName, _countof(szFileName));
- FILE* in = _tfopen(szFileName, _T("rb"));
+ FILE* in = _tfopen(szFileName, L"rb");
if (in == NULL)
return TRUE;
@@ -178,21 +178,21 @@ BOOL CJabberProto::OnIqRequestAvatar(HXML, CJabberIqInfo *pInfo)
fclose(in);
ptrA str(mir_base64_encode((PBYTE)(char*)buffer, bytes));
- m_ThreadInfo->send(XmlNodeIq(_T("result"), pInfo) << XQUERY(JABBER_FEAT_AVATAR) << XCHILD(_T("query"), _A2T(str)) << XATTR(_T("mimetype"), szMimeType));
+ m_ThreadInfo->send(XmlNodeIq(L"result", pInfo) << XQUERY(JABBER_FEAT_AVATAR) << XCHILD(L"query", _A2T(str)) << XATTR(L"mimetype", szMimeType));
return TRUE;
}
BOOL CJabberProto::OnSiRequest(HXML node, CJabberIqInfo *pInfo)
{
- const TCHAR *szProfile = XmlGetAttrValue(pInfo->GetChildNode(), _T("profile"));
+ const TCHAR *szProfile = XmlGetAttrValue(pInfo->GetChildNode(), L"profile");
if (szProfile && !mir_tstrcmp(szProfile, JABBER_FEAT_SI_FT))
FtHandleSiRequest(node);
else {
- XmlNodeIq iq(_T("error"), pInfo);
- HXML error = iq << XCHILD(_T("error")) << XATTRI(_T("code"), 400) << XATTR(_T("type"), _T("cancel"));
- error << XCHILDNS(_T("bad-request"), _T("urn:ietf:params:xml:ns:xmpp-stanzas"));
- error << XCHILD(_T("bad-profile"));
+ XmlNodeIq iq(L"error", pInfo);
+ HXML error = iq << XCHILD(L"error") << XATTRI(L"code", 400) << XATTR(L"type", L"cancel");
+ error << XCHILDNS(L"bad-request", L"urn:ietf:params:xml:ns:xmpp-stanzas");
+ error << XCHILD(L"bad-profile");
m_ThreadInfo->send(iq);
}
return TRUE;
@@ -227,7 +227,7 @@ BOOL CJabberProto::OnRosterPushRequest(HXML, CJabberIqInfo *pInfo)
// invalid JID
if (!bRetVal) {
- debugLog(_T("<iq/> attempt to hack via roster push from %s"), pInfo->GetFrom());
+ debugLog(L"<iq/> attempt to hack via roster push from %s", pInfo->GetFrom());
return TRUE;
}
}
@@ -240,16 +240,16 @@ BOOL CJabberProto::OnRosterPushRequest(HXML, CJabberIqInfo *pInfo)
if (!itemNode)
break;
- if (mir_tstrcmp(XmlGetName(itemNode), _T("item")) != 0)
+ if (mir_tstrcmp(XmlGetName(itemNode), L"item") != 0)
continue;
- if ((jid = XmlGetAttrValue(itemNode, _T("jid"))) == NULL)
+ if ((jid = XmlGetAttrValue(itemNode, L"jid")) == NULL)
continue;
- if ((str = XmlGetAttrValue(itemNode, _T("subscription"))) == NULL)
+ if ((str = XmlGetAttrValue(itemNode, L"subscription")) == NULL)
continue;
// we will not add new account when subscription=remove
- if (!mir_tstrcmp(str, _T("to")) || !mir_tstrcmp(str, _T("both")) || !mir_tstrcmp(str, _T("from")) || !mir_tstrcmp(str, _T("none"))) {
- const TCHAR *name = XmlGetAttrValue(itemNode, _T("name"));
+ if (!mir_tstrcmp(str, L"to") || !mir_tstrcmp(str, L"both") || !mir_tstrcmp(str, L"from") || !mir_tstrcmp(str, L"none")) {
+ const TCHAR *name = XmlGetAttrValue(itemNode, L"name");
ptrT nick((name != NULL) ? mir_tstrdup(name) : JabberNickFromJID(jid));
if (nick != NULL) {
MCONTACT hContact = HContactFromJID(jid, false);
@@ -287,18 +287,18 @@ BOOL CJabberProto::OnRosterPushRequest(HXML, CJabberIqInfo *pInfo)
}
if (JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, jid)) {
- if (!mir_tstrcmp(str, _T("both"))) item->subscription = SUB_BOTH;
- else if (!mir_tstrcmp(str, _T("to"))) item->subscription = SUB_TO;
- else if (!mir_tstrcmp(str, _T("from"))) item->subscription = SUB_FROM;
+ 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;
else item->subscription = SUB_NONE;
- debugLog(_T("Roster push for jid=%s, set subscription to %s"), jid, str);
+ debugLog(L"Roster push for jid=%s, set subscription to %s", jid, str);
MCONTACT hContact = HContactFromJID(jid);
// 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, _T("remove"))) {
+ if (!mir_tstrcmp(str, L"remove")) {
if (hContact) {
SetContactOfflineStatus(hContact);
ListRemove(LIST_ROSTER, jid);
@@ -327,8 +327,8 @@ BOOL CJabberProto::OnIqRequestOOB(HXML, CJabberIqInfo *pInfo)
if (m_options.BsOnlyIBB) {
// reject
- XmlNodeIq iq(_T("error"), pInfo);
- HXML e = XmlAddChild(iq, _T("error"), _T("File transfer refused")); XmlAddAttr(e, _T("code"), 406);
+ XmlNodeIq iq(L"error", pInfo);
+ HXML e = XmlAddChild(iq, L"error", L"File transfer refused"); XmlAddAttr(e, L"code", 406);
m_ThreadInfo->send(iq);
return TRUE;
}
@@ -344,7 +344,7 @@ BOOL CJabberProto::OnIqRequestOOB(HXML, CJabberIqInfo *pInfo)
// Parse the URL
TCHAR *str = (TCHAR*)XmlGetText(n); // URL of the file to get
- if (!_tcsnicmp(str, _T("http://"), 7)) {
+ if (!_tcsnicmp(str, L"http://", 7)) {
TCHAR *p = str + 7, *q;
if ((q = _tcschr(p, '/')) != NULL) {
TCHAR text[1024];
@@ -371,7 +371,7 @@ BOOL CJabberProto::OnIqRequestOOB(HXML, CJabberIqInfo *pInfo)
desc = (TCHAR*)XmlGetText(n);
TCHAR *str2;
- debugLog(_T("description = %s"), desc);
+ debugLog(L"description = %s", desc);
if ((str2 = _tcsrchr(ft->httpPath, '/')) != NULL)
str2++;
else
@@ -391,8 +391,8 @@ BOOL CJabberProto::OnIqRequestOOB(HXML, CJabberIqInfo *pInfo)
}
else {
// reject
- XmlNodeIq iq(_T("error"), pInfo);
- HXML e = XmlAddChild(iq, _T("error"), _T("File transfer refused")); XmlAddAttr(e, _T("code"), 406);
+ XmlNodeIq iq(L"error", pInfo);
+ HXML e = XmlAddChild(iq, L"error", L"File transfer refused"); XmlAddAttr(e, L"code", 406);
m_ThreadInfo->send(iq);
delete ft;
}
@@ -404,7 +404,7 @@ BOOL CJabberProto::OnHandleDiscoInfoRequest(HXML iqNode, CJabberIqInfo *pInfo)
if (!pInfo->GetChildNode())
return TRUE;
- const TCHAR *szNode = XmlGetAttrValue(pInfo->GetChildNode(), _T("node"));
+ const TCHAR *szNode = XmlGetAttrValue(pInfo->GetChildNode(), L"node");
// caps hack
if (m_clientCapsManager.HandleInfoRequest(iqNode, pInfo, szNode))
return TRUE;
@@ -415,9 +415,9 @@ BOOL CJabberProto::OnHandleDiscoInfoRequest(HXML iqNode, CJabberIqInfo *pInfo)
// another request, send empty result
m_ThreadInfo->send(
- XmlNodeIq(_T("error"), pInfo)
- << XCHILD(_T("error")) << XATTRI(_T("code"), 404) << XATTR(_T("type"), _T("cancel"))
- << XCHILDNS(_T("item-not-found"), _T("urn:ietf:params:xml:ns:xmpp-stanzas")));
+ XmlNodeIq(L"error", pInfo)
+ << XCHILD(L"error") << XATTRI(L"code", 404) << XATTR(L"type", L"cancel")
+ << XCHILDNS(L"item-not-found", L"urn:ietf:params:xml:ns:xmpp-stanzas"));
return TRUE;
}
@@ -427,19 +427,19 @@ BOOL CJabberProto::OnHandleDiscoItemsRequest(HXML iqNode, CJabberIqInfo *pInfo)
return TRUE;
// ad-hoc commands check:
- const TCHAR *szNode = XmlGetAttrValue(pInfo->GetChildNode(), _T("node"));
+ const TCHAR *szNode = XmlGetAttrValue(pInfo->GetChildNode(), L"node");
if (szNode && m_adhocManager.HandleItemsRequest(iqNode, pInfo, szNode))
return TRUE;
// another request, send empty result
- XmlNodeIq iq(_T("result"), pInfo);
+ XmlNodeIq iq(L"result", pInfo);
HXML resultQuery = iq << XQUERY(JABBER_FEAT_DISCO_ITEMS);
if (szNode)
- XmlAddAttr(resultQuery, _T("node"), szNode);
+ XmlAddAttr(resultQuery, L"node", szNode);
if (!szNode && m_options.EnableRemoteControl)
- resultQuery << XCHILD(_T("item")) << XATTR(_T("jid"), m_ThreadInfo->fullJID)
- << XATTR(_T("node"), JABBER_FEAT_COMMANDS) << XATTR(_T("name"), _T("Ad-hoc commands"));
+ resultQuery << XCHILD(L"item") << XATTR(L"jid", m_ThreadInfo->fullJID)
+ << XATTR(L"node", JABBER_FEAT_COMMANDS) << XATTR(L"name", L"Ad-hoc commands");
m_ThreadInfo->send(iq);
return TRUE;
@@ -473,9 +473,9 @@ BOOL CJabberProto::OnIqHttpAuth(HXML node, CJabberIqInfo *pInfo)
if (!pConfirm)
return TRUE;
- const TCHAR *szId = XmlGetAttrValue(pConfirm, _T("id"));
- const TCHAR *szMethod = XmlGetAttrValue(pConfirm, _T("method"));
- const TCHAR *szUrl = XmlGetAttrValue(pConfirm, _T("url"));
+ const TCHAR *szId = XmlGetAttrValue(pConfirm, L"id");
+ const TCHAR *szMethod = XmlGetAttrValue(pConfirm, L"method");
+ const TCHAR *szUrl = XmlGetAttrValue(pConfirm, L"url");
if (!szId || !szMethod || !szUrl)
return TRUE;
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp
index fdba87e6cf..61fe3f353d 100644
--- a/protocols/JabberG/src/jabber_iqid.cpp
+++ b/protocols/JabberG/src/jabber_iqid.cpp
@@ -34,8 +34,8 @@ void CJabberProto::OnIqResultServerDiscoInfo(HXML iqNode, CJabberIqInfo*)
if (iqNode == NULL)
return;
- const TCHAR *type = XmlGetAttrValue(iqNode, _T("type"));
- if (mir_tstrcmp(type, _T("result")))
+ const TCHAR *type = XmlGetAttrValue(iqNode, L"type");
+ if (mir_tstrcmp(type, L"result"))
return;
HXML query = XmlGetChildByTag(iqNode, "query", "xmlns", JABBER_FEAT_DISCO_INFO);
@@ -43,13 +43,13 @@ void CJabberProto::OnIqResultServerDiscoInfo(HXML iqNode, CJabberIqInfo*)
return;
HXML identity;
- for (int i = 1; (identity = XmlGetNthChild(query, _T("identity"), i)) != NULL; i++) {
+ for (int i = 1; (identity = XmlGetNthChild(query, L"identity", i)) != NULL; i++) {
JABBER_DISCO_FIELD tmp = {
- XmlGetAttrValue(identity, _T("category")),
- XmlGetAttrValue(identity, _T("type")),
- XmlGetAttrValue(identity, _T("name")) };
+ XmlGetAttrValue(identity, L"category"),
+ XmlGetAttrValue(identity, L"type"),
+ XmlGetAttrValue(identity, L"name") };
- if (!mir_tstrcmp(tmp.category, _T("pubsub")) && !mir_tstrcmp(tmp.type, _T("pep"))) {
+ if (!mir_tstrcmp(tmp.category, L"pubsub") && !mir_tstrcmp(tmp.type, L"pep")) {
m_bPepSupported = true;
EnableMenuItems(true);
@@ -62,8 +62,8 @@ void CJabberProto::OnIqResultServerDiscoInfo(HXML iqNode, CJabberIqInfo*)
if (m_ThreadInfo) {
HXML feature;
- for (int i = 1; (feature = XmlGetNthChild(query, _T("feature"), i)) != NULL; i++) {
- const TCHAR *featureName = XmlGetAttrValue(feature, _T("var"));
+ for (int i = 1; (feature = XmlGetNthChild(query, L"feature", i)) != NULL; i++) {
+ const TCHAR *featureName = XmlGetAttrValue(feature, L"var");
if (!featureName)
continue;
@@ -86,7 +86,7 @@ void CJabberProto::OnIqResultNestedRosterGroups(HXML iqNode, CJabberIqInfo *pInf
if (iqNode && pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT) {
bPrivateStorageSupport = true;
- szGroupDelimeter = XPathFmt(iqNode, _T("query[@xmlns='%s']/roster[@xmlns='%s']"), JABBER_FEAT_PRIVATE_STORAGE, JABBER_FEAT_NESTED_ROSTER_GROUPS);
+ szGroupDelimeter = XPathFmt(iqNode, L"query[@xmlns='%s']/roster[@xmlns='%s']", JABBER_FEAT_PRIVATE_STORAGE, JABBER_FEAT_NESTED_ROSTER_GROUPS);
if (szGroupDelimeter && !szGroupDelimeter[0])
szGroupDelimeter = NULL; // "" as roster delimeter is not supported :)
}
@@ -96,22 +96,22 @@ void CJabberProto::OnIqResultNestedRosterGroups(HXML iqNode, CJabberIqInfo *pInf
return;
// is our default delimiter?
- if ((!szGroupDelimeter && bPrivateStorageSupport) || (szGroupDelimeter && mir_tstrcmp(szGroupDelimeter, _T("\\"))))
+ if ((!szGroupDelimeter && bPrivateStorageSupport) || (szGroupDelimeter && mir_tstrcmp(szGroupDelimeter, L"\\")))
m_ThreadInfo->send(
- XmlNodeIq(_T("set"), SerialNext()) << XQUERY(JABBER_FEAT_PRIVATE_STORAGE)
- << XCHILD(_T("roster"), _T("\\")) << XATTR(_T("xmlns"), JABBER_FEAT_NESTED_ROSTER_GROUPS));
+ XmlNodeIq(L"set", SerialNext()) << XQUERY(JABBER_FEAT_PRIVATE_STORAGE)
+ << XCHILD(L"roster", L"\\") << XATTR(L"xmlns", JABBER_FEAT_NESTED_ROSTER_GROUPS));
// roster request
- TCHAR *szUserData = mir_tstrdup(szGroupDelimeter ? szGroupDelimeter : _T("\\"));
+ TCHAR *szUserData = mir_tstrdup(szGroupDelimeter ? szGroupDelimeter : L"\\");
m_ThreadInfo->send(
XmlNodeIq( AddIQ(&CJabberProto::OnIqResultGetRoster, JABBER_IQ_TYPE_GET, NULL, 0, -1, (void*)szUserData))
- << XCHILDNS(_T("query"), JABBER_FEAT_IQ_ROSTER));
+ << XCHILDNS(L"query", JABBER_FEAT_IQ_ROSTER));
}
void CJabberProto::OnIqResultNotes(HXML iqNode, CJabberIqInfo *pInfo)
{
if (iqNode && pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT) {
- HXML hXmlData = XPathFmt(iqNode, _T("query[@xmlns='%s']/storage[@xmlns='%s']"),
+ HXML hXmlData = XPathFmt(iqNode, L"query[@xmlns='%s']/storage[@xmlns='%s']",
JABBER_FEAT_PRIVATE_STORAGE, JABBER_FEAT_MIRANDA_NOTES);
if (hXmlData) m_notes.LoadXml(hXmlData);
}
@@ -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, _T("conference")) && item->bAutoJoin)
+ if (item != NULL && !mir_tstrcmp(item->type, L"conference") && item->bAutoJoin)
ll.insert(item);
}
@@ -144,8 +144,8 @@ void CJabberProto::OnProcessLoginRq(ThreadData *info, DWORD rq)
TCHAR room[256], text[128];
_tcsncpy_s(text, item->jid, _TRUNCATE);
_tcsncpy_s(room, text, _TRUNCATE);
- TCHAR *p = _tcstok(room, _T("@"));
- TCHAR *server = _tcstok(NULL, _T("@"));
+ TCHAR *p = _tcstok(room, L"@");
+ TCHAR *server = _tcstok(NULL, L"@");
if (item->nick && item->nick[0])
GroupchatJoinRoom(server, p, item->nick, item->password, true);
else {
@@ -178,18 +178,18 @@ void CJabberProto::OnLoggedIn()
pIqInfo->SetTimeout(30000);
m_ThreadInfo->send(
XmlNodeIq(pIqInfo) << XQUERY(JABBER_FEAT_PRIVATE_STORAGE)
- << XCHILDNS(_T("roster"), JABBER_FEAT_NESTED_ROSTER_GROUPS));
+ << XCHILDNS(L"roster", JABBER_FEAT_NESTED_ROSTER_GROUPS));
}
// Server-side notes
m_ThreadInfo->send(
XmlNodeIq(AddIQ(&CJabberProto::OnIqResultNotes, JABBER_IQ_TYPE_GET))
<< XQUERY(JABBER_FEAT_PRIVATE_STORAGE)
- << XCHILDNS(_T("storage"), JABBER_FEAT_MIRANDA_NOTES));
+ << XCHILDNS(L"storage", JABBER_FEAT_MIRANDA_NOTES));
m_ThreadInfo->send(
XmlNodeIq(AddIQ(&CJabberProto::OnIqResultDiscoBookmarks, JABBER_IQ_TYPE_GET))
- << XQUERY(JABBER_FEAT_PRIVATE_STORAGE) << XCHILDNS(_T("storage"), _T("storage:bookmarks")));
+ << XQUERY(JABBER_FEAT_PRIVATE_STORAGE) << XCHILDNS(L"storage", L"storage:bookmarks"));
m_bPepSupported = false;
m_ThreadInfo->jabberServerCaps = JABBER_RESOURCE_CAPS_NONE;
@@ -216,22 +216,22 @@ void CJabberProto::OnIqResultGetAuth(HXML iqNode, CJabberIqInfo*)
HXML queryNode;
const TCHAR *type;
- if ((type = XmlGetAttrValue(iqNode, _T("type"))) == NULL) return;
+ if ((type = XmlGetAttrValue(iqNode, L"type")) == NULL) return;
if ((queryNode = XmlGetChild(iqNode, "query")) == NULL) return;
- if (!mir_tstrcmp(type, _T("result"))) {
+ if (!mir_tstrcmp(type, L"result")) {
XmlNodeIq iq(AddIQ(&CJabberProto::OnIqResultSetAuth, JABBER_IQ_TYPE_SET));
- HXML query = iq << XQUERY(_T("jabber:iq:auth"));
- query << XCHILD(_T("username"), m_ThreadInfo->conn.username);
+ HXML query = iq << XQUERY(L"jabber:iq:auth");
+ query << XCHILD(L"username", m_ThreadInfo->conn.username);
if (XmlGetChild(queryNode, "digest") != NULL && m_ThreadInfo->szStreamId) {
JabberShaStrBuf buf;
T2Utf str(m_ThreadInfo->conn.password);
char text[200];
mir_snprintf(text, "%s%s", m_ThreadInfo->szStreamId, str);
- query << XCHILD(_T("digest"), _A2T(JabberSha1(text, buf)));
+ query << XCHILD(L"digest", _A2T(JabberSha1(text, buf)));
}
else if (XmlGetChild(queryNode, "password") != NULL)
- query << XCHILD(_T("password"), m_ThreadInfo->conn.password);
+ query << XCHILD(L"password", m_ThreadInfo->conn.password);
else {
debugLogA("No known authentication mechanism accepted by the server.");
m_ThreadInfo->send("</stream:stream>");
@@ -239,11 +239,11 @@ void CJabberProto::OnIqResultGetAuth(HXML iqNode, CJabberIqInfo*)
}
if (XmlGetChild(queryNode, "resource") != NULL)
- query << XCHILD(_T("resource"), m_ThreadInfo->resource);
+ query << XCHILD(L"resource", m_ThreadInfo->resource);
m_ThreadInfo->send(iq);
}
- else if (!mir_tstrcmp(type, _T("error"))) {
+ else if (!mir_tstrcmp(type, L"error")) {
m_ThreadInfo->send("</stream:stream>");
TCHAR text[128];
@@ -261,9 +261,9 @@ void CJabberProto::OnIqResultSetAuth(HXML iqNode, CJabberIqInfo*)
// RECVED: authentication result
// ACTION: if successfully logged in, continue by requesting roster list and set my initial status
debugLogA("<iq/> iqIdSetAuth");
- if ((type = XmlGetAttrValue(iqNode, _T("type"))) == NULL) return;
+ if ((type = XmlGetAttrValue(iqNode, L"type")) == NULL) return;
- if (!mir_tstrcmp(type, _T("result"))) {
+ if (!mir_tstrcmp(type, L"result")) {
ptrT tszNick(getTStringA("Nick"));
if (tszNick == NULL)
setTString("Nick", m_ThreadInfo->conn.username);
@@ -271,7 +271,7 @@ void CJabberProto::OnIqResultSetAuth(HXML iqNode, CJabberIqInfo*)
OnLoggedIn();
}
// What to do if password error? etc...
- else if (!mir_tstrcmp(type, _T("error"))) {
+ else if (!mir_tstrcmp(type, L"error")) {
TCHAR text[128];
m_ThreadInfo->send("</stream:stream>");
@@ -290,16 +290,16 @@ void CJabberProto::OnIqResultBind(HXML iqNode, CJabberIqInfo *pInfo)
LPCTSTR szJid = XPathT(iqNode, "bind[@xmlns='urn:ietf:params:xml:ns:xmpp-bind']/jid");
if (szJid) {
if (!_tcsncmp(m_ThreadInfo->fullJID, szJid, _countof(m_ThreadInfo->fullJID)))
- debugLog(_T("Result Bind: %s confirmed "), m_ThreadInfo->fullJID);
+ debugLog(L"Result Bind: %s confirmed ", m_ThreadInfo->fullJID);
else {
- debugLog(_T("Result Bind: %s changed to %s"), m_ThreadInfo->fullJID, szJid);
+ debugLog(L"Result Bind: %s changed to %s", m_ThreadInfo->fullJID, szJid);
_tcsncpy_s(m_ThreadInfo->fullJID, szJid, _TRUNCATE);
}
}
if (m_ThreadInfo->bIsSessionAvailable)
m_ThreadInfo->send(
XmlNodeIq( AddIQ(&CJabberProto::OnIqResultSession, JABBER_IQ_TYPE_SET))
- << XCHILDNS(_T("session"), _T("urn:ietf:params:xml:ns:xmpp-session")));
+ << XCHILDNS(L"session", L"urn:ietf:params:xml:ns:xmpp-session"));
else
OnLoggedIn();
}
@@ -357,12 +357,12 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo)
return;
}
- if (mir_tstrcmp(XmlGetAttrValue(queryNode, _T("xmlns")), JABBER_FEAT_IQ_ROSTER)) {
+ if (mir_tstrcmp(XmlGetAttrValue(queryNode, L"xmlns"), JABBER_FEAT_IQ_ROSTER)) {
mir_free(szGroupDelimeter);
return;
}
- if (!mir_tstrcmp(szGroupDelimeter, _T("\\"))) {
+ if (!mir_tstrcmp(szGroupDelimeter, L"\\")) {
mir_free(szGroupDelimeter);
szGroupDelimeter = NULL;
}
@@ -377,25 +377,25 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo)
if (!itemNode)
break;
- if (mir_tstrcmp(XmlGetName(itemNode), _T("item")))
+ if (mir_tstrcmp(XmlGetName(itemNode), L"item"))
continue;
- const TCHAR *str = XmlGetAttrValue(itemNode, _T("subscription"));
+ const TCHAR *str = XmlGetAttrValue(itemNode, L"subscription");
JABBER_SUBSCRIPTION sub;
if (str == NULL) sub = SUB_NONE;
- else if (!mir_tstrcmp(str, _T("both"))) sub = SUB_BOTH;
- else if (!mir_tstrcmp(str, _T("to"))) sub = SUB_TO;
- else if (!mir_tstrcmp(str, _T("from"))) sub = SUB_FROM;
+ 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 sub = SUB_NONE;
- const TCHAR *jid = XmlGetAttrValue(itemNode, _T("jid"));
+ const TCHAR *jid = XmlGetAttrValue(itemNode, L"jid");
if (jid == NULL)
continue;
if (_tcschr(jid, '@') == NULL)
bIsTransport = true;
- const TCHAR *name = XmlGetAttrValue(itemNode, _T("name"));
+ const TCHAR *name = XmlGetAttrValue(itemNode, L"name");
TCHAR *nick = (name != NULL) ? mir_tstrdup(name) : JabberNickFromJID(jid);
if (nick == NULL)
continue;
@@ -419,7 +419,7 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo)
szPos += mir_tstrlen(szGroupDelimeter);
TCHAR *szNewGroup = (TCHAR *)mir_alloc(sizeof(TCHAR) * (mir_tstrlen(item->group) + mir_tstrlen(szPos) + 2));
mir_tstrcpy(szNewGroup, item->group);
- mir_tstrcat(szNewGroup, _T("\\"));
+ mir_tstrcat(szNewGroup, L"\\");
mir_tstrcat(szNewGroup, szPos);
mir_free(item->group);
item->group = szNewGroup;
@@ -478,7 +478,7 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo)
setByte(hContact, "IsTransport", false);
}
- const TCHAR *imagepath = XmlGetAttrValue(itemNode, _T("vz:img"));
+ const TCHAR *imagepath = XmlGetAttrValue(itemNode, L"vz:img");
if (imagepath)
httpavatars->insert(new JABBER_HTTP_AVATARS(imagepath, hContact));
}
@@ -494,7 +494,7 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo)
MCONTACT hNext = db_find_next(hContact, m_szModuleName);
ptrT jid(getTStringA(hContact, "jid"));
if (jid != NULL && !ListGetItemPtr(LIST_ROSTER, jid)) {
- debugLog(_T("Syncing roster: preparing to delete %s (hContact=0x%x)"), jid, hContact);
+ debugLog(L"Syncing roster: preparing to delete %s (hContact=0x%x)", jid, hContact);
CallService(MS_DB_CONTACT_DELETE, hContact, 0);
}
hContact = hNext;
@@ -530,14 +530,14 @@ void CJabberProto::OnIqResultGetRegister(HXML iqNode, CJabberIqInfo*)
HXML queryNode;
const TCHAR *type;
- if ((type = XmlGetAttrValue(iqNode, _T("type"))) == NULL) return;
+ if ((type = XmlGetAttrValue(iqNode, L"type")) == NULL) return;
if ((queryNode = XmlGetChild(iqNode, "query")) == NULL) return;
- if (!mir_tstrcmp(type, _T("result"))) {
+ if (!mir_tstrcmp(type, L"result")) {
if (m_hwndAgentRegInput)
SendMessage(m_hwndAgentRegInput, WM_JABBER_REGINPUT_ACTIVATE, 1 /*success*/, (LPARAM)xmlCopyNode(iqNode));
}
- else if (!mir_tstrcmp(type, _T("error"))) {
+ else if (!mir_tstrcmp(type, L"error")) {
if (m_hwndAgentRegInput) {
HXML errorNode = XmlGetChild(iqNode, "error");
TCHAR *str = JabberErrorMsg(errorNode);
@@ -554,10 +554,10 @@ void CJabberProto::OnIqResultSetRegister(HXML iqNode, CJabberIqInfo*)
debugLogA("<iq/> iqIdSetRegister");
const TCHAR *type, *from;
- if ((type = XmlGetAttrValue(iqNode, _T("type"))) == NULL) return;
- if ((from = XmlGetAttrValue(iqNode, _T("from"))) == NULL) return;
+ if ((type = XmlGetAttrValue(iqNode, L"type")) == NULL) return;
+ if ((from = XmlGetAttrValue(iqNode, L"from")) == NULL) return;
- if (!mir_tstrcmp(type, _T("result"))) {
+ if (!mir_tstrcmp(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, _T("error"))) {
+ else if (!mir_tstrcmp(type, L"error")) {
if (m_hwndRegProgress) {
HXML errorNode = XmlGetChild(iqNode, "error");
TCHAR *str = JabberErrorMsg(errorNode);
@@ -601,7 +601,7 @@ void CJabberProto::OnIqResultGetVcardPhoto(HXML n, MCONTACT hContact, bool &hasP
TCHAR szAvatarFileName[MAX_PATH];
GetAvatarFileName(hContact, szAvatarFileName, _countof(szAvatarFileName));
- debugLog(_T("Picture file name set to %s"), szAvatarFileName);
+ debugLog(L"Picture file name set to %s", szAvatarFileName);
HANDLE hFile = CreateFile(szAvatarFileName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE)
return;
@@ -618,7 +618,7 @@ void CJabberProto::OnIqResultGetVcardPhoto(HXML n, MCONTACT hContact, bool &hasP
hasPhoto = true;
CallService(MS_AV_SETMYAVATART, (WPARAM)m_szModuleName, (LPARAM)szAvatarFileName);
- debugLog(_T("My picture saved to %s"), szAvatarFileName);
+ debugLog(L"My picture saved to %s", szAvatarFileName);
}
else {
ptrT jid(getTStringA(hContact, "jid"));
@@ -634,7 +634,7 @@ void CJabberProto::OnIqResultGetVcardPhoto(HXML n, MCONTACT hContact, bool &hasP
if (item->photoFileName && mir_tstrcmp(item->photoFileName, szAvatarFileName))
DeleteFile(item->photoFileName);
replaceStrT(item->photoFileName, szAvatarFileName);
- debugLog(_T("Contact's picture saved to %s"), szAvatarFileName);
+ debugLog(L"Contact's picture saved to %s", szAvatarFileName);
OnIqResultGotAvatar(hContact, o, szPicType);
}
}
@@ -661,27 +661,27 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
DBVARIANT dbv;
debugLogA("<iq/> iqIdGetVcard");
- if ((type = XmlGetAttrValue(iqNode, _T("type"))) == NULL) return;
- if ((jid = XmlGetAttrValue(iqNode, _T("from"))) == NULL) return;
+ if ((type = XmlGetAttrValue(iqNode, L"type")) == NULL) return;
+ if ((jid = XmlGetAttrValue(iqNode, L"from")) == NULL) return;
int id = JabberGetPacketID(iqNode);
if (id == m_nJabberSearchID) {
m_nJabberSearchID = -1;
if ((vCardNode = XmlGetChild(iqNode, "vCard")) != NULL) {
- if (!mir_tstrcmp(type, _T("result"))) {
+ if (!mir_tstrcmp(type, L"result")) {
PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
psr.flags = PSR_TCHAR;
psr.nick.t = sttGetText(vCardNode, "NICKNAME");
psr.firstName.t = sttGetText(vCardNode, "FN");
- psr.lastName.t = _T("");
+ psr.lastName.t = L"";
psr.email.t = sttGetText(vCardNode, "EMAIL");
psr.id.t = NEWTSTR_ALLOCA(jid);
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)id, (LPARAM)&psr);
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
}
- else if (!mir_tstrcmp(type, _T("error")))
+ else if (!mir_tstrcmp(type, L"error"))
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
}
else ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
@@ -699,13 +699,13 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
debugLogA("Other user's vcard");
}
- if (!mir_tstrcmp(type, _T("error"))) {
+ if (!mir_tstrcmp(type, L"error")) {
if ((hContact = HContactFromJID(jid)) != NULL)
ProtoBroadcastAck(hContact, ACKTYPE_GETINFO, ACKRESULT_FAILED, (HANDLE)1, 0);
return;
}
- if (mir_tstrcmp(type, _T("result")))
+ if (mir_tstrcmp(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), _T("FN"))) {
+ if (!mir_tstrcmp(XmlGetName(n), L"FN")) {
if (XmlGetText(n) != NULL) {
hasFn = true;
setTString(hContact, "FullName", XmlGetText(n));
}
}
- else if (!mir_tstrcmp(XmlGetName(n), _T("NICKNAME"))) {
+ else if (!mir_tstrcmp(XmlGetName(n), L"NICKNAME")) {
if (XmlGetText(n) != NULL) {
hasNick = true;
setTString(hContact, "Nick", XmlGetText(n));
}
}
- else if (!mir_tstrcmp(XmlGetName(n), _T("N"))) {
+ else if (!mir_tstrcmp(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), _T("EMAIL"))) {
+ else if (!mir_tstrcmp(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,11 +779,11 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
nEmail++;
}
}
- else if (!mir_tstrcmp(XmlGetName(n), _T("BDAY"))) {
+ else if (!mir_tstrcmp(XmlGetName(n), L"BDAY")) {
// Birthday
if (!hasBday && XmlGetText(n) != NULL) {
if (hContact != NULL) {
- if (_stscanf(XmlGetText(n), _T("%d-%d-%d"), &nYear, &nMonth, &nDay) == 3) {
+ if (_stscanf(XmlGetText(n), L"%d-%d-%d", &nYear, &nMonth, &nDay) == 3) {
hasBday = true;
setWord(hContact, "BirthYear", (WORD)nYear);
setByte(hContact, "BirthMonth", (BYTE)nMonth);
@@ -804,7 +804,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
}
}
}
- else if (!mir_tstrcmp(XmlGetName(n), _T("GENDER"))) {
+ else if (!mir_tstrcmp(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), _T("ADR"))) {
+ else if (!mir_tstrcmp(XmlGetName(n), L"ADR")) {
if (!hasHome && XmlGetChild(n, "HOME") != NULL) {
// Home address
TCHAR 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, _T("%s\r\n%s"), XmlGetText(m), XmlGetText(o));
+ mir_sntprintf(text, L"%s\r\n%s", XmlGetText(m), XmlGetText(o));
else if ((o = XmlGetChild(n, "EXTADD")) != NULL && XmlGetText(o) != NULL)
- mir_sntprintf(text, _T("%s\r\n%s"), XmlGetText(m), XmlGetText(o));
+ mir_sntprintf(text, L"%s\r\n%s", XmlGetText(m), XmlGetText(o));
else
_tcsncpy_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, _T("%s\r\n%s"), XmlGetText(m), XmlGetText(o));
+ mir_sntprintf(text, L"%s\r\n%s", XmlGetText(m), XmlGetText(o));
else if ((o = XmlGetChild(n, "EXTADD")) != NULL && XmlGetText(o) != NULL)
- mir_sntprintf(text, _T("%s\r\n%s"), XmlGetText(m), XmlGetText(o));
+ mir_sntprintf(text, L"%s\r\n%s", XmlGetText(m), XmlGetText(o));
else
_tcsncpy_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), _T("TEL"))) {
+ else if (!mir_tstrcmp(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), _T("URL"))) {
+ else if (!mir_tstrcmp(XmlGetName(n), L"URL")) {
// Homepage
if (!hasUrl && XmlGetText(n) != NULL) {
hasUrl = true;
setTString(hContact, "Homepage", XmlGetText(n));
}
}
- else if (!mir_tstrcmp(XmlGetName(n), _T("ORG"))) {
+ else if (!mir_tstrcmp(XmlGetName(n), L"ORG")) {
if (!hasOrgname && !hasOrgunit) {
if ((m = XmlGetChild(n, "ORGNAME")) != NULL && XmlGetText(m) != NULL) {
hasOrgname = true;
@@ -985,27 +985,27 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
}
}
}
- else if (!mir_tstrcmp(XmlGetName(n), _T("ROLE"))) {
+ else if (!mir_tstrcmp(XmlGetName(n), L"ROLE")) {
if (!hasRole && XmlGetText(n) != NULL) {
hasRole = true;
setTString(hContact, "Role", XmlGetText(n));
}
}
- else if (!mir_tstrcmp(XmlGetName(n), _T("TITLE"))) {
+ else if (!mir_tstrcmp(XmlGetName(n), L"TITLE")) {
if (!hasTitle && XmlGetText(n) != NULL) {
hasTitle = true;
setTString(hContact, "CompanyPosition", XmlGetText(n));
}
}
- else if (!mir_tstrcmp(XmlGetName(n), _T("DESC"))) {
+ else if (!mir_tstrcmp(XmlGetName(n), L"DESC")) {
if (!hasDesc && XmlGetText(n) != NULL) {
hasDesc = true;
CMString tszMemo(XmlGetText(n));
- tszMemo.Replace(_T("\n"), _T("\r\n"));
+ tszMemo.Replace(L"\n", L"\r\n");
setTString(hContact, "About", tszMemo);
}
}
- else if (!mir_tstrcmp(XmlGetName(n), _T("PHOTO")))
+ else if (!mir_tstrcmp(XmlGetName(n), L"PHOTO"))
OnIqResultGetVcardPhoto(n, hContact, hasPhoto);
}
}
@@ -1145,7 +1145,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
void CJabberProto::OnIqResultSetVcard(HXML iqNode, CJabberIqInfo*)
{
debugLogA("<iq/> iqIdSetVcard");
- if (XmlGetAttrValue(iqNode, _T("type")))
+ if (XmlGetAttrValue(iqNode, L"type"))
WindowList_Broadcast(m_hWindowList, WM_JABBER_REFRESH_VCARD, 0, 0);
}
@@ -1156,10 +1156,10 @@ void CJabberProto::OnIqResultSetSearch(HXML iqNode, CJabberIqInfo*)
int id;
debugLogA("<iq/> iqIdGetSearch");
- if ((type = XmlGetAttrValue(iqNode, _T("type"))) == NULL) return;
+ if ((type = XmlGetAttrValue(iqNode, L"type")) == NULL) return;
if ((id = JabberGetPacketID(iqNode)) == -1) return;
- if (!mir_tstrcmp(type, _T("result"))) {
+ if (!mir_tstrcmp(type, L"result")) {
if ((queryNode = XmlGetChild(iqNode, "query")) == NULL)
return;
@@ -1170,26 +1170,26 @@ void CJabberProto::OnIqResultSetSearch(HXML iqNode, CJabberIqInfo*)
if (!itemNode)
break;
- if (!mir_tstrcmp(XmlGetName(itemNode), _T("item"))) {
- if ((jid = XmlGetAttrValue(itemNode, _T("jid"))) != NULL) {
+ if (!mir_tstrcmp(XmlGetName(itemNode), L"item")) {
+ if ((jid = XmlGetAttrValue(itemNode, L"jid")) != NULL) {
psr.id.t = (TCHAR*)jid;
- debugLog(_T("Result jid = %s"), jid);
+ debugLog(L"Result jid = %s", jid);
if ((n = XmlGetChild(itemNode, "nick")) != NULL && XmlGetText(n) != NULL)
psr.nick.t = (TCHAR*)XmlGetText(n);
else
- psr.nick.t = _T("");
+ psr.nick.t = L"";
if ((n = XmlGetChild(itemNode, "first")) != NULL && XmlGetText(n) != NULL)
psr.firstName.t = (TCHAR*)XmlGetText(n);
else
- psr.firstName.t = _T("");
+ psr.firstName.t = L"";
if ((n = XmlGetChild(itemNode, "last")) != NULL && XmlGetText(n) != NULL)
psr.lastName.t = (TCHAR*)XmlGetText(n);
else
- psr.lastName.t = _T("");
+ psr.lastName.t = L"";
if ((n = XmlGetChild(itemNode, "email")) != NULL && XmlGetText(n) != NULL)
psr.email.t = (TCHAR*)XmlGetText(n);
else
- psr.email.t = _T("");
+ psr.email.t = L"";
psr.flags = PSR_TCHAR;
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)id, (LPARAM)&psr);
}
@@ -1198,7 +1198,7 @@ void CJabberProto::OnIqResultSetSearch(HXML iqNode, CJabberIqInfo*)
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
}
- else if (!mir_tstrcmp(type, _T("error")))
+ else if (!mir_tstrcmp(type, L"error"))
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
}
@@ -1207,7 +1207,7 @@ void CJabberProto::OnIqResultExtSearch(HXML iqNode, CJabberIqInfo*)
HXML queryNode;
debugLogA("<iq/> iqIdGetExtSearch");
- const TCHAR *type = XmlGetAttrValue(iqNode, _T("type"));
+ const TCHAR *type = XmlGetAttrValue(iqNode, L"type");
if (type == NULL)
return;
@@ -1215,14 +1215,14 @@ void CJabberProto::OnIqResultExtSearch(HXML iqNode, CJabberIqInfo*)
if (id == -1)
return;
- if (!mir_tstrcmp(type, _T("result"))) {
+ if (!mir_tstrcmp(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), _T("item")))
+ if (mir_tstrcmp(XmlGetName(itemNode), L"item"))
continue;
PROTOSEARCHRESULT psr = { 0 };
@@ -1234,10 +1234,10 @@ void CJabberProto::OnIqResultExtSearch(HXML iqNode, CJabberIqInfo*)
if (!fieldNode)
break;
- if (mir_tstrcmp(XmlGetName(fieldNode), _T("field")))
+ if (mir_tstrcmp(XmlGetName(fieldNode), L"field"))
continue;
- const TCHAR *fieldName = XmlGetAttrValue(fieldNode, _T("var"));
+ const TCHAR *fieldName = XmlGetAttrValue(fieldNode, L"var");
if (fieldName == NULL)
continue;
@@ -1245,20 +1245,20 @@ void CJabberProto::OnIqResultExtSearch(HXML iqNode, CJabberIqInfo*)
if (n == NULL)
continue;
- if (!mir_tstrcmp(fieldName, _T("jid"))) {
+ if (!mir_tstrcmp(fieldName, L"jid")) {
psr.id.t = (TCHAR*)XmlGetText(n);
- debugLog(_T("Result jid = %s"), psr.id.t);
+ debugLog(L"Result jid = %s", psr.id.t);
}
- else if (!mir_tstrcmp(fieldName, _T("nickname")))
- psr.nick.t = (XmlGetText(n) != NULL) ? (TCHAR*)XmlGetText(n) : _T("");
- else if (!mir_tstrcmp(fieldName, _T("fn")))
- psr.firstName.t = (XmlGetText(n) != NULL) ? (TCHAR*)XmlGetText(n) : _T("");
- else if (!mir_tstrcmp(fieldName, _T("given")))
- psr.firstName.t = (XmlGetText(n) != NULL) ? (TCHAR*)XmlGetText(n) : _T("");
- else if (!mir_tstrcmp(fieldName, _T("family")))
- psr.lastName.t = (XmlGetText(n) != NULL) ? (TCHAR*)XmlGetText(n) : _T("");
- else if (!mir_tstrcmp(fieldName, _T("email")))
- psr.email.t = (XmlGetText(n) != NULL) ? (TCHAR*)XmlGetText(n) : _T("");
+ else if (!mir_tstrcmp(fieldName, L"nickname"))
+ psr.nick.t = (XmlGetText(n) != NULL) ? (TCHAR*)XmlGetText(n) : L"";
+ else if (!mir_tstrcmp(fieldName, L"fn"))
+ psr.firstName.t = (XmlGetText(n) != NULL) ? (TCHAR*)XmlGetText(n) : L"";
+ else if (!mir_tstrcmp(fieldName, L"given"))
+ psr.firstName.t = (XmlGetText(n) != NULL) ? (TCHAR*)XmlGetText(n) : L"";
+ else if (!mir_tstrcmp(fieldName, L"family"))
+ psr.lastName.t = (XmlGetText(n) != NULL) ? (TCHAR*)XmlGetText(n) : L"";
+ else if (!mir_tstrcmp(fieldName, L"email"))
+ psr.email.t = (XmlGetText(n) != NULL) ? (TCHAR*)XmlGetText(n) : L"";
}
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)id, (LPARAM)&psr);
@@ -1266,7 +1266,7 @@ void CJabberProto::OnIqResultExtSearch(HXML iqNode, CJabberIqInfo*)
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
}
- else if (!mir_tstrcmp(type, _T("error")))
+ else if (!mir_tstrcmp(type, L"error"))
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
}
@@ -1274,15 +1274,15 @@ void CJabberProto::OnIqResultSetPassword(HXML iqNode, CJabberIqInfo*)
{
debugLogA("<iq/> iqIdSetPassword");
- const TCHAR *type = XmlGetAttrValue(iqNode, _T("type"));
+ const TCHAR *type = XmlGetAttrValue(iqNode, L"type");
if (type == NULL)
return;
- if (!mir_tstrcmp(type, _T("result"))) {
+ if (!mir_tstrcmp(type, L"result")) {
_tcsncpy_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, _T("error")))
+ else if (!mir_tstrcmp(type, L"error"))
MessageBox(NULL, TranslateT("Password cannot be changed."), TranslateT("Change Password"), MB_OK | MB_ICONSTOP | MB_SETFOREGROUND);
}
@@ -1290,7 +1290,7 @@ void CJabberProto::OnIqResultGetVCardAvatar(HXML iqNode, CJabberIqInfo*)
{
debugLogA("<iq/> OnIqResultGetVCardAvatar");
- const TCHAR *from = XmlGetAttrValue(iqNode, _T("from"));
+ const TCHAR *from = XmlGetAttrValue(iqNode, L"from");
if (from == NULL)
return;
@@ -1299,8 +1299,8 @@ void CJabberProto::OnIqResultGetVCardAvatar(HXML iqNode, CJabberIqInfo*)
return;
const TCHAR *type;
- if ((type = XmlGetAttrValue(iqNode, _T("type"))) == NULL) return;
- if (mir_tstrcmp(type, _T("result"))) return;
+ if ((type = XmlGetAttrValue(iqNode, L"type")) == NULL) return;
+ if (mir_tstrcmp(type, L"result")) return;
HXML vCard = XmlGetChild(iqNode, "vCard");
if (vCard == NULL) return;
@@ -1331,7 +1331,7 @@ void CJabberProto::OnIqResultGetClientAvatar(HXML iqNode, CJabberIqInfo*)
debugLogA("<iq/> iqIdResultGetClientAvatar");
- const TCHAR *from = XmlGetAttrValue(iqNode, _T("from"));
+ const TCHAR *from = XmlGetAttrValue(iqNode, L"from");
if (from == NULL)
return;
MCONTACT hContact = HContactFromJID(from);
@@ -1339,17 +1339,17 @@ void CJabberProto::OnIqResultGetClientAvatar(HXML iqNode, CJabberIqInfo*)
return;
HXML n = NULL;
- if ((type = XmlGetAttrValue(iqNode, _T("type"))) != NULL && !mir_tstrcmp(type, _T("result"))) {
+ if ((type = XmlGetAttrValue(iqNode, L"type")) != NULL && !mir_tstrcmp(type, L"result")) {
HXML queryNode = XmlGetChild(iqNode, "query");
if (queryNode != NULL) {
- const TCHAR *xmlns = XmlGetAttrValue(queryNode, _T("xmlns"));
+ const TCHAR *xmlns = XmlGetAttrValue(queryNode, L"xmlns");
if (!mir_tstrcmp(xmlns, JABBER_FEAT_AVATAR))
n = XmlGetChild(queryNode, "data");
}
}
if (n != NULL) {
- OnIqResultGotAvatar(hContact, n, XmlGetAttrValue(n, _T("mimetype")));
+ OnIqResultGotAvatar(hContact, n, XmlGetAttrValue(n, L"mimetype"));
return;
}
@@ -1369,7 +1369,7 @@ void CJabberProto::OnIqResultGetServerAvatar(HXML iqNode, CJabberIqInfo*)
{
debugLogA("<iq/> iqIdResultGetServerAvatar");
- const TCHAR *from = XmlGetAttrValue(iqNode, _T("from"));
+ const TCHAR *from = XmlGetAttrValue(iqNode, L"from");
if (from == NULL)
return;
@@ -1378,18 +1378,18 @@ void CJabberProto::OnIqResultGetServerAvatar(HXML iqNode, CJabberIqInfo*)
return;
HXML n = NULL;
- const TCHAR *type = XmlGetAttrValue(iqNode, _T("type"));
- if (!mir_tstrcmp(type, _T("result"))) {
+ const TCHAR *type = XmlGetAttrValue(iqNode, L"type");
+ if (!mir_tstrcmp(type, L"result")) {
HXML queryNode = XmlGetChild(iqNode, "query");
if (queryNode != NULL) {
- const TCHAR *xmlns = XmlGetAttrValue(queryNode, _T("xmlns"));
+ const TCHAR *xmlns = XmlGetAttrValue(queryNode, L"xmlns");
if (!mir_tstrcmp(xmlns, JABBER_FEAT_SERVER_AVATAR))
n = XmlGetChild(queryNode, "data");
}
}
if (n != NULL) {
- OnIqResultGotAvatar(hContact, n, XmlGetAttrValue(n, _T("mimetype")));
+ OnIqResultGotAvatar(hContact, n, XmlGetAttrValue(n, L"mimetype"));
return;
}
@@ -1401,7 +1401,7 @@ void CJabberProto::OnIqResultGetServerAvatar(HXML iqNode, CJabberIqInfo*)
// Try VCard photo
m_ThreadInfo->send(
- XmlNodeIq(AddIQ(&CJabberProto::OnIqResultGetVCardAvatar, JABBER_IQ_TYPE_GET, szJid)) << XCHILDNS(_T("vCard"), JABBER_FEAT_VCARD_TEMP));
+ XmlNodeIq(AddIQ(&CJabberProto::OnIqResultGetVCardAvatar, JABBER_IQ_TYPE_GET, szJid)) << XCHILDNS(L"vCard", JABBER_FEAT_VCARD_TEMP));
}
@@ -1414,13 +1414,13 @@ void CJabberProto::OnIqResultGotAvatar(MCONTACT hContact, HXML n, const TCHAR *m
int pictureType;
if (mimeType != NULL) {
- if (!mir_tstrcmp(mimeType, _T("image/jpeg"))) pictureType = PA_FORMAT_JPEG;
- else if (!mir_tstrcmp(mimeType, _T("image/png"))) pictureType = PA_FORMAT_PNG;
- else if (!mir_tstrcmp(mimeType, _T("image/gif"))) pictureType = PA_FORMAT_GIF;
- else if (!mir_tstrcmp(mimeType, _T("image/bmp"))) pictureType = PA_FORMAT_BMP;
+ 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;
else {
LBL_ErrFormat:
- debugLog(_T("Invalid mime type specified for picture: %s"), mimeType);
+ debugLog(L"Invalid mime type specified for picture: %s", mimeType);
return;
}
}
@@ -1448,7 +1448,7 @@ LBL_ErrFormat:
GetAvatarFileName(hContact, tszFileName, _countof(tszFileName));
_tcsncpy_s(ai.filename, tszFileName, _TRUNCATE);
- FILE *out = _tfopen(tszFileName, _T("wb"));
+ FILE *out = _tfopen(tszFileName, L"wb");
if (out != NULL) {
fwrite(body, resultLen, 1, out);
fclose(out);
@@ -1456,7 +1456,7 @@ LBL_ErrFormat:
char buffer[41];
setString(hContact, "AvatarSaved", bin2hex(digest, sizeof(digest), buffer));
ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, HANDLE(&ai), NULL);
- debugLog(_T("Broadcast new avatar: %s"), ai.filename);
+ debugLog(L"Broadcast new avatar: %s", ai.filename);
}
else ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, HANDLE(&ai), NULL);
}
@@ -1469,12 +1469,12 @@ void CJabberProto::OnIqResultDiscoBookmarks(HXML iqNode, CJabberIqInfo*)
// RECVED: list of bookmarks
// ACTION: refresh bookmarks dialog
debugLogA("<iq/> iqIdGetBookmarks");
- const TCHAR *type = XmlGetAttrValue(iqNode, _T("type"));
+ const TCHAR *type = XmlGetAttrValue(iqNode, L"type");
if (type == NULL)
return;
const TCHAR *jid;
- if (!mir_tstrcmp(type, _T("result"))) {
+ if (!mir_tstrcmp(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, _T("conference")) && (jid = XmlGetAttrValue(itemNode, _T("jid")))) {
+ if (!mir_tstrcmp(name, L"conference") && (jid = XmlGetAttrValue(itemNode, L"jid"))) {
JABBER_LIST_ITEM *item = ListAdd(LIST_BOOKMARK, jid);
- item->name = mir_tstrdup(XmlGetAttrValue(itemNode, _T("name")));
- item->type = mir_tstrdup(_T("conference"));
+ item->name = mir_tstrdup(XmlGetAttrValue(itemNode, L"name"));
+ item->type = mir_tstrdup(L"conference");
item->bUseResource = true;
item->nick = mir_tstrdup(XPathT(itemNode, "nick"));
item->password = mir_tstrdup(XPathT(itemNode, "password"));
- const TCHAR *autoJ = XmlGetAttrValue(itemNode, _T("autojoin"));
+ const TCHAR *autoJ = XmlGetAttrValue(itemNode, L"autojoin");
if (autoJ != NULL)
- item->bAutoJoin = !mir_tstrcmp(autoJ, _T("true")) || !mir_tstrcmp(autoJ, _T("1"));
+ item->bAutoJoin = !mir_tstrcmp(autoJ, L"true") || !mir_tstrcmp(autoJ, L"1");
}
- else if (!mir_tstrcmp(name, _T("url")) && (jid = XmlGetAttrValue(itemNode, _T("url")))) {
+ else if (!mir_tstrcmp(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, _T("name")));
- item->type = mir_tstrdup(_T("url"));
+ item->name = mir_tstrdup(XmlGetAttrValue(itemNode, L"name"));
+ item->type = mir_tstrdup(L"url");
}
}
}
@@ -1512,7 +1512,7 @@ void CJabberProto::OnIqResultDiscoBookmarks(HXML iqNode, CJabberIqInfo*)
OnProcessLoginRq(m_ThreadInfo, JABBER_LOGIN_BOOKMARKS);
}
}
- else if (!mir_tstrcmp(type, _T("error"))) {
+ else if (!mir_tstrcmp(type, L"error")) {
if (m_ThreadInfo->jabberServerCaps & JABBER_CAPS_PRIVATE_STORAGE) {
m_ThreadInfo->jabberServerCaps &= ~JABBER_CAPS_PRIVATE_STORAGE;
EnableMenuItems(true);
@@ -1524,7 +1524,7 @@ void CJabberProto::OnIqResultDiscoBookmarks(HXML iqNode, CJabberIqInfo*)
void CJabberProto::SetBookmarkRequest(XmlNodeIq& iq)
{
HXML query = iq << XQUERY(JABBER_FEAT_PRIVATE_STORAGE);
- HXML storage = query << XCHILDNS(_T("storage"), _T("storage:bookmarks"));
+ HXML storage = query << XCHILDNS(L"storage", L"storage:bookmarks");
LISTFOREACH(i, this, LIST_BOOKMARK)
{
@@ -1532,22 +1532,22 @@ void CJabberProto::SetBookmarkRequest(XmlNodeIq& iq)
if (item == NULL || item->jid == NULL)
continue;
- if (!mir_tstrcmp(item->type, _T("conference"))) {
- HXML itemNode = storage << XCHILD(_T("conference")) << XATTR(_T("jid"), item->jid);
+ if (!mir_tstrcmp(item->type, L"conference")) {
+ HXML itemNode = storage << XCHILD(L"conference") << XATTR(L"jid", item->jid);
if (item->name)
- itemNode << XATTR(_T("name"), item->name);
+ itemNode << XATTR(L"name", item->name);
if (item->bAutoJoin)
- itemNode << XATTRI(_T("autojoin"), 1);
+ itemNode << XATTRI(L"autojoin", 1);
if (item->nick)
- itemNode << XCHILD(_T("nick"), item->nick);
+ itemNode << XCHILD(L"nick", item->nick);
if (item->password)
- itemNode << XCHILD(_T("password"), item->password);
+ itemNode << XCHILD(L"password", item->password);
}
- if (!mir_tstrcmp(item->type, _T("url"))) {
- HXML itemNode = storage << XCHILD(_T("url")) << XATTR(_T("url"), item->jid);
+ if (!mir_tstrcmp(item->type, L"url")) {
+ HXML itemNode = storage << XCHILD(L"url") << XATTR(L"url", item->jid);
if (item->name)
- itemNode << XATTR(_T("name"), item->name);
+ itemNode << XATTR(L"name", item->name);
}
}
}
@@ -1559,14 +1559,14 @@ void CJabberProto::OnIqResultSetBookmarks(HXML iqNode, CJabberIqInfo*)
debugLogA("<iq/> iqIdSetBookmarks");
- const TCHAR *type = XmlGetAttrValue(iqNode, _T("type"));
+ const TCHAR *type = XmlGetAttrValue(iqNode, L"type");
if (type == NULL)
return;
- if (!mir_tstrcmp(type, _T("result"))) {
+ if (!mir_tstrcmp(type, L"result")) {
UI_SAFE_NOTIFY(m_pDlgBookmarks, WM_JABBER_REFRESH);
}
- else if (!mir_tstrcmp(type, _T("error"))) {
+ else if (!mir_tstrcmp(type, L"error")) {
HXML errorNode = XmlGetChild(iqNode, "error");
TCHAR *str = JabberErrorMsg(errorNode);
MessageBox(NULL, str, TranslateT("Jabber Bookmarks Error"), MB_OK | MB_SETFOREGROUND);
@@ -1608,7 +1608,7 @@ void CJabberProto::OnIqResultEntityTime(HXML pIqNode, CJabberIqInfo *pInfo)
return;
if (pInfo->m_nIqType == JABBER_IQ_TYPE_RESULT) {
- LPCTSTR szTzo = XPathFmt(pIqNode, _T("time[@xmlns='%s']/tzo"), JABBER_FEAT_ENTITY_TIME);
+ LPCTSTR szTzo = XPathFmt(pIqNode, L"time[@xmlns='%s']/tzo", JABBER_FEAT_ENTITY_TIME);
if (szTzo && szTzo[0]) {
LPCTSTR szMin = _tcschr(szTzo, ':');
int nTz = _ttoi(szTzo) * -2;
@@ -1620,7 +1620,7 @@ void CJabberProto::OnIqResultEntityTime(HXML pIqNode, CJabberIqInfo *pInfo)
setByte(pInfo->m_hContact, "Timezone", (signed char)nTz);
- LPCTSTR szTz = XPathFmt(pIqNode, _T("time[@xmlns='%s']/tz"), JABBER_FEAT_ENTITY_TIME);
+ LPCTSTR szTz = XPathFmt(pIqNode, L"time[@xmlns='%s']/tz", JABBER_FEAT_ENTITY_TIME);
if (szTz)
setTString(pInfo->m_hContact, "TzName", szTz);
else
diff --git a/protocols/JabberG/src/jabber_iqid_muc.cpp b/protocols/JabberG/src/jabber_iqid_muc.cpp
index 58418c0219..576080d884 100644
--- a/protocols/JabberG/src/jabber_iqid_muc.cpp
+++ b/protocols/JabberG/src/jabber_iqid_muc.cpp
@@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
void CJabberProto::SetMucConfig(HXML node, void *from)
{
if (m_ThreadInfo && from) {
- XmlNodeIq iq(_T("set"), SerialNext(), (TCHAR*)from);
+ XmlNodeIq iq(L"set", SerialNext(), (TCHAR*)from);
HXML query = iq << XQUERY(JABBER_FEAT_MUC_OWNER);
XmlAddChild(query, node);
m_ThreadInfo->send(iq);
@@ -42,24 +42,24 @@ void CJabberProto::SetMucConfig(HXML node, void *from)
void CJabberProto::OnIqResultGetMuc(HXML iqNode, CJabberIqInfo*)
{
debugLogA("<iq/> iqIdGetMuc");
- LPCTSTR type = XmlGetAttrValue(iqNode, _T("type"));
+ LPCTSTR type = XmlGetAttrValue(iqNode, L"type");
if (type == NULL)
return;
- LPCTSTR from = XmlGetAttrValue(iqNode, _T("from"));
+ LPCTSTR from = XmlGetAttrValue(iqNode, L"from");
if (from == NULL)
return;
- if (!mir_tstrcmp(type, _T("result"))) {
- HXML queryNode = XmlGetChild(iqNode, _T("query"));
+ if (!mir_tstrcmp(type, L"result")) {
+ HXML queryNode = XmlGetChild(iqNode, L"query");
if (queryNode != NULL) {
- LPCTSTR str = XmlGetAttrValue(queryNode, _T("xmlns"));
+ LPCTSTR str = XmlGetAttrValue(queryNode, L"xmlns");
if (!mir_tstrcmp(str, JABBER_FEAT_MUC_OWNER)) {
- HXML xNode = XmlGetChild(queryNode, _T("x"));
+ HXML xNode = XmlGetChild(queryNode, L"x");
if (xNode != NULL) {
- str = XmlGetAttrValue(xNode, _T("xmlns"));
+ str = XmlGetAttrValue(xNode, L"xmlns");
if (!mir_tstrcmp(str, JABBER_FEAT_DATA_FORMS))
//LaunchForm(xNode);
- FormCreateDialog(xNode, _T("Jabber Conference Room Configuration"), &CJabberProto::SetMucConfig, mir_tstrdup(from));
+ FormCreateDialog(xNode, L"Jabber Conference Room Configuration", &CJabberProto::SetMucConfig, mir_tstrdup(from));
}
}
}
@@ -98,9 +98,9 @@ static void sttFillJidList(HWND hwndDlg)
TCHAR tszItemText[JABBER_MAX_JID_LEN + 256];
HXML iqNode = jidListInfo->iqNode;
if (iqNode != NULL) {
- LPCTSTR from = XmlGetAttrValue(iqNode, _T("from"));
+ LPCTSTR from = XmlGetAttrValue(iqNode, L"from");
if (from != NULL) {
- HXML queryNode = XmlGetChild(iqNode, _T("query"));
+ HXML queryNode = XmlGetChild(iqNode, L"query");
if (queryNode != NULL) {
lvi.mask = LVIF_TEXT | LVIF_PARAM;
lvi.iSubItem = 0;
@@ -110,20 +110,20 @@ static void sttFillJidList(HWND hwndDlg)
if (!itemNode)
break;
- LPCTSTR jid = XmlGetAttrValue(itemNode, _T("jid"));
+ LPCTSTR jid = XmlGetAttrValue(itemNode, L"jid");
if (jid != NULL) {
lvi.pszText = (TCHAR*)jid;
if (jidListInfo->type == MUC_BANLIST) {
- LPCTSTR reason = XmlGetText(XmlGetChild(itemNode, _T("reason")));
+ LPCTSTR reason = XmlGetText(XmlGetChild(itemNode, L"reason"));
if (reason != NULL) {
- mir_sntprintf(tszItemText, _T("%s (%s)"), jid, reason);
+ mir_sntprintf(tszItemText, L"%s (%s)", jid, reason);
lvi.pszText = tszItemText;
}
}
else if (jidListInfo->type == MUC_VOICELIST || jidListInfo->type == MUC_MODERATORLIST) {
- LPCTSTR nick = XmlGetAttrValue(itemNode, _T("nick"));
+ LPCTSTR nick = XmlGetAttrValue(itemNode, L"nick");
if (nick != NULL) {
- mir_sntprintf(tszItemText, _T("%s (%s)"), nick, jid);
+ mir_sntprintf(tszItemText, L"%s (%s)", nick, jid);
lvi.pszText = tszItemText;
}
}
@@ -239,10 +239,10 @@ static INT_PTR CALLBACK JabberMucJidListDlgProc(HWND hwndDlg, UINT msg, WPARAM w
if ((dat = (JABBER_MUC_JIDLIST_INFO *)lParam) != NULL) {
HXML iqNode = dat->iqNode;
if (iqNode != NULL) {
- LPCTSTR from = XmlGetAttrValue(iqNode, _T("from"));
+ LPCTSTR from = XmlGetAttrValue(iqNode, L"from");
if (from != NULL) {
dat->roomJid = mir_tstrdup(from);
- HXML queryNode = XmlGetChild(iqNode, _T("query"));
+ HXML queryNode = XmlGetChild(iqNode, L"query");
if (queryNode != NULL) {
TCHAR *localFrom = mir_tstrdup(from);
mir_sntprintf(title, TranslateT("%s, %d items (%s)"),
@@ -437,11 +437,11 @@ static void CALLBACK JabberMucJidListCreateDialogApcProc(void* param)
if (iqNode == NULL)
return;
- LPCTSTR from = XmlGetAttrValue(iqNode, _T("from"));
+ LPCTSTR from = XmlGetAttrValue(iqNode, L"from");
if (from == NULL)
return;
- HXML queryNode = XmlGetChild(iqNode, _T("query"));
+ HXML queryNode = XmlGetChild(iqNode, L"query");
if (queryNode == NULL)
return;
@@ -480,11 +480,11 @@ static void CALLBACK JabberMucJidListCreateDialogApcProc(void* param)
void CJabberProto::OnIqResultMucGetJidList(HXML iqNode, JABBER_MUC_JIDLIST_TYPE listType)
{
- LPCTSTR type = XmlGetAttrValue(iqNode, _T("type"));
+ LPCTSTR type = XmlGetAttrValue(iqNode, L"type");
if (type == NULL)
return;
- if (!mir_tstrcmp(type, _T("result"))) {
+ if (!mir_tstrcmp(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_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp
index 4a20f0dc88..c82c57eedd 100644
--- a/protocols/JabberG/src/jabber_menu.cpp
+++ b/protocols/JabberG/src/jabber_menu.cpp
@@ -461,7 +461,7 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM)
FormatMirVer(r, szTmp);
hIcon = Finger_GetClientIcon(szTmp, 0);
}
- szTmp.Format(_T("%s [%s, %d]"), r->m_tszResourceName, pcli->pfnGetStatusModeDescription(r->m_iStatus, 0), r->m_iPriority);
+ szTmp.Format(L"%s [%s, %d]", r->m_tszResourceName, pcli->pfnGetStatusModeDescription(r->m_iStatus, 0), r->m_iPriority);
Menu_ModifyItem(m_phMenuResourceItems[i], szTmp, hIcon);
DestroyIcon(hIcon);
}
@@ -520,7 +520,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleRequestAuth(WPARAM hContact, LPARAM)
if (hContact != NULL && m_bJabberOnline) {
ptrT jid(getTStringA(hContact, "jid"));
if (jid != NULL)
- m_ThreadInfo->send(XmlNode(_T("presence")) << XATTR(_T("to"), jid) << XATTR(_T("type"), _T("subscribe")));
+ m_ThreadInfo->send(XmlNode(L"presence") << XATTR(L"to", jid) << XATTR(L"type", L"subscribe"));
}
return 0;
}
@@ -530,7 +530,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleGrantAuth(WPARAM hContact, LPARAM)
if (hContact != NULL && m_bJabberOnline) {
ptrT jid(getTStringA(hContact, "jid"));
if (jid != NULL)
- m_ThreadInfo->send(XmlNode(_T("presence")) << XATTR(_T("to"), jid) << XATTR(_T("type"), _T("subscribed")));
+ m_ThreadInfo->send(XmlNode(L"presence") << XATTR(L"to", jid) << XATTR(L"type", L"subscribed"));
}
return 0;
}
@@ -540,7 +540,7 @@ INT_PTR __cdecl CJabberProto::OnMenuRevokeAuth(WPARAM hContact, LPARAM)
if (hContact != NULL && m_bJabberOnline) {
ptrT jid(getTStringA(hContact, "jid"));
if (jid != NULL)
- m_ThreadInfo->send(XmlNode(_T("presence")) << XATTR(_T("to"), jid) << XATTR(_T("type"), _T("unsubscribed")));
+ m_ThreadInfo->send(XmlNode(L"presence") << XATTR(L"to", jid) << XATTR(L"type", L"unsubscribed"));
}
return 0;
}
@@ -552,9 +552,9 @@ INT_PTR __cdecl CJabberProto::OnMenuTransportLogin(WPARAM hContact, LPARAM)
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, ptrT(getTStringA(hContact, "jid")));
if (item != NULL) {
- XmlNode p(_T("presence")); XmlAddAttr(p, _T("to"), item->jid);
+ XmlNode p(L"presence"); XmlAddAttr(p, L"to", item->jid);
if (item->getTemp()->m_iStatus == ID_STATUS_ONLINE)
- XmlAddAttr(p, _T("type"), _T("unavailable"));
+ XmlAddAttr(p, L"type", L"unavailable");
m_ThreadInfo->send(p);
}
return 0;
@@ -584,7 +584,7 @@ INT_PTR __cdecl CJabberProto::OnMenuBookmarkAdd(WPARAM hContact, LPARAM)
JABBER_LIST_ITEM *item = new JABBER_LIST_ITEM();
item->jid = mir_tstrdup(roomID);
item->name = pcli->pfnGetContactDisplayName(hContact, 0);
- item->type = _T("conference");
+ item->type = L"conference";
item->nick = getTStringA(hContact, "MyNick");
AddEditBookmark(item);
delete item;
@@ -973,8 +973,8 @@ int CJabberProto::OnProcessSrmmEvent(WPARAM, LPARAM lParam)
if (GetResourceCapabilites(jid, TRUE) & JABBER_CAPS_CHATSTATES)
m_ThreadInfo->send(
- XmlNode(_T("message")) << XATTR(_T("to"), jid) << XATTR(_T("type"), _T("chat")) << XATTRID(SerialNext())
- << XCHILDNS(_T("gone"), JABBER_FEAT_CHATSTATES));
+ XmlNode(L"message") << XATTR(L"to", jid) << XATTR(L"type", L"chat") << XATTRID(SerialNext())
+ << XCHILDNS(L"gone", JABBER_FEAT_CHATSTATES));
}
}
}
@@ -1083,7 +1083,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleDirectPresence(WPARAM hContact, LPARAM
if (item == NULL)
return 0;
- mir_sntprintf(text, _T("%s/%s"), item->jid, item->nick);
+ mir_sntprintf(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 820fa3a3e7..dc7e7f6026 100644
--- a/protocols/JabberG/src/jabber_message_handlers.cpp
+++ b/protocols/JabberG/src/jabber_message_handlers.cpp
@@ -44,9 +44,9 @@ BOOL CJabberProto::OnMessageError(HXML node, ThreadData*, CJabberMessageInfo* pI
TCHAR buf[512];
HXML bodyNode = XmlGetChild(node, "body");
if (bodyNode)
- mir_sntprintf(buf, _T("%s:\n%s\n%s"), pInfo->GetFrom(), XmlGetText(bodyNode), szErrText);
+ mir_sntprintf(buf, L"%s:\n%s\n%s", pInfo->GetFrom(), XmlGetText(bodyNode), szErrText);
else
- mir_sntprintf(buf, _T("%s:\n%s"), pInfo->GetFrom(), szErrText);
+ mir_sntprintf(buf, L"%s:\n%s", pInfo->GetFrom(), szErrText);
MsgPopup(NULL, buf, TranslateT("Jabber Error"));
}
@@ -58,8 +58,8 @@ BOOL CJabberProto::OnMessageError(HXML node, ThreadData*, CJabberMessageInfo* pI
BOOL CJabberProto::OnMessageIbb(HXML, ThreadData*, CJabberMessageInfo* pInfo)
{
BOOL bOk = FALSE;
- const TCHAR *sid = XmlGetAttrValue(pInfo->GetChildNode(), _T("sid"));
- const TCHAR *seq = XmlGetAttrValue(pInfo->GetChildNode(), _T("seq"));
+ const TCHAR *sid = XmlGetAttrValue(pInfo->GetChildNode(), L"sid");
+ const TCHAR *seq = XmlGetAttrValue(pInfo->GetChildNode(), L"seq");
if (sid && seq && XmlGetText(pInfo->GetChildNode()))
bOk = OnIbbRecvdData(XmlGetText(pInfo->GetChildNode()), sid, seq);
diff --git a/protocols/JabberG/src/jabber_message_manager.cpp b/protocols/JabberG/src/jabber_message_manager.cpp
index 6800cfb729..47a683a23e 100644
--- a/protocols/JabberG/src/jabber_message_manager.cpp
+++ b/protocols/JabberG/src/jabber_message_manager.cpp
@@ -43,9 +43,9 @@ CJabberMessageManager::~CJabberMessageManager()
void CJabberMessageManager::FillPermanentHandlers()
{
- AddPermanentHandler(&CJabberProto::OnMessageError, JABBER_MESSAGE_TYPE_ERROR, JABBER_MESSAGE_PARSE_FROM | JABBER_MESSAGE_PARSE_HCONTACT, NULL, FALSE, _T("error"));
- AddPermanentHandler(&CJabberProto::OnMessageIbb, 0, 0, JABBER_FEAT_IBB, FALSE, _T("data"));
- AddPermanentHandler(&CJabberProto::OnMessagePubsubEvent, 0, 0, JABBER_FEAT_PUBSUB_EVENT, FALSE, _T("event"));
+ AddPermanentHandler(&CJabberProto::OnMessageError, JABBER_MESSAGE_TYPE_ERROR, JABBER_MESSAGE_PARSE_FROM | JABBER_MESSAGE_PARSE_HCONTACT, NULL, FALSE, L"error");
+ AddPermanentHandler(&CJabberProto::OnMessageIbb, 0, 0, JABBER_FEAT_IBB, FALSE, L"data");
+ AddPermanentHandler(&CJabberProto::OnMessagePubsubEvent, 0, 0, JABBER_FEAT_PUBSUB_EVENT, FALSE, L"event");
AddPermanentHandler(&CJabberProto::OnMessageGroupchat, JABBER_MESSAGE_TYPE_GROUPCHAT, JABBER_MESSAGE_PARSE_FROM, NULL, FALSE, NULL);
}
@@ -57,17 +57,17 @@ bool CJabberMessageManager::HandleMessagePermanent(HXML node, ThreadData *pThrea
// have to get all data here, in the loop, because there's always possibility that previous handler modified it
CJabberMessageInfo messageInfo;
- LPCTSTR szType = XmlGetAttrValue(node, _T("type"));
+ LPCTSTR szType = XmlGetAttrValue(node, L"type");
if (szType) {
- if (!mir_tstrcmpi(szType, _T("normal")))
+ if (!mir_tstrcmpi(szType, L"normal"))
messageInfo.m_nMessageType = JABBER_MESSAGE_TYPE_NORMAL;
- else if (!mir_tstrcmpi(szType, _T("error")))
+ else if (!mir_tstrcmpi(szType, L"error"))
messageInfo.m_nMessageType = JABBER_MESSAGE_TYPE_ERROR;
- else if (!mir_tstrcmpi(szType, _T("chat")))
+ else if (!mir_tstrcmpi(szType, L"chat"))
messageInfo.m_nMessageType = JABBER_MESSAGE_TYPE_CHAT;
- else if (!mir_tstrcmpi(szType, _T("groupchat")))
+ else if (!mir_tstrcmpi(szType, L"groupchat"))
messageInfo.m_nMessageType = JABBER_MESSAGE_TYPE_GROUPCHAT;
- else if (!mir_tstrcmpi(szType, _T("headline")))
+ else if (!mir_tstrcmpi(szType, L"headline"))
messageInfo.m_nMessageType = JABBER_MESSAGE_TYPE_HEADLINE;
else
return false;
@@ -80,7 +80,7 @@ bool CJabberMessageManager::HandleMessagePermanent(HXML node, ThreadData *pThrea
HXML child = XmlGetChild(node, i);
LPCTSTR szTagName = XmlGetName(child);
- LPCTSTR szXmlns = XmlGetAttrValue(child, _T("xmlns"));
+ 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))) {
// node suits handler criteria, call the handler
@@ -88,19 +88,19 @@ bool CJabberMessageManager::HandleMessagePermanent(HXML node, ThreadData *pThrea
messageInfo.m_szChildTagName = szTagName;
messageInfo.m_szChildTagXmlns = szXmlns;
messageInfo.m_pUserData = pInfo.m_pUserData;
- messageInfo.m_szFrom = XmlGetAttrValue(node, _T("from")); // is necessary for ppro->debugLogA() below, that's why we must parse it even if JABBER_MESSAGE_PARSE_FROM flag is not set
+ messageInfo.m_szFrom = XmlGetAttrValue(node, L"from"); // is necessary for ppro->debugLogA() below, that's why we must parse it even if JABBER_MESSAGE_PARSE_FROM flag is not set
if (pInfo.m_dwParamsToParse & JABBER_MESSAGE_PARSE_ID_STR)
- messageInfo.m_szId = XmlGetAttrValue(node, _T("id"));
+ messageInfo.m_szId = XmlGetAttrValue(node, L"id");
if (pInfo.m_dwParamsToParse & JABBER_IQ_PARSE_TO)
- messageInfo.m_szTo = XmlGetAttrValue(node, _T("to"));
+ messageInfo.m_szTo = XmlGetAttrValue(node, L"to");
if (pInfo.m_dwParamsToParse & JABBER_MESSAGE_PARSE_HCONTACT)
messageInfo.m_hContact = ppro->HContactFromJID(messageInfo.m_szFrom);
if (messageInfo.m_szFrom)
- ppro->debugLog(_T("Handling message from %s"), messageInfo.m_szFrom);
+ ppro->debugLog(L"Handling message from %s", messageInfo.m_szFrom);
if ((ppro->*(pInfo.m_pHandler))(node, pThreadData, &messageInfo))
return true;
}
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp
index 0d9b4a7c01..de15d1102b 100644
--- a/protocols/JabberG/src/jabber_misc.cpp
+++ b/protocols/JabberG/src/jabber_misc.cpp
@@ -32,11 +32,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
void CJabberProto::AddContactToRoster(const TCHAR *jid, const TCHAR *nick, const TCHAR *grpName)
{
- XmlNodeIq iq(_T("set"), SerialNext());
+ XmlNodeIq iq(L"set", SerialNext());
HXML query = iq << XQUERY(JABBER_FEAT_IQ_ROSTER)
- << XCHILD(_T("item")) << XATTR(_T("jid"), jid) << XATTR(_T("name"), nick);
+ << XCHILD(L"item") << XATTR(L"jid", jid) << XATTR(L"name", nick);
if (grpName)
- query << XCHILD(_T("group"), grpName);
+ query << XCHILD(L"group", grpName);
m_ThreadInfo->send(iq);
}
@@ -114,7 +114,7 @@ MCONTACT CJabberProto::DBCreateContact(const TCHAR *jid, const TCHAR *nick, bool
if (JABBER_LIST_ITEM *pItem = ListAdd(LIST_ROSTER, jid, hNewContact))
pItem->bUseResource = _tcschr(szJid, '/') != 0;
- debugLog(_T("Create Jabber contact jid=%s, nick=%s"), szJid, nick);
+ debugLog(L"Create Jabber contact jid=%s, nick=%s", szJid, nick);
DBCheckIsTransportedContact(szJid, hNewContact);
return hNewContact;
}
@@ -156,7 +156,7 @@ BOOL CJabberProto::AddDbPresenceEvent(MCONTACT hContact, BYTE btEventType)
void CJabberProto::GetAvatarFileName(MCONTACT hContact, TCHAR* pszDest, size_t cbLen)
{
- int tPathLen = mir_sntprintf(pszDest, cbLen, _T("%s\\%S"), VARST(_T("%miranda_avatarcache%")), m_szModuleName);
+ int tPathLen = mir_sntprintf(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, TCHAR* pszDest, size_t c
db_free(&dbv);
}
else _i64toa((LONG_PTR)hContact, str, 10);
- mir_sntprintf(pszDest + tPathLen, MAX_PATH - tPathLen, _T("%S%s"), JabberSha1(str, buf), szFileType);
+ mir_sntprintf(pszDest + tPathLen, MAX_PATH - tPathLen, L"%S%s", JabberSha1(str, buf), szFileType);
}
else if (m_ThreadInfo != NULL) {
- mir_sntprintf(pszDest + tPathLen, MAX_PATH - tPathLen, _T("%s@%S avatar%s"),
+ mir_sntprintf(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, _T("%S@%S avatar%s"),
+ mir_sntprintf(pszDest + tPathLen, MAX_PATH - tPathLen, L"%S@%S avatar%s",
(res1) ? (LPSTR)res1 : "noname", (res2) ? (LPSTR)res2 : m_szModuleName, szFileType);
}
}
@@ -286,12 +286,12 @@ struct
}
static sttCapsNodeToName_Map[] =
{
- { _T("http://miranda-im.org"), _T("Miranda IM Jabber") },
- { _T("http://miranda-ng.org"), _T("Miranda NG Jabber") },
- { _T("http://www.google.com"), _T("GTalk") },
- { _T("http://mail.google.com"), _T("GMail") },
- { _T("http://talk.google.com/xmpp/bot"), _T("GTalk Bot") },
- { _T("http://www.android.com"), _T("Android") },
+ { L"http://miranda-im.org", L"Miranda IM Jabber" },
+ { L"http://miranda-ng.org", L"Miranda NG Jabber" },
+ { L"http://www.google.com", L"GTalk" },
+ { L"http://mail.google.com", L"GMail" },
+ { L"http://talk.google.com/xmpp/bot", L"GTalk Bot" },
+ { L"http://www.android.com", L"Android" },
};
void CJabberProto::UpdateMirVer(JABBER_LIST_ITEM *item)
@@ -300,7 +300,7 @@ void CJabberProto::UpdateMirVer(JABBER_LIST_ITEM *item)
if (!hContact)
return;
- debugLog(_T("JabberUpdateMirVer: for jid %s"), item->jid);
+ debugLog(L"JabberUpdateMirVer: for jid %s", item->jid);
pResourceStatus p(NULL);
if (item->resourceMode == RSMODE_LASTSEEN)
@@ -320,55 +320,55 @@ void CJabberProto::FormatMirVer(pResourceStatus &resource, CMString &res)
// jabber:iq:version info requested and exists?
if (resource->m_dwVersionRequestTime && resource->m_tszSoftware) {
- debugLog(_T("JabberUpdateMirVer: for iq:version rc %s: %s"), resource->m_tszResourceName, resource->m_tszSoftware);
+ debugLog(L"JabberUpdateMirVer: for iq:version rc %s: %s", resource->m_tszResourceName, resource->m_tszSoftware);
if (!resource->m_tszSoftwareVersion || _tcsstr(resource->m_tszSoftware, resource->m_tszSoftwareVersion))
res = resource->m_tszSoftware;
else
- res.Format(_T("%s %s"), resource->m_tszSoftware, resource->m_tszSoftwareVersion);
+ res.Format(L"%s %s", resource->m_tszSoftware, resource->m_tszSoftwareVersion);
}
// no version info and no caps info? set MirVer = resource name
else if (!resource->m_tszCapsNode || !resource->m_tszCapsVer) {
- debugLog(_T("JabberUpdateMirVer: for rc %s: %s"), resource->m_tszResourceName, resource->m_tszResourceName);
+ debugLog(L"JabberUpdateMirVer: for rc %s: %s", resource->m_tszResourceName, resource->m_tszResourceName);
if (resource->m_tszResourceName)
res = resource->m_tszResourceName;
}
// XEP-0115 caps mode
else {
- debugLog(_T("JabberUpdateMirVer: for rc %s: %s#%s"), resource->m_tszResourceName, resource->m_tszCapsNode, resource->m_tszCapsVer);
+ debugLog(L"JabberUpdateMirVer: for rc %s: %s#%s", resource->m_tszResourceName, resource->m_tszCapsNode, resource->m_tszCapsVer);
int i;
// search through known software list
for (i = 0; i < _countof(sttCapsNodeToName_Map); i++)
if (_tcsstr(resource->m_tszCapsNode, sttCapsNodeToName_Map[i].node)) {
- res.Format(_T("%s %s"), sttCapsNodeToName_Map[i].name, resource->m_tszCapsVer);
+ res.Format(L"%s %s", sttCapsNodeToName_Map[i].name, resource->m_tszCapsVer);
break;
}
// unknown software
if (i == _countof(sttCapsNodeToName_Map))
- res.Format(_T("%s %s"), resource->m_tszCapsNode, resource->m_tszCapsVer);
+ res.Format(L"%s %s", resource->m_tszCapsNode, resource->m_tszCapsVer);
}
// attach additional info for fingerprint plguin
- if (resource->m_tszCapsExt && _tcsstr(resource->m_tszCapsExt, JABBER_EXT_PLATFORMX86) && !_tcsstr(res, _T("x86")))
- res.Append(_T(" x86"));
+ if (resource->m_tszCapsExt && _tcsstr(resource->m_tszCapsExt, JABBER_EXT_PLATFORMX86) && !_tcsstr(res, L"x86"))
+ res.Append(L" x86");
- if (resource->m_tszCapsExt && _tcsstr(resource->m_tszCapsExt, JABBER_EXT_PLATFORMX64) && !_tcsstr(res, _T("x64")))
- res.Append(_T(" x64"));
+ if (resource->m_tszCapsExt && _tcsstr(resource->m_tszCapsExt, JABBER_EXT_PLATFORMX64) && !_tcsstr(res, L"x64"))
+ res.Append(L" x64");
- if (resource->m_tszCapsExt && _tcsstr(resource->m_tszCapsExt, JABBER_EXT_SECUREIM) && !_tcsstr(res, _T("(SecureIM)")))
- res.Append(_T(" (SecureIM)"));
+ if (resource->m_tszCapsExt && _tcsstr(resource->m_tszCapsExt, JABBER_EXT_SECUREIM) && !_tcsstr(res, L"(SecureIM)"))
+ res.Append(L" (SecureIM)");
- if (resource->m_tszCapsExt && _tcsstr(resource->m_tszCapsExt, JABBER_EXT_MIROTR) && !_tcsstr(res, _T("(MirOTR)")))
- res.Append(_T(" (MirOTR)"));
+ if (resource->m_tszCapsExt && _tcsstr(resource->m_tszCapsExt, JABBER_EXT_MIROTR) && !_tcsstr(res, L"(MirOTR)"))
+ res.Append(L" (MirOTR)");
- if (resource->m_tszCapsExt && _tcsstr(resource->m_tszCapsExt, JABBER_EXT_NEWGPG) && !_tcsstr(res, _T("(New_GPG)")))
- res.Append(_T(" (New_GPG)"));
+ if (resource->m_tszCapsExt && _tcsstr(resource->m_tszCapsExt, JABBER_EXT_NEWGPG) && !_tcsstr(res, L"(New_GPG)"))
+ res.Append(L" (New_GPG)");
if (resource->m_tszResourceName && !_tcsstr(res, resource->m_tszResourceName))
- if (_tcsstr(res, _T("Miranda IM")) || _tcsstr(res, _T("Miranda NG")) || m_options.ShowForeignResourceInMirVer)
- res.AppendFormat(_T(" [%s]"), resource->m_tszResourceName);
+ if (_tcsstr(res, L"Miranda IM") || _tcsstr(res, L"Miranda NG") || m_options.ShowForeignResourceInMirVer)
+ res.AppendFormat(L" [%s]", resource->m_tszResourceName);
}
@@ -385,7 +385,7 @@ void CJabberProto::UpdateMirVer(MCONTACT hContact, pResourceStatus &resource)
TCHAR szFullJid[JABBER_MAX_JID_LEN];
if (resource->m_tszResourceName && !_tcschr(jid, '/'))
- mir_sntprintf(szFullJid, _T("%s/%s"), jid, resource->m_tszResourceName);
+ mir_sntprintf(szFullJid, L"%s/%s", jid, resource->m_tszResourceName);
else
mir_tstrncpy(szFullJid, jid, _countof(szFullJid));
setTString(hContact, DBSETTING_DISPLAY_UID, szFullJid);
@@ -438,7 +438,7 @@ void CJabberProto::SetContactOfflineStatus(MCONTACT hContact)
void CJabberProto::InitPopups(void)
{
TCHAR desc[256];
- mir_sntprintf(desc, _T("%s %s"), m_tszUserName, TranslateT("Errors"));
+ mir_sntprintf(desc, L"%s %s", m_tszUserName, TranslateT("Errors"));
char name[256];
mir_snprintf(name, "%s_%s", m_szModuleName, "Error");
@@ -485,7 +485,7 @@ CMString CJabberProto::ExtractImage(HXML node)
if ((nHtml = XmlGetChild(node, "html")) != NULL &&
(nBody = XmlGetChild(nHtml, "body")) != NULL &&
(nImg = XmlGetChild(nBody, "img")) != NULL &&
- (src = XmlGetAttrValue(nImg, _T("src"))) != NULL) {
+ (src = XmlGetAttrValue(nImg, L"src")) != NULL) {
CMString strSrc(src);
if (strSrc.Left(11).Compare(L"data:image/") == 0) {
@@ -501,8 +501,8 @@ CMString CJabberProto::ExtractImage(HXML node)
TCHAR tszTempPath[MAX_PATH], tszTempFile[MAX_PATH];
GetTempPath(_countof(tszTempPath), tszTempPath);
- GetTempFileName(tszTempPath, _T("jab"), InterlockedIncrement(&g_nTempFileId), tszTempFile);
- _tcsncat_s(tszTempFile, _T("."), 1);
+ GetTempFileName(tszTempPath, L"jab", InterlockedIncrement(&g_nTempFileId), tszTempFile);
+ _tcsncat_s(tszTempFile, L".", 1);
_tcsncat_s(tszTempFile, ext, ext.GetLength());
HANDLE h = CreateFile(tszTempFile, GENERIC_READ | GENERIC_WRITE,
@@ -516,7 +516,7 @@ CMString CJabberProto::ExtractImage(HXML node)
WriteFile(h, buffer, bufferLen, &n, NULL);
CloseHandle(h);
- link = _T(" file:///");
+ link = L" file:///";
link += tszTempFile;
}
}
diff --git a/protocols/JabberG/src/jabber_notes.cpp b/protocols/JabberG/src/jabber_notes.cpp
index 47cbbd8cfb..aa46e14e58 100644
--- a/protocols/JabberG/src/jabber_notes.cpp
+++ b/protocols/JabberG/src/jabber_notes.cpp
@@ -153,10 +153,10 @@ void CNoteList::SaveXml(HXML hXmlParent)
CNoteList &me = *this;
for (int i = 0; i < getCount(); i++) {
- HXML hXmlItem = hXmlParent << XCHILD(_T("note"));
- hXmlItem << XATTR(_T("from"), me[i].GetFrom()) << XATTR(_T("tags"), me[i].GetTagsStr());
- hXmlItem << XCHILD(_T("title"), me[i].GetTitle());
- hXmlItem << XCHILD(_T("text"), me[i].GetText());
+ HXML hXmlItem = hXmlParent << XCHILD(L"note");
+ hXmlItem << XATTR(L"from", me[i].GetFrom()) << XATTR(L"tags", me[i].GetTagsStr());
+ hXmlItem << XCHILD(L"title", me[i].GetTitle());
+ hXmlItem << XCHILD(L"text", me[i].GetText());
}
}
@@ -601,9 +601,9 @@ private:
void btnSave_OnClick(CCtrlButton *)
{
- XmlNodeIq iq(_T("set"));
+ XmlNodeIq iq(L"set");
HXML query = iq << XQUERY(JABBER_FEAT_PRIVATE_STORAGE);
- HXML storage = query << XCHILDNS(_T("storage"), JABBER_FEAT_MIRANDA_NOTES);
+ HXML storage = query << XCHILDNS(L"storage", JABBER_FEAT_MIRANDA_NOTES);
m_proto->m_notes.SaveXml(storage);
m_proto->m_ThreadInfo->send(iq);
EnableControls();
@@ -710,9 +710,9 @@ void CJabberProto::ProcessIncomingNote(CNoteItem *pNote, bool ok)
if (ok && pNote->IsNotEmpty()) {
m_notes.insert(pNote);
- XmlNodeIq iq(_T("set"));
+ XmlNodeIq iq(L"set");
HXML query = iq << XQUERY(JABBER_FEAT_PRIVATE_STORAGE);
- HXML storage = query << XCHILDNS(_T("storage"), JABBER_FEAT_MIRANDA_NOTES);
+ HXML storage = query << XCHILDNS(L"storage", JABBER_FEAT_MIRANDA_NOTES);
m_notes.SaveXml(storage);
m_ThreadInfo->send(iq);
}
@@ -727,7 +727,7 @@ void CJabberProto::ProcessOutgoingNote(CNoteItem *pNote, bool ok)
}
TCHAR buf[1024];
- mir_sntprintf(buf, _T("Incoming note: %s\n\n%s\nTags: %s"),
+ mir_sntprintf(buf, L"Incoming note: %s\n\n%s\nTags: %s",
pNote->GetTitle(), pNote->GetText(), pNote->GetTagsStr());
JabberCapsBits jcb = GetResourceCapabilites(pNote->GetFrom(), TRUE);
@@ -737,20 +737,20 @@ void CJabberProto::ProcessOutgoingNote(CNoteItem *pNote, bool ok)
int nMsgId = SerialNext();
- XmlNode m(_T("message"));
- m << XATTR(_T("type"), _T("chat")) << XATTR(_T("to"), pNote->GetFrom()) << XATTRID(nMsgId);
- m << XCHILD(_T("body"), buf);
- HXML hXmlItem = m << XCHILDNS(_T("x"), JABBER_FEAT_MIRANDA_NOTES) << XCHILD(_T("note"));
- hXmlItem << XATTR(_T("tags"), pNote->GetTagsStr());
- hXmlItem << XCHILD(_T("title"), pNote->GetTitle());
- hXmlItem << XCHILD(_T("text"), pNote->GetText());
+ XmlNode m(L"message");
+ m << XATTR(L"type", L"chat") << XATTR(L"to", pNote->GetFrom()) << XATTRID(nMsgId);
+ m << XCHILD(L"body", buf);
+ HXML hXmlItem = m << XCHILDNS(L"x", JABBER_FEAT_MIRANDA_NOTES) << XCHILD(L"note");
+ hXmlItem << XATTR(L"tags", pNote->GetTagsStr());
+ hXmlItem << XCHILD(L"title", pNote->GetTitle());
+ hXmlItem << XCHILD(L"text", pNote->GetText());
// message receipts XEP priority
if (jcb & JABBER_CAPS_MESSAGE_RECEIPTS)
- m << XCHILDNS(_T("request"), JABBER_FEAT_MESSAGE_RECEIPTS);
+ m << XCHILDNS(L"request", JABBER_FEAT_MESSAGE_RECEIPTS);
else if (jcb & JABBER_CAPS_MESSAGE_EVENTS) {
- HXML x = m << XCHILDNS(_T("x"), JABBER_FEAT_MESSAGE_EVENTS);
- x << XCHILD(_T("delivered")); x << XCHILD(_T("offline"));
+ HXML x = m << XCHILDNS(L"x", JABBER_FEAT_MESSAGE_EVENTS);
+ x << XCHILD(L"delivered"); x << XCHILD(L"offline");
}
else
nMsgId = -1;
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp
index 40f2b4fb61..9c165d1ce8 100644
--- a/protocols/JabberG/src/jabber_opt.cpp
+++ b/protocols/JabberG/src/jabber_opt.cpp
@@ -33,194 +33,194 @@ static BOOL(WINAPI *pfnEnableThemeDialogTexture)(HANDLE, DWORD) = 0;
/////////////////////////////////////////////////////////////////////////////////////////
// JabberRegisterDlgProc - the dialog proc for registering new account
-#define STR_FORMAT _T("%s %s@%S:%d?")
+#define STR_FORMAT L"%s %s@%S:%d?"
struct { TCHAR *szCode; TCHAR *szDescription; } g_LanguageCodes[] = {
- { _T("aa"), LPGENT("Afar") },
- { _T("ab"), LPGENT("Abkhazian") },
- { _T("af"), LPGENT("Afrikaans") },
- { _T("ak"), LPGENT("Akan") },
- { _T("sq"), LPGENT("Albanian") },
- { _T("am"), LPGENT("Amharic") },
- { _T("ar"), LPGENT("Arabic") },
- { _T("an"), LPGENT("Aragonese") },
- { _T("hy"), LPGENT("Armenian") },
- { _T("as"), LPGENT("Assamese") },
- { _T("av"), LPGENT("Avaric") },
- { _T("ae"), LPGENT("Avestan") },
- { _T("ay"), LPGENT("Aymara") },
- { _T("az"), LPGENT("Azerbaijani") },
- { _T("ba"), LPGENT("Bashkir") },
- { _T("bm"), LPGENT("Bambara") },
- { _T("eu"), LPGENT("Basque") },
- { _T("be"), LPGENT("Belarusian") },
- { _T("bn"), LPGENT("Bengali") },
- { _T("bh"), LPGENT("Bihari") },
- { _T("bi"), LPGENT("Bislama") },
- { _T("bs"), LPGENT("Bosnian") },
- { _T("br"), LPGENT("Breton") },
- { _T("bg"), LPGENT("Bulgarian") },
- { _T("my"), LPGENT("Burmese") },
- { _T("ca"), LPGENT("Catalan; Valencian") },
- { _T("ch"), LPGENT("Chamorro") },
- { _T("ce"), LPGENT("Chechen") },
- { _T("zh"), LPGENT("Chinese") },
- { _T("cu"), LPGENT("Church Slavic; Old Slavonic") },
- { _T("cv"), LPGENT("Chuvash") },
- { _T("kw"), LPGENT("Cornish") },
- { _T("co"), LPGENT("Corsican") },
- { _T("cr"), LPGENT("Cree") },
- { _T("cs"), LPGENT("Czech") },
- { _T("da"), LPGENT("Danish") },
- { _T("dv"), LPGENT("Divehi; Dhivehi; Maldivian") },
- { _T("nl"), LPGENT("Dutch; Flemish") },
- { _T("dz"), LPGENT("Dzongkha") },
- { _T("en"), LPGENT("English") },
- { _T("eo"), LPGENT("Esperanto") },
- { _T("et"), LPGENT("Estonian") },
- { _T("ee"), LPGENT("Ewe") },
- { _T("fo"), LPGENT("Faroese") },
- { _T("fj"), LPGENT("Fijian") },
- { _T("fi"), LPGENT("Finnish") },
- { _T("fr"), LPGENT("French") },
- { _T("fy"), LPGENT("Western Frisian") },
- { _T("ff"), LPGENT("Fulah") },
- { _T("ka"), LPGENT("Georgian") },
- { _T("de"), LPGENT("German") },
- { _T("gd"), LPGENT("Gaelic; Scottish Gaelic") },
- { _T("ga"), LPGENT("Irish") },
- { _T("gl"), LPGENT("Galician") },
- { _T("gv"), LPGENT("Manx") },
- { _T("el"), LPGENT("Greek, Modern (1453-)") },
- { _T("gn"), LPGENT("Guarani") },
- { _T("gu"), LPGENT("Gujarati") },
- { _T("ht"), LPGENT("Haitian; Haitian Creole") },
- { _T("ha"), LPGENT("Hausa") },
- { _T("he"), LPGENT("Hebrew") },
- { _T("hz"), LPGENT("Herero") },
- { _T("hi"), LPGENT("Hindi") },
- { _T("ho"), LPGENT("Hiri Motu") },
- { _T("hu"), LPGENT("Hungarian") },
- { _T("ig"), LPGENT("Igbo") },
- { _T("is"), LPGENT("Icelandic") },
- { _T("io"), LPGENT("Ido") },
- { _T("ii"), LPGENT("Sichuan Yi") },
- { _T("iu"), LPGENT("Inuktitut") },
- { _T("ie"), LPGENT("Interlingue") },
- { _T("ia"), LPGENT("Interlingua (International Auxiliary Language Association)") },
- { _T("id"), LPGENT("Indonesian") },
- { _T("ik"), LPGENT("Inupiaq") },
- { _T("it"), LPGENT("Italian") },
- { _T("jv"), LPGENT("Javanese") },
- { _T("ja"), LPGENT("Japanese") },
- { _T("kl"), LPGENT("Kalaallisut; Greenlandic") },
- { _T("kn"), LPGENT("Kannada") },
- { _T("ks"), LPGENT("Kashmiri") },
- { _T("kr"), LPGENT("Kanuri") },
- { _T("kk"), LPGENT("Kazakh") },
- { _T("km"), LPGENT("Central Khmer") },
- { _T("ki"), LPGENT("Kikuyu; Gikuyu") },
- { _T("rw"), LPGENT("Kinyarwanda") },
- { _T("ky"), LPGENT("Kirghiz; Kyrgyz") },
- { _T("kv"), LPGENT("Komi") },
- { _T("kg"), LPGENT("Kongo") },
- { _T("ko"), LPGENT("Korean") },
- { _T("kj"), LPGENT("Kuanyama; Kwanyama") },
- { _T("ku"), LPGENT("Kurdish") },
- { _T("lo"), LPGENT("Lao") },
- { _T("la"), LPGENT("Latin") },
- { _T("lv"), LPGENT("Latvian") },
- { _T("li"), LPGENT("Limburgan; Limburger; Limburgish") },
- { _T("ln"), LPGENT("Lingala") },
- { _T("lt"), LPGENT("Lithuanian") },
- { _T("lb"), LPGENT("Luxembourgish; Letzeburgesch") },
- { _T("lu"), LPGENT("Luba-Katanga") },
- { _T("lg"), LPGENT("Ganda") },
- { _T("mk"), LPGENT("Macedonian") },
- { _T("mh"), LPGENT("Marshallese") },
- { _T("ml"), LPGENT("Malayalam") },
- { _T("mi"), LPGENT("Maori") },
- { _T("mr"), LPGENT("Marathi") },
- { _T("ms"), LPGENT("Malay") },
- { _T("mg"), LPGENT("Malagasy") },
- { _T("mt"), LPGENT("Maltese") },
- { _T("mo"), LPGENT("Moldavian") },
- { _T("mn"), LPGENT("Mongolian") },
- { _T("na"), LPGENT("Nauru") },
- { _T("nv"), LPGENT("Navajo; Navaho") },
- { _T("nr"), LPGENT("Ndebele, South; South Ndebele") },
- { _T("nd"), LPGENT("Ndebele, North; North Ndebele") },
- { _T("ng"), LPGENT("Ndonga") },
- { _T("ne"), LPGENT("Nepali") },
- { _T("nn"), LPGENT("Norwegian Nynorsk; Nynorsk, Norwegian") },
- { _T("nb"), LPGENT("Bokmaal, Norwegian; Norwegian Bokmaal") },
- { _T("no"), LPGENT("Norwegian") },
- { _T("ny"), LPGENT("Chichewa; Chewa; Nyanja") },
- { _T("oc"), LPGENT("Occitan (post 1500); Provencal") },
- { _T("oj"), LPGENT("Ojibwa") },
- { _T("or"), LPGENT("Oriya") },
- { _T("om"), LPGENT("Oromo") },
- { _T("os"), LPGENT("Ossetian; Ossetic") },
- { _T("pa"), LPGENT("Panjabi; Punjabi") },
- { _T("fa"), LPGENT("Persian") },
- { _T("pi"), LPGENT("Pali") },
- { _T("pl"), LPGENT("Polish") },
- { _T("pt"), LPGENT("Portuguese") },
- { _T("ps"), LPGENT("Pushto") },
- { _T("qu"), LPGENT("Quechua") },
- { _T("rm"), LPGENT("Romansh") },
- { _T("ro"), LPGENT("Romanian") },
- { _T("rn"), LPGENT("Rundi") },
- { _T("ru"), LPGENT("Russian") },
- { _T("sg"), LPGENT("Sango") },
- { _T("sa"), LPGENT("Sanskrit") },
- { _T("sr"), LPGENT("Serbian") },
- { _T("hr"), LPGENT("Croatian") },
- { _T("si"), LPGENT("Sinhala; Sinhalese") },
- { _T("sk"), LPGENT("Slovak") },
- { _T("sl"), LPGENT("Slovenian") },
- { _T("se"), LPGENT("Northern Sami") },
- { _T("sm"), LPGENT("Samoan") },
- { _T("sn"), LPGENT("Shona") },
- { _T("sd"), LPGENT("Sindhi") },
- { _T("so"), LPGENT("Somali") },
- { _T("st"), LPGENT("Sotho, Southern") },
- { _T("es"), LPGENT("Spanish; Castilian") },
- { _T("sc"), LPGENT("Sardinian") },
- { _T("ss"), LPGENT("Swati") },
- { _T("su"), LPGENT("Sundanese") },
- { _T("sw"), LPGENT("Swahili") },
- { _T("sv"), LPGENT("Swedish") },
- { _T("ty"), LPGENT("Tahitian") },
- { _T("ta"), LPGENT("Tamil") },
- { _T("tt"), LPGENT("Tatar") },
- { _T("te"), LPGENT("Telugu") },
- { _T("tg"), LPGENT("Tajik") },
- { _T("tl"), LPGENT("Tagalog") },
- { _T("th"), LPGENT("Thai") },
- { _T("bo"), LPGENT("Tibetan") },
- { _T("ti"), LPGENT("Tigrinya") },
- { _T("to"), LPGENT("Tonga (Tonga Islands)") },
- { _T("tn"), LPGENT("Tswana") },
- { _T("ts"), LPGENT("Tsonga") },
- { _T("tk"), LPGENT("Turkmen") },
- { _T("tr"), LPGENT("Turkish") },
- { _T("tw"), LPGENT("Twi") },
- { _T("ug"), LPGENT("Uighur; Uyghur") },
- { _T("uk"), LPGENT("Ukrainian") },
- { _T("ur"), LPGENT("Urdu") },
- { _T("uz"), LPGENT("Uzbek") },
- { _T("ve"), LPGENT("Venda") },
- { _T("vi"), LPGENT("Vietnamese") },
- { _T("vo"), LPGENT("Volapuk") },
- { _T("cy"), LPGENT("Welsh") },
- { _T("wa"), LPGENT("Walloon") },
- { _T("wo"), LPGENT("Wolof") },
- { _T("xh"), LPGENT("Xhosa") },
- { _T("yi"), LPGENT("Yiddish") },
- { _T("yo"), LPGENT("Yoruba") },
- { _T("za"), LPGENT("Zhuang; Chuang") },
- { _T("zu"), LPGENT("Zulu") },
+ { L"aa", LPGENT("Afar") },
+ { L"ab", LPGENT("Abkhazian") },
+ { L"af", LPGENT("Afrikaans") },
+ { L"ak", LPGENT("Akan") },
+ { L"sq", LPGENT("Albanian") },
+ { L"am", LPGENT("Amharic") },
+ { L"ar", LPGENT("Arabic") },
+ { L"an", LPGENT("Aragonese") },
+ { L"hy", LPGENT("Armenian") },
+ { L"as", LPGENT("Assamese") },
+ { L"av", LPGENT("Avaric") },
+ { L"ae", LPGENT("Avestan") },
+ { L"ay", LPGENT("Aymara") },
+ { L"az", LPGENT("Azerbaijani") },
+ { L"ba", LPGENT("Bashkir") },
+ { L"bm", LPGENT("Bambara") },
+ { L"eu", LPGENT("Basque") },
+ { L"be", LPGENT("Belarusian") },
+ { L"bn", LPGENT("Bengali") },
+ { L"bh", LPGENT("Bihari") },
+ { L"bi", LPGENT("Bislama") },
+ { L"bs", LPGENT("Bosnian") },
+ { L"br", LPGENT("Breton") },
+ { L"bg", LPGENT("Bulgarian") },
+ { L"my", LPGENT("Burmese") },
+ { L"ca", LPGENT("Catalan; Valencian") },
+ { L"ch", LPGENT("Chamorro") },
+ { L"ce", LPGENT("Chechen") },
+ { L"zh", LPGENT("Chinese") },
+ { L"cu", LPGENT("Church Slavic; Old Slavonic") },
+ { L"cv", LPGENT("Chuvash") },
+ { L"kw", LPGENT("Cornish") },
+ { L"co", LPGENT("Corsican") },
+ { L"cr", LPGENT("Cree") },
+ { L"cs", LPGENT("Czech") },
+ { L"da", LPGENT("Danish") },
+ { L"dv", LPGENT("Divehi; Dhivehi; Maldivian") },
+ { L"nl", LPGENT("Dutch; Flemish") },
+ { L"dz", LPGENT("Dzongkha") },
+ { L"en", LPGENT("English") },
+ { L"eo", LPGENT("Esperanto") },
+ { L"et", LPGENT("Estonian") },
+ { L"ee", LPGENT("Ewe") },
+ { L"fo", LPGENT("Faroese") },
+ { L"fj", LPGENT("Fijian") },
+ { L"fi", LPGENT("Finnish") },
+ { L"fr", LPGENT("French") },
+ { L"fy", LPGENT("Western Frisian") },
+ { L"ff", LPGENT("Fulah") },
+ { L"ka", LPGENT("Georgian") },
+ { L"de", LPGENT("German") },
+ { L"gd", LPGENT("Gaelic; Scottish Gaelic") },
+ { L"ga", LPGENT("Irish") },
+ { L"gl", LPGENT("Galician") },
+ { L"gv", LPGENT("Manx") },
+ { L"el", LPGENT("Greek, Modern (1453-)") },
+ { L"gn", LPGENT("Guarani") },
+ { L"gu", LPGENT("Gujarati") },
+ { L"ht", LPGENT("Haitian; Haitian Creole") },
+ { L"ha", LPGENT("Hausa") },
+ { L"he", LPGENT("Hebrew") },
+ { L"hz", LPGENT("Herero") },
+ { L"hi", LPGENT("Hindi") },
+ { L"ho", LPGENT("Hiri Motu") },
+ { L"hu", LPGENT("Hungarian") },
+ { L"ig", LPGENT("Igbo") },
+ { L"is", LPGENT("Icelandic") },
+ { L"io", LPGENT("Ido") },
+ { L"ii", LPGENT("Sichuan Yi") },
+ { L"iu", LPGENT("Inuktitut") },
+ { L"ie", LPGENT("Interlingue") },
+ { L"ia", LPGENT("Interlingua (International Auxiliary Language Association)") },
+ { L"id", LPGENT("Indonesian") },
+ { L"ik", LPGENT("Inupiaq") },
+ { L"it", LPGENT("Italian") },
+ { L"jv", LPGENT("Javanese") },
+ { L"ja", LPGENT("Japanese") },
+ { L"kl", LPGENT("Kalaallisut; Greenlandic") },
+ { L"kn", LPGENT("Kannada") },
+ { L"ks", LPGENT("Kashmiri") },
+ { L"kr", LPGENT("Kanuri") },
+ { L"kk", LPGENT("Kazakh") },
+ { L"km", LPGENT("Central Khmer") },
+ { L"ki", LPGENT("Kikuyu; Gikuyu") },
+ { L"rw", LPGENT("Kinyarwanda") },
+ { L"ky", LPGENT("Kirghiz; Kyrgyz") },
+ { L"kv", LPGENT("Komi") },
+ { L"kg", LPGENT("Kongo") },
+ { L"ko", LPGENT("Korean") },
+ { L"kj", LPGENT("Kuanyama; Kwanyama") },
+ { L"ku", LPGENT("Kurdish") },
+ { L"lo", LPGENT("Lao") },
+ { L"la", LPGENT("Latin") },
+ { L"lv", LPGENT("Latvian") },
+ { L"li", LPGENT("Limburgan; Limburger; Limburgish") },
+ { L"ln", LPGENT("Lingala") },
+ { L"lt", LPGENT("Lithuanian") },
+ { L"lb", LPGENT("Luxembourgish; Letzeburgesch") },
+ { L"lu", LPGENT("Luba-Katanga") },
+ { L"lg", LPGENT("Ganda") },
+ { L"mk", LPGENT("Macedonian") },
+ { L"mh", LPGENT("Marshallese") },
+ { L"ml", LPGENT("Malayalam") },
+ { L"mi", LPGENT("Maori") },
+ { L"mr", LPGENT("Marathi") },
+ { L"ms", LPGENT("Malay") },
+ { L"mg", LPGENT("Malagasy") },
+ { L"mt", LPGENT("Maltese") },
+ { L"mo", LPGENT("Moldavian") },
+ { L"mn", LPGENT("Mongolian") },
+ { L"na", LPGENT("Nauru") },
+ { L"nv", LPGENT("Navajo; Navaho") },
+ { L"nr", LPGENT("Ndebele, South; South Ndebele") },
+ { L"nd", LPGENT("Ndebele, North; North Ndebele") },
+ { L"ng", LPGENT("Ndonga") },
+ { L"ne", LPGENT("Nepali") },
+ { L"nn", LPGENT("Norwegian Nynorsk; Nynorsk, Norwegian") },
+ { L"nb", LPGENT("Bokmaal, Norwegian; Norwegian Bokmaal") },
+ { L"no", LPGENT("Norwegian") },
+ { L"ny", LPGENT("Chichewa; Chewa; Nyanja") },
+ { L"oc", LPGENT("Occitan (post 1500); Provencal") },
+ { L"oj", LPGENT("Ojibwa") },
+ { L"or", LPGENT("Oriya") },
+ { L"om", LPGENT("Oromo") },
+ { L"os", LPGENT("Ossetian; Ossetic") },
+ { L"pa", LPGENT("Panjabi; Punjabi") },
+ { L"fa", LPGENT("Persian") },
+ { L"pi", LPGENT("Pali") },
+ { L"pl", LPGENT("Polish") },
+ { L"pt", LPGENT("Portuguese") },
+ { L"ps", LPGENT("Pushto") },
+ { L"qu", LPGENT("Quechua") },
+ { L"rm", LPGENT("Romansh") },
+ { L"ro", LPGENT("Romanian") },
+ { L"rn", LPGENT("Rundi") },
+ { L"ru", LPGENT("Russian") },
+ { L"sg", LPGENT("Sango") },
+ { L"sa", LPGENT("Sanskrit") },
+ { L"sr", LPGENT("Serbian") },
+ { L"hr", LPGENT("Croatian") },
+ { L"si", LPGENT("Sinhala; Sinhalese") },
+ { L"sk", LPGENT("Slovak") },
+ { L"sl", LPGENT("Slovenian") },
+ { L"se", LPGENT("Northern Sami") },
+ { L"sm", LPGENT("Samoan") },
+ { L"sn", LPGENT("Shona") },
+ { L"sd", LPGENT("Sindhi") },
+ { L"so", LPGENT("Somali") },
+ { L"st", LPGENT("Sotho, Southern") },
+ { L"es", LPGENT("Spanish; Castilian") },
+ { L"sc", LPGENT("Sardinian") },
+ { L"ss", LPGENT("Swati") },
+ { L"su", LPGENT("Sundanese") },
+ { L"sw", LPGENT("Swahili") },
+ { L"sv", LPGENT("Swedish") },
+ { L"ty", LPGENT("Tahitian") },
+ { L"ta", LPGENT("Tamil") },
+ { L"tt", LPGENT("Tatar") },
+ { L"te", LPGENT("Telugu") },
+ { L"tg", LPGENT("Tajik") },
+ { L"tl", LPGENT("Tagalog") },
+ { L"th", LPGENT("Thai") },
+ { L"bo", LPGENT("Tibetan") },
+ { L"ti", LPGENT("Tigrinya") },
+ { L"to", LPGENT("Tonga (Tonga Islands)") },
+ { L"tn", LPGENT("Tswana") },
+ { L"ts", LPGENT("Tsonga") },
+ { L"tk", LPGENT("Turkmen") },
+ { L"tr", LPGENT("Turkish") },
+ { L"tw", LPGENT("Twi") },
+ { L"ug", LPGENT("Uighur; Uyghur") },
+ { L"uk", LPGENT("Ukrainian") },
+ { L"ur", LPGENT("Urdu") },
+ { L"uz", LPGENT("Uzbek") },
+ { L"ve", LPGENT("Venda") },
+ { L"vi", LPGENT("Vietnamese") },
+ { L"vo", LPGENT("Volapuk") },
+ { L"cy", LPGENT("Welsh") },
+ { L"wa", LPGENT("Walloon") },
+ { L"wo", LPGENT("Wolof") },
+ { L"xh", LPGENT("Xhosa") },
+ { L"yi", LPGENT("Yiddish") },
+ { L"yo", LPGENT("Yoruba") },
+ { L"za", LPGENT("Zhuang; Chuang") },
+ { L"zu", LPGENT("Zulu") },
{ NULL, NULL }
};
@@ -331,7 +331,7 @@ CCtrlEditJid::CCtrlEditJid(CDlgBase* dlg, int ctrlId):
static void sttStoreJidFromUI(CJabberProto *ppro, CCtrlEdit &txtUsername, CCtrlCombo &cbServer)
{
- ppro->setTString("jid", CMString(FORMAT, _T("%s@%s"), ptrT(txtUsername.GetText()), ptrT(cbServer.GetText())));
+ ppro->setTString("jid", CMString(FORMAT, L"%s@%s", ptrT(txtUsername.GetText()), ptrT(cbServer.GetText())));
}
class CDlgOptAccount : public CJabberDlgBase
@@ -388,22 +388,22 @@ public:
m_gotservers(false),
m_lnkServers(this, IDC_LINK_PUBLIC_SERVER, "https://xmpp.net/directory.php")
{
- CreateLink(m_txtUsername, "LoginName", _T(""));
+ CreateLink(m_txtUsername, "LoginName", L"");
CreateLink(m_txtPriority, "Priority", DBVT_DWORD, 0);
CreateLink(m_chkSavePassword, proto->m_options.SavePassword);
- CreateLink(m_cbResource, "Resource", _T("Miranda"));
+ CreateLink(m_cbResource, "Resource", L"Miranda");
CreateLink(m_chkUseHostnameAsResource, proto->m_options.HostNameAsResource);
CreateLink(m_chkUseDomainLogin, proto->m_options.UseDomainLogin);
- CreateLink(m_cbServer, "LoginServer", _T("jabber.org"));
+ CreateLink(m_cbServer, "LoginServer", L"jabber.org");
CreateLink(m_txtPort, "Port", DBVT_WORD, 5222);
CreateLink(m_chkUseSsl, proto->m_options.UseSSL);
CreateLink(m_chkUseTls, proto->m_options.UseTLS);
CreateLink(m_chkManualHost, proto->m_options.ManualConnect);
- CreateLink(m_txtManualHost, "ManualHost", _T(""));
+ CreateLink(m_txtManualHost, "ManualHost", L"");
CreateLink(m_txtManualPort, "ManualPort", DBVT_WORD, 0);
CreateLink(m_chkKeepAlive, proto->m_options.KeepAlive);
CreateLink(m_chkAutoDeleteContacts, proto->m_options.RosterSync);
- CreateLink(m_txtUserDirectory, "Jud", _T(""));
+ CreateLink(m_txtUserDirectory, "Jud", L"");
// Bind events
m_cbServer.OnDropdown = Callback(this, &CDlgOptAccount::cbServer_OnDropdown);
@@ -434,7 +434,7 @@ protected:
m_cbServer.AddString(TranslateT("Loading..."));
// fill predefined resources
- TCHAR *szResources[] = { _T("Home"), _T("Work"), _T("Office"), _T("Miranda") };
+ TCHAR *szResources[] = { L"Home", L"Work", L"Office", L"Miranda" };
for (int i = 0; i < _countof(szResources); i++)
m_cbResource.AddString(szResources[i]);
@@ -450,7 +450,7 @@ protected:
m_cbResource.AddString(tszResource);
m_cbResource.SetText(tszResource);
}
- else m_cbResource.SetText(_T("Miranda"));
+ else m_cbResource.SetText(L"Miranda");
for (int i = 0; g_LanguageCodes[i].szCode; i++) {
int iItem = m_cbLocale.AddString(TranslateTS(g_LanguageCodes[i].szDescription), (LPARAM)g_LanguageCodes[i].szCode);
@@ -571,8 +571,8 @@ private:
if (res == IDYES)
m_proto->m_ThreadInfo->send(
- XmlNodeIq(_T("set"), m_proto->SerialNext(), m_proto->m_szJabberJID) << XQUERY(JABBER_FEAT_REGISTER)
- << XCHILD(_T("remove")));
+ XmlNodeIq(L"set", m_proto->SerialNext(), m_proto->m_szJabberJID) << XQUERY(JABBER_FEAT_REGISTER)
+ << XCHILD(L"remove"));
}
void btnChangePassword_OnClick(CCtrlButton *)
@@ -631,8 +631,8 @@ private:
m_txtUsername.Enable(!checked);
m_chkSavePassword.Enable(!checked);
if (checked) {
- m_txtPassword.SetText(_T(""));
- m_txtUsername.SetText(_T(""));
+ m_txtPassword.SetText(L"");
+ m_txtUsername.SetText(L"");
m_chkSavePassword.SetState(BST_CHECKED);
}
}
@@ -697,8 +697,8 @@ private:
if (!n)
break;
- if (!mir_tstrcmp(XmlGetName(n), _T("item")))
- if (const TCHAR *jid = XmlGetAttrValue(n, _T("jid")))
+ if (!mir_tstrcmp(XmlGetName(n), L"item"))
+ if (const TCHAR *jid = XmlGetAttrValue(n, L"jid"))
if (m_cbServer.FindString(jid, -1, true) == CB_ERR)
m_cbServer.AddString(jid);
}
@@ -732,7 +732,7 @@ private:
TCHAR *buf = mir_a2t(result->pData);
XmlNode node(buf, NULL, NULL);
if (node) {
- HXML queryNode = XmlGetChild(node, _T("query"));
+ HXML queryNode = XmlGetChild(node, L"query");
SendMessage(hwnd, WM_JABBER_REFRESH, 0, (LPARAM)queryNode);
bIsError = false;
}
@@ -776,41 +776,41 @@ public:
CreateLink(m_chkDirect, proto->m_options.BsDirect);
CreateLink(m_chkDirectManual, proto->m_options.BsDirectManual);
CreateLink(m_chkProxy, proto->m_options.BsProxyManual);
- CreateLink(m_txtDirect, "BsDirectAddr", _T(""));
- CreateLink(m_txtProxy, "BsProxyServer", _T(""));
+ CreateLink(m_txtDirect, "BsDirectAddr", L"");
+ CreateLink(m_txtProxy, "BsProxyServer", L"");
m_chkDirect.OnChange =
m_chkDirectManual.OnChange = Callback(this, &CDlgOptAdvanced::chkDirect_OnChange);
m_chkProxy.OnChange = Callback(this, &CDlgOptAdvanced::chkProxy_OnChange);
- m_otvOptions.AddOption(LPGENT("Messaging") _T("/") LPGENT("Send messages slower, but with full acknowledgment"), m_proto->m_options.MsgAck);
- m_otvOptions.AddOption(LPGENT("Messaging") _T("/") LPGENT("Enable avatars"), m_proto->m_options.EnableAvatars);
- m_otvOptions.AddOption(LPGENT("Messaging") _T("/") LPGENT("Log chat state changes"), m_proto->m_options.LogChatstates);
- m_otvOptions.AddOption(LPGENT("Messaging") _T("/") LPGENT("Log presence subscription state changes"), m_proto->m_options.LogPresence);
- m_otvOptions.AddOption(LPGENT("Messaging") _T("/") LPGENT("Log presence errors"), m_proto->m_options.LogPresenceErrors);
- m_otvOptions.AddOption(LPGENT("Messaging") _T("/") LPGENT("Enable user moods receiving"), m_proto->m_options.EnableUserMood);
- m_otvOptions.AddOption(LPGENT("Messaging") _T("/") LPGENT("Enable user tunes receiving"), m_proto->m_options.EnableUserTune);
- m_otvOptions.AddOption(LPGENT("Messaging") _T("/") LPGENT("Enable user activity receiving"), m_proto->m_options.EnableUserActivity);
- m_otvOptions.AddOption(LPGENT("Messaging") _T("/") LPGENT("Receive notes"), m_proto->m_options.AcceptNotes);
- m_otvOptions.AddOption(LPGENT("Messaging") _T("/") LPGENT("Automatically save received notes"), m_proto->m_options.AutosaveNotes);
- m_otvOptions.AddOption(LPGENT("Messaging") _T("/") LPGENT("Enable server-side history"), m_proto->m_options.EnableMsgArchive);
-
- m_otvOptions.AddOption(LPGENT("Server options") _T("/") LPGENT("Disable SASL authentication (for old servers)"), m_proto->m_options.Disable3920auth);
- m_otvOptions.AddOption(LPGENT("Server options") _T("/") LPGENT("Enable stream compression (if possible)"), m_proto->m_options.EnableZlib);
-
- m_otvOptions.AddOption(LPGENT("Other") _T("/") LPGENT("Enable remote controlling (from another resource of same JID only)"), m_proto->m_options.EnableRemoteControl);
- m_otvOptions.AddOption(LPGENT("Other") _T("/") LPGENT("Show transport agents on contact list"), m_proto->m_options.ShowTransport);
- m_otvOptions.AddOption(LPGENT("Other") _T("/") LPGENT("Automatically add contact when accept authorization"), m_proto->m_options.AutoAdd);
- m_otvOptions.AddOption(LPGENT("Other") _T("/") LPGENT("Automatically accept authorization requests"), m_proto->m_options.AutoAcceptAuthorization);
- m_otvOptions.AddOption(LPGENT("Other") _T("/") LPGENT("Fix incorrect timestamps in incoming messages"), m_proto->m_options.FixIncorrectTimestamps);
- m_otvOptions.AddOption(LPGENT("Other") _T("/") LPGENT("Disable frame"), m_proto->m_options.DisableFrame);
- m_otvOptions.AddOption(LPGENT("Other") _T("/") LPGENT("Enable XMPP link processing (requires AssocMgr)"), m_proto->m_options.ProcessXMPPLinks);
- m_otvOptions.AddOption(LPGENT("Other") _T("/") LPGENT("Keep contacts assigned to local groups (ignore roster group)"), m_proto->m_options.IgnoreRosterGroups);
-
- m_otvOptions.AddOption(LPGENT("Security") _T("/") LPGENT("Allow servers to request version (XEP-0092)"), m_proto->m_options.AllowVersionRequests);
- m_otvOptions.AddOption(LPGENT("Security") _T("/") LPGENT("Show information about operating system in version replies"), m_proto->m_options.ShowOSVersion);
- m_otvOptions.AddOption(LPGENT("Security") _T("/") LPGENT("Accept only in band incoming filetransfers (don't disclose own IP)"), m_proto->m_options.BsOnlyIBB);
- m_otvOptions.AddOption(LPGENT("Security") _T("/") LPGENT("Accept HTTP Authentication requests (XEP-0070)"), m_proto->m_options.AcceptHttpAuth);
+ m_otvOptions.AddOption(LPGENT("Messaging") L"/" LPGENT("Send messages slower, but with full acknowledgment"), m_proto->m_options.MsgAck);
+ m_otvOptions.AddOption(LPGENT("Messaging") L"/" LPGENT("Enable avatars"), m_proto->m_options.EnableAvatars);
+ m_otvOptions.AddOption(LPGENT("Messaging") L"/" LPGENT("Log chat state changes"), m_proto->m_options.LogChatstates);
+ m_otvOptions.AddOption(LPGENT("Messaging") L"/" LPGENT("Log presence subscription state changes"), m_proto->m_options.LogPresence);
+ m_otvOptions.AddOption(LPGENT("Messaging") L"/" LPGENT("Log presence errors"), m_proto->m_options.LogPresenceErrors);
+ m_otvOptions.AddOption(LPGENT("Messaging") L"/" LPGENT("Enable user moods receiving"), m_proto->m_options.EnableUserMood);
+ m_otvOptions.AddOption(LPGENT("Messaging") L"/" LPGENT("Enable user tunes receiving"), m_proto->m_options.EnableUserTune);
+ m_otvOptions.AddOption(LPGENT("Messaging") L"/" LPGENT("Enable user activity receiving"), m_proto->m_options.EnableUserActivity);
+ m_otvOptions.AddOption(LPGENT("Messaging") L"/" LPGENT("Receive notes"), m_proto->m_options.AcceptNotes);
+ m_otvOptions.AddOption(LPGENT("Messaging") L"/" LPGENT("Automatically save received notes"), m_proto->m_options.AutosaveNotes);
+ m_otvOptions.AddOption(LPGENT("Messaging") L"/" LPGENT("Enable server-side history"), m_proto->m_options.EnableMsgArchive);
+
+ m_otvOptions.AddOption(LPGENT("Server options") L"/" LPGENT("Disable SASL authentication (for old servers)"), m_proto->m_options.Disable3920auth);
+ m_otvOptions.AddOption(LPGENT("Server options") L"/" LPGENT("Enable stream compression (if possible)"), m_proto->m_options.EnableZlib);
+
+ m_otvOptions.AddOption(LPGENT("Other") L"/" LPGENT("Enable remote controlling (from another resource of same JID only)"), m_proto->m_options.EnableRemoteControl);
+ m_otvOptions.AddOption(LPGENT("Other") L"/" LPGENT("Show transport agents on contact list"), m_proto->m_options.ShowTransport);
+ m_otvOptions.AddOption(LPGENT("Other") L"/" LPGENT("Automatically add contact when accept authorization"), m_proto->m_options.AutoAdd);
+ m_otvOptions.AddOption(LPGENT("Other") L"/" LPGENT("Automatically accept authorization requests"), m_proto->m_options.AutoAcceptAuthorization);
+ m_otvOptions.AddOption(LPGENT("Other") L"/" LPGENT("Fix incorrect timestamps in incoming messages"), m_proto->m_options.FixIncorrectTimestamps);
+ m_otvOptions.AddOption(LPGENT("Other") L"/" LPGENT("Disable frame"), m_proto->m_options.DisableFrame);
+ m_otvOptions.AddOption(LPGENT("Other") L"/" LPGENT("Enable XMPP link processing (requires AssocMgr)"), m_proto->m_options.ProcessXMPPLinks);
+ m_otvOptions.AddOption(LPGENT("Other") L"/" LPGENT("Keep contacts assigned to local groups (ignore roster group)"), m_proto->m_options.IgnoreRosterGroups);
+
+ m_otvOptions.AddOption(LPGENT("Security") L"/" LPGENT("Allow servers to request version (XEP-0092)"), m_proto->m_options.AllowVersionRequests);
+ m_otvOptions.AddOption(LPGENT("Security") L"/" LPGENT("Show information about operating system in version replies"), m_proto->m_options.ShowOSVersion);
+ m_otvOptions.AddOption(LPGENT("Security") L"/" LPGENT("Accept only in band incoming filetransfers (don't disclose own IP)"), m_proto->m_options.BsOnlyIBB);
+ m_otvOptions.AddOption(LPGENT("Security") L"/" LPGENT("Accept HTTP Authentication requests (XEP-0070)"), m_proto->m_options.AcceptHttpAuth);
}
void OnInitDialog()
@@ -896,21 +896,21 @@ public:
m_txtQuit(this, IDC_TXT_QUIT),
m_otvOptions(this, IDC_OPTTREE)
{
- CreateLink(m_txtAltNick, "GcAltNick", _T(""));
+ CreateLink(m_txtAltNick, "GcAltNick", L"");
CreateLink(m_txtSlap, "GcMsgSlap", TranslateTS(JABBER_GC_MSG_SLAP));
CreateLink(m_txtQuit, "GcMsgQuit", TranslateTS(JABBER_GC_MSG_QUIT));
- m_otvOptions.AddOption(LPGENT("General") _T("/") LPGENT("Autoaccept multiuser chat invitations"), m_proto->m_options.AutoAcceptMUC);
- m_otvOptions.AddOption(LPGENT("General") _T("/") LPGENT("Automatically join bookmarks on login"), m_proto->m_options.AutoJoinBookmarks);
- m_otvOptions.AddOption(LPGENT("General") _T("/") LPGENT("Automatically join conferences on login"), m_proto->m_options.AutoJoinConferences);
- m_otvOptions.AddOption(LPGENT("General") _T("/") LPGENT("Hide conference windows at startup"), m_proto->m_options.AutoJoinHidden);
- m_otvOptions.AddOption(LPGENT("General") _T("/") LPGENT("Do not show multiuser chat invitations"), m_proto->m_options.IgnoreMUCInvites);
- m_otvOptions.AddOption(LPGENT("Log events") _T("/") LPGENT("Ban notifications"), m_proto->m_options.GcLogBans);
- m_otvOptions.AddOption(LPGENT("Log events") _T("/") LPGENT("Room configuration changes"), m_proto->m_options.GcLogConfig);
- m_otvOptions.AddOption(LPGENT("Log events") _T("/") LPGENT("Affiliation changes"), m_proto->m_options.GcLogAffiliations);
- m_otvOptions.AddOption(LPGENT("Log events") _T("/") LPGENT("Role changes"), m_proto->m_options.GcLogRoles);
- m_otvOptions.AddOption(LPGENT("Log events") _T("/") LPGENT("Status changes"), m_proto->m_options.GcLogStatuses);
- m_otvOptions.AddOption(LPGENT("Log events") _T("/") LPGENT("Don't notify history messages"), m_proto->m_options.GcLogChatHistory);
+ m_otvOptions.AddOption(LPGENT("General") L"/" LPGENT("Autoaccept multiuser chat invitations"), m_proto->m_options.AutoAcceptMUC);
+ m_otvOptions.AddOption(LPGENT("General") L"/" LPGENT("Automatically join bookmarks on login"), m_proto->m_options.AutoJoinBookmarks);
+ m_otvOptions.AddOption(LPGENT("General") L"/" LPGENT("Automatically join conferences on login"), m_proto->m_options.AutoJoinConferences);
+ m_otvOptions.AddOption(LPGENT("General") L"/" LPGENT("Hide conference windows at startup"), m_proto->m_options.AutoJoinHidden);
+ m_otvOptions.AddOption(LPGENT("General") L"/" LPGENT("Do not show multiuser chat invitations"), m_proto->m_options.IgnoreMUCInvites);
+ m_otvOptions.AddOption(LPGENT("Log events") L"/" LPGENT("Ban notifications"), m_proto->m_options.GcLogBans);
+ m_otvOptions.AddOption(LPGENT("Log events") L"/" LPGENT("Room configuration changes"), m_proto->m_options.GcLogConfig);
+ m_otvOptions.AddOption(LPGENT("Log events") L"/" LPGENT("Affiliation changes"), m_proto->m_options.GcLogAffiliations);
+ m_otvOptions.AddOption(LPGENT("Log events") L"/" LPGENT("Role changes"), m_proto->m_options.GcLogRoles);
+ m_otvOptions.AddOption(LPGENT("Log events") L"/" LPGENT("Status changes"), m_proto->m_options.GcLogStatuses);
+ m_otvOptions.AddOption(LPGENT("Log events") L"/" LPGENT("Don't notify history messages"), m_proto->m_options.GcLogChatHistory);
}
};
@@ -1000,16 +1000,16 @@ void CJabberProto::_RosterHandleGetRequest(HXML node, CJabberIqInfo*)
if (query == NULL) return;
int i = 1;
while (TRUE) {
- HXML item = XmlGetNthChild(query, _T("item"), i++);
+ HXML item = XmlGetNthChild(query, L"item", i++);
if (item == NULL)
break;
- const TCHAR *jid = XmlGetAttrValue(item, _T("jid"));
+ const TCHAR *jid = XmlGetAttrValue(item, L"jid");
if (jid == NULL)
continue;
- const TCHAR *name = XmlGetAttrValue(item, _T("name"));
- const TCHAR *subscription = XmlGetAttrValue(item, _T("subscription"));
+ const TCHAR *name = XmlGetAttrValue(item, L"name");
+ const TCHAR *subscription = XmlGetAttrValue(item, L"subscription");
const TCHAR *group = XmlGetText(XmlGetChild(item, "group"));
_RosterInsertListItem(hList, jid, name, group, subscription, TRUE);
}
@@ -1050,15 +1050,15 @@ void CJabberProto::_RosterHandleGetRequest(HXML node, CJabberIqInfo*)
XmlNodeIq iq(AddIQ(&CJabberProto::_RosterHandleGetRequest, JABBER_IQ_TYPE_SET));
- HXML query = iq << XCHILDNS(_T("query"), JABBER_FEAT_IQ_ROSTER);
+ HXML query = iq << XCHILDNS(L"query", JABBER_FEAT_IQ_ROSTER);
int itemCount = 0;
int ListItemCount = ListView_GetItemCount(hList);
for (int index = 0; index < ListItemCount; index++) {
- TCHAR jid[JABBER_MAX_JID_LEN] = _T("");
- TCHAR name[260] = _T("");
- TCHAR group[260] = _T("");
- TCHAR subscr[260] = _T("");
+ TCHAR jid[JABBER_MAX_JID_LEN] = L"";
+ TCHAR name[260] = L"";
+ TCHAR group[260] = L"";
+ TCHAR subscr[260] = L"";
ListView_GetItemText(hList, index, 0, jid, _countof(jid));
ListView_GetItemText(hList, index, 1, name, _countof(name));
ListView_GetItemText(hList, index, 2, group, _countof(group));
@@ -1067,17 +1067,17 @@ void CJabberProto::_RosterHandleGetRequest(HXML node, CJabberIqInfo*)
BOOL bRemove = !ListView_GetCheckState(hList, index);
if (itemRoster && bRemove) {
//delete item
- query << XCHILD(_T("item")) << XATTR(_T("jid"), jid) << XATTR(_T("subscription"), _T("remove"));
+ query << XCHILD(L"item") << XATTR(L"jid", jid) << XATTR(L"subscription", L"remove");
itemCount++;
}
else if (!bRemove) {
BOOL bPushed = itemRoster ? TRUE : FALSE;
if (!bPushed) {
- const TCHAR *rosterName = XmlGetAttrValue(itemRoster, _T("name"));
+ const TCHAR *rosterName = XmlGetAttrValue(itemRoster, L"name");
if ((rosterName != NULL || name[0] != 0) && mir_tstrcmpi(rosterName, name))
bPushed = TRUE;
if (!bPushed) {
- rosterName = XmlGetAttrValue(itemRoster, _T("subscription"));
+ rosterName = XmlGetAttrValue(itemRoster, L"subscription");
if ((rosterName != NULL || subscr[0] != 0) && mir_tstrcmpi(rosterName, subscr))
bPushed = TRUE;
}
@@ -1088,12 +1088,12 @@ void CJabberProto::_RosterHandleGetRequest(HXML node, CJabberIqInfo*)
}
}
if (bPushed) {
- HXML item = query << XCHILD(_T("item"));
+ HXML item = query << XCHILD(L"item");
if (mir_tstrlen(group))
- item << XCHILD(_T("group"), group);
+ item << XCHILD(L"group", group);
if (mir_tstrlen(name))
- item << XATTR(_T("name"), name);
- item << XATTR(_T("jid"), jid) << XATTR(_T("subscription"), subscr[0] ? subscr : _T("none"));
+ item << XATTR(L"name", name);
+ item << XATTR(L"jid", jid) << XATTR(L"subscription", subscr[0] ? subscr : L"none");
itemCount++;
}
}
@@ -1120,7 +1120,7 @@ void CJabberProto::_RosterSendRequest(HWND hwndDlg, BYTE rrAction)
m_ThreadInfo->send(
XmlNodeIq(AddIQ(&CJabberProto::_RosterHandleGetRequest, JABBER_IQ_TYPE_GET))
- << XCHILDNS(_T("query"), JABBER_FEAT_IQ_ROSTER));
+ << XCHILDNS(L"query", JABBER_FEAT_IQ_ROSTER));
}
static void _RosterItemEditEnd(HWND hEditor, ROSTEREDITDAT * edat, BOOL bCancel)
@@ -1179,7 +1179,7 @@ void CJabberProto::_RosterExportToFile(HWND hwndDlg)
TCHAR filename[MAX_PATH] = { 0 };
TCHAR filter[MAX_PATH];
- mir_sntprintf(filter, _T("%s (*.xml)%c*.xml%c%c"), TranslateT("XML for MS Excel (UTF-8 encoded)"), 0, 0, 0);
+ mir_sntprintf(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;
@@ -1189,41 +1189,41 @@ void CJabberProto::_RosterExportToFile(HWND hwndDlg)
ofn.Flags = OFN_HIDEREADONLY;
ofn.nMaxFile = _countof(filename);
ofn.nMaxFileTitle = MAX_PATH;
- ofn.lpstrDefExt = _T("xml");
+ ofn.lpstrDefExt = L"xml";
if (!GetSaveFileName(&ofn)) return;
- FILE * fp = fopent(filename, _T("w"));
+ FILE * fp = fopent(filename, L"w");
if (!fp) return;
HWND hList = GetDlgItem(hwndDlg, IDC_ROSTER);
int ListItemCount = ListView_GetItemCount(hList);
- XmlNode root(_T("Workbook"));
- root << XATTR(_T("xmlns"), _T("urn:schemas-microsoft-com:office:spreadsheet"))
- << XATTR(_T("xmlns:o"), _T("urn:schemas-microsoft-com:office:office"))
- << XATTR(_T("xmlns:x"), _T("urn:schemas-microsoft-com:office:excel"))
- << XATTR(_T("xmlns:ss"), _T("urn:schemas-microsoft-com:office:spreadsheet"))
- << XATTR(_T("xmlns:html"), _T("http://www.w3.org/TR/REC-html40"));
- root << XCHILD(_T("ExcelWorkbook"))
- << XATTR(_T("xmlns"), _T("urn:schemas-microsoft-com:office:excel"));
- HXML table = root << XCHILD(_T("Worksheet")) << XATTR(_T("ss:Name"), _T("Exported roster"))
- << XCHILD(_T("Table"));
+ XmlNode root(L"Workbook");
+ root << XATTR(L"xmlns", L"urn:schemas-microsoft-com:office:spreadsheet")
+ << XATTR(L"xmlns:o", L"urn:schemas-microsoft-com:office:office")
+ << XATTR(L"xmlns:x", L"urn:schemas-microsoft-com:office:excel")
+ << XATTR(L"xmlns:ss", L"urn:schemas-microsoft-com:office:spreadsheet")
+ << XATTR(L"xmlns:html", L"http://www.w3.org/TR/REC-html40");
+ root << XCHILD(L"ExcelWorkbook")
+ << XATTR(L"xmlns", L"urn:schemas-microsoft-com:office:excel");
+ HXML table = root << XCHILD(L"Worksheet") << XATTR(L"ss:Name", L"Exported roster")
+ << XCHILD(L"Table");
for (int index = 0; index < ListItemCount; index++) {
- TCHAR jid[JABBER_MAX_JID_LEN] = _T("");
- TCHAR name[260] = _T("");
- TCHAR group[260] = _T("");
- TCHAR subscr[260] = _T("");
+ TCHAR jid[JABBER_MAX_JID_LEN] = L"";
+ TCHAR name[260] = L"";
+ TCHAR group[260] = L"";
+ TCHAR subscr[260] = L"";
ListView_GetItemText(hList, index, 0, jid, _countof(jid));
ListView_GetItemText(hList, index, 1, name, _countof(name));
ListView_GetItemText(hList, index, 2, group, _countof(group));
ListView_GetItemText(hList, index, 3, subscr, _countof(subscr));
- HXML node = table << XCHILD(_T("Row"));
- node << XCHILD(_T("Cell")) << XCHILD(_T("Data"), _T("+")) << XATTR(_T("ss:Type"), _T("String"));
- node << XCHILD(_T("Cell")) << XCHILD(_T("Data"), jid) << XATTR(_T("ss:Type"), _T("String"));
- node << XCHILD(_T("Cell")) << XCHILD(_T("Data"), name) << XATTR(_T("ss:Type"), _T("String"));
- node << XCHILD(_T("Cell")) << XCHILD(_T("Data"), group) << XATTR(_T("ss:Type"), _T("String"));
- node << XCHILD(_T("Cell")) << XCHILD(_T("Data"), subscr) << XATTR(_T("ss:Type"), _T("String"));
+ HXML node = table << XCHILD(L"Row");
+ node << XCHILD(L"Cell") << XCHILD(L"Data", L"+") << XATTR(L"ss:Type", L"String");
+ node << XCHILD(L"Cell") << XCHILD(L"Data", jid) << XATTR(L"ss:Type", L"String");
+ node << XCHILD(L"Cell") << XCHILD(L"Data", name) << XATTR(L"ss:Type", L"String");
+ node << XCHILD(L"Cell") << XCHILD(L"Data", group) << XATTR(L"ss:Type", L"String");
+ node << XCHILD(L"Cell") << XCHILD(L"Data", subscr) << XATTR(L"ss:Type", L"String");
}
@@ -1274,7 +1274,7 @@ void CJabberProto::_RosterImportFromFile(HWND hwndDlg)
int nBytesProcessed = 0;
XmlNode node(newBuf, &nBytesProcessed, NULL);
if (node) {
- HXML Workbook = XmlGetChild(node, _T("Workbook"));
+ HXML Workbook = XmlGetChild(node, L"Workbook");
if (Workbook) {
HXML Worksheet = XmlGetChild(Workbook, "Worksheet");
if (Worksheet) {
@@ -1283,7 +1283,7 @@ void CJabberProto::_RosterImportFromFile(HWND hwndDlg)
int index = 1;
HWND hList = GetDlgItem(hwndDlg, IDC_ROSTER);
while (TRUE) {
- HXML Row = XmlGetNthChild(Table, _T("Row"), index++);
+ HXML Row = XmlGetNthChild(Table, L"Row", index++);
if (!Row)
break;
@@ -1292,13 +1292,13 @@ void CJabberProto::_RosterImportFromFile(HWND hwndDlg)
const TCHAR *name = NULL;
const TCHAR *group = NULL;
const TCHAR *subscr = NULL;
- HXML Cell = XmlGetNthChild(Row, _T("Cell"), 1);
+ HXML Cell = XmlGetNthChild(Row, L"Cell", 1);
HXML Data = (Cell) ? XmlGetChild(Cell, "Data") : XmlNode();
if (Data) {
- if (!mir_tstrcmpi(XmlGetText(Data), _T("+"))) bAdd = TRUE;
- else if (mir_tstrcmpi(XmlGetText(Data), _T("-"))) continue;
+ if (!mir_tstrcmpi(XmlGetText(Data), L"+")) bAdd = TRUE;
+ else if (mir_tstrcmpi(XmlGetText(Data), L"-")) continue;
- Cell = XmlGetNthChild(Row, _T("Cell"), 2);
+ Cell = XmlGetNthChild(Row, L"Cell", 2);
if (Cell) Data = XmlGetChild(Cell, "Data");
else Data = NULL;
if (Data) {
@@ -1306,17 +1306,17 @@ void CJabberProto::_RosterImportFromFile(HWND hwndDlg)
if (!jid || mir_tstrlen(jid) == 0) continue;
}
- Cell = XmlGetNthChild(Row, _T("Cell"), 3);
+ Cell = XmlGetNthChild(Row, L"Cell", 3);
if (Cell) Data = XmlGetChild(Cell, "Data");
else Data = NULL;
if (Data) name = XmlGetText(Data);
- Cell = XmlGetNthChild(Row, _T("Cell"), 4);
+ Cell = XmlGetNthChild(Row, L"Cell", 4);
if (Cell) Data = XmlGetChild(Cell, "Data");
else Data = NULL;
if (Data) group = XmlGetText(Data);
- Cell = XmlGetNthChild(Row, _T("Cell"), 5);
+ Cell = XmlGetNthChild(Row, L"Cell", 5);
if (Cell) Data = XmlGetChild(Cell, "Data");
else Data = NULL;
if (Data) subscr = XmlGetText(Data);
@@ -1544,10 +1544,10 @@ public:
{
SetParent(hwndParent);
- CreateLink(m_txtUsername, "LoginName", _T(""));
+ CreateLink(m_txtUsername, "LoginName", L"");
CreateLink(m_chkSavePassword, proto->m_options.SavePassword);
- CreateLink(m_cbResource, "Resource", _T("Miranda"));
- CreateLink(m_cbServer, "LoginServer", _T("jabber.org"));
+ CreateLink(m_cbResource, "Resource", L"Miranda");
+ CreateLink(m_cbServer, "LoginServer", L"jabber.org");
CreateLink(m_txtPort, "Port", DBVT_WORD, 5222);
CreateLink(m_chkUseDomainLogin, proto->m_options.UseDomainLogin);
@@ -1578,7 +1578,7 @@ protected:
m_cbServer.AddString(TranslateT("Loading..."));
// fill predefined resources
- TCHAR *szResources[] = { _T("Home"), _T("Work"), _T("Office"), _T("Miranda") };
+ TCHAR *szResources[] = { L"Home", L"Work", L"Office", L"Miranda" };
for (int i = 0; i < _countof(szResources); i++)
m_cbResource.AddString(szResources[i]);
@@ -1594,7 +1594,7 @@ protected:
m_cbResource.AddString(tszResource);
m_cbResource.SetText(tszResource);
}
- else m_cbResource.SetText(_T("Miranda"));
+ else m_cbResource.SetText(L"Miranda");
m_cbType.AddString(TranslateT("Public XMPP Network"), ACC_PUBLIC);
m_cbType.AddString(TranslateT("Secure XMPP Network"), ACC_TLS);
@@ -1864,8 +1864,8 @@ private:
m_txtUsername.Enable(!checked);
m_chkSavePassword.Enable(!checked);
if (checked) {
- m_txtPassword.SetText(_T(""));
- m_txtUsername.SetText(_T(""));
+ m_txtPassword.SetText(L"");
+ m_txtUsername.SetText(L"");
m_chkSavePassword.SetState(BST_CHECKED);
}
}
@@ -2171,8 +2171,8 @@ void CJabberDlgAccMgrUI::RefreshServers(HXML node)
if (!n)
break;
- if (!mir_tstrcmp(XmlGetName(n), _T("item")))
- if (const TCHAR *jid = XmlGetAttrValue(n, _T("jid")))
+ if (!mir_tstrcmp(XmlGetName(n), L"item"))
+ if (const TCHAR *jid = XmlGetAttrValue(n, L"jid"))
if (m_cbServer.FindString(jid, -1, true) == CB_ERR)
m_cbServer.AddString(jid);
}
@@ -2202,7 +2202,7 @@ void CJabberDlgAccMgrUI::QueryServerListThread(void *arg)
TCHAR *ptszText = mir_a2t(result->pData);
XmlNode node(ptszText, NULL, NULL);
if (node) {
- HXML queryNode = XmlGetChild(node, _T("query"));
+ HXML queryNode = XmlGetChild(node, L"query");
if (queryNode && IsWindow(hwnd)) {
SendMessage(hwnd, WM_JABBER_REFRESH, 0, (LPARAM)queryNode);
bIsError = false;
diff --git a/protocols/JabberG/src/jabber_password.cpp b/protocols/JabberG/src/jabber_password.cpp
index d75d0afec1..f81d00a074 100644
--- a/protocols/JabberG/src/jabber_password.cpp
+++ b/protocols/JabberG/src/jabber_password.cpp
@@ -74,8 +74,8 @@ static INT_PTR CALLBACK JabberChangePasswordDlgProc(HWND hwndDlg, UINT msg, WPAR
XmlNodeIq iq(ppro->AddIQ(&CJabberProto::OnIqResultSetPassword, JABBER_IQ_TYPE_SET, _A2T(ppro->m_ThreadInfo->conn.server)));
HXML q = iq << XQUERY(JABBER_FEAT_REGISTER);
- q << XCHILD(_T("username"), ppro->m_ThreadInfo->conn.username);
- q << XCHILD(_T("password"), newPasswd);
+ q << XCHILD(L"username", ppro->m_ThreadInfo->conn.username);
+ q << XCHILD(L"password", newPasswd);
ppro->m_ThreadInfo->send(iq);
}
DestroyWindow(hwndDlg);
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp
index c957183889..4e0fac80ed 100644
--- a/protocols/JabberG/src/jabber_privacy.cpp
+++ b/protocols/JabberG/src/jabber_privacy.cpp
@@ -39,7 +39,7 @@ BOOL CJabberProto::OnIqRequestPrivacyLists(HXML, CJabberIqInfo *pInfo)
}
else m_pDlgPrivacyLists->SetStatusText(TranslateT("Warning: privacy lists were changed on server."));
- m_ThreadInfo->send( XmlNodeIq(_T("result"), pInfo));
+ m_ThreadInfo->send( XmlNodeIq(L"result", pInfo));
}
return TRUE;
}
@@ -73,11 +73,11 @@ void CJabberProto::OnIqResultPrivacyList(HXML iqNode, CJabberIqInfo*)
if (iqNode == NULL)
return;
- const TCHAR *type = XmlGetAttrValue(iqNode, _T("type"));
+ const TCHAR *type = XmlGetAttrValue(iqNode, L"type");
if (type == NULL)
return;
- if ( mir_tstrcmp(type, _T("result")))
+ if ( mir_tstrcmp(type, L"result"))
return;
HXML query = XmlGetChild(iqNode , "query");
@@ -86,7 +86,7 @@ void CJabberProto::OnIqResultPrivacyList(HXML iqNode, CJabberIqInfo*)
HXML list = XmlGetChild(query, "list");
if (list == NULL)
return;
- TCHAR *szListName = (TCHAR*)XmlGetAttrValue(list, _T("name"));
+ TCHAR *szListName = (TCHAR*)XmlGetAttrValue(list, L"name");
if (!szListName)
return;
@@ -100,26 +100,26 @@ void CJabberProto::OnIqResultPrivacyList(HXML iqNode, CJabberIqInfo*)
}
HXML item;
- for (int i = 1; (item = XmlGetNthChild(list, _T("item"), i)) != NULL; i++) {
- const TCHAR *itemType = XmlGetAttrValue(item, _T("type"));
+ for (int i = 1; (item = XmlGetNthChild(list, L"item", i)) != NULL; i++) {
+ const TCHAR *itemType = XmlGetAttrValue(item, L"type");
PrivacyListRuleType nItemType = Else;
if (itemType) {
- if (!mir_tstrcmpi(itemType, _T("jid")))
+ if (!mir_tstrcmpi(itemType, L"jid"))
nItemType = Jid;
- else if (!mir_tstrcmpi(itemType, _T("group")))
+ else if (!mir_tstrcmpi(itemType, L"group"))
nItemType = Group;
- else if (!mir_tstrcmpi(itemType, _T("subscription")))
+ else if (!mir_tstrcmpi(itemType, L"subscription"))
nItemType = Subscription;
}
- const TCHAR *itemValue = XmlGetAttrValue(item, _T("value"));
+ const TCHAR *itemValue = XmlGetAttrValue(item, L"value");
- const TCHAR *itemAction = XmlGetAttrValue(item, _T("action"));
+ const TCHAR *itemAction = XmlGetAttrValue(item, L"action");
BOOL bAllow = TRUE;
- if (itemAction && !mir_tstrcmpi(itemAction, _T("deny")))
+ if (itemAction && !mir_tstrcmpi(itemAction, L"deny"))
bAllow = FALSE;
- const TCHAR *itemOrder = XmlGetAttrValue(item, _T("order"));
+ const TCHAR *itemOrder = XmlGetAttrValue(item, L"order");
DWORD dwOrder = 0;
if (itemOrder)
dwOrder = _ttoi(itemOrder);
@@ -179,13 +179,13 @@ void CJabberProto::OnIqResultPrivacyListActive(HXML iqNode, CJabberIqInfo *pInfo
if (iqNode == NULL)
return;
- const TCHAR *type = XmlGetAttrValue(iqNode, _T("type"));
+ const TCHAR *type = XmlGetAttrValue(iqNode, L"type");
if (type == NULL)
return;
CMString szText;
- if (!mir_tstrcmp(type, _T("result"))) {
+ if (!mir_tstrcmp(type, L"result")) {
mir_cslock lck(m_privacyListManager.m_cs);
if (pList) {
m_privacyListManager.SetActiveListName(pList->GetListName());
@@ -214,7 +214,7 @@ void CJabberProto::OnIqResultPrivacyListDefault(HXML iqNode, CJabberIqInfo *pInf
if (iqNode == NULL)
return;
- const TCHAR *type = XmlGetAttrValue(iqNode, _T("type"));
+ const TCHAR *type = XmlGetAttrValue(iqNode, L"type");
if (type == NULL)
return;
@@ -222,7 +222,7 @@ void CJabberProto::OnIqResultPrivacyListDefault(HXML iqNode, CJabberIqInfo *pInf
szText[0] = 0;
{
mir_cslock lck(m_privacyListManager.m_cs);
- if (!mir_tstrcmp(type, _T("result"))) {
+ if (!mir_tstrcmp(type, L"result")) {
CPrivacyList *pList = (CPrivacyList *)pInfo->GetUserData();
if (pList) {
m_privacyListManager.SetDefaultListName(pList->GetListName());
@@ -258,11 +258,11 @@ void CJabberProto::OnIqResultPrivacyLists(HXML iqNode, CJabberIqInfo *pInfo)
m_privacyListManager.RemoveAllLists();
for (int i = 1; ; i++) {
- HXML list = XmlGetNthChild(query, _T("list"), i);
+ HXML list = XmlGetNthChild(query, L"list", i);
if (list == NULL)
break;
- const TCHAR *listName = XmlGetAttrValue(list, _T("name"));
+ const TCHAR *listName = XmlGetAttrValue(list, L"name");
if (listName) {
m_privacyListManager.AddList((TCHAR*)listName);
@@ -270,20 +270,20 @@ void CJabberProto::OnIqResultPrivacyLists(HXML iqNode, CJabberIqInfo *pInfo)
if (m_pDlgPrivacyLists)
m_ThreadInfo->send(
XmlNodeIq( AddIQ(&CJabberProto::OnIqResultPrivacyList, JABBER_IQ_TYPE_GET))
- << XQUERY(JABBER_FEAT_PRIVACY_LISTS) << XCHILD(_T("list")) << XATTR(_T("name"), listName));
+ << XQUERY(JABBER_FEAT_PRIVACY_LISTS) << XCHILD(L"list") << XATTR(L"name", listName));
}
}
const TCHAR *szName = NULL;
HXML node = XmlGetChild(query , "active");
if (node)
- szName = XmlGetAttrValue(node, _T("name"));
+ szName = XmlGetAttrValue(node, L"name");
m_privacyListManager.SetActiveListName(szName);
szName = NULL;
node = XmlGetChild(query , "default");
if (node)
- szName = XmlGetAttrValue(node, _T("name"));
+ szName = XmlGetAttrValue(node, L"name");
m_privacyListManager.SetDefaultListName(szName);
}
UI_SAFE_NOTIFY(m_pDlgPrivacyLists, WM_JABBER_REFRESH);
@@ -367,7 +367,7 @@ public:
SendDlgItemMessage(m_hwnd, IDC_ICO_PRESENCEIN, STM_SETICON, (WPARAM)m_proto->LoadIconEx("pl_prin_allow"), 0);
SendDlgItemMessage(m_hwnd, IDC_ICO_PRESENCEOUT, STM_SETICON, (WPARAM)m_proto->LoadIconEx("pl_prout_allow"), 0);
- TCHAR *szTypes[] = { _T("JID"), _T("Group"), _T("Subscription"), _T("Any") };
+ TCHAR *szTypes[] = { L"JID", L"Group", L"Subscription", L"Any" };
int i, nTypes[] = { Jid, Group, Subscription, Else };
for (i=0; i < _countof(szTypes); i++) {
LRESULT nItem = SendDlgItemMessage(m_hwnd, IDC_COMBO_TYPE, CB_ADDSTRING, 0, (LPARAM)TranslateTS(szTypes[i]));
@@ -377,7 +377,7 @@ public:
}
SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUE, CB_RESETCONTENT, 0, 0);
- TCHAR *szSubscriptions[] = { _T("none"), _T("from"), _T("to"), _T("both") };
+ TCHAR *szSubscriptions[] = { L"none", L"from", L"to", L"both" };
for (i=0; i < _countof(szSubscriptions); i++) {
LRESULT nItem = SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUE, CB_ADDSTRING, 0, (LPARAM)TranslateTS(szSubscriptions[i]));
SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUE, CB_SETITEMDATA, nItem, (LPARAM)szSubscriptions[i]);
@@ -507,7 +507,7 @@ public:
if (nCurSel != CB_ERR)
m_pRule->SetValue((TCHAR*)SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUE, CB_GETITEMDATA, nCurSel, 0));
else
- m_pRule->SetValue(_T("none"));
+ m_pRule->SetValue(L"none");
break;
default:
@@ -991,16 +991,16 @@ void CJabberDlgPrivacyLists::ShowAdvancedList(CPrivacyList *pList)
TCHAR szTypeValue[ 512 ];
switch (pRule->GetType()) {
case Jid:
- mir_sntprintf(szTypeValue, _T("If Jabber ID is '%s' then"), pRule->GetValue());
+ mir_sntprintf(szTypeValue, L"If Jabber ID is '%s' then", pRule->GetValue());
break;
case Group:
- mir_sntprintf(szTypeValue, _T("If group is '%s' then"), pRule->GetValue());
+ mir_sntprintf(szTypeValue, L"If group is '%s' then", pRule->GetValue());
break;
case Subscription:
- mir_sntprintf(szTypeValue, _T("If subscription is '%s' then"), pRule->GetValue());
+ mir_sntprintf(szTypeValue, L"If subscription is '%s' then", pRule->GetValue());
break;
case Else:
- mir_sntprintf(szTypeValue, _T("Else"));
+ mir_sntprintf(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, _T("all"));
+ mir_tstrcpy(szPackets, L"all");
else {
if (dwPackets & JABBER_PL_RULE_TYPE_MESSAGE)
- mir_tstrcat(szPackets, _T("messages"));
+ mir_tstrcat(szPackets, L"messages");
if (dwPackets & JABBER_PL_RULE_TYPE_PRESENCE_IN) {
if (mir_tstrlen(szPackets))
- mir_tstrcat(szPackets, _T(", "));
- mir_tstrcat(szPackets, _T("presence-in"));
+ mir_tstrcat(szPackets, L", ");
+ mir_tstrcat(szPackets, L"presence-in");
}
if (dwPackets & JABBER_PL_RULE_TYPE_PRESENCE_OUT) {
if (mir_tstrlen(szPackets))
- mir_tstrcat(szPackets, _T(", "));
- mir_tstrcat(szPackets, _T("presence-out"));
+ mir_tstrcat(szPackets, L", ");
+ mir_tstrcat(szPackets, L"presence-out");
}
if (dwPackets & JABBER_PL_RULE_TYPE_IQ) {
if (mir_tstrlen(szPackets))
- mir_tstrcat(szPackets, _T(", "));
- mir_tstrcat(szPackets, _T("queries"));
+ mir_tstrcat(szPackets, L", ");
+ mir_tstrcat(szPackets, L"queries");
}
}
TCHAR szListItem[ 512 ];
- mir_sntprintf(szListItem, _T("%s %s %s"), szTypeValue, pRule->GetAction() ? _T("allow") : _T("deny"), szPackets);
+ mir_sntprintf(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);
@@ -1081,25 +1081,25 @@ void CJabberDlgPrivacyLists::DrawRuleAction(HDC hdc, COLORREF clLine1, COLORREF,
if (pRule->GetPackets() & JABBER_PL_RULE_TYPE_PRESENCE_IN) {
--itemCount;
if (needComma)
- DrawNextRulePart(hdc, clLine1, itemCount ? _T(", ") : TranslateT(" and "), rc);
+ DrawNextRulePart(hdc, clLine1, itemCount ? L", " : TranslateT(" and "), rc);
needComma = true;
DrawNextRulePart(hdc, clLine1, TranslateT("incoming presences"), rc);
}
if (pRule->GetPackets() & JABBER_PL_RULE_TYPE_PRESENCE_OUT) {
--itemCount;
if (needComma)
- DrawNextRulePart(hdc, clLine1, itemCount ? _T(", ") : TranslateT(" and "), rc);
+ DrawNextRulePart(hdc, clLine1, itemCount ? L", " : TranslateT(" and "), rc);
needComma = true;
DrawNextRulePart(hdc, clLine1, TranslateT("outgoing presences"), rc);
}
if (pRule->GetPackets() & JABBER_PL_RULE_TYPE_IQ) {
--itemCount;
if (needComma)
- DrawNextRulePart(hdc, clLine1, itemCount ? _T(", ") : TranslateT(" and "), rc);
+ DrawNextRulePart(hdc, clLine1, itemCount ? L", " : TranslateT(" and "), rc);
needComma = true;
DrawNextRulePart(hdc, clLine1, TranslateT("queries"), rc);
}
- DrawNextRulePart(hdc, clLine1, _T("."), rc);
+ DrawNextRulePart(hdc, clLine1, L".", rc);
}
}
@@ -1385,10 +1385,10 @@ void CJabberDlgPrivacyLists::CListApplyList(HWND hwndList, CPrivacyList *pList)
break;
case Subscription:
- if (!mir_tstrcmp(pRule->GetValue(), _T("none"))) hItem = clc_info.hItemSubNone;
- else if (!mir_tstrcmp(pRule->GetValue(), _T("from"))) hItem = clc_info.hItemSubFrom;
- else if (!mir_tstrcmp(pRule->GetValue(), _T("to"))) hItem = clc_info.hItemSubTo;
- else if (!mir_tstrcmp(pRule->GetValue(), _T("both"))) hItem = clc_info.hItemSubBoth;
+ 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;
break;
case Else:
@@ -1484,28 +1484,28 @@ void CJabberDlgPrivacyLists::CListBuildList(HWND hwndList, CPrivacyList *pList)
}
hItem = clc_info.hItemSubBoth;
- szJid = _T("both");
+ szJid = L"both";
if (dwPackets = CListGetPackets(hwndList, hItem, true))
pList->AddRule(Subscription, szJid, TRUE, dwOrder++, dwPackets);
if (dwPackets = CListGetPackets(hwndList, hItem, false))
pList->AddRule(Subscription, szJid, FALSE, dwOrder++, dwPackets);
hItem = clc_info.hItemSubFrom;
- szJid = _T("from");
+ szJid = L"from";
if (dwPackets = CListGetPackets(hwndList, hItem, true))
pList->AddRule(Subscription, szJid, TRUE, dwOrder++, dwPackets);
if (dwPackets = CListGetPackets(hwndList, hItem, false))
pList->AddRule(Subscription, szJid, FALSE, dwOrder++, dwPackets);
hItem = clc_info.hItemSubNone;
- szJid = _T("none");
+ szJid = L"none";
if (dwPackets = CListGetPackets(hwndList, hItem, true))
pList->AddRule(Subscription, szJid, TRUE, dwOrder++, dwPackets);
if (dwPackets = CListGetPackets(hwndList, hItem, false))
pList->AddRule(Subscription, szJid, FALSE, dwOrder++, dwPackets);
hItem = clc_info.hItemSubTo;
- szJid = _T("to");
+ szJid = L"to";
if (dwPackets = CListGetPackets(hwndList, hItem, true))
pList->AddRule(Subscription, szJid, TRUE, dwOrder++, dwPackets);
if (dwPackets = CListGetPackets(hwndList, hItem, false))
@@ -1637,7 +1637,7 @@ void CJabberDlgPrivacyLists::btnAddJid_OnClick(CCtrlButton *)
int len = GetWindowTextLength(GetDlgItem(m_hwnd, IDC_NEWJID))+1;
TCHAR *buf = (TCHAR *)_alloca(sizeof(TCHAR) * len);
GetDlgItemText(m_hwnd, IDC_NEWJID, buf, len);
- SetDlgItemText(m_hwnd, IDC_NEWJID, _T(""));
+ SetDlgItemText(m_hwnd, IDC_NEWJID, L"");
CListAddContact(GetDlgItem(m_hwnd, IDC_CLIST), buf);
}
@@ -1658,9 +1658,9 @@ void CJabberDlgPrivacyLists::btnActivate_OnClick(CCtrlButton *)
SetWindowLongPtr(GetDlgItem(m_hwnd, IDC_ACTIVATE), GWLP_USERDATA, (LONG_PTR)pList);
XmlNodeIq iq(m_proto->AddIQ(&CJabberProto::OnIqResultPrivacyListActive, JABBER_IQ_TYPE_SET, NULL, 0, -1, pList));
HXML query = iq << XQUERY(JABBER_FEAT_PRIVACY_LISTS);
- HXML active = query << XCHILD(_T("active"));
+ HXML active = query << XCHILD(L"active");
if (pList)
- active << XATTR(_T("name"), pList->GetListName());
+ active << XATTR(L"name", pList->GetListName());
lck.unlock();
SetStatusText(TranslateT(JABBER_PL_BUSY_MSG));
@@ -1685,9 +1685,9 @@ void CJabberDlgPrivacyLists::btnSetDefault_OnClick(CCtrlButton *)
XmlNodeIq iq(m_proto->AddIQ(&CJabberProto::OnIqResultPrivacyListDefault, JABBER_IQ_TYPE_SET, NULL, 0, -1, pList));
HXML query = iq << XQUERY(JABBER_FEAT_PRIVACY_LISTS);
- HXML defaultTag = query << XCHILD(_T("default"));
+ HXML defaultTag = query << XCHILD(L"default");
if (pList)
- XmlAddAttr(defaultTag, _T("name"), pList->GetListName());
+ XmlAddAttr(defaultTag, L"name", pList->GetListName());
lck.unlock();
SetStatusText(TranslateT(JABBER_PL_BUSY_MSG));
@@ -1766,7 +1766,7 @@ void CJabberDlgPrivacyLists::btnAddRule_OnClick(CCtrlButton*)
CPrivacyList *pList = GetSelectedList(m_hwnd);
if (pList) {
- CPrivacyListRule* pRule = new CPrivacyListRule(m_proto, Jid, _T(""), FALSE);
+ CPrivacyListRule* pRule = new CPrivacyListRule(m_proto, Jid, L"", FALSE);
CJabberDlgPrivacyRule dlgPrivacyRule(m_proto, m_hwnd, pRule);
int nResult = dlgPrivacyRule.DoModal();
if (nResult) {
@@ -1917,38 +1917,38 @@ void CJabberDlgPrivacyLists::btnApply_OnClick(CCtrlButton *)
XmlNodeIq iq(m_proto->AddIQ(&CJabberProto::OnIqResultPrivacyListModify, JABBER_IQ_TYPE_SET, NULL, 0, -1, pUserData));
HXML query = iq << XQUERY(JABBER_FEAT_PRIVACY_LISTS);
- HXML listTag = query << XCHILD(_T("list")) << XATTR(_T("name"), pList->GetListName());
+ HXML listTag = query << XCHILD(L"list") << XATTR(L"name", pList->GetListName());
while (pRule) {
- HXML itemTag = listTag << XCHILD(_T("item"));
+ HXML itemTag = listTag << XCHILD(L"item");
switch (pRule->GetType()) {
case Jid:
- itemTag << XATTR(_T("type"), _T("jid"));
+ itemTag << XATTR(L"type", L"jid");
break;
case Group:
- itemTag << XATTR(_T("type"), _T("group"));
+ itemTag << XATTR(L"type", L"group");
break;
case Subscription:
- itemTag << XATTR(_T("type"), _T("subscription"));
+ itemTag << XATTR(L"type", L"subscription");
break;
}
if (pRule->GetType() != Else)
- itemTag << XATTR(_T("value"), pRule->GetValue());
+ itemTag << XATTR(L"value", pRule->GetValue());
if (pRule->GetAction())
- itemTag << XATTR(_T("action"), _T("allow"));
+ itemTag << XATTR(L"action", L"allow");
else
- itemTag << XATTR(_T("action"), _T("deny"));
- itemTag << XATTRI(_T("order"), pRule->GetOrder());
+ itemTag << XATTR(L"action", L"deny");
+ itemTag << XATTRI(L"order", pRule->GetOrder());
DWORD dwPackets = pRule->GetPackets();
if (dwPackets != JABBER_PL_RULE_TYPE_ALL) {
if (dwPackets & JABBER_PL_RULE_TYPE_IQ)
- itemTag << XCHILD(_T("iq"));
+ itemTag << XCHILD(L"iq");
if (dwPackets & JABBER_PL_RULE_TYPE_PRESENCE_IN)
- itemTag << XCHILD(_T("presence-in"));
+ itemTag << XCHILD(L"presence-in");
if (dwPackets & JABBER_PL_RULE_TYPE_PRESENCE_OUT)
- itemTag << XCHILD(_T("presence-out"));
+ itemTag << XCHILD(L"presence-out");
if (dwPackets & JABBER_PL_RULE_TYPE_MESSAGE)
- itemTag << XCHILD(_T("message"));
+ itemTag << XCHILD(L"message");
}
pRule = pRule->GetNext();
}
@@ -2076,9 +2076,9 @@ INT_PTR __cdecl CJabberProto::menuSetPrivacyList(WPARAM, LPARAM, LPARAM iList)
XmlNodeIq iq(AddIQ(&CJabberProto::OnIqResultPrivacyListActive, JABBER_IQ_TYPE_SET, NULL, 0, -1, pList));
HXML query = iq << XQUERY(JABBER_FEAT_PRIVACY_LISTS);
- HXML active = query << XCHILD(_T("active"));
+ HXML active = query << XCHILD(L"active");
if (pList)
- active << XATTR(_T("name"), pList->GetListName());
+ active << XATTR(L"name", pList->GetListName());
lck.unlock();
m_ThreadInfo->send(iq);
diff --git a/protocols/JabberG/src/jabber_privacy.h b/protocols/JabberG/src/jabber_privacy.h
index 6c12682db2..6f48cebd11 100644
--- a/protocols/JabberG/src/jabber_privacy.h
+++ b/protocols/JabberG/src/jabber_privacy.h
@@ -58,7 +58,7 @@ class CPrivacyListRule
protected:
friend class CPrivacyList;
public:
- CPrivacyListRule(CJabberProto *ppro, PrivacyListRuleType type = Else, const TCHAR *szValue = _T(""), BOOL bAction = TRUE, DWORD dwOrder = 90, DWORD dwPackets = 0)
+ CPrivacyListRule(CJabberProto *ppro, PrivacyListRuleType type = Else, const TCHAR *szValue = L"", BOOL bAction = TRUE, DWORD dwOrder = 90, DWORD dwPackets = 0)
{
m_proto = ppro;
m_szValue = mir_tstrdup(szValue);
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index b64ac73c55..96bbe0c424 100755
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -147,7 +147,7 @@ CJabberProto::CJabberProto(const char *aProtoName, const TCHAR *aUserName) :
db_set_resident(m_szModuleName, "Grant");
if ((m_tszSelectedLang = getTStringA("XmlLang")) == NULL)
- m_tszSelectedLang = mir_tstrdup(_T("en"));
+ m_tszSelectedLang = mir_tstrdup(L"en");
}
CJabberProto::~CJabberProto()
@@ -297,7 +297,7 @@ int __cdecl CJabberProto::OnPreShutdown(WPARAM, LPARAM)
MCONTACT CJabberProto::AddToListByJID(const TCHAR *newJid, DWORD flags)
{
- debugLog(_T("AddToListByJID jid = %s"), newJid);
+ debugLog(L"AddToListByJID jid = %s", newJid);
MCONTACT hContact = DBCreateContact(newJid, NULL, true, false);
if (flags & PALF_TEMPORARY)
@@ -371,18 +371,18 @@ int CJabberProto::Authorize(MEVENT hDbEvent)
char *lastName = firstName + mir_strlen(firstName) + 1;
char *jid = lastName + mir_strlen(lastName) + 1;
- debugLog(_T("Send 'authorization allowed' to %s"), jid);
+ debugLog(L"Send 'authorization allowed' to %s", jid);
TCHAR *newJid = (dbei.flags & DBEF_UTF) ? mir_utf8decodeT(jid) : mir_a2t(jid);
- m_ThreadInfo->send(XmlNode(_T("presence")) << XATTR(_T("to"), newJid) << XATTR(_T("type"), _T("subscribed")));
+ m_ThreadInfo->send(XmlNode(L"presence") << XATTR(L"to", newJid) << XATTR(L"type", L"subscribed"));
// Automatically add this user to my roster if option is enabled
if (m_options.AutoAdd == TRUE) {
JABBER_LIST_ITEM *item;
if ((item = ListGetItemPtr(LIST_ROSTER, newJid)) == NULL || (item->subscription != SUB_BOTH && item->subscription != SUB_TO)) {
- debugLog(_T("Try adding contact automatically jid = %s"), jid);
+ debugLog(L"Try adding contact automatically jid = %s", jid);
if (MCONTACT hContact = AddToListByJID(newJid, 0)) {
// Trigger actual add by removing the "NotOnList" added by AddToListByJID()
// See AddToListByJID() and JabberDbSettingChanged().
@@ -430,7 +430,7 @@ int CJabberProto::AuthDeny(MEVENT hDbEvent, const TCHAR*)
debugLogA("Send 'authorization denied' to %s", jid);
ptrT newJid(dbei.flags & DBEF_UTF ? mir_utf8decodeT(jid) : mir_a2t(jid));
- m_ThreadInfo->send(XmlNode(_T("presence")) << XATTR(_T("to"), newJid) << XATTR(_T("type"), _T("unsubscribed")));
+ m_ThreadInfo->send(XmlNode(L"presence") << XATTR(L"to", newJid) << XATTR(L"type", L"unsubscribed"));
return 0;
}
@@ -502,16 +502,16 @@ int __cdecl CJabberProto::FileDeny(MCONTACT, HANDLE hTransfer, const TCHAR *)
switch (ft->type) {
case FT_OOB:
- m_ThreadInfo->send(XmlNodeIq(_T("error"), ft->szId, ft->jid) << XCHILD(_T("error"), _T("File transfer refused")) << XATTRI(_T("code"), 406));
+ m_ThreadInfo->send(XmlNodeIq(L"error", ft->szId, ft->jid) << XCHILD(L"error", L"File transfer refused") << XATTRI(L"code", 406));
break;
case FT_BYTESTREAM:
case FT_IBB:
m_ThreadInfo->send(
- XmlNodeIq(_T("error"), ft->szId, ft->jid)
- << XCHILD(_T("error"), _T("File transfer refused")) << XATTRI(_T("code"), 403) << XATTR(_T("type"), _T("cancel"))
- << XCHILDNS(_T("forbidden"), _T("urn:ietf:params:xml:ns:xmpp-stanzas"))
- << XCHILD(_T("text"), _T("File transfer refused")) << XATTR(_T("xmlns"), _T("urn:ietf:params:xml:ns:xmpp-stanzas")));
+ XmlNodeIq(L"error", ft->szId, ft->jid)
+ << XCHILD(L"error", L"File transfer refused") << XATTRI(L"code", 403) << XATTR(L"type", L"cancel")
+ << XCHILDNS(L"forbidden", L"urn:ietf:params:xml:ns:xmpp-stanzas")
+ << XCHILD(L"text", L"File transfer refused") << XATTR(L"xmlns", L"urn:ietf:params:xml:ns:xmpp-stanzas"));
break;
}
delete ft;
@@ -580,7 +580,7 @@ int __cdecl CJabberProto::GetInfo(MCONTACT hContact, int /*infoType*/)
if (m_ThreadInfo) {
m_ThreadInfo->send(
XmlNodeIq(AddIQ(&CJabberProto::OnIqResultEntityTime, JABBER_IQ_TYPE_GET, jid, JABBER_IQ_PARSE_HCONTACT))
- << XCHILDNS(_T("time"), JABBER_FEAT_ENTITY_TIME));
+ << XCHILDNS(L"time", JABBER_FEAT_ENTITY_TIME));
// XEP-0012, last logoff time
XmlNodeIq iq2(AddIQ(&CJabberProto::OnIqResultLastActivity, JABBER_IQ_TYPE_GET, jid, JABBER_IQ_PARSE_FROM));
@@ -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]);
TCHAR tmp[JABBER_MAX_JID_LEN];
- mir_sntprintf(tmp, _T("%s/%s"), szBareJid, r->m_tszResourceName);
+ mir_sntprintf(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));
@@ -661,8 +661,8 @@ void __cdecl CJabberProto::BasicSearchThread(JABBER_SEARCH_BASIC *jsb)
psr.cbSize = sizeof(psr);
psr.flags = PSR_TCHAR;
psr.nick.t = jsb->jid;
- psr.firstName.t = _T("");
- psr.lastName.t = _T("");
+ psr.firstName.t = L"";
+ psr.lastName.t = L"";
psr.id.t = jsb->jid;
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)jsb->hSearch, (LPARAM)&psr);
@@ -672,7 +672,7 @@ void __cdecl CJabberProto::BasicSearchThread(JABBER_SEARCH_BASIC *jsb)
HANDLE __cdecl CJabberProto::SearchBasic(const TCHAR *szJid)
{
- debugLog(_T("JabberBasicSearch called with lParam = '%s'"), szJid);
+ debugLog(L"JabberBasicSearch called with lParam = '%s'", szJid);
JABBER_SEARCH_BASIC *jsb;
if (!m_bJabberOnline || (jsb = (JABBER_SEARCH_BASIC*)mir_alloc(sizeof(JABBER_SEARCH_BASIC))) == NULL)
@@ -689,19 +689,19 @@ HANDLE __cdecl CJabberProto::SearchBasic(const TCHAR *szJid)
mir_free(szServer);
szServer = getTStringA(NULL, "LoginServer");
if (szServer == NULL)
- szServer = mir_tstrdup(_T("jabber.org"));
- else if (numericjid && !mir_tstrcmpi(szServer, _T("S.ms"))) {
+ szServer = mir_tstrdup(L"jabber.org");
+ else if (numericjid && !mir_tstrcmpi(szServer, L"S.ms")) {
mir_free(szServer);
- szServer = mir_tstrdup(_T("sms"));
+ szServer = mir_tstrdup(L"sms");
}
- mir_sntprintf(jsb->jid, _T("%s@%s"), szJid, szServer);
+ mir_sntprintf(jsb->jid, L"%s@%s", szJid, szServer);
}
else _tcsncpy_s(jsb->jid, szJid, _TRUNCATE);
mir_free(szServer);
}
else _tcsncpy_s(jsb->jid, szJid, _TRUNCATE);
- debugLog(_T("Adding '%s' without validation"), jsb->jid);
+ debugLog(L"Adding '%s' without validation", jsb->jid);
jsb->hSearch = SerialNext();
ForkThread((MyThreadFunc)&CJabberProto::BasicSearchThread, jsb);
return (HANDLE)jsb->hSearch;
@@ -719,7 +719,7 @@ HANDLE __cdecl CJabberProto::SearchByEmail(const TCHAR *email)
LPCSTR jid = szServerName == 0 ? "users.jabber.org" : szServerName;
CJabberIqInfo *pInfo = AddIQ(&CJabberProto::OnIqResultSetSearch, JABBER_IQ_TYPE_SET, _A2T(jid));
- m_ThreadInfo->send(XmlNodeIq(pInfo) << XQUERY(_T("jabber:iq:search")) << XCHILD(_T("email"), email));
+ m_ThreadInfo->send(XmlNodeIq(pInfo) << XQUERY(L"jabber:iq:search") << XCHILD(L"email", email));
return (HANDLE)pInfo->GetIqId();
}
@@ -739,31 +739,31 @@ HANDLE __cdecl CJabberProto::SearchByName(const TCHAR *nick, const TCHAR *firstN
(bIsExtFormat) ? &CJabberProto::OnIqResultExtSearch : &CJabberProto::OnIqResultSetSearch,
JABBER_IQ_TYPE_SET, _A2T(szServerName == 0 ? "users.jabber.org" : szServerName));
XmlNodeIq iq(pInfo);
- HXML query = iq << XQUERY(_T("jabber:iq:search"));
+ HXML query = iq << XQUERY(L"jabber:iq:search");
if (bIsExtFormat) {
if (m_tszSelectedLang)
- iq << XATTR(_T("xml:lang"), m_tszSelectedLang);
+ iq << XATTR(L"xml:lang", m_tszSelectedLang);
- HXML x = query << XCHILDNS(_T("x"), JABBER_FEAT_DATA_FORMS) << XATTR(_T("type"), _T("submit"));
+ HXML x = query << XCHILDNS(L"x", JABBER_FEAT_DATA_FORMS) << XATTR(L"type", L"submit");
if (nick[0] != '\0')
- x << XCHILD(_T("field")) << XATTR(_T("var"), _T("user")) << XATTR(_T("value"), nick);
+ x << XCHILD(L"field") << XATTR(L"var", L"user") << XATTR(L"value", nick);
if (firstName[0] != '\0')
- x << XCHILD(_T("field")) << XATTR(_T("var"), _T("fn")) << XATTR(_T("value"), firstName);
+ x << XCHILD(L"field") << XATTR(L"var", L"fn") << XATTR(L"value", firstName);
if (lastName[0] != '\0')
- x << XCHILD(_T("field")) << XATTR(_T("var"), _T("given")) << XATTR(_T("value"), lastName);
+ x << XCHILD(L"field") << XATTR(L"var", L"given") << XATTR(L"value", lastName);
}
else {
if (nick[0] != '\0')
- query << XCHILD(_T("nick"), nick);
+ query << XCHILD(L"nick", nick);
if (firstName[0] != '\0')
- query << XCHILD(_T("first"), firstName);
+ query << XCHILD(L"first", firstName);
if (lastName[0] != '\0')
- query << XCHILD(_T("last"), lastName);
+ query << XCHILD(L"last", lastName);
}
m_ThreadInfo->send(iq);
@@ -798,16 +798,16 @@ int __cdecl CJabberProto::SendContacts(MCONTACT hContact, int, int nContacts, MC
if (~jcb & JABBER_CAPS_ROSTER_EXCHANGE)
return 0;
- XmlNode m(_T("message"));
- HXML x = m << XCHILDNS(_T("x"), JABBER_FEAT_ROSTER_EXCHANGE);
+ XmlNode m(L"message");
+ HXML x = m << XCHILDNS(L"x", JABBER_FEAT_ROSTER_EXCHANGE);
for (int i = 0; i < nContacts; i++) {
ptrT jid(getTStringA(hContactsList[i], "jid"));
if (jid != NULL)
- x << XCHILD(_T("item")) << XATTR(_T("action"), _T("add")) << XATTR(_T("jid"), jid);
+ x << XCHILD(L"item") << XATTR(L"action", L"add") << XATTR(L"jid", jid);
}
- m << XATTR(_T("to"), szClientJid) << XATTRID(SerialNext());
+ m << XATTR(L"to", szClientJid) << XATTRID(SerialNext());
m_ThreadInfo->send(m);
return 1;
}
@@ -873,7 +873,7 @@ HANDLE __cdecl CJabberProto::SendFile(MCONTACT hContact, const TCHAR *szDescript
int i, j;
for (i = j = 0; i < ft->std.totalFiles; i++) {
if (_tstati64(ppszFiles[i], &statbuf))
- debugLog(_T("'%s' is an invalid filename"), ppszFiles[i]);
+ debugLog(L"'%s' is an invalid filename", ppszFiles[i]);
else {
ft->std.ptszFiles[j] = mir_tstrdup(ppszFiles[i]);
ft->fileSize[j] = statbuf.st_size;
@@ -954,16 +954,16 @@ int __cdecl CJabberProto::SendMsg(MCONTACT hContact, int, const char* pszSrc)
TCHAR *msgType;
if (ListGetItemPtr(LIST_CHATROOM, szClientJid) && _tcschr(szClientJid, '/') == NULL)
- msgType = _T("groupchat");
+ msgType = L"groupchat";
else
- msgType = _T("chat");
+ msgType = L"chat";
- XmlNode m(_T("message")); XmlAddAttr(m, _T("type"), msgType);
+ XmlNode m(L"message"); XmlAddAttr(m, L"type", msgType);
if (!isEncrypted)
- m << XCHILD(_T("body"), msg);
+ m << XCHILD(L"body", msg);
else {
- m << XCHILD(_T("body"), _T("[This message is encrypted.]"));
- m << XCHILD(_T("x"), msg) << XATTR(_T("xmlns"), _T("jabber:x:encrypted"));
+ m << XCHILD(L"body", L"[This message is encrypted.]");
+ m << XCHILD(L"x", msg) << XATTR(L"xmlns", L"jabber:x:encrypted");
}
mir_free(msg);
@@ -977,7 +977,7 @@ int __cdecl CJabberProto::SendMsg(MCONTACT hContact, int, const char* pszSrc)
jcb = JABBER_RESOURCE_CAPS_NONE;
if (jcb & JABBER_CAPS_CHATSTATES)
- m << XCHILDNS(_T("active"), JABBER_FEAT_CHATSTATES);
+ m << XCHILDNS(L"active", JABBER_FEAT_CHATSTATES);
if (
// if message delivery check disabled by entity caps manager
@@ -985,29 +985,29 @@ 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, _T("groupchat")) ||
+ !mir_tstrcmp(msgType, L"groupchat") ||
// if message delivery check disabled in settings
!m_options.MsgAck || !getByte(hContact, "MsgAck", TRUE))
{
- if (!mir_tstrcmp(msgType, _T("groupchat")))
- XmlAddAttr(m, _T("to"), szClientJid);
+ if (!mir_tstrcmp(msgType, L"groupchat"))
+ XmlAddAttr(m, L"to", szClientJid);
else {
id = SerialNext();
- XmlAddAttr(m, _T("to"), szClientJid); XmlAddAttrID(m, id);
+ XmlAddAttr(m, L"to", szClientJid); XmlAddAttrID(m, id);
}
m_ThreadInfo->send(m);
ForkThread(&CJabberProto::SendMessageAckThread, new TFakeAckParams(hContact, 0, id));
}
else {
- XmlAddAttr(m, _T("to"), szClientJid); XmlAddAttrID(m, id);
+ XmlAddAttr(m, L"to", szClientJid); XmlAddAttrID(m, id);
// message receipts XEP priority
if (jcb & JABBER_CAPS_MESSAGE_RECEIPTS)
- m << XCHILDNS(_T("request"), JABBER_FEAT_MESSAGE_RECEIPTS);
+ m << XCHILDNS(L"request", JABBER_FEAT_MESSAGE_RECEIPTS);
else if (jcb & JABBER_CAPS_MESSAGE_EVENTS) {
- HXML x = m << XCHILDNS(_T("x"), JABBER_FEAT_MESSAGE_EVENTS);
- x << XCHILD(_T("delivered")); x << XCHILD(_T("offline"));
+ HXML x = m << XCHILDNS(L"x", JABBER_FEAT_MESSAGE_EVENTS);
+ x << XCHILD(L"delivered"); x << XCHILD(L"offline");
}
m_ThreadInfo->send(m);
@@ -1038,7 +1038,7 @@ int __cdecl CJabberProto::SetApparentMode(MCONTACT hContact, int mode)
switch (mode) {
case ID_STATUS_ONLINE:
if (m_iStatus == ID_STATUS_INVISIBLE || oldMode == ID_STATUS_OFFLINE)
- m_ThreadInfo->send(XmlNode(_T("presence")) << XATTR(_T("to"), jid));
+ m_ThreadInfo->send(XmlNode(L"presence") << XATTR(L"to", jid));
break;
case ID_STATUS_OFFLINE:
if (m_iStatus != ID_STATUS_INVISIBLE || oldMode == ID_STATUS_ONLINE)
@@ -1124,11 +1124,11 @@ 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, _T("\r\n"));
+ if (str[0] != '\0') mir_tstrcat(str, L"\r\n");
if (msgCount > 1) {
- mir_tstrcat(str, _T("("));
+ mir_tstrcat(str, L"(");
mir_tstrcat(str, r->m_tszResourceName);
- mir_tstrcat(str, _T("): "));
+ mir_tstrcat(str, L"): ");
}
mir_tstrcat(str, r->m_tszStatusMessage);
}
@@ -1162,7 +1162,7 @@ HANDLE __cdecl CJabberProto::GetAwayMsg(MCONTACT hContact)
int __cdecl CJabberProto::SetAwayMsg(int status, const TCHAR *msg)
{
- debugLog(_T("SetAwayMsg called, wParam=%d lParam=%s"), status, msg);
+ debugLog(L"SetAwayMsg called, wParam=%d lParam=%s", status, msg);
TCHAR **szMsg;
mir_cslockfull lck(m_csModeMsgMutex);
@@ -1229,32 +1229,32 @@ int __cdecl CJabberProto::UserIsTyping(MCONTACT hContact, int type)
if (jcb & JABBER_RESOURCE_CAPS_ERROR)
jcb = JABBER_RESOURCE_CAPS_NONE;
- XmlNode m(_T("message")); XmlAddAttr(m, _T("to"), szClientJid);
+ XmlNode m(L"message"); XmlAddAttr(m, L"to", szClientJid);
if (jcb & JABBER_CAPS_CHATSTATES) {
- m << XATTR(_T("type"), _T("chat")) << XATTRID(SerialNext());
+ m << XATTR(L"type", L"chat") << XATTRID(SerialNext());
switch (type) {
case PROTOTYPE_SELFTYPING_OFF:
- m << XCHILDNS(_T("paused"), JABBER_FEAT_CHATSTATES);
+ m << XCHILDNS(L"paused", JABBER_FEAT_CHATSTATES);
m_ThreadInfo->send(m);
break;
case PROTOTYPE_SELFTYPING_ON:
- m << XCHILDNS(_T("composing"), JABBER_FEAT_CHATSTATES);
+ m << XCHILDNS(L"composing", JABBER_FEAT_CHATSTATES);
m_ThreadInfo->send(m);
break;
}
}
else if (jcb & JABBER_CAPS_MESSAGE_EVENTS) {
- HXML x = m << XCHILDNS(_T("x"), JABBER_FEAT_MESSAGE_EVENTS);
+ HXML x = m << XCHILDNS(L"x", JABBER_FEAT_MESSAGE_EVENTS);
if (item->messageEventIdStr != NULL)
- x << XCHILD(_T("id"), item->messageEventIdStr);
+ x << XCHILD(L"id", item->messageEventIdStr);
switch (type) {
case PROTOTYPE_SELFTYPING_OFF:
m_ThreadInfo->send(m);
break;
case PROTOTYPE_SELFTYPING_ON:
- x << XCHILD(_T("composing"));
+ x << XCHILD(L"composing");
m_ThreadInfo->send(m);
break;
}
diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp
index 492d24b3df..c851f55959 100644
--- a/protocols/JabberG/src/jabber_rc.cpp
+++ b/protocols/JabberG/src/jabber_rc.cpp
@@ -36,7 +36,7 @@ CJabberAdhocSession::CJabberAdhocSession(CJabberProto* global)
m_bAutofreeUserData = FALSE;
m_dwStage = 0;
ppro = global;
- m_szSessionId.Format(_T("%u%u"), ppro->SerialNext(), GetTickCount());
+ m_szSessionId.Format(L"%u%u", ppro->SerialNext(), GetTickCount());
m_dwStartTime = GetTickCount();
}
@@ -58,7 +58,7 @@ BOOL CJabberProto::HandleAdhocCommandRequest(HXML iqNode, CJabberIqInfo *pInfo)
return TRUE;
}
- const TCHAR *szNode = XmlGetAttrValue(pInfo->GetChildNode(), _T("node"));
+ const TCHAR *szNode = XmlGetAttrValue(pInfo->GetChildNode(), L"node");
if (!szNode)
return TRUE;
@@ -72,8 +72,8 @@ BOOL CJabberAdhocManager::HandleItemsRequest(HXML, CJabberIqInfo *pInfo, const T
return FALSE;
if (!mir_tstrcmp(szNode, JABBER_FEAT_COMMANDS)) {
- XmlNodeIq iq(_T("result"), pInfo);
- HXML resultQuery = iq << XQUERY(JABBER_FEAT_DISCO_ITEMS) << XATTR(_T("node"), JABBER_FEAT_COMMANDS);
+ XmlNodeIq iq(L"result", pInfo);
+ HXML resultQuery = iq << XQUERY(JABBER_FEAT_DISCO_ITEMS) << XATTR(L"node", JABBER_FEAT_COMMANDS);
{
mir_cslock lck(m_cs);
@@ -83,8 +83,8 @@ BOOL CJabberAdhocManager::HandleItemsRequest(HXML, CJabberIqInfo *pInfo, const T
if (!szJid)
szJid = m_pProto->m_ThreadInfo->fullJID;
- resultQuery << XCHILD(_T("item")) << XATTR(_T("jid"), szJid)
- << XATTR(_T("node"), pNode->GetNode()) << XATTR(_T("name"), pNode->GetName());
+ resultQuery << XCHILD(L"item") << XATTR(L"jid", szJid)
+ << XATTR(L"node", pNode->GetNode()) << XATTR(L"name", pNode->GetName());
pNode = pNode->GetNext();
}
@@ -103,15 +103,15 @@ BOOL CJabberAdhocManager::HandleInfoRequest(HXML, CJabberIqInfo *pInfo, const TC
// FIXME: same code twice
if (!mir_tstrcmp(szNode, JABBER_FEAT_COMMANDS)) {
- XmlNodeIq iq(_T("result"), pInfo);
- HXML resultQuery = iq << XQUERY(JABBER_FEAT_DISCO_INFO) << XATTR(_T("node"), JABBER_FEAT_COMMANDS);
- resultQuery << XCHILD(_T("identity")) << XATTR(_T("name"), _T("Ad-hoc commands"))
- << XATTR(_T("category"), _T("automation")) << XATTR(_T("type"), _T("command-node"));
+ 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")
+ << XATTR(L"category", L"automation") << XATTR(L"type", L"command-node");
- resultQuery << XCHILD(_T("feature")) << XATTR(_T("var"), JABBER_FEAT_COMMANDS);
- resultQuery << XCHILD(_T("feature")) << XATTR(_T("var"), JABBER_FEAT_DATA_FORMS);
- resultQuery << XCHILD(_T("feature")) << XATTR(_T("var"), JABBER_FEAT_DISCO_INFO);
- resultQuery << XCHILD(_T("feature")) << XATTR(_T("var"), JABBER_FEAT_DISCO_ITEMS);
+ resultQuery << XCHILD(L"feature") << XATTR(L"var", JABBER_FEAT_COMMANDS);
+ resultQuery << XCHILD(L"feature") << XATTR(L"var", JABBER_FEAT_DATA_FORMS);
+ resultQuery << XCHILD(L"feature") << XATTR(L"var", JABBER_FEAT_DISCO_INFO);
+ resultQuery << XCHILD(L"feature") << XATTR(L"var", JABBER_FEAT_DISCO_ITEMS);
m_pProto->m_ThreadInfo->send(iq);
return TRUE;
@@ -122,14 +122,14 @@ BOOL CJabberAdhocManager::HandleInfoRequest(HXML, CJabberIqInfo *pInfo, const TC
if (pNode == NULL)
return FALSE;
- XmlNodeIq iq(_T("result"), pInfo);
- HXML resultQuery = iq << XQUERY(JABBER_FEAT_DISCO_INFO) << XATTR(_T("node"), JABBER_FEAT_DISCO_INFO);
- resultQuery << XCHILD(_T("identity")) << XATTR(_T("name"), pNode->GetName())
- << XATTR(_T("category"), _T("automation")) << XATTR(_T("type"), _T("command-node"));
+ XmlNodeIq iq(L"result", pInfo);
+ HXML resultQuery = iq << XQUERY(JABBER_FEAT_DISCO_INFO) << XATTR(L"node", JABBER_FEAT_DISCO_INFO);
+ resultQuery << XCHILD(L"identity") << XATTR(L"name", pNode->GetName())
+ << XATTR(L"category", L"automation") << XATTR(L"type", L"command-node");
- resultQuery << XCHILD(_T("feature")) << XATTR(_T("var"), JABBER_FEAT_COMMANDS);
- resultQuery << XCHILD(_T("feature")) << XATTR(_T("var"), JABBER_FEAT_DATA_FORMS);
- resultQuery << XCHILD(_T("feature")) << XATTR(_T("var"), JABBER_FEAT_DISCO_INFO);
+ resultQuery << XCHILD(L"feature") << XATTR(L"var", JABBER_FEAT_COMMANDS);
+ resultQuery << XCHILD(L"feature") << XATTR(L"var", JABBER_FEAT_DATA_FORMS);
+ resultQuery << XCHILD(L"feature") << XATTR(L"var", JABBER_FEAT_DISCO_INFO);
lck.unlock();
m_pProto->m_ThreadInfo->send(iq);
return TRUE;
@@ -147,14 +147,14 @@ BOOL CJabberAdhocManager::HandleCommandRequest(HXML iqNode, CJabberIqInfo *pInfo
lck.unlock();
m_pProto->m_ThreadInfo->send(
- XmlNodeIq(_T("error"), pInfo)
- << XCHILD(_T("error")) << XATTR(_T("type"), _T("cancel"))
- << XCHILDNS(_T("item-not-found"), _T("urn:ietf:params:xml:ns:xmpp-stanzas")));
+ XmlNodeIq(L"error", pInfo)
+ << XCHILD(L"error") << XATTR(L"type", L"cancel")
+ << XCHILDNS(L"item-not-found", L"urn:ietf:params:xml:ns:xmpp-stanzas"));
return FALSE;
}
- const TCHAR *szSessionId = XmlGetAttrValue(commandNode, _T("sessionid"));
+ const TCHAR *szSessionId = XmlGetAttrValue(commandNode, L"sessionid");
CJabberAdhocSession* pSession = NULL;
if (szSessionId) {
@@ -162,10 +162,10 @@ BOOL CJabberAdhocManager::HandleCommandRequest(HXML iqNode, CJabberIqInfo *pInfo
if (!pSession) {
lck.unlock();
- XmlNodeIq iq(_T("error"), pInfo);
- HXML errorNode = iq << XCHILD(_T("error")) << XATTR(_T("type"), _T("modify"));
- errorNode << XCHILDNS(_T("bad-request"), _T("urn:ietf:params:xml:ns:xmpp-stanzas"));
- errorNode << XCHILDNS(_T("bad-sessionid"), JABBER_FEAT_COMMANDS);
+ XmlNodeIq iq(L"error", pInfo);
+ HXML errorNode = iq << XCHILD(L"error") << XATTR(L"type", L"modify");
+ errorNode << XCHILDNS(L"bad-request", L"urn:ietf:params:xml:ns:xmpp-stanzas");
+ errorNode << XCHILDNS(L"bad-sessionid", JABBER_FEAT_COMMANDS);
m_pProto->m_ThreadInfo->send(iq);
return FALSE;
}
@@ -177,9 +177,9 @@ BOOL CJabberAdhocManager::HandleCommandRequest(HXML iqNode, CJabberIqInfo *pInfo
lck.unlock();
m_pProto->m_ThreadInfo->send(
- XmlNodeIq(_T("error"), pInfo)
- << XCHILD(_T("error")) << XATTR(_T("type"), _T("cancel"))
- << XCHILDNS(_T("forbidden"), _T("urn:ietf:params:xml:ns:xmpp-stanzas")));
+ XmlNodeIq(L"error", pInfo)
+ << XCHILD(L"error") << XATTR(L"type", L"cancel")
+ << XCHILDNS(L"forbidden", L"urn:ietf:params:xml:ns:xmpp-stanzas"));
return FALSE;
}
@@ -190,20 +190,20 @@ BOOL CJabberAdhocManager::HandleCommandRequest(HXML iqNode, CJabberIqInfo *pInfo
if (nResultCode == JABBER_ADHOC_HANDLER_STATUS_COMPLETED) {
m_pProto->m_ThreadInfo->send(
- XmlNodeIq(_T("result"), pInfo)
- << XCHILDNS(_T("command"), JABBER_FEAT_COMMANDS) << XATTR(_T("node"), szNode)
- << XATTR(_T("sessionid"), pSession->GetSessionId()) << XATTR(_T("status"), _T("completed"))
- << XCHILD(_T("note"), TranslateT("Command completed successfully")) << XATTR(_T("type"), _T("info")));
+ XmlNodeIq(L"result", pInfo)
+ << XCHILDNS(L"command", JABBER_FEAT_COMMANDS) << XATTR(L"node", szNode)
+ << XATTR(L"sessionid", pSession->GetSessionId()) << XATTR(L"status", L"completed")
+ << XCHILD(L"note", TranslateT("Command completed successfully")) << XATTR(L"type", L"info"));
RemoveSession(pSession);
pSession = NULL;
}
else if (nResultCode == JABBER_ADHOC_HANDLER_STATUS_CANCEL) {
m_pProto->m_ThreadInfo->send(
- XmlNodeIq(_T("result"), pInfo)
- << XCHILDNS(_T("command"), JABBER_FEAT_COMMANDS) << XATTR(_T("node"), szNode)
- << XATTR(_T("sessionid"), pSession->GetSessionId()) << XATTR(_T("status"), _T("canceled"))
- << XCHILD(_T("note"), TranslateT("Error occurred during processing command")) << XATTR(_T("type"), _T("error")));
+ XmlNodeIq(L"result", pInfo)
+ << XCHILDNS(L"command", JABBER_FEAT_COMMANDS) << XATTR(L"node", szNode)
+ << XATTR(L"sessionid", pSession->GetSessionId()) << XATTR(L"status", L"canceled")
+ << XCHILD(L"note", TranslateT("Error occurred during processing command")) << XATTR(L"type", L"error"));
RemoveSession(pSession);
pSession = NULL;
@@ -257,74 +257,74 @@ int CJabberProto::AdhocSetStatusHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhoc
// first form
pSession->SetStage(1);
- XmlNodeIq iq(_T("result"), pInfo);
+ XmlNodeIq iq(L"result", pInfo);
HXML xNode = iq
- << XCHILDNS(_T("command"), JABBER_FEAT_COMMANDS) << XATTR(_T("node"), JABBER_FEAT_RC_SET_STATUS)
- << XATTR(_T("sessionid"), pSession->GetSessionId()) << XATTR(_T("status"), _T("executing"))
- << XCHILDNS(_T("x"), JABBER_FEAT_DATA_FORMS) << XATTR(_T("type"), _T("form"));
+ << XCHILDNS(L"command", JABBER_FEAT_COMMANDS) << XATTR(L"node", JABBER_FEAT_RC_SET_STATUS)
+ << XATTR(L"sessionid", pSession->GetSessionId()) << XATTR(L"status", L"executing")
+ << XCHILDNS(L"x", JABBER_FEAT_DATA_FORMS) << XATTR(L"type", L"form");
- xNode << XCHILD(_T("title"), TranslateT("Change Status"));
- xNode << XCHILD(_T("instructions"), TranslateT("Choose the status and status message"));
+ xNode << XCHILD(L"title", TranslateT("Change Status"));
+ xNode << XCHILD(L"instructions", TranslateT("Choose the status and status message"));
- xNode << XCHILD(_T("field")) << XATTR(_T("type"), _T("hidden")) << XATTR(_T("var"), _T("FORM_TYPE"))
- << XATTR(_T("value"), JABBER_FEAT_RC);
+ xNode << XCHILD(L"field") << XATTR(L"type", L"hidden") << XATTR(L"var", L"FORM_TYPE")
+ << XATTR(L"value", JABBER_FEAT_RC);
- HXML fieldNode = xNode << XCHILD(_T("field")) << XATTR(_T("label"), TranslateT("Status"))
- << XATTR(_T("type"), _T("list-single")) << XATTR(_T("var"), _T("status"));
+ HXML fieldNode = xNode << XCHILD(L"field") << XATTR(L"label", TranslateT("Status"))
+ << XATTR(L"type", L"list-single") << XATTR(L"var", L"status");
- fieldNode << XCHILD(_T("required"));
+ fieldNode << XCHILD(L"required");
int status = CallService(MS_CLIST_GETSTATUSMODE, 0, 0);
switch (status) {
case ID_STATUS_INVISIBLE:
- fieldNode << XCHILD(_T("value"), _T("invisible"));
+ fieldNode << XCHILD(L"value", L"invisible");
break;
case ID_STATUS_AWAY:
case ID_STATUS_ONTHEPHONE:
case ID_STATUS_OUTTOLUNCH:
- fieldNode << XCHILD(_T("value"), _T("away"));
+ fieldNode << XCHILD(L"value", L"away");
break;
case ID_STATUS_NA:
- fieldNode << XCHILD(_T("value"), _T("xa"));
+ fieldNode << XCHILD(L"value", L"xa");
break;
case ID_STATUS_DND:
case ID_STATUS_OCCUPIED:
- fieldNode << XCHILD(_T("value"), _T("dnd"));
+ fieldNode << XCHILD(L"value", L"dnd");
break;
case ID_STATUS_FREECHAT:
- fieldNode << XCHILD(_T("value"), _T("chat"));
+ fieldNode << XCHILD(L"value", L"chat");
break;
case ID_STATUS_ONLINE:
default:
- fieldNode << XCHILD(_T("value"), _T("online"));
+ fieldNode << XCHILD(L"value", L"online");
break;
}
- fieldNode << XCHILD(_T("option")) << XATTR(_T("label"), TranslateT("Free for chat")) << XCHILD(_T("value"), _T("chat"));
- fieldNode << XCHILD(_T("option")) << XATTR(_T("label"), TranslateT("Online")) << XCHILD(_T("value"), _T("online"));
- fieldNode << XCHILD(_T("option")) << XATTR(_T("label"), TranslateT("Away")) << XCHILD(_T("value"), _T("away"));
- fieldNode << XCHILD(_T("option")) << XATTR(_T("label"), TranslateT("Extended away (Not available)")) << XCHILD(_T("value"), _T("xa"));
- fieldNode << XCHILD(_T("option")) << XATTR(_T("label"), TranslateT("Do not disturb")) << XCHILD(_T("value"), _T("dnd"));
- fieldNode << XCHILD(_T("option")) << XATTR(_T("label"), TranslateT("Invisible")) << XCHILD(_T("value"), _T("invisible"));
- fieldNode << XCHILD(_T("option")) << XATTR(_T("label"), TranslateT("Offline")) << XCHILD(_T("value"), _T("offline"));
+ fieldNode << XCHILD(L"option") << XATTR(L"label", TranslateT("Free for chat")) << XCHILD(L"value", L"chat");
+ fieldNode << XCHILD(L"option") << XATTR(L"label", TranslateT("Online")) << XCHILD(L"value", L"online");
+ fieldNode << XCHILD(L"option") << XATTR(L"label", TranslateT("Away")) << XCHILD(L"value", L"away");
+ fieldNode << XCHILD(L"option") << XATTR(L"label", TranslateT("Extended away (Not available)")) << XCHILD(L"value", L"xa");
+ fieldNode << XCHILD(L"option") << XATTR(L"label", TranslateT("Do not disturb")) << XCHILD(L"value", L"dnd");
+ fieldNode << XCHILD(L"option") << XATTR(L"label", TranslateT("Invisible")) << XCHILD(L"value", L"invisible");
+ fieldNode << XCHILD(L"option") << XATTR(L"label", TranslateT("Offline")) << XCHILD(L"value", L"offline");
// priority
TCHAR szPriority[ 256 ];
- mir_sntprintf(szPriority, _T("%d"), (int)getDword("Priority", 5));
- xNode << XCHILD(_T("field")) << XATTR(_T("label"), TranslateT("Priority")) << XATTR(_T("type"), _T("text-single"))
- << XATTR(_T("var"), _T("status-priority")) << XCHILD(_T("value"), szPriority);
+ mir_sntprintf(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);
// status message text
- xNode << XCHILD(_T("field")) << XATTR(_T("label"), TranslateT("Status message"))
- << XATTR(_T("type"), _T("text-multi")) << XATTR(_T("var"), _T("status-message"));
+ xNode << XCHILD(L"field") << XATTR(L"label", TranslateT("Status message"))
+ << XATTR(L"type", L"text-multi") << XATTR(L"var", L"status-message");
// global status
- fieldNode = xNode << XCHILD(_T("field")) << XATTR(_T("label"), TranslateT("Change global status"))
- << XATTR(_T("type"), _T("boolean")) << XATTR(_T("var"), _T("status-global"));
+ 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((TCHAR*)CallService(MS_AWAYMSG_GETSTATUSMSGT, status, 0));
if (tszStatusMsg)
- fieldNode << XCHILD(_T("value"), tszStatusMsg);
+ fieldNode << XCHILD(L"value", tszStatusMsg);
m_ThreadInfo->send(iq);
return JABBER_ADHOC_HANDLER_STATUS_EXECUTING;
@@ -337,7 +337,7 @@ int CJabberProto::AdhocSetStatusHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhoc
if (!xNode)
return JABBER_ADHOC_HANDLER_STATUS_CANCEL;
- HXML fieldNode = XmlGetChildByTag(xNode, "field", "var", _T("status")), valueNode;
+ HXML fieldNode = XmlGetChildByTag(xNode, "field", "var", L"status"), valueNode;
if (!fieldNode)
return JABBER_ADHOC_HANDLER_STATUS_CANCEL;
@@ -346,19 +346,19 @@ int CJabberProto::AdhocSetStatusHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhoc
return JABBER_ADHOC_HANDLER_STATUS_CANCEL;
int status;
- if (!mir_tstrcmp(ptszValue, _T("away"))) status = ID_STATUS_AWAY;
- else if (!mir_tstrcmp(ptszValue, _T("xa"))) status = ID_STATUS_NA;
- else if (!mir_tstrcmp(ptszValue, _T("dnd"))) status = ID_STATUS_DND;
- else if (!mir_tstrcmp(ptszValue, _T("chat"))) status = ID_STATUS_FREECHAT;
- else if (!mir_tstrcmp(ptszValue, _T("online"))) status = ID_STATUS_ONLINE;
- else if (!mir_tstrcmp(ptszValue, _T("invisible"))) status = ID_STATUS_INVISIBLE;
- else if (!mir_tstrcmp(ptszValue, _T("offline"))) status = ID_STATUS_OFFLINE;
+ 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;
else
return JABBER_ADHOC_HANDLER_STATUS_CANCEL;
int priority = -9999;
- fieldNode = XmlGetChildByTag(xNode, "field", "var", _T("status-priority"));
+ fieldNode = XmlGetChildByTag(xNode, "field", "var", L"status-priority");
if (fieldNode && (valueNode = XmlGetChild(fieldNode , "value")))
if (ptszValue = XmlGetText(valueNode))
priority = _ttoi(ptszValue);
@@ -367,7 +367,7 @@ int CJabberProto::AdhocSetStatusHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhoc
setDword("Priority", priority);
const TCHAR *szStatusMessage = NULL;
- fieldNode = XmlGetChildByTag(xNode, "field", "var", _T("status-message"));
+ fieldNode = XmlGetChildByTag(xNode, "field", "var", L"status-message");
if (fieldNode && (valueNode = XmlGetChild(fieldNode , "value")))
szStatusMessage = XmlGetText(valueNode);
@@ -375,9 +375,9 @@ int CJabberProto::AdhocSetStatusHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhoc
int nNoDlg = db_get_b(NULL, "SRAway", StatusModeToDbSetting(status, "NoDlg"), 0);
db_set_b(NULL, "SRAway", StatusModeToDbSetting(status, "NoDlg"), 1);
- db_set_ts(NULL, "SRAway", StatusModeToDbSetting(status, "Msg"), szStatusMessage ? szStatusMessage : _T(""));
+ db_set_ts(NULL, "SRAway", StatusModeToDbSetting(status, "Msg"), szStatusMessage ? szStatusMessage : L"");
- fieldNode = XmlGetChildByTag(xNode, "field", "var", _T("status-global"));
+ fieldNode = XmlGetChildByTag(xNode, "field", "var", L"status-global");
if (fieldNode && (valueNode = XmlGetChild(fieldNode , "value"))) {
if ((ptszValue = XmlGetText(valueNode)) != NULL && _ttoi(ptszValue))
CallService(MS_CLIST_SETSTATUSMODE, status, NULL);
@@ -400,32 +400,32 @@ int CJabberProto::AdhocOptionsHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe
// first form
pSession->SetStage(1);
- XmlNodeIq iq(_T("result"), pInfo);
+ XmlNodeIq iq(L"result", pInfo);
HXML xNode = iq
- << XCHILDNS(_T("command"), JABBER_FEAT_COMMANDS) << XATTR(_T("node"), JABBER_FEAT_RC_SET_OPTIONS)
- << XATTR(_T("sessionid"), pSession->GetSessionId()) << XATTR(_T("status"), _T("executing"))
- << XCHILDNS(_T("x"), JABBER_FEAT_DATA_FORMS) << XATTR(_T("type"), _T("form"));
+ << XCHILDNS(L"command", JABBER_FEAT_COMMANDS) << XATTR(L"node", JABBER_FEAT_RC_SET_OPTIONS)
+ << XATTR(L"sessionid", pSession->GetSessionId()) << XATTR(L"status", L"executing")
+ << XCHILDNS(L"x", JABBER_FEAT_DATA_FORMS) << XATTR(L"type", L"form");
- xNode << XCHILD(_T("title"), TranslateT("Set Options"));
- xNode << XCHILD(_T("instructions"), TranslateT("Set the desired options"));
+ xNode << XCHILD(L"title", TranslateT("Set Options"));
+ xNode << XCHILD(L"instructions", TranslateT("Set the desired options"));
- xNode << XCHILD(_T("field")) << XATTR(_T("type"), _T("hidden")) << XATTR(_T("var"), _T("FORM_TYPE"))
- << XATTR(_T("value"), JABBER_FEAT_RC);
+ xNode << XCHILD(L"field") << XATTR(L"type", L"hidden") << XATTR(L"var", L"FORM_TYPE")
+ << XATTR(L"value", JABBER_FEAT_RC);
// Automatically Accept File Transfers
TCHAR szTmpBuff[ 1024 ];
- mir_sntprintf(szTmpBuff, _T("%d"), db_get_b(NULL, "SRFile", "AutoAccept", 0));
- xNode << XCHILD(_T("field")) << XATTR(_T("label"), TranslateT("Automatically Accept File Transfers"))
- << XATTR(_T("type"), _T("boolean")) << XATTR(_T("var"), _T("auto-files")) << XCHILD(_T("value"), szTmpBuff);
+ mir_sntprintf(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, _T("%d"), db_get_b(NULL, "Skin", "UseSound", 0));
- xNode << XCHILD(_T("field")) << XATTR(_T("label"), TranslateT("Play sounds"))
- << XATTR(_T("type"), _T("boolean")) << XATTR(_T("var"), _T("sounds")) << XCHILD(_T("value"), szTmpBuff);
+ mir_sntprintf(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);
// Disable remote controlling
- xNode << XCHILD(_T("field")) << XATTR(_T("label"), TranslateT("Disable remote controlling (check twice what you are doing)"))
- << XATTR(_T("type"), _T("boolean")) << XATTR(_T("var"), _T("enable-rc")) << XCHILD(_T("value"), _T("0"));
+ xNode << XCHILD(L"field") << XATTR(L"label", TranslateT("Disable remote controlling (check twice what you are doing)"))
+ << XATTR(L"type", L"boolean") << XATTR(L"var", L"enable-rc") << XCHILD(L"value", L"0");
m_ThreadInfo->send(iq);
return JABBER_ADHOC_HANDLER_STATUS_EXECUTING;
@@ -439,19 +439,19 @@ int CJabberProto::AdhocOptionsHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe
return JABBER_ADHOC_HANDLER_STATUS_CANCEL;
// Automatically Accept File Transfers
- HXML fieldNode = XmlGetChildByTag(xNode, "field", "var", _T("auto-files")), valueNode;
+ HXML fieldNode = XmlGetChildByTag(xNode, "field", "var", L"auto-files"), valueNode;
if (fieldNode && (valueNode = XmlGetChild(fieldNode , "value")))
if (XmlGetText(valueNode))
db_set_b(NULL, "SRFile", "AutoAccept", (BYTE)_ttoi(XmlGetText(valueNode)));
// Use sounds
- fieldNode = XmlGetChildByTag(xNode, "field", "var", _T("sounds"));
+ fieldNode = XmlGetChildByTag(xNode, "field", "var", L"sounds");
if (fieldNode && (valueNode = XmlGetChild(fieldNode , "value")))
if (XmlGetText(valueNode))
db_set_b(NULL, "Skin", "UseSound", (BYTE)_ttoi(XmlGetText(valueNode)));
// Disable remote controlling
- fieldNode = XmlGetChildByTag(xNode, "field", "var", _T("enable-rc"));
+ fieldNode = XmlGetChildByTag(xNode, "field", "var", L"enable-rc");
if (fieldNode && (valueNode = XmlGetChild(fieldNode , "value")))
if (XmlGetText(valueNode) && _ttoi(XmlGetText(valueNode)))
m_options.EnableRemoteControl = 0;
@@ -498,10 +498,10 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe
mir_sntprintf(szMsg, TranslateT("There is no messages to forward"));
m_ThreadInfo->send(
- XmlNodeIq(_T("result"), pInfo)
- << XCHILDNS(_T("command"), JABBER_FEAT_COMMANDS) << XATTR(_T("node"), JABBER_FEAT_RC_FORWARD)
- << XATTR(_T("sessionid"), pSession->GetSessionId()) << XATTR(_T("status"), _T("completed"))
- << XCHILD(_T("note"), szMsg) << XATTR(_T("type"), _T("info")));
+ XmlNodeIq(L"result", pInfo)
+ << XCHILDNS(L"command", JABBER_FEAT_COMMANDS) << XATTR(L"node", JABBER_FEAT_RC_FORWARD)
+ << XATTR(L"sessionid", pSession->GetSessionId()) << XATTR(L"status", L"completed")
+ << XCHILD(L"note", szMsg) << XATTR(L"type", L"info"));
return JABBER_ADHOC_HANDLER_STATUS_REMOVE_SESSION;
}
@@ -509,24 +509,24 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe
// first form
pSession->SetStage(1);
- XmlNodeIq iq(_T("result"), pInfo);
+ XmlNodeIq iq(L"result", pInfo);
HXML xNode = iq
- << XCHILDNS(_T("command"), JABBER_FEAT_COMMANDS) << XATTR(_T("node"), JABBER_FEAT_RC_FORWARD)
- << XATTR(_T("sessionid"), pSession->GetSessionId()) << XATTR(_T("status"), _T("executing"))
- << XCHILDNS(_T("x"), JABBER_FEAT_DATA_FORMS) << XATTR(_T("type"), _T("form"));
+ << XCHILDNS(L"command", JABBER_FEAT_COMMANDS) << XATTR(L"node", JABBER_FEAT_RC_FORWARD)
+ << XATTR(L"sessionid", pSession->GetSessionId()) << XATTR(L"status", L"executing")
+ << XCHILDNS(L"x", JABBER_FEAT_DATA_FORMS) << XATTR(L"type", L"form");
- xNode << XCHILD(_T("title"), TranslateT("Forward options"));
+ xNode << XCHILD(L"title", TranslateT("Forward options"));
mir_sntprintf(szMsg, TranslateT("%d message(s) to be forwarded"), nUnreadEvents);
- xNode << XCHILD(_T("instructions"), szMsg);
+ xNode << XCHILD(L"instructions", szMsg);
- xNode << XCHILD(_T("field")) << XATTR(_T("type"), _T("hidden")) << XATTR(_T("var"), _T("FORM_TYPE"))
- << XCHILD(_T("value"), JABBER_FEAT_RC);
+ xNode << XCHILD(L"field") << XATTR(L"type", L"hidden") << XATTR(L"var", L"FORM_TYPE")
+ << XCHILD(L"value", JABBER_FEAT_RC);
// remove clist events
- xNode << XCHILD(_T("field")) << XATTR(_T("label"), TranslateT("Mark messages as read")) << XATTR(_T("type"), _T("boolean"))
- << XATTR(_T("var"), _T("remove-clist-events")) << XCHILD(_T("value"),
- m_options.RcMarkMessagesAsRead == 1 ? _T("1") : _T("0"));
+ xNode << XCHILD(L"field") << XATTR(L"label", TranslateT("Mark messages as read")) << XATTR(L"type", L"boolean")
+ << XATTR(L"var", L"remove-clist-events") << XCHILD(L"value",
+ m_options.RcMarkMessagesAsRead == 1 ? L"1" : L"0");
m_ThreadInfo->send(iq);
return JABBER_ADHOC_HANDLER_STATUS_EXECUTING;
@@ -542,7 +542,7 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe
BOOL bRemoveCListEvents = TRUE;
// remove clist events
- HXML fieldNode = XmlGetChildByTag(xNode,"field", "var", _T("remove-clist-events")), valueNode;
+ HXML fieldNode = XmlGetChildByTag(xNode,"field", "var", L"remove-clist-events"), valueNode;
if (fieldNode && (valueNode = XmlGetChild(fieldNode , "value")))
if (XmlGetText(valueNode) && !_ttoi(XmlGetText(valueNode)))
bRemoveCListEvents = FALSE;
@@ -573,29 +573,29 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe
if (szEventText == NULL)
continue;
- XmlNode msg(_T("message"));
- msg << XATTR(_T("to"), pInfo->GetFrom()) << XATTRID(SerialNext())
- << XCHILD(_T("body"), szEventText);
+ XmlNode msg(L"message");
+ msg << XATTR(L"to", pInfo->GetFrom()) << XATTRID(SerialNext())
+ << XCHILD(L"body", szEventText);
- HXML addressesNode = msg << XCHILDNS(_T("addresses"), JABBER_FEAT_EXT_ADDRESSING);
+ HXML addressesNode = msg << XCHILDNS(L"addresses", JABBER_FEAT_EXT_ADDRESSING);
TCHAR szOFrom[JABBER_MAX_JID_LEN];
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, _T("%s/%s"), tszJid, szOResource);
+ mir_sntprintf(szOFrom, L"%s/%s", tszJid, szOResource);
} else
_tcsncpy_s(szOFrom, tszJid, _TRUNCATE);
- addressesNode << XCHILD(_T("address")) << XATTR(_T("type"), _T("ofrom")) << XATTR(_T("jid"), szOFrom);
- addressesNode << XCHILD(_T("address")) << XATTR(_T("type"), _T("oto")) << XATTR(_T("jid"), m_ThreadInfo->fullJID);
+ addressesNode << XCHILD(L"address") << XATTR(L"type", L"ofrom") << XATTR(L"jid", szOFrom);
+ addressesNode << XCHILD(L"address") << XATTR(L"type", L"oto") << XATTR(L"jid", m_ThreadInfo->fullJID);
time_t ltime = (time_t)dbei.timestamp;
struct tm *gmt = gmtime(&ltime);
TCHAR stime[512];
- mir_sntprintf(stime, _T("%.4i-%.2i-%.2iT%.2i:%.2i:%.2iZ"), gmt->tm_year + 1900, gmt->tm_mon + 1, gmt->tm_mday,
+ mir_sntprintf(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(_T("delay"), _T("urn:xmpp:delay")) << XATTR(_T("stamp"), stime);
+ msg << XCHILDNS(L"delay", L"urn:xmpp:delay") << XATTR(L"stamp", stime);
m_ThreadInfo->send(msg);
@@ -610,10 +610,10 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe
mir_sntprintf(szMsg, TranslateT("%d message(s) forwarded"), nEventsSent);
m_ThreadInfo->send(
- XmlNodeIq(_T("result"), pInfo)
- << XCHILDNS(_T("command"), JABBER_FEAT_COMMANDS) << XATTR(_T("node"), JABBER_FEAT_RC_FORWARD)
- << XATTR(_T("sessionid"), pSession->GetSessionId()) << XATTR(_T("status"), _T("completed"))
- << XCHILD(_T("note"), szMsg) << XATTR(_T("type"), _T("info")));
+ XmlNodeIq(L"result", pInfo)
+ << XCHILDNS(L"command", JABBER_FEAT_COMMANDS) << XATTR(L"node", JABBER_FEAT_RC_FORWARD)
+ << XATTR(L"sessionid", pSession->GetSessionId()) << XATTR(L"status", L"completed")
+ << XCHILD(L"note", szMsg) << XATTR(L"type", L"info"));
return JABBER_ADHOC_HANDLER_STATUS_REMOVE_SESSION;
}
@@ -632,10 +632,10 @@ int CJabberProto::AdhocLockWSHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSes
mir_sntprintf(szMsg, TranslateT("Error %d occurred during workstation lock"), GetLastError());
m_ThreadInfo->send(
- XmlNodeIq(_T("result"), pInfo)
- << XCHILDNS(_T("command"), JABBER_FEAT_COMMANDS) << XATTR(_T("node"), JABBER_FEAT_RC_WS_LOCK)
- << XATTR(_T("sessionid"), pSession->GetSessionId()) << XATTR(_T("status"), _T("completed"))
- << XCHILD(_T("note"), szMsg) << XATTR(_T("type"), bOk ? _T("info") : _T("error")));
+ XmlNodeIq(L"result", pInfo)
+ << XCHILDNS(L"command", JABBER_FEAT_COMMANDS) << XATTR(L"node", JABBER_FEAT_RC_WS_LOCK)
+ << XATTR(L"sessionid", pSession->GetSessionId()) << XATTR(L"status", L"completed")
+ << XCHILD(L"note", szMsg) << XATTR(L"type", bOk ? L"info" : L"error"));
return JABBER_ADHOC_HANDLER_STATUS_REMOVE_SESSION;
}
@@ -651,21 +651,21 @@ int CJabberProto::AdhocQuitMirandaHandler(HXML, CJabberIqInfo *pInfo, CJabberAdh
// first form
pSession->SetStage(1);
- XmlNodeIq iq(_T("result"), pInfo);
+ XmlNodeIq iq(L"result", pInfo);
HXML xNode = iq
- << XCHILDNS(_T("command"), JABBER_FEAT_COMMANDS) << XATTR(_T("node"), JABBER_FEAT_RC_QUIT_MIRANDA)
- << XATTR(_T("sessionid"), pSession->GetSessionId()) << XATTR(_T("status"), _T("executing"))
- << XCHILDNS(_T("x"), JABBER_FEAT_DATA_FORMS) << XATTR(_T("type"), _T("form"));
+ << XCHILDNS(L"command", JABBER_FEAT_COMMANDS) << XATTR(L"node", JABBER_FEAT_RC_QUIT_MIRANDA)
+ << XATTR(L"sessionid", pSession->GetSessionId()) << XATTR(L"status", L"executing")
+ << XCHILDNS(L"x", JABBER_FEAT_DATA_FORMS) << XATTR(L"type", L"form");
- xNode << XCHILD(_T("title"), TranslateT("Confirmation needed"));
- xNode << XCHILD(_T("instructions"), TranslateT("Please confirm Miranda NG shutdown"));
+ xNode << XCHILD(L"title", TranslateT("Confirmation needed"));
+ xNode << XCHILD(L"instructions", TranslateT("Please confirm Miranda NG shutdown"));
- xNode << XCHILD(_T("field")) << XATTR(_T("type"), _T("hidden")) << XATTR(_T("var"), _T("FORM_TYPE"))
- << XCHILD(_T("value"), JABBER_FEAT_RC);
+ xNode << XCHILD(L"field") << XATTR(L"type", L"hidden") << XATTR(L"var", L"FORM_TYPE")
+ << XCHILD(L"value", JABBER_FEAT_RC);
// I Agree checkbox
- xNode << XCHILD(_T("field")) << XATTR(_T("label"), _T("I agree")) << XATTR(_T("type"), _T("boolean"))
- << XATTR(_T("var"), _T("allow-shutdown")) << XCHILD(_T("value"), _T("0"));
+ xNode << XCHILD(L"field") << XATTR(L"label", L"I agree") << XATTR(L"type", L"boolean")
+ << XATTR(L"var", L"allow-shutdown") << XCHILD(L"value", L"0");
m_ThreadInfo->send(iq);
return JABBER_ADHOC_HANDLER_STATUS_EXECUTING;
@@ -681,7 +681,7 @@ int CJabberProto::AdhocQuitMirandaHandler(HXML, CJabberIqInfo *pInfo, CJabberAdh
HXML fieldNode, valueNode;
// I Agree checkbox
- fieldNode = XmlGetChildByTag(xNode,"field", "var", _T("allow-shutdown"));
+ fieldNode = XmlGetChildByTag(xNode,"field", "var", L"allow-shutdown");
if (fieldNode && (valueNode = XmlGetChild(fieldNode , "value")))
if (XmlGetText(valueNode) && _ttoi(XmlGetText(valueNode)))
CallFunctionAsync(JabberQuitMirandaIMThread, 0);
@@ -712,38 +712,38 @@ int CJabberProto::AdhocLeaveGroupchatsHandler(HXML, CJabberIqInfo *pInfo, CJabbe
mir_sntprintf(szMsg, TranslateT("There is no group chats to leave"));
m_ThreadInfo->send(
- XmlNodeIq(_T("result"), pInfo)
- << XCHILDNS(_T("command"), JABBER_FEAT_COMMANDS) << XATTR(_T("node"), JABBER_FEAT_RC_LEAVE_GROUPCHATS)
- << XATTR(_T("sessionid"), pSession->GetSessionId()) << XATTR(_T("status"), _T("completed"))
- << XCHILD(_T("note"), szMsg) << XATTR(_T("type"), _T("info")));
+ XmlNodeIq(L"result", pInfo)
+ << XCHILDNS(L"command", JABBER_FEAT_COMMANDS) << XATTR(L"node", JABBER_FEAT_RC_LEAVE_GROUPCHATS)
+ << XATTR(L"sessionid", pSession->GetSessionId()) << XATTR(L"status", L"completed")
+ << XCHILD(L"note", szMsg) << XATTR(L"type", L"info"));
return JABBER_ADHOC_HANDLER_STATUS_REMOVE_SESSION;
}
pSession->SetStage(1);
- XmlNodeIq iq(_T("result"), pInfo);
+ XmlNodeIq iq(L"result", pInfo);
HXML xNode = iq
- << XCHILDNS(_T("command"), JABBER_FEAT_COMMANDS) << XATTR(_T("node"), JABBER_FEAT_RC_LEAVE_GROUPCHATS)
- << XATTR(_T("sessionid"), pSession->GetSessionId()) << XATTR(_T("status"), _T("executing"))
- << XCHILDNS(_T("x"), JABBER_FEAT_DATA_FORMS) << XATTR(_T("type"), _T("form"));
+ << XCHILDNS(L"command", JABBER_FEAT_COMMANDS) << XATTR(L"node", JABBER_FEAT_RC_LEAVE_GROUPCHATS)
+ << XATTR(L"sessionid", pSession->GetSessionId()) << XATTR(L"status", L"executing")
+ << XCHILDNS(L"x", JABBER_FEAT_DATA_FORMS) << XATTR(L"type", L"form");
- xNode << XCHILD(_T("title"), TranslateT("Leave group chats"));
- xNode << XCHILD(_T("instructions"), TranslateT("Choose the group chats you want to leave"));
+ xNode << XCHILD(L"title", TranslateT("Leave group chats"));
+ xNode << XCHILD(L"instructions", TranslateT("Choose the group chats you want to leave"));
- xNode << XCHILD(_T("field")) << XATTR(_T("type"), _T("hidden")) << XATTR(_T("var"), _T("FORM_TYPE"))
- << XATTR(_T("value"), JABBER_FEAT_RC);
+ xNode << XCHILD(L"field") << XATTR(L"type", L"hidden") << XATTR(L"var", L"FORM_TYPE")
+ << XATTR(L"value", JABBER_FEAT_RC);
// Groupchats
- HXML fieldNode = xNode << XCHILD(_T("field")) << XATTR(_T("label"), NULL) << XATTR(_T("type"), _T("list-multi")) << XATTR(_T("var"), _T("groupchats"));
- fieldNode << XCHILD(_T("required"));
+ HXML fieldNode = xNode << XCHILD(L"field") << XATTR(L"label", NULL) << XATTR(L"type", L"list-multi") << XATTR(L"var", L"groupchats");
+ fieldNode << XCHILD(L"required");
{
mir_cslock lck(m_csLists);
LISTFOREACH_NODEF(i, this, LIST_CHATROOM)
{
JABBER_LIST_ITEM *item = ListGetItemPtrFromIndex(i);
if (item != NULL)
- fieldNode << XCHILD(_T("option")) << XATTR(_T("label"), item->jid) << XCHILD(_T("value"), item->jid);
+ fieldNode << XCHILD(L"option") << XATTR(L"label", item->jid) << XCHILD(L"value", item->jid);
}
}
@@ -759,11 +759,11 @@ int CJabberProto::AdhocLeaveGroupchatsHandler(HXML, CJabberIqInfo *pInfo, CJabbe
return JABBER_ADHOC_HANDLER_STATUS_CANCEL;
// Groupchat list here:
- HXML fieldNode = XmlGetChildByTag(xNode,"field", "var", _T("groupchats"));
+ HXML fieldNode = XmlGetChildByTag(xNode,"field", "var", L"groupchats");
if (fieldNode) {
for (i=0; i < XmlGetChildCount(fieldNode); i++) {
HXML valueNode = XmlGetChild(fieldNode, i);
- if (valueNode && XmlGetName(valueNode) && XmlGetText(valueNode) && !mir_tstrcmp(XmlGetName(valueNode), _T("value"))) {
+ if (valueNode && XmlGetName(valueNode) && XmlGetText(valueNode) && !mir_tstrcmp(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_search.cpp b/protocols/JabberG/src/jabber_search.cpp
index fde6109462..3c033d178c 100644
--- a/protocols/JabberG/src/jabber_search.cpp
+++ b/protocols/JabberG/src/jabber_search.cpp
@@ -105,8 +105,8 @@ static int JabberSearchAddField(HWND hwndDlg, Data* FieldDat)
int Order = (FieldDat->bHidden) ? -1 : FieldDat->Order;
- HWND hwndLabel = CreateWindowEx(0, _T("STATIC"), (LPCTSTR)TranslateTS(FieldDat->Label), WS_CHILD, CornerX, CornerY + Order * 40, width, 13, hwndParent, NULL, hInst, 0);
- HWND hwndVar = CreateWindowEx(0 | WS_EX_CLIENTEDGE, _T("EDIT"), (LPCTSTR)FieldDat->defValue, WS_CHILD | WS_TABSTOP, CornerX + 5, CornerY + Order * 40 + 14, width, 20, hwndParent, NULL, hInst, 0);
+ HWND hwndLabel = CreateWindowEx(0, L"STATIC", (LPCTSTR)TranslateTS(FieldDat->Label), WS_CHILD, CornerX, CornerY + Order * 40, width, 13, hwndParent, NULL, hInst, 0);
+ HWND hwndVar = CreateWindowEx(0 | WS_EX_CLIENTEDGE, L"EDIT", (LPCTSTR)FieldDat->defValue, WS_CHILD | WS_TABSTOP, CornerX + 5, CornerY + Order * 40 + 14, width, 20, hwndParent, NULL, hInst, 0);
SendMessage(hwndLabel, WM_SETFONT, (WPARAM)hFont, 0);
SendMessage(hwndVar, WM_SETFONT, (WPARAM)hFont, 0);
if (!FieldDat->bHidden) {
@@ -137,19 +137,19 @@ void CJabberProto::OnIqResultGetSearchFields(HXML iqNode, CJabberIqInfo*)
if (!searchHandleDlg)
return;
- LPCTSTR type = XmlGetAttrValue(iqNode, _T("type"));
+ LPCTSTR type = XmlGetAttrValue(iqNode, L"type");
if (type == NULL)
return;
- if (!mir_tstrcmp(type, _T("result"))) {
- HXML queryNode = XmlGetNthChild(iqNode, _T("query"), 1);
+ if (!mir_tstrcmp(type, L"result")) {
+ HXML queryNode = XmlGetNthChild(iqNode, L"query", 1);
HXML xNode = XmlGetChildByTag(queryNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
ShowWindow(searchHandleDlg, SW_HIDE);
if (xNode) {
//1. Form
PostMessage(searchHandleDlg, WM_USER + 11, (WPARAM)xmlCopyNode(xNode), 0);
- HXML xcNode = XmlGetNthChild(xNode, _T("instructions"), 1);
+ HXML xcNode = XmlGetNthChild(xNode, L"instructions", 1);
if (xcNode)
SetDlgItemText(searchHandleDlg, IDC_INSTRUCTIONS, XmlGetText(xcNode));
}
@@ -160,7 +160,7 @@ void CJabberProto::OnIqResultGetSearchFields(HXML iqNode, CJabberIqInfo*)
if (!chNode)
break;
- if (!mir_tstrcmpi(XmlGetName(chNode), _T("instructions")) && XmlGetText(chNode))
+ if (!mir_tstrcmpi(XmlGetName(chNode), L"instructions") && XmlGetText(chNode))
SetDlgItemText(searchHandleDlg, IDC_INSTRUCTIONS, TranslateTS(XmlGetText(chNode)));
else if (XmlGetName(chNode)) {
Data *MyData = (Data*)malloc(sizeof(Data));
@@ -177,22 +177,22 @@ void CJabberProto::OnIqResultGetSearchFields(HXML iqNode, CJabberIqInfo*)
}
}
- const TCHAR *szFrom = XmlGetAttrValue(iqNode, _T("from"));
+ const TCHAR *szFrom = XmlGetAttrValue(iqNode, L"from");
if (szFrom)
SearchAddToRecent(szFrom, searchHandleDlg);
PostMessage(searchHandleDlg, WM_USER + 10, 0, 0);
ShowWindow(searchHandleDlg, SW_SHOW);
}
- else if (!mir_tstrcmp(type, _T("error"))) {
+ else if (!mir_tstrcmp(type, L"error")) {
const TCHAR *code = NULL;
const TCHAR *description = NULL;
TCHAR buff[255];
HXML errorNode = XmlGetChild(iqNode, "error");
if (errorNode) {
- code = XmlGetAttrValue(errorNode, _T("code"));
+ code = XmlGetAttrValue(errorNode, L"code");
description = XmlGetText(errorNode);
}
- mir_sntprintf(buff, TranslateT("Error %s %s\r\nPlease select other server"), code ? code : _T(""), description ? description : _T(""));
+ mir_sntprintf(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"));
@@ -203,7 +203,7 @@ void CJabberProto::OnIqResultGetSearchFields(HXML iqNode, CJabberIqInfo*)
// The pmFields is the pointer to map of <field Name, field Label> Not unical but ordered
// This can help to made result parser routines more simple
-static TCHAR *nickfields[] = { _T("nick"), _T("nickname"), _T("fullname"), _T("name"), _T("given"), _T("first"), _T("jid"), NULL };
+static TCHAR *nickfields[] = { L"nick", L"nickname", L"fullname", L"name", L"given", L"first", L"jid", NULL };
void CJabberProto::SearchReturnResults(HANDLE id, void * pvUsersInfo, U_TCHAR_MAP * pmAllFields)
{
@@ -260,8 +260,8 @@ void CJabberProto::SearchReturnResults(HANDLE id, void * pvUsersInfo, U_TCHAR_M
for (int j = 0; j < nFieldCount; j++) {
TCHAR *var = ListOfFields[j];
TCHAR *value = pmUserData->operator [](var);
- Results.pszFields[j] = value ? value : (TCHAR *)_T(" ");
- if (!mir_tstrcmpi(var, _T("jid")) && value)
+ Results.pszFields[j] = value ? value : (TCHAR *)L" ";
+ if (!mir_tstrcmpi(var, L"jid") && value)
Results.psr.id.t = value;
}
@@ -271,7 +271,7 @@ void CJabberProto::SearchReturnResults(HANDLE id, void * pvUsersInfo, U_TCHAR_M
if (nick) {
if (mir_tstrcmpi(nick, Results.psr.id.t))
- mir_sntprintf(buff, _T("%s (%s)"), nick, Results.psr.id.t);
+ mir_sntprintf(buff, L"%s (%s)", nick, Results.psr.id.t);
else
_tcsncpy_s(buff, nick, _TRUNCATE);
@@ -307,23 +307,23 @@ void CJabberProto::OnIqResultAdvancedSearch(HXML iqNode, CJabberIqInfo*)
U_TCHAR_MAP mColumnsNames(10);
LIST<void> SearchResults(2);
- if (((id = JabberGetPacketID(iqNode)) == -1) || ((type = XmlGetAttrValue(iqNode, _T("type"))) == NULL)) {
+ if (((id = JabberGetPacketID(iqNode)) == -1) || ((type = XmlGetAttrValue(iqNode, L"type")) == NULL)) {
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
return;
}
- if (!mir_tstrcmp(type, _T("result"))) {
- HXML queryNode = XmlGetNthChild(iqNode, _T("query"), 1);
+ if (!mir_tstrcmp(type, L"result")) {
+ HXML queryNode = XmlGetNthChild(iqNode, L"query", 1);
HXML xNode = XmlGetChildByTag(queryNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
if (xNode) {
//1. Form search results info
- HXML reportNode = XmlGetNthChild(xNode, _T("reported"), 1);
+ HXML reportNode = XmlGetNthChild(xNode, L"reported", 1);
if (reportNode) {
int i = 1;
- while (HXML fieldNode = XmlGetNthChild(reportNode, _T("field"), i++)) {
- TCHAR *var = (TCHAR*)XmlGetAttrValue(fieldNode, _T("var"));
+ while (HXML fieldNode = XmlGetNthChild(reportNode, L"field", i++)) {
+ TCHAR *var = (TCHAR*)XmlGetAttrValue(fieldNode, L"var");
if (var) {
- TCHAR *Label = (TCHAR*)XmlGetAttrValue(fieldNode, _T("label"));
+ TCHAR *Label = (TCHAR*)XmlGetAttrValue(fieldNode, L"label");
mColumnsNames.insert(var, (Label != NULL) ? Label : var);
}
}
@@ -331,12 +331,12 @@ void CJabberProto::OnIqResultAdvancedSearch(HXML iqNode, CJabberIqInfo*)
int i = 1;
HXML itemNode;
- while (itemNode = XmlGetNthChild(xNode, _T("item"), i++)) {
+ while (itemNode = XmlGetNthChild(xNode, L"item", i++)) {
U_TCHAR_MAP *pUserColumn = new U_TCHAR_MAP(10);
int j = 1;
- while (HXML fieldNode = XmlGetNthChild(itemNode, _T("field"), j++)) {
- if (TCHAR* var = (TCHAR*)XmlGetAttrValue(fieldNode, _T("var"))) {
- if (TCHAR* Text = (TCHAR*)XmlGetText(XmlGetChild(fieldNode, _T("value")))) {
+ while (HXML fieldNode = XmlGetNthChild(itemNode, L"field", j++)) {
+ if (TCHAR* var = (TCHAR*)XmlGetAttrValue(fieldNode, L"var")) {
+ if (TCHAR* Text = (TCHAR*)XmlGetText(XmlGetChild(fieldNode, L"value"))) {
if (!mColumnsNames[var])
mColumnsNames.insert(var, var);
pUserColumn->insert(var, Text);
@@ -350,14 +350,14 @@ void CJabberProto::OnIqResultAdvancedSearch(HXML iqNode, CJabberIqInfo*)
else {
//2. Field list search results info
int i = 1;
- while (HXML itemNode = XmlGetNthChild(queryNode, _T("item"), i++)) {
+ while (HXML itemNode = XmlGetNthChild(queryNode, L"item", i++)) {
U_TCHAR_MAP *pUserColumn = new U_TCHAR_MAP(10);
- TCHAR *jid = (TCHAR*)XmlGetAttrValue(itemNode, _T("jid"));
+ TCHAR *jid = (TCHAR*)XmlGetAttrValue(itemNode, L"jid");
TCHAR *keyReturned;
- mColumnsNames.insertCopyKey(_T("jid"), _T("jid"), &keyReturned, CopyKey, DestroyKey);
- mColumnsNames.insert(_T("jid"), keyReturned);
- pUserColumn->insertCopyKey(_T("jid"), jid, NULL, CopyKey, DestroyKey);
+ mColumnsNames.insertCopyKey(L"jid", L"jid", &keyReturned, CopyKey, DestroyKey);
+ mColumnsNames.insert(L"jid", keyReturned);
+ pUserColumn->insertCopyKey(L"jid", jid, NULL, CopyKey, DestroyKey);
for (int j = 0;; j++) {
HXML child = XmlGetChild(itemNode, j);
@@ -368,7 +368,7 @@ void CJabberProto::OnIqResultAdvancedSearch(HXML iqNode, CJabberIqInfo*)
if (szColumnName) {
LPCTSTR ptszChild = XmlGetText(child);
if (ptszChild && *ptszChild) {
- mColumnsNames.insertCopyKey((TCHAR*)szColumnName, _T(""), &keyReturned, CopyKey, DestroyKey);
+ mColumnsNames.insertCopyKey((TCHAR*)szColumnName, L"", &keyReturned, CopyKey, DestroyKey);
mColumnsNames.insert((TCHAR*)szColumnName, keyReturned);
pUserColumn->insertCopyKey((TCHAR*)szColumnName, (TCHAR*)ptszChild, NULL, CopyKey, DestroyKey);
}
@@ -379,17 +379,17 @@ void CJabberProto::OnIqResultAdvancedSearch(HXML iqNode, CJabberIqInfo*)
}
}
}
- else if (!mir_tstrcmp(type, _T("error"))) {
+ else if (!mir_tstrcmp(type, L"error")) {
const TCHAR *code = NULL;
const TCHAR *description = NULL;
TCHAR buff[255];
HXML errorNode = XmlGetChild(iqNode, "error");
if (errorNode) {
- code = XmlGetAttrValue(errorNode, _T("code"));
+ code = XmlGetAttrValue(errorNode, L"code");
description = XmlGetText(errorNode);
}
- mir_sntprintf(buff, TranslateT("Error %s %s\r\nTry to specify more detailed"), code ? code : _T(""), description ? description : _T(""));
+ mir_sntprintf(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);
@@ -477,7 +477,7 @@ int CJabberProto::SearchRenewFields(HWND hwndDlg, JabberSearchData *dat)
searchHandleDlg = hwndDlg;
CJabberIqInfo *pInfo = AddIQ(&CJabberProto::OnIqResultGetSearchFields, JABBER_IQ_TYPE_GET, szServerName);
- m_ThreadInfo->send(XmlNodeIq(pInfo) << XQUERY(_T("jabber:iq:search")));
+ m_ThreadInfo->send(XmlNodeIq(pInfo) << XQUERY(L"jabber:iq:search"));
return pInfo->GetIqId();
}
@@ -715,7 +715,7 @@ HWND __cdecl CJabberProto::CreateExtendedSearchUI(HWND parent)
{
if (parent && hInst) {
ptrT szServer(getTStringA("LoginServer"));
- if (szServer == NULL || mir_tstrcmpi(szServer, _T("S.ms")))
+ if (szServer == NULL || mir_tstrcmpi(szServer, L"S.ms"))
return CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_SEARCHUSER), parent, JabberSearchAdvancedDlgProc, (LPARAM)this);
}
@@ -748,10 +748,10 @@ HWND __cdecl CJabberProto::SearchAdvanced(HWND hwndDlg)
// formating query
CJabberIqInfo *pInfo = AddIQ(&CJabberProto::OnIqResultAdvancedSearch, JABBER_IQ_TYPE_SET, szServerName);
XmlNodeIq iq(pInfo);
- HXML query = iq << XQUERY(_T("jabber:iq:search"));
+ HXML query = iq << XQUERY(L"jabber:iq:search");
if (m_tszSelectedLang)
- iq << XATTR(_T("xml:lang"), m_tszSelectedLang); // i'm sure :)
+ iq << XATTR(L"xml:lang", m_tszSelectedLang); // i'm sure :)
// next can be 2 cases:
// Forms: XEP-0055 Example 7
diff --git a/protocols/JabberG/src/jabber_search.h b/protocols/JabberG/src/jabber_search.h
index b8247ac8f4..ef96830e7b 100644
--- a/protocols/JabberG/src/jabber_search.h
+++ b/protocols/JabberG/src/jabber_search.h
@@ -208,7 +208,7 @@ public:
if (rv->_value)
return rv->_value;
else
- return _T("");
+ return L"";
}
else
return NULL;
diff --git a/protocols/JabberG/src/jabber_secur.cpp b/protocols/JabberG/src/jabber_secur.cpp
index 66a879d302..1308ba8a40 100644
--- a/protocols/JabberG/src/jabber_secur.cpp
+++ b/protocols/JabberG/src/jabber_secur.cpp
@@ -36,11 +36,11 @@ TNtlmAuth::TNtlmAuth(ThreadData *info, const char* mechanism, const TCHAR *hostn
const TCHAR *szProvider;
if (!mir_strcmp(mechanism, "GSS-SPNEGO"))
- szProvider = _T("Negotiate");
+ szProvider = L"Negotiate";
else if (!mir_strcmp(mechanism, "GSSAPI"))
- szProvider = _T("GSSAPI");
+ szProvider = L"GSSAPI";
else if (!mir_strcmp(mechanism, "NTLM"))
- szProvider = _T("NTLM");
+ szProvider = L"NTLM";
else {
LBL_Invalid:
bIsValid = false;
@@ -48,7 +48,7 @@ LBL_Invalid:
return;
}
- TCHAR szSpn[1024] = _T("");
+ TCHAR szSpn[1024] = L"";
if (mir_strcmp(mechanism, "NTLM"))
if (!getSpn(szSpn, _countof(szSpn)) && !mir_strcmp(mechanism, "GSSAPI"))
goto LBL_Invalid;
@@ -65,7 +65,7 @@ TNtlmAuth::~TNtlmAuth()
bool TNtlmAuth::getSpn(TCHAR* szSpn, size_t dwSpnLen)
{
- TCHAR szFullUserName[128] = _T("");
+ TCHAR szFullUserName[128] = L"";
ULONG szFullUserNameLen = _countof(szFullUserName);
if (!GetUserNameEx(NameDnsDomain, szFullUserName, &szFullUserNameLen)) {
szFullUserName[0] = 0;
@@ -79,7 +79,7 @@ bool TNtlmAuth::getSpn(TCHAR* szSpn, size_t dwSpnLen)
if (szHostName && szHostName[0]) {
TCHAR *szFullUserNameU = _tcsupr(mir_tstrdup(szFullUserName));
- mir_sntprintf(szSpn, dwSpnLen, _T("xmpp/%s/%s@%s"), szHostName, szFullUserName, szFullUserNameU);
+ mir_sntprintf(szSpn, dwSpnLen, L"xmpp/%s/%s@%s", szHostName, szFullUserName, szFullUserNameU);
mir_free(szFullUserNameU);
}
else {
@@ -91,7 +91,7 @@ bool TNtlmAuth::getSpn(TCHAR* szSpn, size_t dwSpnLen)
connectHost = host->h_name;
TCHAR *connectHostT = mir_a2t(connectHost);
- mir_sntprintf(szSpn, dwSpnLen, _T("xmpp/%s@%s"), connectHostT, _tcsupr(szFullUserName));
+ mir_sntprintf(szSpn, dwSpnLen, L"xmpp/%s@%s", connectHostT, _tcsupr(szFullUserName));
mir_free(connectHostT);
}
@@ -116,7 +116,7 @@ char* TNtlmAuth::getChallenge(const TCHAR *challenge)
if (!hProvider)
return NULL;
- ptrA text((!mir_tstrcmp(challenge, _T("="))) ? mir_strdup("") : mir_t2a(challenge));
+ ptrA text((!mir_tstrcmp(challenge, L"=")) ? mir_strdup("") : mir_t2a(challenge));
if (info->conn.password[0] != 0)
return Netlib_NtlmCreateResponse2(hProvider, text, info->conn.username, info->conn.password, &complete);
diff --git a/protocols/JabberG/src/jabber_svc.cpp b/protocols/JabberG/src/jabber_svc.cpp
index 0c9abaf40a..bfdee3d9c7 100644
--- a/protocols/JabberG/src/jabber_svc.cpp
+++ b/protocols/JabberG/src/jabber_svc.cpp
@@ -153,15 +153,15 @@ INT_PTR __cdecl CJabberProto::JabberGetAvatarInfo(WPARAM wParam, LPARAM lParam)
TCHAR szJid[JABBER_MAX_JID_LEN]; szJid[0] = 0;
if (item->arResources.getCount() != NULL && !isXVcard)
if (TCHAR *bestResName = ListGetBestClientResourceNamePtr(tszJid))
- mir_sntprintf(szJid, _T("%s/%s"), tszJid, bestResName);
+ mir_sntprintf(szJid, L"%s/%s", tszJid, bestResName);
if (szJid[0] == 0)
_tcsncpy_s(szJid, tszJid, _TRUNCATE);
- debugLog(_T("Rereading %s for %s"), isXVcard ? JABBER_FEAT_VCARD_TEMP : JABBER_FEAT_AVATAR, szJid);
+ debugLog(L"Rereading %s for %s", isXVcard ? JABBER_FEAT_VCARD_TEMP : JABBER_FEAT_AVATAR, szJid);
m_ThreadInfo->send((isXVcard) ?
- XmlNodeIq( AddIQ(&CJabberProto::OnIqResultGetVCardAvatar, JABBER_IQ_TYPE_GET, szJid)) << XCHILDNS(_T("vCard"), JABBER_FEAT_VCARD_TEMP) :
+ XmlNodeIq( AddIQ(&CJabberProto::OnIqResultGetVCardAvatar, JABBER_IQ_TYPE_GET, szJid)) << XCHILDNS(L"vCard", JABBER_FEAT_VCARD_TEMP) :
XmlNodeIq( AddIQ(&CJabberProto::OnIqResultGetClientAvatar, JABBER_IQ_TYPE_GET, szJid)) << XQUERY(JABBER_FEAT_AVATAR));
return GAIR_WAITFOR;
}
@@ -299,7 +299,7 @@ INT_PTR __cdecl CJabberProto::JabberSetAvatar(WPARAM, LPARAM lParam)
m_options.AvatarType = ProtoGetBufferFormat(pResult);
GetAvatarFileName(NULL, tFileName, MAX_PATH);
- FILE *out = _tfopen(tFileName, _T("wb"));
+ FILE *out = _tfopen(tFileName, L"wb");
if (out != NULL) {
fwrite(pResult, dwPngSize, 1, out);
fclose(out);
@@ -320,7 +320,7 @@ INT_PTR __cdecl CJabberProto::JabberSetNickname(WPARAM wParam, LPARAM lParam)
TCHAR *nickname = (wParam & SMNN_UNICODE) ? mir_u2t((WCHAR*)lParam) : mir_a2t((char*)lParam);
setTString("Nick", nickname);
- SetServerVcard(FALSE, _T(""));
+ SetServerVcard(FALSE, L"");
return 0;
}
@@ -341,13 +341,13 @@ static const TCHAR *JabberEnum2AffilationStr[] = { LPGENT("None"), LPGENT("Outca
static void appendString(bool bIsTipper, const TCHAR *tszTitle, const TCHAR *tszValue, CMString &out)
{
if (!out.IsEmpty())
- out.Append(bIsTipper ? _T("\n") : _T("\r\n"));
+ out.Append(bIsTipper ? L"\n" : L"\r\n");
if (bIsTipper)
- out.AppendFormat(_T("<b>%s</b>\t%s"), TranslateTS(tszTitle), tszValue);
+ out.AppendFormat(L"<b>%s</b>\t%s", TranslateTS(tszTitle), tszValue);
else {
TCHAR *p = TranslateTS(tszTitle);
- out.AppendFormat(_T("%s%s\t%s"), p, mir_tstrlen(p) <= 7 ? _T("\t") : _T(""), tszValue);
+ out.AppendFormat(L"%s%s\t%s", p, mir_tstrlen(p) <= 7 ? L"\t" : L"", tszValue);
}
}
@@ -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, _T("message")))) {
+ if (!szCommand || (szCommand && !mir_tstrcmpi(szCommand, L"message"))) {
// message
if (!ServiceExists(MS_MSG_SENDMESSAGEW))
return 1;
@@ -447,7 +447,7 @@ INT_PTR __cdecl CJabberProto::JabberServiceParseXmppURI(WPARAM, LPARAM lParam)
return 1;
if (szSecondParam) { //there are parameters to message
- szMsgBody = _tcsstr(szSecondParam, _T("body="));
+ szMsgBody = _tcsstr(szSecondParam, L"body=");
if (szMsgBody) {
szMsgBody += 5;
TCHAR *szDelim = _tcschr(szMsgBody, _T(';'));
@@ -461,7 +461,7 @@ INT_PTR __cdecl CJabberProto::JabberServiceParseXmppURI(WPARAM, LPARAM lParam)
return 0;
}
- if (!mir_tstrcmpi(szCommand, _T("roster"))) {
+ if (!mir_tstrcmpi(szCommand, L"roster")) {
if (!HContactFromJID(szJid)) {
PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
@@ -479,21 +479,21 @@ INT_PTR __cdecl CJabberProto::JabberServiceParseXmppURI(WPARAM, LPARAM lParam)
}
// chat join invitation
- if (!mir_tstrcmpi(szCommand, _T("join"))) {
+ if (!mir_tstrcmpi(szCommand, L"join")) {
GroupchatJoinRoomByJid(NULL, szJid);
return 0;
}
// service discovery request
- if (!mir_tstrcmpi(szCommand, _T("disco"))) {
+ if (!mir_tstrcmpi(szCommand, L"disco")) {
OnMenuHandleServiceDiscovery(0, (LPARAM)szJid);
return 0;
}
// ad-hoc commands
- if (!mir_tstrcmpi(szCommand, _T("command"))) {
+ if (!mir_tstrcmpi(szCommand, L"command")) {
if (szSecondParam) {
- if (!_tcsnicmp(szSecondParam, _T("node="), 5)) {
+ if (!_tcsnicmp(szSecondParam, L"node=", 5)) {
szSecondParam += 5;
if (!*szSecondParam)
szSecondParam = NULL;
@@ -506,7 +506,7 @@ INT_PTR __cdecl CJabberProto::JabberServiceParseXmppURI(WPARAM, LPARAM lParam)
}
// send file
- if (!mir_tstrcmpi(szCommand, _T("sendfile"))) {
+ if (!mir_tstrcmpi(szCommand, L"sendfile")) {
MCONTACT hContact = HContactFromJID(szJid, false);
if (hContact == NULL)
hContact = DBCreateContact(szJid, szJid, true, true);
@@ -532,13 +532,13 @@ INT_PTR __cdecl CJabberProto::JabberSendNudge(WPARAM hContact, LPARAM)
TCHAR tszJid[JABBER_MAX_JID_LEN];
TCHAR *szResource = ListGetBestClientResourceNamePtr(jid);
if (szResource)
- mir_sntprintf(tszJid, _T("%s/%s"), jid, szResource);
+ mir_sntprintf(tszJid, L"%s/%s", jid, szResource);
else
_tcsncpy_s(tszJid, jid, _TRUNCATE);
m_ThreadInfo->send(
- XmlNode(_T("message")) << XATTR(_T("type"), _T("headline")) << XATTR(_T("to"), tszJid)
- << XCHILDNS(_T("attention"), JABBER_FEAT_ATTENTION));
+ XmlNode(L"message") << XATTR(L"type", L"headline") << XATTR(L"to", tszJid)
+ << XCHILDNS(L"attention", JABBER_FEAT_ATTENTION));
return 0;
}
@@ -548,29 +548,29 @@ BOOL CJabberProto::SendHttpAuthReply(CJabberHttpAuthParams *pParams, BOOL bAutho
return FALSE;
if (pParams->m_nType == CJabberHttpAuthParams::IQ) {
- XmlNodeIq iq(bAuthorized ? _T("result") : _T("error"), pParams->m_szIqId, pParams->m_szFrom);
+ XmlNodeIq iq(bAuthorized ? L"result" : L"error", pParams->m_szIqId, pParams->m_szFrom);
if (!bAuthorized) {
- iq << XCHILDNS(_T("confirm"), JABBER_FEAT_HTTP_AUTH) << XATTR(_T("id"), pParams->m_szId)
- << XATTR(_T("method"), pParams->m_szMethod) << XATTR(_T("url"), pParams->m_szUrl);
- iq << XCHILD(_T("error")) << XATTRI(_T("code"), 401) << XATTR(_T("type"), _T("auth"))
- << XCHILDNS(_T("not-authorized"), _T("urn:ietf:params:xml:xmpp-stanzas"));
+ iq << XCHILDNS(L"confirm", JABBER_FEAT_HTTP_AUTH) << XATTR(L"id", pParams->m_szId)
+ << XATTR(L"method", pParams->m_szMethod) << XATTR(L"url", pParams->m_szUrl);
+ iq << XCHILD(L"error") << XATTRI(L"code", 401) << XATTR(L"type", L"auth")
+ << XCHILDNS(L"not-authorized", L"urn:ietf:params:xml:xmpp-stanzas");
}
m_ThreadInfo->send(iq);
}
else if (pParams->m_nType == CJabberHttpAuthParams::MSG) {
- XmlNode msg(_T("message"));
- msg << XATTR(_T("to"), pParams->m_szFrom);
+ XmlNode msg(L"message");
+ msg << XATTR(L"to", pParams->m_szFrom);
if (!bAuthorized)
- msg << XATTR(_T("type"), _T("error"));
+ msg << XATTR(L"type", L"error");
if (pParams->m_szThreadId)
- msg << XCHILD(_T("thread"), pParams->m_szThreadId);
+ msg << XCHILD(L"thread", pParams->m_szThreadId);
- msg << XCHILDNS(_T("confirm"), JABBER_FEAT_HTTP_AUTH) << XATTR(_T("id"), pParams->m_szId)
- << XATTR(_T("method"), pParams->m_szMethod) << XATTR(_T("url"), pParams->m_szUrl);
+ msg << XCHILDNS(L"confirm", JABBER_FEAT_HTTP_AUTH) << XATTR(L"id", pParams->m_szId)
+ << XATTR(L"method", pParams->m_szMethod) << XATTR(L"url", pParams->m_szUrl);
if (!bAuthorized)
- msg << XCHILD(_T("error")) << XATTRI(_T("code"), 401) << XATTR(_T("type"), _T("auth"))
- << XCHILDNS(_T("not-authorized"), _T("urn:ietf:params:xml:xmpp-stanzas"));
+ msg << XCHILD(L"error") << XATTRI(L"code", 401) << XATTR(L"type", L"auth")
+ << XCHILDNS(L"not-authorized", L"urn:ietf:params:xml:xmpp-stanzas");
m_ThreadInfo->send(msg);
}
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index 312422bae7..328ada850e 100755
--- a/protocols/JabberG/src/jabber_thread.cpp
+++ b/protocols/JabberG/src/jabber_thread.cpp
@@ -191,16 +191,16 @@ void CJabberProto::xmlStreamInitializeNow(ThreadData *info)
m_szXmlStreamToBeInitialized = NULL;
}
- HXML n = xmlCreateNode(_T("xml"), NULL, 1) << XATTR(_T("version"), _T("1.0")) << XATTR(_T("encoding"), _T("UTF-8"));
+ HXML n = xmlCreateNode(L"xml", NULL, 1) << XATTR(L"version", L"1.0") << XATTR(L"encoding", L"UTF-8");
- HXML stream = n << XCHILDNS(_T("stream:stream"), _T("jabber:client")) << XATTR(_T("to"), _A2T(info->conn.server))
- << XATTR(_T("xmlns:stream"), _T("http://etherx.jabber.org/streams"));
+ HXML stream = n << XCHILDNS(L"stream:stream", L"jabber:client") << XATTR(L"to", _A2T(info->conn.server))
+ << XATTR(L"xmlns:stream", L"http://etherx.jabber.org/streams");
if (m_tszSelectedLang)
- XmlAddAttr(stream, _T("xml:lang"), m_tszSelectedLang);
+ XmlAddAttr(stream, L"xml:lang", m_tszSelectedLang);
if (!m_options.Disable3920auth)
- XmlAddAttr(stream, _T("version"), _T("1.0"));
+ XmlAddAttr(stream, L"version", L"1.0");
LPTSTR xmlQuery = xmlToString(n, NULL);
T2Utf buf(xmlQuery);
@@ -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, _T("Miranda"));
+ mir_tstrcpy(info.resource, L"Miranda");
}
else {
if ((tszValue = getTStringA("Resource")) != NULL)
_tcsncpy_s(info.resource, tszValue, _TRUNCATE);
else
- mir_tstrcpy(info.resource, _T("Miranda"));
+ mir_tstrcpy(info.resource, L"Miranda");
}
TCHAR jidStr[512];
- mir_sntprintf(jidStr, _T("%s@%S/%s"), info.conn.username, info.conn.server, info.resource);
+ mir_sntprintf(jidStr, L"%s@%S/%s", info.conn.username, info.conn.server, info.resource);
_tcsncpy_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)
_tcsncpy_s(info.conn.password, m_savedPassword, _TRUNCATE);
else {
- mir_sntprintf(jidStr, _T("%s@%S"), info.conn.username, info.conn.server);
+ mir_sntprintf(jidStr, L"%s@%S", info.conn.username, info.conn.server);
JabberPasswordDlgParam param;
param.pro = this;
@@ -392,7 +392,7 @@ LBL_FatalError:
if (!info.bIsReg) {
size_t len = mir_tstrlen(info.conn.username) + mir_strlen(info.conn.server) + 1;
m_szJabberJID = (TCHAR*)mir_alloc(sizeof(TCHAR)*(len + 1));
- mir_sntprintf(m_szJabberJID, len + 1, _T("%s@%S"), info.conn.username, info.conn.server);
+ mir_sntprintf(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
@@ -400,7 +400,7 @@ LBL_FatalError:
}
xmlStreamInitializeNow(&info);
- const TCHAR *tag = _T("stream:stream");
+ const TCHAR *tag = L"stream:stream";
debugLogA("Entering main recv loop");
int datalen = 0;
@@ -424,7 +424,7 @@ LBL_FatalError:
if (info.jabberServerCaps & JABBER_CAPS_PING) {
CJabberIqInfo *pInfo = AddIQ(&CJabberProto::OnPingReply, JABBER_IQ_TYPE_GET, NULL, 0, -1, this);
pInfo->SetTimeout(m_options.ConnectionKeepAliveTimeout);
- info.send(XmlNodeIq(pInfo) << XATTR(_T("from"), info.fullJID) << XCHILDNS(_T("ping"), JABBER_FEAT_PING));
+ info.send(XmlNodeIq(pInfo) << XATTR(L"from", info.fullJID) << XCHILDNS(L"ping", JABBER_FEAT_PING));
}
else info.send(" \t ");
continue;
@@ -489,7 +489,7 @@ recvRest:
if (m_szXmlStreamToBeInitialized) {
xmlStreamInitializeNow(&info);
- tag = _T("stream:stream");
+ tag = L"stream:stream";
}
if (root && datalen)
goto recvRest;
@@ -551,7 +551,7 @@ recvRest:
void CJabberProto::PerformRegistration(ThreadData *info)
{
iqIdRegGetReg = SerialNext();
- info->send(XmlNodeIq(_T("get"), iqIdRegGetReg, NULL) << XQUERY(JABBER_FEAT_REGISTER));
+ info->send(XmlNodeIq(L"get", iqIdRegGetReg, NULL) << XQUERY(JABBER_FEAT_REGISTER));
SendMessage(info->conn.reg_hwndDlg, WM_JABBER_REGDLG_UPDATE, 50, (LPARAM)TranslateT("Requesting registration instruction..."));
}
@@ -560,7 +560,7 @@ void CJabberProto::PerformIqAuth(ThreadData *info)
{
if (!info->bIsReg) {
info->send(XmlNodeIq(AddIQ(&CJabberProto::OnIqResultGetAuth, JABBER_IQ_TYPE_GET))
- << XQUERY(_T("jabber:iq:auth")) << XCHILD(_T("username"), info->conn.username));
+ << XQUERY(L"jabber:iq:auth") << XCHILD(L"username", info->conn.username));
}
else PerformRegistration(info);
}
@@ -569,17 +569,17 @@ void CJabberProto::PerformIqAuth(ThreadData *info)
void CJabberProto::OnProcessStreamOpening(HXML node, ThreadData *info)
{
- if (mir_tstrcmp(XmlGetName(node), _T("stream:stream")))
+ if (mir_tstrcmp(XmlGetName(node), L"stream:stream"))
return;
if (!info->bIsReg) {
- const TCHAR *sid = XmlGetAttrValue(node, _T("id"));
+ const TCHAR *sid = XmlGetAttrValue(node, L"id");
if (sid != NULL)
info->szStreamId = mir_t2a(sid);
}
// old server - disable SASL then
- if (XmlGetAttrValue(node, _T("version")) == NULL)
+ if (XmlGetAttrValue(node, L"version") == NULL)
info->proto->m_options.Disable3920auth = TRUE;
if (info->proto->m_options.Disable3920auth)
@@ -665,8 +665,8 @@ void CJabberProto::PerformAuthentication(ThreadData *info)
info->auth = auth;
if (!request) request = auth->getInitialRequest();
- info->send(XmlNode(_T("auth"), _A2T(request)) << XATTR(_T("xmlns"), _T("urn:ietf:params:xml:ns:xmpp-sasl"))
- << XATTR(_T("mechanism"), _A2T(auth->getName())));
+ info->send(XmlNode(L"auth", _A2T(request)) << XATTR(L"xmlns", L"urn:ietf:params:xml:ns:xmpp-sasl")
+ << XATTR(L"mechanism", _A2T(auth->getName())));
mir_free(request);
}
@@ -682,29 +682,29 @@ void CJabberProto::OnProcessFeatures(HXML node, ThreadData *info)
if (!n)
break;
- if (!mir_tstrcmp(XmlGetName(n), _T("starttls"))) {
+ if (!mir_tstrcmp(XmlGetName(n), L"starttls")) {
if (!info->conn.useSSL && m_options.UseTLS) {
debugLogA("Requesting TLS");
- info->send(XmlNode(XmlGetName(n)) << XATTR(_T("xmlns"), _T("urn:ietf:params:xml:ns:xmpp-tls")));
+ info->send(XmlNode(XmlGetName(n)) << XATTR(L"xmlns", L"urn:ietf:params:xml:ns:xmpp-tls"));
return;
} }
- if (!mir_tstrcmp(XmlGetName(n), _T("compression")) && m_options.EnableZlib == TRUE) {
+ if (!mir_tstrcmp(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), _T("method"))) {
- if (!mir_tstrcmp(XmlGetText(c), _T("zlib")) && info->zlibInit() == TRUE) {
+ if (!mir_tstrcmp(XmlGetName(c), L"method")) {
+ if (!mir_tstrcmp(XmlGetText(c), L"zlib") && info->zlibInit() == TRUE) {
debugLogA("Requesting Zlib compression");
- info->send(XmlNode(_T("compress")) << XATTR(_T("xmlns"), _T("http://jabber.org/protocol/compress"))
- << XCHILD(_T("method"), _T("zlib")));
+ 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), _T("mechanisms"))) {
+ if (!mir_tstrcmp(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), _T("mechanism"))) {
+ if (!mir_tstrcmp(XmlGetName(c), L"mechanism")) {
LPCTSTR ptszMechanism = XmlGetText(c);
- if (!mir_tstrcmp(ptszMechanism, _T("PLAIN"))) m_AuthMechs.isPlainOldAvailable = m_AuthMechs.isPlainAvailable = true;
- else if (!mir_tstrcmp(ptszMechanism, _T("DIGEST-MD5"))) m_AuthMechs.isMd5Available = true;
- else if (!mir_tstrcmp(ptszMechanism, _T("SCRAM-SHA-1"))) m_AuthMechs.isScramAvailable = true;
- else if (!mir_tstrcmp(ptszMechanism, _T("NTLM"))) m_AuthMechs.isNtlmAvailable = true;
- else if (!mir_tstrcmp(ptszMechanism, _T("GSS-SPNEGO"))) m_AuthMechs.isSpnegoAvailable = true;
- else if (!mir_tstrcmp(ptszMechanism, _T("GSSAPI"))) m_AuthMechs.isKerberosAvailable = true;
+ 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;
}
- else if (!mir_tstrcmp(XmlGetName(c), _T("hostname"))) {
- const TCHAR *mech = XmlGetAttrValue(c, _T("mechanism"));
- if (mech && mir_tstrcmpi(mech, _T("GSSAPI")) == 0) {
+ else if (!mir_tstrcmp(XmlGetName(c), L"hostname")) {
+ const TCHAR *mech = XmlGetAttrValue(c, L"mechanism");
+ if (mech && mir_tstrcmpi(mech, L"GSSAPI") == 0) {
m_AuthMechs.m_gssapiHostName = mir_tstrdup(XmlGetText(c));
}
}
}
}
- else if (!mir_tstrcmp(XmlGetName(n), _T("register"))) isRegisterAvailable = true;
- else if (!mir_tstrcmp(XmlGetName(n), _T("auth"))) m_AuthMechs.isAuthAvailable = true;
- else if (!mir_tstrcmp(XmlGetName(n), _T("session"))) m_AuthMechs.isSessionAvailable = true;
+ 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;
}
if (areMechanismsDefined) {
@@ -755,8 +755,8 @@ void CJabberProto::OnProcessFeatures(HXML node, ThreadData *info)
if (info->auth) { //We are already logged-in
info->send(
XmlNodeIq(AddIQ(&CJabberProto::OnIqResultBind, JABBER_IQ_TYPE_SET))
- << XCHILDNS(_T("bind"), _T("urn:ietf:params:xml:ns:xmpp-bind"))
- << XCHILD(_T("resource"), info->resource));
+ << XCHILDNS(L"bind", L"urn:ietf:params:xml:ns:xmpp-bind")
+ << XCHILD(L"resource", info->resource));
if (m_AuthMechs.isSessionAvailable)
info->bIsSessionAvailable = TRUE;
@@ -772,8 +772,8 @@ void CJabberProto::OnProcessFailure(HXML node, ThreadData *info)
{
const TCHAR *type;
//failure xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\"
- if ((type = XmlGetAttrValue(node, _T("xmlns"))) == NULL) return;
- if (!mir_tstrcmp(type, _T("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")) {
PerformAuthentication(info);
}
}
@@ -799,13 +799,13 @@ void CJabberProto::OnProcessError(HXML node, ThreadData *info)
const TCHAR *name = XmlGetName(n);
const TCHAR *desc = XmlGetText(n);
if (desc)
- pos += mir_sntprintf(buff + pos, 1024 - pos, _T("%s: %s\r\n"), name, desc);
+ pos += mir_sntprintf(buff + pos, 1024 - pos, L"%s: %s\r\n", name, desc);
else
- pos += mir_sntprintf(buff + pos, 1024 - pos, _T("%s\r\n"), name);
+ pos += mir_sntprintf(buff + pos, 1024 - pos, L"%s\r\n", name);
- if (!mir_tstrcmp(name, _T("conflict")))
+ if (!mir_tstrcmp(name, L"conflict"))
ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_OTHERLOCATION);
- else if (!mir_tstrcmp(name, _T("see-other-host"))) {
+ else if (!mir_tstrcmp(name, L"see-other-host")) {
skipMsg = true;
}
}
@@ -820,10 +820,10 @@ void CJabberProto::OnProcessSuccess(HXML node, ThreadData *info)
// int iqId;
// RECVED: <success ...
// ACTION: if successfully logged in, continue by requesting roster list and set my initial status
- if ((type = XmlGetAttrValue(node, _T("xmlns"))) == NULL)
+ if ((type = XmlGetAttrValue(node, L"xmlns")) == NULL)
return;
- if (!mir_tstrcmp(type, _T("urn:ietf:params:xml:ns:xmpp-sasl"))) {
+ if (!mir_tstrcmp(type, L"urn:ietf:params:xml:ns:xmpp-sasl")) {
if (!info->auth->validateLogin(XmlGetText(node))) {
info->send("</stream:stream>");
return;
@@ -836,7 +836,7 @@ void CJabberProto::OnProcessSuccess(HXML node, ThreadData *info)
xmlStreamInitialize("after successful sasl");
}
- else debugLog(_T("Success: unknown action %s."), type);
+ else debugLog(L"Success: unknown action %s.", type);
}
void CJabberProto::OnProcessChallenge(HXML node, ThreadData *info)
@@ -846,11 +846,11 @@ void CJabberProto::OnProcessChallenge(HXML node, ThreadData *info)
return;
}
- if (mir_tstrcmp(XmlGetAttrValue(node, _T("xmlns")), _T("urn:ietf:params:xml:ns:xmpp-sasl")))
+ if (mir_tstrcmp(XmlGetAttrValue(node, L"xmlns"), L"urn:ietf:params:xml:ns:xmpp-sasl"))
return;
char* challenge = info->auth->getChallenge(XmlGetText(node));
- info->send(XmlNode(_T("response"), _A2T(challenge)) << XATTR(_T("xmlns"), _T("urn:ietf:params:xml:ns:xmpp-sasl")));
+ info->send(XmlNode(L"response", _A2T(challenge)) << XATTR(L"xmlns", L"urn:ietf:params:xml:ns:xmpp-sasl"));
mir_free(challenge);
}
@@ -858,34 +858,34 @@ void CJabberProto::OnProcessProtocol(HXML node, ThreadData *info)
{
OnConsoleProcessXml(node, JCPF_IN);
- if (!mir_tstrcmp(XmlGetName(node), _T("proceed")))
+ if (!mir_tstrcmp(XmlGetName(node), L"proceed"))
OnProcessProceed(node, info);
- else if (!mir_tstrcmp(XmlGetName(node), _T("compressed")))
+ else if (!mir_tstrcmp(XmlGetName(node), L"compressed"))
OnProcessCompressed(node, info);
- else if (!mir_tstrcmp(XmlGetName(node), _T("stream:features")))
+ else if (!mir_tstrcmp(XmlGetName(node), L"stream:features"))
OnProcessFeatures(node, info);
- else if (!mir_tstrcmp(XmlGetName(node), _T("stream:stream")))
+ else if (!mir_tstrcmp(XmlGetName(node), L"stream:stream"))
OnProcessStreamOpening(node, info);
- else if (!mir_tstrcmp(XmlGetName(node), _T("success")))
+ else if (!mir_tstrcmp(XmlGetName(node), L"success"))
OnProcessSuccess(node, info);
- else if (!mir_tstrcmp(XmlGetName(node), _T("failure")))
+ else if (!mir_tstrcmp(XmlGetName(node), L"failure"))
OnProcessFailure(node, info);
- else if (!mir_tstrcmp(XmlGetName(node), _T("stream:error")))
+ else if (!mir_tstrcmp(XmlGetName(node), L"stream:error"))
OnProcessError(node, info);
- else if (!mir_tstrcmp(XmlGetName(node), _T("challenge")))
+ else if (!mir_tstrcmp(XmlGetName(node), L"challenge"))
OnProcessChallenge(node, info);
else if (!info->bIsReg) {
- if (!mir_tstrcmp(XmlGetName(node), _T("message")))
+ if (!mir_tstrcmp(XmlGetName(node), L"message"))
OnProcessMessage(node, info);
- else if (!mir_tstrcmp(XmlGetName(node), _T("presence")))
+ else if (!mir_tstrcmp(XmlGetName(node), L"presence"))
OnProcessPresence(node, info);
- else if (!mir_tstrcmp(XmlGetName(node), _T("iq")))
+ else if (!mir_tstrcmp(XmlGetName(node), L"iq"))
OnProcessIq(node);
else
debugLogA("Invalid top-level tag (only <message/> <presence/> and <iq/> allowed)");
}
else {
- if (!mir_tstrcmp(XmlGetName(node), _T("iq")))
+ if (!mir_tstrcmp(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 TCHAR *type;
- if ((type = XmlGetAttrValue(node, _T("xmlns"))) != NULL && !mir_tstrcmp(type, _T("error")))
+ if ((type = XmlGetAttrValue(node, L"xmlns")) != NULL && !mir_tstrcmp(type, L"error"))
return;
- if (!mir_tstrcmp(type, _T("urn:ietf:params:xml:ns:xmpp-tls"))) {
+ if (!mir_tstrcmp(type, L"urn:ietf:params:xml:ns:xmpp-tls")) {
debugLogA("Starting TLS...");
char* gtlk = strstr(info->conn.manualHost, "google.com");
@@ -922,10 +922,10 @@ void CJabberProto::OnProcessCompressed(HXML node, ThreadData *info)
{
debugLogA("Compression confirmed");
- const TCHAR *type = XmlGetAttrValue(node, _T("xmlns"));
- if (type != NULL && !mir_tstrcmp(type, _T("error")))
+ const TCHAR *type = XmlGetAttrValue(node, L"xmlns");
+ if (type != NULL && !mir_tstrcmp(type, L"error"))
return;
- if (mir_tstrcmp(type, _T("http://jabber.org/protocol/compress")))
+ if (mir_tstrcmp(type, L"http://jabber.org/protocol/compress"))
return;
debugLogA("Starting Zlib stream compression...");
@@ -938,7 +938,7 @@ void CJabberProto::OnProcessCompressed(HXML node, ThreadData *info)
void CJabberProto::OnProcessPubsubEvent(HXML node)
{
- const TCHAR *from = XmlGetAttrValue(node, _T("from"));
+ const TCHAR *from = XmlGetAttrValue(node, L"from");
if (!from)
return;
@@ -960,7 +960,7 @@ void CJabberProto::OnProcessPubsubEvent(HXML node)
return;
}
- HXML tuneNode = XPath(itemsNode, _T("item/tune[@xmlns='") JABBER_FEAT_USER_TUNE _T("']"));
+ HXML tuneNode = XPath(itemsNode, L"item/tune[@xmlns='" JABBER_FEAT_USER_TUNE L"']");
if (!tuneNode)
return;
@@ -974,7 +974,7 @@ void CJabberProto::OnProcessPubsubEvent(HXML node)
szLengthInTime[0] = 0;
if (szLength) {
int nLength = _ttoi(szLength);
- mir_sntprintf(szLengthInTime, _T("%02d:%02d:%02d"), nLength / 3600, (nLength / 60) % 60, nLength % 60);
+ mir_sntprintf(szLengthInTime, L"%02d:%02d:%02d", nLength / 3600, (nLength / 60) % 60, nLength % 60);
}
SetContactTune(hContact, szArtist, szLength ? szLengthInTime : NULL, szSource, szTitle, szTrack);
@@ -1026,21 +1026,21 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
{
HXML xNode, n;
- if (!XmlGetName(node) || mir_tstrcmp(XmlGetName(node), _T("message")))
+ if (!XmlGetName(node) || mir_tstrcmp(XmlGetName(node), L"message"))
return;
- LPCTSTR from, type = XmlGetAttrValue(node, _T("type"));
- if ((from = XmlGetAttrValue(node, _T("from"))) == NULL)
+ LPCTSTR from, type = XmlGetAttrValue(node, L"type");
+ if ((from = XmlGetAttrValue(node, L"from")) == NULL)
return;
- LPCTSTR idStr = XmlGetAttrValue(node, _T("id"));
+ LPCTSTR idStr = XmlGetAttrValue(node, L"id");
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, _T("error"))) && XmlGetChildByTag(node, "request", "xmlns", JABBER_FEAT_MESSAGE_RECEIPTS)) {
+ if ((!type || mir_tstrcmpi(type, L"error")) && XmlGetChildByTag(node, "request", "xmlns", JABBER_FEAT_MESSAGE_RECEIPTS)) {
info->send(
- XmlNode(_T("message")) << XATTR(_T("to"), from) << XATTR(_T("id"), idStr)
- << XCHILDNS(_T("received"), JABBER_FEAT_MESSAGE_RECEIPTS) << XATTR(_T("id"), idStr));
+ XmlNode(L"message") << XATTR(L"to", from) << XATTR(L"id", idStr)
+ << XCHILDNS(L"received", JABBER_FEAT_MESSAGE_RECEIPTS) << XATTR(L"id", idStr));
if (pFromResource)
pFromResource->m_jcbManualDiscoveredCaps |= JABBER_CAPS_MESSAGE_RECEIPTS;
@@ -1071,19 +1071,19 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
TCHAR *szTmp = (TCHAR *)alloca(sizeof(TCHAR) * cbLen);
szTmp[0] = 0;
if (szMessage)
- mir_tstrcat(szTmp, _T("Subject: "));
+ mir_tstrcat(szTmp, L"Subject: ");
mir_tstrcat(szTmp, ptszSubject);
if (szMessage) {
- mir_tstrcat(szTmp, _T("\r\n"));
+ mir_tstrcat(szTmp, L"\r\n");
mir_tstrcat(szTmp, szMessage);
}
szMessage = szTmp;
}
if (szMessage && (n = XmlGetChildByTag(node, "addresses", "xmlns", JABBER_FEAT_EXT_ADDRESSING))) {
- HXML addressNode = XmlGetChildByTag(n, "address", "type", _T("ofrom"));
+ HXML addressNode = XmlGetChildByTag(n, "address", "type", L"ofrom");
if (addressNode) {
- const TCHAR *szJid = XmlGetAttrValue(addressNode, _T("jid"));
+ const TCHAR *szJid = XmlGetAttrValue(addressNode, L"jid");
if (szJid) {
size_t cbLen = mir_tstrlen(szMessage) + 1000;
TCHAR *p = (TCHAR*)alloca(sizeof(TCHAR) * cbLen);
@@ -1161,9 +1161,9 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
}
if ((n = XmlGetChildByTag(node, "confirm", "xmlns", JABBER_FEAT_HTTP_AUTH)) && m_options.AcceptHttpAuth) {
- const TCHAR *szId = XmlGetAttrValue(n, _T("id"));
- const TCHAR *szMethod = XmlGetAttrValue(n, _T("method"));
- const TCHAR *szUrl = XmlGetAttrValue(n, _T("url"));
+ const TCHAR *szId = XmlGetAttrValue(n, L"id");
+ const TCHAR *szMethod = XmlGetAttrValue(n, L"method");
+ const TCHAR *szUrl = XmlGetAttrValue(n, L"url");
if (!szId || !szMethod || !szUrl)
return;
@@ -1187,10 +1187,10 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
// parsing extensions
for (int i = 0; (xNode = XmlGetChild(node, i)) != NULL; i++) {
- if ((xNode = XmlGetNthChild(node, _T("x"), i + 1)) == NULL)
+ if ((xNode = XmlGetNthChild(node, L"x", i + 1)) == NULL)
continue;
- const TCHAR *ptszXmlns = XmlGetAttrValue(xNode, _T("xmlns"));
+ const TCHAR *ptszXmlns = XmlGetAttrValue(xNode, L"xmlns");
if (ptszXmlns == NULL)
continue;
@@ -1198,16 +1198,16 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
if (OnIncomingNote(from, XmlGetChild(xNode, "note")))
return;
}
- else if (!mir_tstrcmp(ptszXmlns, _T("jabber:x:encrypted"))) {
+ else if (!mir_tstrcmp(ptszXmlns, L"jabber:x:encrypted")) {
LPCTSTR ptszText = XmlGetText(xNode);
if (ptszText == NULL)
return;
//XEP-0027 is not strict enough, different clients have different implementations
//additional validation is required
- TCHAR *prolog = _T("-----BEGIN PGP MESSAGE-----");
- TCHAR *prolog_newline = _T("\r\n\r\n");
- TCHAR *epilog = _T("\r\n-----END PGP MESSAGE-----\r\n");
+ TCHAR *prolog = L"-----BEGIN PGP MESSAGE-----";
+ TCHAR *prolog_newline = L"\r\n\r\n";
+ TCHAR *epilog = L"\r\n-----END PGP MESSAGE-----\r\n";
size_t len = 0;
TCHAR *tempstring = nullptr;
@@ -1215,19 +1215,19 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
{
len = mir_tstrlen(prolog) + mir_tstrlen(prolog_newline) + mir_tstrlen(ptszText) + mir_tstrlen(epilog) + 3;
tempstring = (TCHAR*)_alloca(sizeof(TCHAR)*len);
- mir_sntprintf(tempstring, len, _T("%s%s%s%s"), prolog, prolog_newline, ptszText, epilog);
+ mir_sntprintf(tempstring, len, L"%s%s%s%s", prolog, prolog_newline, ptszText, epilog);
}
else
{
len = mir_tstrlen(ptszText) + 3;
tempstring = (TCHAR*)_alloca(sizeof(TCHAR)*len);
- mir_sntprintf(tempstring, len, _T("%s"), ptszText);
+ mir_sntprintf(tempstring, len, L"%s", ptszText);
}
szMessage = tempstring;
}
else if (!mir_tstrcmp(ptszXmlns, JABBER_FEAT_DELAY) && msgTime == 0) {
- const TCHAR *ptszTimeStamp = XmlGetAttrValue(xNode, _T("stamp"));
+ const TCHAR *ptszTimeStamp = XmlGetAttrValue(xNode, L"stamp");
if (ptszTimeStamp != NULL)
msgTime = JabberIsoToUnixTime(ptszTimeStamp);
}
@@ -1266,10 +1266,10 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
if (!isDelivered && (n = XmlGetChild(xNode, "delivered")) != NULL) {
isDelivered = true;
- XmlNode m(_T("message")); m << XATTR(_T("to"), from);
- HXML x = m << XCHILDNS(_T("x"), JABBER_FEAT_MESSAGE_EVENTS);
- x << XCHILD(_T("delivered"));
- x << XCHILD(_T("id"), idStr);
+ XmlNode m(L"message"); m << XATTR(L"to", from);
+ HXML x = m << XCHILDNS(L"x", JABBER_FEAT_MESSAGE_EVENTS);
+ x << XCHILD(L"delivered");
+ x << XCHILD(L"id", idStr);
info->send(m);
}
if (item != NULL && XmlGetChild(xNode, "composing") != NULL) {
@@ -1286,17 +1286,17 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
TCHAR *szTmp = (TCHAR *)alloca(sizeof(TCHAR)* cbLen);
mir_tstrcpy(szTmp, ptszUrl);
if (szMessage) {
- mir_tstrcat(szTmp, _T("\r\n"));
+ mir_tstrcat(szTmp, L"\r\n");
mir_tstrcat(szTmp, szMessage);
}
szMessage = szTmp;
}
}
else if (!mir_tstrcmp(ptszXmlns, JABBER_FEAT_MUC_USER)) {
- HXML inviteNode = XmlGetChild(xNode, _T("invite"));
+ HXML inviteNode = XmlGetChild(xNode, L"invite");
if (inviteNode != NULL) {
- inviteFromJid = XmlGetAttrValue(inviteNode, _T("from"));
- inviteReason = XmlGetText(XmlGetChild(inviteNode, _T("reason")));
+ inviteFromJid = XmlGetAttrValue(inviteNode, L"from");
+ inviteReason = XmlGetText(XmlGetChild(inviteNode, L"reason"));
inviteRoomJid = from;
if (inviteReason == NULL)
inviteReason = szMessage;
@@ -1306,24 +1306,24 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
}
else if (!mir_tstrcmp(ptszXmlns, JABBER_FEAT_ROSTER_EXCHANGE) &&
item != NULL && (item->subscription == SUB_BOTH || item->subscription == SUB_TO)) {
- TCHAR chkJID[JABBER_MAX_JID_LEN] = _T("@");
+ TCHAR chkJID[JABBER_MAX_JID_LEN] = L"@";
JabberStripJid(from, chkJID + 1, _countof(chkJID) - 1);
for (int j = 1;; j++) {
- HXML iNode = XmlGetNthChild(xNode, _T("item"), j);
+ HXML iNode = XmlGetNthChild(xNode, L"item", j);
if (iNode == NULL)
break;
- const TCHAR *action = XmlGetAttrValue(iNode, _T("action"));
- const TCHAR *jid = XmlGetAttrValue(iNode, _T("jid"));
- const TCHAR *nick = XmlGetAttrValue(iNode, _T("name"));
- const TCHAR *group = XmlGetText(XmlGetChild(iNode, _T("group")));
+ const TCHAR *action = XmlGetAttrValue(iNode, L"action");
+ const TCHAR *jid = XmlGetAttrValue(iNode, L"jid");
+ const TCHAR *nick = XmlGetAttrValue(iNode, L"name");
+ const TCHAR *group = XmlGetText(XmlGetChild(iNode, L"group"));
if (action && jid && _tcsstr(jid, chkJID)) {
- if (!mir_tstrcmp(action, _T("add"))) {
+ if (!mir_tstrcmp(action, L"add")) {
MCONTACT cc = DBCreateContact(jid, nick, false, false);
if (group)
db_set_ts(cc, "CList", "Group", group);
}
- else if (!mir_tstrcmp(action, _T("delete"))) {
+ else if (!mir_tstrcmp(action, L"delete")) {
MCONTACT cc = HContactFromJID(jid);
if (cc)
CallService(MS_DB_CONTACT_DELETE, cc, 0);
@@ -1332,7 +1332,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
}
}
else if (!isChatRoomInvitation && !mir_tstrcmp(ptszXmlns, JABBER_FEAT_DIRECT_MUC_INVITE)) {
- inviteRoomJid = XmlGetAttrValue(xNode, _T("jid"));
+ inviteRoomJid = XmlGetAttrValue(xNode, L"jid");
inviteFromJid = from;
if (inviteReason == NULL)
inviteReason = XmlGetText(xNode);
@@ -1367,7 +1367,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
CMString tmp(szMessage);
tmp += ExtractImage(node);
- tmp.Replace(_T("\n"), _T("\r\n"));
+ tmp.Replace(L"\n", L"\r\n");
ptrA buf(mir_utf8encodeW(tmp));
if (item != NULL) {
@@ -1403,11 +1403,11 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
// XEP-0115: Entity Capabilities
void CJabberProto::OnProcessPresenceCapabilites(HXML node)
{
- const TCHAR *from = XmlGetAttrValue(node, _T("from"));
+ const TCHAR *from = XmlGetAttrValue(node, L"from");
if (from == NULL)
return;
- debugLog(_T("presence: for jid %s"), from);
+ debugLog(L"presence: for jid %s", from);
pResourceStatus r(ResourceInfoFromJID(from));
if (r == NULL)
@@ -1418,9 +1418,9 @@ void CJabberProto::OnProcessPresenceCapabilites(HXML node)
if ((n = XmlGetChildByTag(node, "c", "xmlns", JABBER_FEAT_ENTITY_CAPS)) != NULL ||
(n = XmlGetChild(node, "c")) != NULL)
{
- const TCHAR *szNode = XmlGetAttrValue(n, _T("node"));
- const TCHAR *szVer = XmlGetAttrValue(n, _T("ver"));
- const TCHAR *szExt = XmlGetAttrValue(n, _T("ext"));
+ const TCHAR *szNode = XmlGetAttrValue(n, L"node");
+ const TCHAR *szVer = XmlGetAttrValue(n, L"ver");
+ const TCHAR *szExt = XmlGetAttrValue(n, L"ext");
if (szNode && szVer) {
r->m_tszCapsNode = mir_tstrdup(szNode);
r->m_tszCapsVer = mir_tstrdup(szVer);
@@ -1472,7 +1472,7 @@ void CJabberProto::UpdateJidDbSettings(const TCHAR *jid)
item->getTemp()->m_iStatus = status;
if (nSelectedResource != -1) {
pResourceStatus r(item->arResources[nSelectedResource]);
- debugLog(_T("JabberUpdateJidDbSettings: updating jid %s to rc %s"), item->jid, r->m_tszResourceName);
+ debugLog(L"JabberUpdateJidDbSettings: updating jid %s to rc %s", item->jid, r->m_tszResourceName);
if (r->m_tszStatusMessage)
db_set_ts(hContact, "CList", "StatusMsg", r->m_tszStatusMessage);
else
@@ -1497,10 +1497,10 @@ void CJabberProto::UpdateJidDbSettings(const TCHAR *jid)
void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
{
- if (!node || !XmlGetName(node) || mir_tstrcmp(XmlGetName(node), _T("presence")))
+ if (!node || !XmlGetName(node) || mir_tstrcmp(XmlGetName(node), L"presence"))
return;
- LPCTSTR from = XmlGetAttrValue(node, _T("from"));
+ LPCTSTR from = XmlGetAttrValue(node, L"from");
if (from == NULL)
return;
@@ -1522,31 +1522,31 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
if (!mir_tstrcmpi(szBareFrom, szBareOurJid))
bSelfPresence = true;
- LPCTSTR type = XmlGetAttrValue(node, _T("type"));
- if (type == NULL || !mir_tstrcmp(type, _T("available"))) {
+ LPCTSTR type = XmlGetAttrValue(node, L"type");
+ if (type == NULL || !mir_tstrcmp(type, L"available")) {
ptrT nick(JabberNickFromJID(from));
if (nick == NULL)
return;
if ((hContact = HContactFromJID(from)) == NULL) {
if (!mir_tstrcmpi(info->fullJID, from) || (!bSelfPresence && !ListGetItemPtr(LIST_ROSTER, from))) {
- debugLog(_T("SKIP Receive presence online from %s (who is not in my roster and not in list - skiping)"), from);
+ debugLog(L"SKIP Receive presence online from %s (who is not in my roster and not in list - skiping)", from);
return;
}
hContact = DBCreateContact(from, nick, true, true);
}
if (!ListGetItemPtr(LIST_ROSTER, from)) {
- debugLog(_T("Receive presence online from %s (who is not in my roster)"), from);
+ debugLog(L"Receive presence online from %s (who is not in my roster)", from);
ListAdd(LIST_ROSTER, from, hContact);
}
DBCheckIsTransportedContact(from, hContact);
int status = ID_STATUS_ONLINE;
if (HXML showNode = XmlGetChild(node, "show")) {
if (LPCTSTR show = XmlGetText(showNode)) {
- if (!mir_tstrcmp(show, _T("away"))) status = ID_STATUS_AWAY;
- else if (!mir_tstrcmp(show, _T("xa"))) status = ID_STATUS_NA;
- else if (!mir_tstrcmp(show, _T("dnd"))) status = ID_STATUS_DND;
- else if (!mir_tstrcmp(show, _T("chat"))) status = ID_STATUS_FREECHAT;
+ 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;
}
}
@@ -1564,15 +1564,15 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
if (_tcschr(from, '@') == NULL) {
UI_SAFE_NOTIFY(m_pDlgServiceDiscovery, WM_JABBER_TRANSPORT_REFRESH);
}
- debugLog(_T("%s (%s) online, set contact status to %s"), nick, from, pcli->pfnGetStatusModeDescription(status, 0));
+ debugLog(L"%s (%s) online, set contact status to %s", nick, from, pcli->pfnGetStatusModeDescription(status, 0));
HXML xNode;
if (m_options.EnableAvatars) {
bool bHasAvatar = false, bRemovedAvatar = false;
debugLogA("Avatar enabled");
- for (int i = 1; (xNode = XmlGetNthChild(node, _T("x"), i)) != NULL; i++) {
- if (!mir_tstrcmp(XmlGetAttrValue(xNode, _T("xmlns")), _T("jabber:x:avatar"))) {
+ for (int i = 1; (xNode = XmlGetNthChild(node, L"x", i)) != NULL; i++) {
+ if (!mir_tstrcmp(XmlGetAttrValue(xNode, L"xmlns"), L"jabber:x:avatar")) {
LPCTSTR ptszHash = XmlGetText(XmlGetChild(xNode, "hash"));
if (ptszHash != NULL) {
delSetting(hContact, "AvatarXVcard");
@@ -1590,8 +1590,8 @@ 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, _T("x"), i)) != NULL; i++) {
- if (!mir_tstrcmp(XmlGetAttrValue(xNode, _T("xmlns")), _T("vcard-temp:x:update"))) {
+ 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 ((xNode = XmlGetChild(xNode, "photo")) != NULL) {
LPCTSTR txt = XmlGetText(xNode);
if (txt != NULL && txt[0] != 0) {
@@ -1619,7 +1619,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
return;
}
- if (!mir_tstrcmp(type, _T("unavailable"))) {
+ if (!mir_tstrcmp(type, L"unavailable")) {
hContact = HContactFromJID(from);
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, from);
if (item != NULL) {
@@ -1639,7 +1639,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
item->getTemp()->m_tszStatusMessage = mir_tstrdup(XmlGetText(XmlGetChild(node, "status")));
}
}
- else debugLog(_T("SKIP Receive presence offline from %s (who is not in my roster)"), from);
+ else debugLog(L"SKIP Receive presence offline from %s (who is not in my roster)", from);
UpdateJidDbSettings(from);
@@ -1650,7 +1650,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
return;
}
- if (!mir_tstrcmp(type, _T("subscribe"))) {
+ if (!mir_tstrcmp(type, L"subscribe")) {
if (hContact = HContactFromJID(from))
AddDbPresenceEvent(hContact, JABBER_DB_EVENT_PRESENCE_SUBSCRIBE);
@@ -1659,7 +1659,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
if (xNick != NULL) {
LPCTSTR xszNick = XmlGetText(xNick);
if (xszNick != NULL && *xszNick) {
- debugLog(_T("Grabbed nick from presence: %s"), xszNick);
+ debugLog(L"Grabbed nick from presence: %s", xszNick);
tszNick = mir_tstrdup(xszNick);
}
}
@@ -1667,12 +1667,12 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
// automatically send authorization allowed to agent/transport
if (_tcschr(from, '@') == NULL || m_options.AutoAcceptAuthorization) {
ListAdd(LIST_ROSTER, from, hContact);
- info->send(XmlNode(_T("presence")) << XATTR(_T("to"), from) << XATTR(_T("type"), _T("subscribed")));
+ info->send(XmlNode(L"presence") << XATTR(L"to", from) << XATTR(L"type", L"subscribed"));
if (m_options.AutoAdd == TRUE) {
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, from);
if (item == NULL || (item->subscription != SUB_BOTH && item->subscription != SUB_TO)) {
- debugLog(_T("Try adding contact automatically jid = %s"), from);
+ debugLog(L"Try adding contact automatically jid = %s", from);
if ((hContact = AddToListByJID(from, 0)) != NULL) {
if (item)
item->hContact = hContact;
@@ -1684,25 +1684,25 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
RebuildInfoFrame();
}
else {
- debugLog(_T("%s (%s) requests authorization"), tszNick, from);
+ debugLog(L"%s (%s) requests authorization", tszNick, from);
DBAddAuthRequest(from, tszNick);
}
return;
}
- if (!mir_tstrcmp(type, _T("unsubscribe")))
+ if (!mir_tstrcmp(type, L"unsubscribe"))
if (hContact = HContactFromJID(from))
AddDbPresenceEvent(hContact, JABBER_DB_EVENT_PRESENCE_UNSUBSCRIBE);
- if (!mir_tstrcmp(type, _T("unsubscribed")))
+ if (!mir_tstrcmp(type, L"unsubscribed"))
if (hContact = HContactFromJID(from))
AddDbPresenceEvent(hContact, JABBER_DB_EVENT_PRESENCE_UNSUBSCRIBED);
- if (!mir_tstrcmp(type, _T("error")))
+ if (!mir_tstrcmp(type, L"error"))
if (hContact = HContactFromJID(from))
AddDbPresenceEvent(hContact, JABBER_DB_EVENT_PRESENCE_ERROR);
- if (!mir_tstrcmp(type, _T("subscribed"))) {
+ if (!mir_tstrcmp(type, L"subscribed")) {
if (hContact = HContactFromJID(from))
AddDbPresenceEvent(hContact, JABBER_DB_EVENT_PRESENCE_SUBSCRIBED);
@@ -1753,41 +1753,41 @@ void CJabberProto::OnIqResultVersion(HXML /*node*/, CJabberIqInfo *pInfo)
BOOL CJabberProto::OnProcessJingle(HXML node)
{
LPCTSTR type;
- HXML child = XmlGetChildByTag(node, _T("jingle"), _T("xmlns"), JABBER_FEAT_JINGLE);
+ HXML child = XmlGetChildByTag(node, L"jingle", L"xmlns", JABBER_FEAT_JINGLE);
if (child) {
- if ((type = XmlGetAttrValue(node, _T("type"))) == NULL) return FALSE;
- if ((!mir_tstrcmp(type, _T("get")) || !mir_tstrcmp(type, _T("set")))) {
- LPCTSTR szAction = XmlGetAttrValue(child, _T("action"));
- LPCTSTR idStr = XmlGetAttrValue(node, _T("id"));
- LPCTSTR from = XmlGetAttrValue(node, _T("from"));
- if (szAction && !mir_tstrcmp(szAction, _T("session-initiate"))) {
+ if ((type = XmlGetAttrValue(node, L"type")) == NULL) return FALSE;
+ if ((!mir_tstrcmp(type, L"get") || !mir_tstrcmp(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 this is a Jingle 'session-initiate' and noone processed it yet, reply with "unsupported-applications"
- m_ThreadInfo->send(XmlNodeIq(_T("result"), idStr, from));
+ m_ThreadInfo->send(XmlNodeIq(L"result", idStr, from));
- XmlNodeIq iq(_T("set"), SerialNext(), from);
- HXML jingleNode = iq << XCHILDNS(_T("jingle"), JABBER_FEAT_JINGLE);
+ XmlNodeIq iq(L"set", SerialNext(), from);
+ HXML jingleNode = iq << XCHILDNS(L"jingle", JABBER_FEAT_JINGLE);
- jingleNode << XATTR(_T("action"), _T("session-terminate"));
- LPCTSTR szInitiator = XmlGetAttrValue(child, _T("initiator"));
+ jingleNode << XATTR(L"action", L"session-terminate");
+ LPCTSTR szInitiator = XmlGetAttrValue(child, L"initiator");
if (szInitiator)
- jingleNode << XATTR(_T("initiator"), szInitiator);
- LPCTSTR szSid = XmlGetAttrValue(child, _T("sid"));
+ jingleNode << XATTR(L"initiator", szInitiator);
+ LPCTSTR szSid = XmlGetAttrValue(child, L"sid");
if (szSid)
- jingleNode << XATTR(_T("sid"), szSid);
+ jingleNode << XATTR(L"sid", szSid);
- jingleNode << XCHILD(_T("reason"))
- << XCHILD(_T("unsupported-applications"));
+ jingleNode << XCHILD(L"reason")
+ << XCHILD(L"unsupported-applications");
m_ThreadInfo->send(iq);
return TRUE;
}
else {
// if it's something else than 'session-initiate' and noone processed it yet, reply with "unknown-session"
- XmlNodeIq iq(_T("error"), idStr, from);
- HXML errNode = iq << XCHILD(_T("error"));
- errNode << XATTR(_T("type"), _T("cancel"));
- errNode << XCHILDNS(_T("item-not-found"), _T("urn:ietf:params:xml:ns:xmpp-stanzas"));
- errNode << XCHILDNS(_T("unknown-session"), _T("urn:xmpp:jingle:errors:1"));
+ XmlNodeIq iq(L"error", idStr, from);
+ HXML errNode = iq << XCHILD(L"error");
+ errNode << XATTR(L"type", L"cancel");
+ errNode << XCHILDNS(L"item-not-found", L"urn:ietf:params:xml:ns:xmpp-stanzas");
+ errNode << XCHILDNS(L"unknown-session", L"urn:xmpp:jingle:errors:1");
m_ThreadInfo->send(iq);
return TRUE;
}
@@ -1801,13 +1801,13 @@ void CJabberProto::OnProcessIq(HXML node)
HXML queryNode;
const TCHAR *type, *xmlns;
- if (!XmlGetName(node) || mir_tstrcmp(XmlGetName(node), _T("iq"))) return;
- if ((type = XmlGetAttrValue(node, _T("type"))) == NULL) return;
+ if (!XmlGetName(node) || mir_tstrcmp(XmlGetName(node), L"iq")) return;
+ if ((type = XmlGetAttrValue(node, L"type")) == NULL) return;
int id = JabberGetPacketID(node);
queryNode = XmlGetChild(node, "query");
- xmlns = XmlGetAttrValue(queryNode, _T("xmlns"));
+ xmlns = XmlGetAttrValue(queryNode, L"xmlns");
// new match by id
if (m_iqManager.HandleIq(id, node))
@@ -1822,7 +1822,7 @@ void CJabberProto::OnProcessIq(HXML node)
return;
// RECVED: <iq type='error'> ...
- if (!mir_tstrcmp(type, _T("error"))) {
+ if (!mir_tstrcmp(type, L"error")) {
TCHAR tszBuf[20];
_itot(id, tszBuf, 10);
@@ -1839,15 +1839,15 @@ void CJabberProto::OnProcessIq(HXML node)
}
}
}
- else if ((!mir_tstrcmp(type, _T("get")) || !mir_tstrcmp(type, _T("set")))) {
- XmlNodeIq iq(_T("error"), id, XmlGetAttrValue(node, _T("from")));
+ else if ((!mir_tstrcmp(type, L"get") || !mir_tstrcmp(type, L"set"))) {
+ XmlNodeIq iq(L"error", id, XmlGetAttrValue(node, L"from"));
HXML pFirstChild = XmlGetChild(node, 0);
if (pFirstChild)
XmlAddChild(iq, pFirstChild);
- iq << XCHILD(_T("error")) << XATTR(_T("type"), _T("cancel"))
- << XCHILDNS(_T("service-unavailable"), _T("urn:ietf:params:xml:ns:xmpp-stanzas"));
+ iq << XCHILD(L"error") << XATTR(L"type", L"cancel")
+ << XCHILDNS(L"service-unavailable", L"urn:ietf:params:xml:ns:xmpp-stanzas");
m_ThreadInfo->send(iq);
}
}
@@ -1857,9 +1857,9 @@ void CJabberProto::SetRegConfig(HXML node, void *from)
{
if (m_regInfo && from) {
TCHAR text[MAX_PATH];
- mir_sntprintf(text, _T("%s@%S"), m_regInfo->conn.username, m_regInfo->conn.server);
- XmlNodeIq iq(_T("set"), SerialNext(), (TCHAR*)from);
- iq << XATTR(_T("from"), text);
+ mir_sntprintf(text, L"%s@%S", m_regInfo->conn.username, m_regInfo->conn.server);
+ XmlNodeIq iq(L"set", SerialNext(), (TCHAR*)from);
+ iq << XATTR(L"from", text);
HXML query = iq << XQUERY(JABBER_FEAT_REGISTER);
XmlAddChild(query, node);
m_regInfo->send(iq);
@@ -1868,28 +1868,28 @@ void CJabberProto::SetRegConfig(HXML node, void *from)
void CJabberProto::OnProcessRegIq(HXML node, ThreadData *info)
{
- if (!XmlGetName(node) || mir_tstrcmp(XmlGetName(node), _T("iq"))) return;
- LPCTSTR type = XmlGetAttrValue(node, _T("type"));
+ if (!XmlGetName(node) || mir_tstrcmp(XmlGetName(node), L"iq")) return;
+ LPCTSTR type = XmlGetAttrValue(node, L"type");
if (type == NULL)
return;
int id = JabberGetPacketID(node);
- LPCTSTR from = XmlGetAttrValue(node, _T("from"));
+ LPCTSTR from = XmlGetAttrValue(node, L"from");
if (from == NULL)
return;
- if (!mir_tstrcmp(type, _T("result"))) {
- HXML queryNode = XmlGetChild(node, _T("query"));
+ if (!mir_tstrcmp(type, L"result")) {
+ HXML queryNode = XmlGetChild(node, L"query");
if (queryNode != NULL) {
- LPCTSTR str = XmlGetAttrValue(queryNode, _T("xmlns"));
+ LPCTSTR str = XmlGetAttrValue(queryNode, L"xmlns");
if (!mir_tstrcmp(str, JABBER_FEAT_REGISTER)) {
- HXML xNode = XmlGetChild(queryNode, _T("x"));
+ HXML xNode = XmlGetChild(queryNode, L"x");
if (xNode != NULL) {
- str = XmlGetAttrValue(xNode, _T("xmlns"));
+ str = XmlGetAttrValue(xNode, L"xmlns");
if (!mir_tstrcmp(str, JABBER_FEAT_DATA_FORMS)) {
m_regInfo = info;
- FormCreateDialog(xNode, _T("Jabber register new user"), &CJabberProto::SetRegConfig, mir_tstrdup(from));
+ FormCreateDialog(xNode, L"Jabber register new user", &CJabberProto::SetRegConfig, mir_tstrdup(from));
return;
}
}
@@ -1900,10 +1900,10 @@ void CJabberProto::OnProcessRegIq(HXML node, ThreadData *info)
if (id == iqIdRegGetReg) {
iqIdRegSetReg = SerialNext();
- XmlNodeIq iq(_T("set"), iqIdRegSetReg);
+ XmlNodeIq iq(L"set", iqIdRegSetReg);
HXML query = iq << XQUERY(JABBER_FEAT_REGISTER);
- query << XCHILD(_T("password"), info->conn.password);
- query << XCHILD(_T("username"), info->conn.username);
+ query << XCHILD(L"password", info->conn.password);
+ query << XCHILD(L"username", info->conn.username);
info->send(iq);
SendMessage(info->conn.reg_hwndDlg, WM_JABBER_REGDLG_UPDATE, 75, (LPARAM)TranslateT("Sending registration information..."));
@@ -1917,7 +1917,7 @@ void CJabberProto::OnProcessRegIq(HXML node, ThreadData *info)
}
}
- else if (!mir_tstrcmp(type, _T("error"))) {
+ else if (!mir_tstrcmp(type, L"error")) {
TCHAR *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_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp
index 7601a92287..a4f11912b4 100644
--- a/protocols/JabberG/src/jabber_userinfo.cpp
+++ b/protocols/JabberG/src/jabber_userinfo.cpp
@@ -174,7 +174,7 @@ static HTREEITEM sttFillInfoLine(HWND hwndTree, HTREEITEM htiRoot, HICON hIcon,
TCHAR buf[256];
if (title)
- mir_sntprintf(buf, _T("%s: %s"), title, value);
+ mir_sntprintf(buf, L"%s: %s", title, value);
else
mir_tstrncpy(buf, value, _countof(buf));
@@ -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, _T("%s %s"), r->m_tszSoftware, r->m_tszSoftwareVersion);
+ mir_sntprintf(buf, L"%s %s", r->m_tszSoftware, r->m_tszSoftwareVersion);
hIcon = Finger_GetClientIcon(buf, 0);
}
}
@@ -251,7 +251,7 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti
// Resource priority
TCHAR szPriority[128];
- mir_sntprintf(szPriority, _T("%d"), (int)r->m_iPriority);
+ mir_sntprintf(szPriority, L"%d", (int)r->m_iPriority);
sttFillInfoLine(hwndTree, htiResource, NULL, TranslateT("Resource priority"), szPriority, sttInfoLineId(resource, INFOLINE_PRIORITY));
// Idle
@@ -269,7 +269,7 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti
sttFillInfoLine(hwndTree, htiResource, NULL, TranslateT("Idle since"), buf, sttInfoLineId(resource, INFOLINE_IDLE));
// caps
- mir_sntprintf(buf, _T("%s/%s"), item->jid, r->m_tszResourceName);
+ mir_sntprintf(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) {
TCHAR szDescription[ 1024 ];
if (g_JabberFeatCapPairs[i].tszDescription)
- mir_sntprintf(szDescription, _T("%s (%s)"), TranslateTS(g_JabberFeatCapPairs[i].tszDescription), g_JabberFeatCapPairs[i].szFeature);
+ mir_sntprintf(szDescription, L"%s (%s)", TranslateTS(g_JabberFeatCapPairs[i].tszDescription), g_JabberFeatCapPairs[i].szFeature);
else
_tcsncpy_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) {
TCHAR szDescription[ 1024 ];
if (ppro->m_lstJabberFeatCapPairsDynamic[j]->szDescription)
- mir_sntprintf(szDescription, _T("%s (%s)"), TranslateTS(ppro->m_lstJabberFeatCapPairsDynamic[j]->szDescription), ppro->m_lstJabberFeatCapPairsDynamic[j]->szFeature);
+ mir_sntprintf(szDescription, L"%s (%s)", TranslateTS(ppro->m_lstJabberFeatCapPairsDynamic[j]->szDescription), ppro->m_lstJabberFeatCapPairsDynamic[j]->szFeature);
else
_tcsncpy_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) {
TCHAR szText[2048];
if (szAdvStatusText && *szAdvStatusText)
- mir_sntprintf(szText, _T("%s (%s)"), TranslateTS(szAdvStatusTitle), szAdvStatusText);
+ mir_sntprintf(szText, L"%s (%s)", TranslateTS(szAdvStatusTitle), szAdvStatusText);
else
_tcsncpy_s(szText, TranslateTS(szAdvStatusTitle), _TRUNCATE);
sttFillInfoLine(hwndTree, htiRoot, IcoLib_GetIcon(szAdvStatusIcon), szTitle, szText, dwInfoLine);
@@ -337,7 +337,7 @@ static void sttFillUserInfo(CJabberProto *ppro, HWND hwndTree, JABBER_LIST_ITEM
sttCleanupInfo(hwndTree, 0);
- HTREEITEM htiRoot = sttFillInfoLine(hwndTree, NULL, ppro->LoadIconEx("main"), _T("JID"), item->jid, sttInfoLineId(0, INFOLINE_NAME), true);
+ HTREEITEM htiRoot = sttFillInfoLine(hwndTree, NULL, ppro->LoadIconEx("main"), L"JID", item->jid, sttInfoLineId(0, INFOLINE_NAME), true);
TCHAR buf[256];
if (MCONTACT hContact = ppro->HContactFromJID(item->jid)) {
@@ -408,7 +408,7 @@ static void sttFillUserInfo(CJabberProto *ppro, HWND hwndTree, JABBER_LIST_ITEM
static void sttGetNodeText(HWND hwndTree, HTREEITEM hti, UserInfoStringBuf *buf, int indent = 0)
{
for (int i = 0; i < indent; i++)
- buf->append(_T("\t"));
+ buf->append(L"\t");
TVITEMEX tvi = { 0 };
tvi.mask = TVIF_HANDLE | TVIF_TEXT | TVIF_STATE;
@@ -422,7 +422,7 @@ static void sttGetNodeText(HWND hwndTree, HTREEITEM hti, UserInfoStringBuf *buf,
}
buf->actualize();
- buf->append(_T("\r\n"));
+ buf->append(L"\r\n");
if (tvi.state & TVIS_EXPANDED)
for (hti = TreeView_GetChild(hwndTree, hti); hti; hti = TreeView_GetNextSibling(hwndTree, hti))
@@ -481,7 +481,7 @@ static INT_PTR CALLBACK JabberUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa
if (dat->item == NULL) {
HWND hwndTree = GetDlgItem(hwndDlg, IDC_TV_INFO);
TreeView_DeleteAllItems(hwndTree);
- HTREEITEM htiRoot = sttFillInfoLine(hwndTree, NULL, dat->ppro->LoadIconEx("main"), _T("JID"), jid, sttInfoLineId(0, INFOLINE_NAME), true);
+ HTREEITEM htiRoot = sttFillInfoLine(hwndTree, NULL, dat->ppro->LoadIconEx("main"), L"JID", jid, sttInfoLineId(0, INFOLINE_NAME), true);
sttFillInfoLine(hwndTree, htiRoot, dat->ppro->LoadIconEx("vcard"), NULL,
TranslateT("Please switch online to see more details."));
break;
@@ -539,7 +539,7 @@ static INT_PTR CALLBACK JabberUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa
tvi.cchTextMax = _countof(szBuffer);
tvi.pszText = szBuffer;
if (TreeView_GetItem(hwndTree, &tvi)) {
- if (TCHAR *str = _tcsstr(szBuffer, _T(": ")))
+ if (TCHAR *str = _tcsstr(szBuffer, L": "))
JabberCopyText(hwndDlg, str + 2);
else
JabberCopyText(hwndDlg, szBuffer);
@@ -649,7 +649,7 @@ static INT_PTR CALLBACK JabberUserPhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wP
item = photoInfo->ppro->ListGetItemPtr(LIST_ROSTER, jid);
if (item != NULL) {
if (item->photoFileName) {
- photoInfo->ppro->debugLog(_T("Showing picture from %s"), item->photoFileName);
+ photoInfo->ppro->debugLog(L"Showing picture from %s", item->photoFileName);
photoInfo->hBitmap = Bitmap_Load(item->photoFileName);
FIP->FI_Premultiply(photoInfo->hBitmap);
ShowWindow(GetDlgItem(hwndDlg, IDC_SAVE), SW_SHOW);
@@ -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, _T("BMP %s (*.bmp)%c*.BMP"), TranslateT("format"), 0);
+ mir_sntprintf(szFilter, L"BMP %s (*.bmp)%c*.BMP", TranslateT("format"), 0);
break;
case PA_FORMAT_GIF:
- mir_sntprintf(szFilter, _T("GIF %s (*.gif)%c*.GIF"), TranslateT("format"), 0);
+ mir_sntprintf(szFilter, L"GIF %s (*.gif)%c*.GIF", TranslateT("format"), 0);
break;
case PA_FORMAT_JPEG:
- mir_sntprintf(szFilter, _T("JPEG %s (*.jpg;*.jpeg)%c*.JPG;*.JPEG"), TranslateT("format"), 0);
+ mir_sntprintf(szFilter, L"JPEG %s (*.jpg;*.jpeg)%c*.JPG;*.JPEG", TranslateT("format"), 0);
break;
default:
- mir_sntprintf(szFilter, _T("%s (*.*)%c*.*"), TranslateT("Unknown format"), 0);
+ mir_sntprintf(szFilter, L"%s (*.*)%c*.*", TranslateT("Unknown format"), 0);
}
TCHAR szFileName[MAX_PATH]; szFileName[0] = '\0';
@@ -701,7 +701,7 @@ static INT_PTR CALLBACK JabberUserPhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wP
ofn.nMaxFile = _MAX_PATH;
ofn.Flags = OFN_OVERWRITEPROMPT;
if (GetSaveFileName(&ofn)) {
- photoInfo->ppro->debugLog(_T("File selected is %s"), szFileName);
+ photoInfo->ppro->debugLog(L"File selected is %s", szFileName);
CopyFile(item->photoFileName, szFileName, FALSE);
}
}
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp
index 8b1f200a44..e4da6b2df3 100644
--- a/protocols/JabberG/src/jabber_util.cpp
+++ b/protocols/JabberG/src/jabber_util.cpp
@@ -69,7 +69,7 @@ MCONTACT CJabberProto::HContactFromJID(const TCHAR *jid, bool bStripResource)
TCHAR* __stdcall JabberNickFromJID(const TCHAR *jid)
{
if (jid == NULL)
- return mir_tstrdup(_T(""));
+ return mir_tstrdup(L"");
const TCHAR *p = _tcschr(jid, '@');
if (p == NULL)
@@ -181,7 +181,7 @@ void __stdcall JabberHttpUrlDecode(TCHAR *str)
if (str == NULL) return;
for (p = q = (TCHAR*)str; *p != '\0'; p++, q++) {
if (*p == '%' && *(p + 1) != '\0' && isxdigit(*(p + 1)) && *(p + 2) != '\0' && isxdigit(*(p + 2))) {
- _stscanf((TCHAR*)p + 1, _T("%2x"), &code);
+ _stscanf((TCHAR*)p + 1, L"%2x", &code);
*q = (unsigned char)code;
p += 2;
}
@@ -258,24 +258,24 @@ TCHAR* __stdcall JabberErrorMsg(HXML errorNode, int* pErrorCode)
if (errorNode == NULL) {
if (pErrorCode)
*pErrorCode = -1;
- mir_sntprintf(errorStr, 256, _T("%s -1: %s"), TranslateT("Error"), TranslateT("Unknown error message"));
+ mir_sntprintf(errorStr, 256, L"%s -1: %s", TranslateT("Error"), TranslateT("Unknown error message"));
return errorStr;
}
int errorCode = -1;
- const TCHAR *str = XmlGetAttrValue(errorNode, _T("code"));
+ const TCHAR *str = XmlGetAttrValue(errorNode, L"code");
if (str != NULL)
errorCode = _ttoi(str);
str = XmlGetText(errorNode);
if (str == NULL)
- str = XmlGetText(XmlGetChild(errorNode, _T("text")));
+ str = XmlGetText(XmlGetChild(errorNode, L"text"));
if (str == NULL) {
for (int i = 0;; i++) {
HXML c = XmlGetChild(errorNode, i);
if (c == NULL) break;
- const TCHAR *attr = XmlGetAttrValue(c, _T("xmlns"));
- if (attr && !mir_tstrcmp(attr, _T("urn:ietf:params:xml:ns:xmpp-stanzas"))) {
+ const TCHAR *attr = XmlGetAttrValue(c, L"xmlns");
+ if (attr && !mir_tstrcmp(attr, L"urn:ietf:params:xml:ns:xmpp-stanzas")) {
str = XmlGetName(c);
break;
}
@@ -283,9 +283,9 @@ TCHAR* __stdcall JabberErrorMsg(HXML errorNode, int* pErrorCode)
}
if (str != NULL)
- mir_sntprintf(errorStr, 256, _T("%s %d: %s\r\n%s"), TranslateT("Error"), errorCode, TranslateTS(JabberErrorStr(errorCode)), str);
+ mir_sntprintf(errorStr, 256, L"%s %d: %s\r\n%s", TranslateT("Error"), errorCode, TranslateTS(JabberErrorStr(errorCode)), str);
else
- mir_sntprintf(errorStr, 256, _T("%s %d: %s"), TranslateT("Error"), errorCode, TranslateTS(JabberErrorStr(errorCode)));
+ mir_sntprintf(errorStr, 256, L"%s %d: %s", TranslateT("Error"), errorCode, TranslateTS(JabberErrorStr(errorCode)));
if (pErrorCode)
*pErrorCode = errorCode;
@@ -308,7 +308,7 @@ void CJabberProto::SendVisibleInvisiblePresence(BOOL invisible)
WORD apparentMode = getWord(hContact, "ApparentMode", 0);
if (invisible == TRUE && apparentMode == ID_STATUS_OFFLINE)
- m_ThreadInfo->send(XmlNode(_T("presence")) << XATTR(_T("to"), item->jid) << XATTR(_T("type"), _T("invisible")));
+ m_ThreadInfo->send(XmlNode(L"presence") << XATTR(L"to", item->jid) << XATTR(L"type", L"invisible"));
else if (invisible == FALSE && apparentMode == ID_STATUS_ONLINE)
SendPresenceTo(m_iStatus, item->jid, NULL);
}
@@ -354,7 +354,7 @@ time_t __stdcall JabberIsoToUnixTime(const TCHAR *stamp)
for (; *p != '\0' && !isdigit(*p); p++);
// Parse time
- if (_stscanf(p, _T("%d:%d:%d"), &timestamp.tm_hour, &timestamp.tm_min, &timestamp.tm_sec) != 3)
+ if (_stscanf(p, L"%d:%d:%d", &timestamp.tm_hour, &timestamp.tm_min, &timestamp.tm_sec) != 3)
return (time_t)0;
timestamp.tm_isdst = 0; // DST is already present in _timezone below
@@ -376,16 +376,16 @@ void CJabberProto::SendPresenceTo(int status, const TCHAR* to, HXML extra, const
TCHAR szPriority[40];
_itot(iPriority, szPriority, 10);
- XmlNode p(_T("presence")); p << XCHILD(_T("priority"), szPriority);
+ XmlNode p(L"presence"); p << XCHILD(L"priority", szPriority);
if (to != NULL)
- p << XATTR(_T("to"), to);
+ p << XATTR(L"to", to);
if (extra)
XmlAddChild(p, extra);
// XEP-0115:Entity Capabilities
- HXML c = p << XCHILDNS(_T("c"), JABBER_FEAT_ENTITY_CAPS) << XATTR(_T("node"), JABBER_CAPS_MIRANDA_NODE)
- << XATTR(_T("ver"), szCoreVersion);
+ HXML c = p << XCHILDNS(L"c", JABBER_FEAT_ENTITY_CAPS) << XATTR(L"node", JABBER_CAPS_MIRANDA_NODE)
+ << XATTR(L"ver", szCoreVersion);
LIST<TCHAR> arrExtCaps(5);
if (bSecureIM)
@@ -430,17 +430,17 @@ void CJabberProto::SendPresenceTo(int status, const TCHAR* to, HXML extra, const
szExtCaps.AppendChar(' ');
szExtCaps += arrExtCaps[i];
}
- XmlAddAttr(c, _T("ext"), szExtCaps);
+ XmlAddAttr(c, L"ext", szExtCaps);
}
if (m_options.EnableAvatars) {
- HXML x = p << XCHILDNS(_T("x"), _T("vcard-temp:x:update"));
+ HXML x = p << XCHILDNS(L"x", L"vcard-temp:x:update");
ptrA hashValue(getStringA("AvatarHash"));
if (hashValue != NULL) // XEP-0153: vCard-Based Avatars
- x << XCHILD(_T("photo"), _A2T(hashValue));
+ x << XCHILD(L"photo", _A2T(hashValue));
else
- x << XCHILD(_T("photo"));
+ x << XCHILD(L"photo");
}
{
mir_cslock lck(m_csModeMsgMutex);
@@ -449,25 +449,25 @@ void CJabberProto::SendPresenceTo(int status, const TCHAR* to, HXML extra, const
if (!msg) msg = m_modeMsgs.szOnline;
break;
case ID_STATUS_INVISIBLE:
- p << XATTR(_T("type"), _T("invisible"));
+ p << XATTR(L"type", L"invisible");
break;
case ID_STATUS_AWAY:
case ID_STATUS_ONTHEPHONE:
case ID_STATUS_OUTTOLUNCH:
- p << XCHILD(_T("show"), _T("away"));
+ p << XCHILD(L"show", L"away");
if (!msg) msg = m_modeMsgs.szAway;
break;
case ID_STATUS_NA:
- p << XCHILD(_T("show"), _T("xa"));
+ p << XCHILD(L"show", L"xa");
if (!msg) msg = m_modeMsgs.szNa;
break;
case ID_STATUS_DND:
case ID_STATUS_OCCUPIED:
- p << XCHILD(_T("show"), _T("dnd"));
+ p << XCHILD(L"show", L"dnd");
if (!msg) msg = m_modeMsgs.szDnd;
break;
case ID_STATUS_FREECHAT:
- p << XCHILD(_T("show"), _T("chat"));
+ p << XCHILD(L"show", L"chat");
if (!msg) msg = m_modeMsgs.szFreechat;
break;
default: // Should not reach here
@@ -475,7 +475,7 @@ void CJabberProto::SendPresenceTo(int status, const TCHAR* to, HXML extra, const
}
if (msg)
- p << XCHILD(_T("status"), msg);
+ p << XCHILD(L"status", msg);
}
m_ThreadInfo->send(p);
@@ -493,7 +493,7 @@ void CJabberProto::SendPresence(int status, bool bSendToAll)
JABBER_LIST_ITEM *item = ListGetItemPtrFromIndex(i);
if (item != NULL && item->nick != NULL) {
TCHAR text[1024];
- mir_sntprintf(text, _T("%s/%s"), item->jid, item->nick);
+ mir_sntprintf(text, L"%s/%s", item->jid, item->nick);
SendPresenceTo(status == ID_STATUS_INVISIBLE ? ID_STATUS_ONLINE : status, text, NULL);
}
}
@@ -505,7 +505,7 @@ void CJabberProto::SendPresence(int status, bool bSendToAll)
int __stdcall JabberGetPacketID(HXML n)
{
- const TCHAR *str = XmlGetAttrValue(n, _T("id"));
+ const TCHAR *str = XmlGetAttrValue(n, L"id");
if (str)
if (!_tcsncmp(str, _T(JABBER_IQID), _countof(JABBER_IQID) - 1))
return _ttoi(str + _countof(JABBER_IQID) - 1);
@@ -516,7 +516,7 @@ int __stdcall JabberGetPacketID(HXML n)
TCHAR* __stdcall JabberId2string(int id)
{
TCHAR text[100];
- mir_sntprintf(text, _T(JABBER_IQID) _T("%d"), id);
+ mir_sntprintf(text, _T(JABBER_IQID) L"%d", id);
return mir_tstrdup(text);
}
@@ -543,7 +543,7 @@ TCHAR* CJabberProto::GetClientJID(const TCHAR *jid, TCHAR *dest, size_t destLen)
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, _T("http://talk.google.com/xmpp/bot/caps"))) {
+ if (LI->arResources.getCount() == 1 && !mir_tstrcmp(LI->arResources[0]->m_tszCapsNode, L"http://talk.google.com/xmpp/bot/caps")) {
if (p) *p = 0;
return dest;
}
@@ -551,7 +551,7 @@ TCHAR* CJabberProto::GetClientJID(const TCHAR *jid, TCHAR *dest, size_t destLen)
if (p == NULL) {
pResourceStatus r(LI->getBestResource());
if (r != NULL)
- mir_sntprintf(dest, destLen, _T("%s/%s"), jid, r->m_tszResourceName);
+ mir_sntprintf(dest, destLen, L"%s/%s", jid, r->m_tszResourceName);
}
}
@@ -582,17 +582,17 @@ TCHAR* __stdcall JabberStripJid(const TCHAR *jid, TCHAR *dest, size_t destLen)
LPCTSTR __stdcall JabberGetPictureType(HXML node, const char *picBuf)
{
if (LPCTSTR ptszType = XmlGetText(XmlGetChild(node, "TYPE")))
- if (!mir_tstrcmp(ptszType, _T("image/jpeg")) ||
- !mir_tstrcmp(ptszType, _T("image/png")) ||
- !mir_tstrcmp(ptszType, _T("image/gif")) ||
- !mir_tstrcmp(ptszType, _T("image/bmp")))
+ 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"))
return ptszType;
switch (ProtoGetBufferFormat(picBuf)) {
- case PA_FORMAT_GIF: return _T("image/gif");
- case PA_FORMAT_BMP: return _T("image/bmp");
- case PA_FORMAT_PNG: return _T("image/png");
- case PA_FORMAT_JPEG: return _T("image/jpeg");
+ case PA_FORMAT_GIF: return L"image/gif";
+ case PA_FORMAT_BMP: return L"image/bmp";
+ case PA_FORMAT_PNG: return L"image/png";
+ case PA_FORMAT_JPEG: return L"image/jpeg";
}
return NULL;
@@ -664,7 +664,7 @@ void CJabberProto::ComboLoadRecentStrings(HWND hwndDlg, UINT idcCombo, char *par
}
if (!SendDlgItemMessage(hwndDlg, idcCombo, CB_GETCOUNT, 0, 0))
- SendDlgItemMessage(hwndDlg, idcCombo, CB_ADDSTRING, 0, (LPARAM)_T(""));
+ SendDlgItemMessage(hwndDlg, idcCombo, CB_ADDSTRING, 0, (LPARAM)L"");
}
void CJabberProto::ComboAddRecentString(HWND hwndDlg, UINT idcCombo, char *param, const TCHAR *string, int recentCount)
@@ -676,7 +676,7 @@ void CJabberProto::ComboAddRecentString(HWND hwndDlg, UINT idcCombo, char *param
int id;
SendDlgItemMessage(hwndDlg, idcCombo, CB_ADDSTRING, 0, (LPARAM)string);
- if ((id = SendDlgItemMessage(hwndDlg, idcCombo, CB_FINDSTRING, (WPARAM)-1, (LPARAM)_T(""))) != CB_ERR)
+ if ((id = SendDlgItemMessage(hwndDlg, idcCombo, CB_FINDSTRING, (WPARAM)-1, (LPARAM)L"")) != CB_ERR)
SendDlgItemMessage(hwndDlg, idcCombo, CB_DELETESTRING, id, 0);
id = getByte(param, 0);
@@ -758,7 +758,7 @@ void CJabberProto::RebuildInfoFrame()
TCHAR* time2str(time_t _time, TCHAR *buf, size_t bufLen)
{
struct tm* T = gmtime(&_time);
- mir_sntprintf(buf, bufLen, _T("%04d-%02d-%02dT%02d:%02d:%02dZ"),
+ mir_sntprintf(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;
}
@@ -766,9 +766,9 @@ TCHAR* time2str(time_t _time, TCHAR *buf, size_t bufLen)
time_t str2time(const TCHAR *buf)
{
struct tm T = { 0 };
- if (_stscanf(buf, _T("%04d-%02d-%02dT%02d:%02d:%02dZ"), &T.tm_year, &T.tm_mon, &T.tm_mday, &T.tm_hour, &T.tm_min, &T.tm_sec) != 6) {
+ if (_stscanf(buf, L"%04d-%02d-%02dT%02d:%02d:%02dZ", &T.tm_year, &T.tm_mon, &T.tm_mday, &T.tm_hour, &T.tm_min, &T.tm_sec) != 6) {
int boo;
- if (_stscanf(buf, _T("%04d-%02d-%02dT%02d:%02d:%02d.%dZ"), &T.tm_year, &T.tm_mon, &T.tm_mday, &T.tm_hour, &T.tm_min, &T.tm_sec, &boo) != 7)
+ if (_stscanf(buf, L"%04d-%02d-%02dT%02d:%02d:%02d.%dZ", &T.tm_year, &T.tm_mon, &T.tm_mday, &T.tm_hour, &T.tm_min, &T.tm_sec, &boo) != 7)
return 0;
}
@@ -837,11 +837,11 @@ BOOL CJabberProto::EnterString(CMString &result, LPCTSTR caption, int type, char
bool JabberReadXep203delay(HXML node, time_t &msgTime)
{
- HXML n = XmlGetChildByTag(node, "delay", "xmlns", _T("urn:xmpp:delay"));
+ HXML n = XmlGetChildByTag(node, "delay", "xmlns", L"urn:xmpp:delay");
if (n == NULL)
return false;
- const TCHAR *ptszTimeStamp = XmlGetAttrValue(n, _T("stamp"));
+ const TCHAR *ptszTimeStamp = XmlGetAttrValue(n, L"stamp");
if (ptszTimeStamp == NULL)
return false;
@@ -927,13 +927,13 @@ void __cdecl CJabberProto::LoadHttpAvatars(void* param)
TCHAR tszFileName[MAX_PATH];
GetAvatarFileName(ai.hContact, tszFileName, _countof(tszFileName));
_tcsncpy_s(ai.filename, tszFileName, _TRUNCATE);
- FILE* out = _tfopen(tszFileName, _T("wb"));
+ FILE* out = _tfopen(tszFileName, L"wb");
if (out != NULL) {
fwrite(res->pData, res->dataLength, 1, out);
fclose(out);
setString(ai.hContact, "AvatarSaved", buffer);
ProtoBroadcastAck(ai.hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, &ai, 0);
- debugLog(_T("Broadcast new avatar: %s"), ai.filename);
+ debugLog(L"Broadcast new avatar: %s", ai.filename);
}
else ProtoBroadcastAck(ai.hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, &ai, 0);
}
diff --git a/protocols/JabberG/src/jabber_vcard.cpp b/protocols/JabberG/src/jabber_vcard.cpp
index 8ad9ff1164..ad0f752bb2 100644
--- a/protocols/JabberG/src/jabber_vcard.cpp
+++ b/protocols/JabberG/src/jabber_vcard.cpp
@@ -36,8 +36,8 @@ int CJabberProto::SendGetVcard(const TCHAR *jid)
if (!m_bJabberOnline) return 0;
CJabberIqInfo *pInfo = AddIQ(&CJabberProto::OnIqResultGetVcard, JABBER_IQ_TYPE_GET, jid);
- m_ThreadInfo->send(XmlNodeIq(pInfo) << XCHILDNS(_T("vCard"), JABBER_FEAT_VCARD_TEMP)
- << XATTR(_T("prodid"), _T("-//HandGen//NONSGML vGen v1.0//EN")) << XATTR(_T("version"), _T("2.0")));
+ m_ThreadInfo->send(XmlNodeIq(pInfo) << XCHILDNS(L"vCard", JABBER_FEAT_VCARD_TEMP)
+ << XATTR(L"prodid", L"-//HandGen//NONSGML vGen v1.0//EN") << XATTR(L"version", L"2.0"));
return pInfo->GetIqId();
}
@@ -291,9 +291,9 @@ static INT_PTR CALLBACK PhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
dat->ppro->GetAvatarFileName(NULL, szAvatarFileName, _countof(szAvatarFileName));
if (_taccess(szAvatarFileName, 0) == 0) {
if (GetTempPath(_countof(szTempPath), szTempPath) <= 0)
- mir_tstrcpy(szTempPath, _T(".\\"));
- if (GetTempFileName(szTempPath, _T("jab"), 0, szTempFileName) > 0) {
- dat->ppro->debugLog(_T("Temp file = %s"), szTempFileName);
+ mir_tstrcpy(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);
@@ -349,16 +349,16 @@ static INT_PTR CALLBACK PhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
struct _stat st;
HBITMAP hNewBitmap;
- dat->ppro->debugLog(_T("File selected is %s"), szFileName);
+ dat->ppro->debugLog(L"File selected is %s", szFileName);
if (_tstat(szFileName, &st) < 0 || st.st_size > 40 * 1024) {
MessageBox(hwndDlg, TranslateT("Only JPG, GIF, and BMP image files smaller than 40 KB are supported."), TranslateT("Jabber vCard"), MB_OK | MB_SETFOREGROUND);
break;
}
if (GetTempPath(_countof(szTempPath), szTempPath) <= 0)
- mir_tstrcpy(szTempPath, _T(".\\"));
+ mir_tstrcpy(szTempPath, L".\\");
- if (GetTempFileName(szTempPath, _T("jab"), 0, szTempFileName) > 0) {
- dat->ppro->debugLog(_T("Temp file = %s"), szTempFileName);
+ if (GetTempFileName(szTempPath, L"jab", 0, szTempFileName) > 0) {
+ dat->ppro->debugLog(L"Temp file = %s", szTempFileName);
if (CopyFile(szFileName, szTempFileName, FALSE) == TRUE) {
if ((hNewBitmap = Bitmap_Load(szTempFileName)) != NULL) {
if (dat->hBitmap) {
@@ -733,7 +733,7 @@ static INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM, LPARAM lP
ptrT email( ppro->getTStringA(idstr));
if (email == NULL) break;
- mir_sntprintf(number, _T("%d"), i+1);
+ mir_sntprintf(number, L"%d", i+1);
lvi.pszText = number;
lvi.lParam = (LPARAM)i;
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_EMAILS), &lvi);
@@ -754,7 +754,7 @@ static INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM, LPARAM lP
ptrT phone( ppro->getTStringA(idstr));
if (phone == NULL) break;
- mir_sntprintf(number, _T("%d"), i+1);
+ mir_sntprintf(number, L"%d", i+1);
lvi.pszText = number;
lvi.lParam = (LPARAM)i;
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
@@ -1018,11 +1018,11 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, TCHAR* szPhotoFileName)
char idstr[33];
XmlNodeIq iq(AddIQ(&CJabberProto::OnIqResultSetVcard, JABBER_IQ_TYPE_SET));
- HXML v = iq << XCHILDNS(_T("vCard"), JABBER_FEAT_VCARD_TEMP);
+ HXML v = iq << XCHILDNS(L"vCard", JABBER_FEAT_VCARD_TEMP);
AppendVcardFromDB(v, "FN", "FullName");
- HXML n = v << XCHILD(_T("N"));
+ HXML n = v << XCHILD(L"N");
AppendVcardFromDB(n, "GIVEN", "FirstName");
AppendVcardFromDB(n, "MIDDLE", "MiddleName");
AppendVcardFromDB(n, "FAMILY", "LastName");
@@ -1037,19 +1037,19 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, TCHAR* szPhotoFileName)
if (email == NULL)
break;
- HXML e = v << XCHILD(_T("EMAIL"), email);
+ HXML e = v << XCHILD(L"EMAIL", email);
AppendVcardFromDB(e, "USERID", idstr);
mir_snprintf(idstr, "e-mailFlag%d", i);
WORD nFlag = getWord(idstr, 0);
- if (nFlag & JABBER_VCEMAIL_HOME) e << XCHILD(_T("HOME"));
- if (nFlag & JABBER_VCEMAIL_WORK) e << XCHILD(_T("WORK"));
- if (nFlag & JABBER_VCEMAIL_INTERNET) e << XCHILD(_T("INTERNET"));
- if (nFlag & JABBER_VCEMAIL_X400) e << XCHILD(_T("X400"));
+ if (nFlag & JABBER_VCEMAIL_HOME) e << XCHILD(L"HOME");
+ if (nFlag & JABBER_VCEMAIL_WORK) e << XCHILD(L"WORK");
+ if (nFlag & JABBER_VCEMAIL_INTERNET) e << XCHILD(L"INTERNET");
+ if (nFlag & JABBER_VCEMAIL_X400) e << XCHILD(L"X400");
}
- n = v << XCHILD(_T("ADR"));
- n << XCHILD(_T("HOME"));
+ n = v << XCHILD(L"ADR");
+ n << XCHILD(L"HOME");
AppendVcardFromDB(n, "STREET", "Street");
AppendVcardFromDB(n, "EXTADR", "Street2");
AppendVcardFromDB(n, "EXTADD", "Street2"); // for compatibility with client using old vcard format
@@ -1059,8 +1059,8 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, TCHAR* szPhotoFileName)
AppendVcardFromDB(n, "CTRY", "Country");
AppendVcardFromDB(n, "COUNTRY", "Country"); // for compatibility with client using old vcard format
- n = v << XCHILD(_T("ADR"));
- n << XCHILD(_T("WORK"));
+ n = v << XCHILD(L"ADR");
+ n << XCHILD(L"WORK");
AppendVcardFromDB(n, "STREET", "CompanyStreet");
AppendVcardFromDB(n, "EXTADR", "CompanyStreet2");
AppendVcardFromDB(n, "EXTADD", "CompanyStreet2"); // for compatibility with client using old vcard format
@@ -1070,7 +1070,7 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, TCHAR* szPhotoFileName)
AppendVcardFromDB(n, "CTRY", "CompanyCountry");
AppendVcardFromDB(n, "COUNTRY", "CompanyCountry"); // for compatibility with client using old vcard format
- n = v << XCHILD(_T("ORG"));
+ n = v << XCHILD(L"ORG");
AppendVcardFromDB(n, "ORGNAME", "Company");
AppendVcardFromDB(n, "ORGUNIT", "CompanyDepartment");
@@ -1085,23 +1085,23 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, TCHAR* szPhotoFileName)
if (phone == NULL)
break;
- n = v << XCHILD(_T("TEL"));
+ n = v << XCHILD(L"TEL");
AppendVcardFromDB(n, "NUMBER", idstr);
mir_snprintf(idstr, "PhoneFlag%d", i);
WORD nFlag = getWord(idstr, 0);
- if (nFlag & JABBER_VCTEL_HOME) n << XCHILD(_T("HOME"));
- if (nFlag & JABBER_VCTEL_WORK) n << XCHILD(_T("WORK"));
- if (nFlag & JABBER_VCTEL_VOICE) n << XCHILD(_T("VOICE"));
- if (nFlag & JABBER_VCTEL_FAX) n << XCHILD(_T("FAX"));
- if (nFlag & JABBER_VCTEL_PAGER) n << XCHILD(_T("PAGER"));
- if (nFlag & JABBER_VCTEL_MSG) n << XCHILD(_T("MSG"));
- if (nFlag & JABBER_VCTEL_CELL) n << XCHILD(_T("CELL"));
- if (nFlag & JABBER_VCTEL_VIDEO) n << XCHILD(_T("VIDEO"));
- if (nFlag & JABBER_VCTEL_BBS) n << XCHILD(_T("BBS"));
- if (nFlag & JABBER_VCTEL_MODEM) n << XCHILD(_T("MODEM"));
- if (nFlag & JABBER_VCTEL_ISDN) n << XCHILD(_T("ISDN"));
- if (nFlag & JABBER_VCTEL_PCS) n << XCHILD(_T("PCS"));
+ if (nFlag & JABBER_VCTEL_HOME) n << XCHILD(L"HOME");
+ if (nFlag & JABBER_VCTEL_WORK) n << XCHILD(L"WORK");
+ if (nFlag & JABBER_VCTEL_VOICE) n << XCHILD(L"VOICE");
+ if (nFlag & JABBER_VCTEL_FAX) n << XCHILD(L"FAX");
+ if (nFlag & JABBER_VCTEL_PAGER) n << XCHILD(L"PAGER");
+ if (nFlag & JABBER_VCTEL_MSG) n << XCHILD(L"MSG");
+ if (nFlag & JABBER_VCTEL_CELL) n << XCHILD(L"CELL");
+ if (nFlag & JABBER_VCTEL_VIDEO) n << XCHILD(L"VIDEO");
+ if (nFlag & JABBER_VCTEL_BBS) n << XCHILD(L"BBS");
+ if (nFlag & JABBER_VCTEL_MODEM) n << XCHILD(L"MODEM");
+ if (nFlag & JABBER_VCTEL_ISDN) n << XCHILD(L"ISDN");
+ if (nFlag & JABBER_VCTEL_PCS) n << XCHILD(L"PCS");
}
TCHAR szAvatarName[MAX_PATH], *szFileName;
@@ -1112,15 +1112,15 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, TCHAR* szPhotoFileName)
szFileName = szAvatarName;
// Set photo element, also update the global jabberVcardPhotoFileName to reflect the update
- debugLog(_T("Before update, file name = %s"), szFileName);
+ debugLog(L"Before update, file name = %s", szFileName);
if (szFileName == NULL || szFileName[0] == 0) {
- v << XCHILD(_T("PHOTO"));
+ v << XCHILD(L"PHOTO");
DeleteFile(szAvatarName);
delSetting("AvatarSaved");
delSetting("AvatarHash");
}
else {
- debugLog(_T("Saving picture from %s"), szFileName);
+ debugLog(L"Saving picture from %s", szFileName);
struct _stat st;
if (_tstat(szFileName, &st) >= 0) {
@@ -1133,16 +1133,16 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, TCHAR* szPhotoFileName)
if (ReadFile(hFile, buffer, st.st_size, &nRead, NULL)) {
ptrA str(mir_base64_encode((PBYTE)(LPSTR)buffer, nRead));
if (str != NULL) {
- n = v << XCHILD(_T("PHOTO"));
+ n = v << XCHILD(L"PHOTO");
TCHAR *szFileType;
switch (ProtoGetBufferFormat(buffer)) {
- case PA_FORMAT_PNG: szFileType = _T("image/png"); break;
- case PA_FORMAT_GIF: szFileType = _T("image/gif"); break;
- case PA_FORMAT_BMP: szFileType = _T("image/bmp"); break;
- default: szFileType = _T("image/jpeg"); break;
+ case PA_FORMAT_PNG: szFileType = L"image/png"; break;
+ case PA_FORMAT_GIF: szFileType = L"image/gif"; break;
+ case PA_FORMAT_BMP: szFileType = L"image/bmp"; break;
+ default: szFileType = L"image/jpeg"; break;
}
- n << XCHILD(_T("TYPE"), szFileType);
- n << XCHILD(_T("BINVAL"), _A2T(str));
+ n << XCHILD(L"TYPE", szFileType);
+ n << XCHILD(L"BINVAL", _A2T(str));
// NEED TO UPDATE OUR AVATAR HASH:
BYTE digest[MIR_SHA1_HASH_SIZE];
diff --git a/protocols/JabberG/src/jabber_xml.cpp b/protocols/JabberG/src/jabber_xml.cpp
index 37f15c2dce..f4626e8921 100644
--- a/protocols/JabberG/src/jabber_xml.cpp
+++ b/protocols/JabberG/src/jabber_xml.cpp
@@ -34,49 +34,49 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// XmlNodeIq class members
XmlNodeIq::XmlNodeIq(const TCHAR *type, int id, LPCTSTR to) :
- XmlNode(_T("iq"))
+ XmlNode(L"iq")
{
- if (type != NULL) *this << XATTR(_T("type"), type);
- if (to != NULL) *this << XATTR(_T("to"), to);
+ if (type != NULL) *this << XATTR(L"type", type);
+ if (to != NULL) *this << XATTR(L"to", to);
if (id != -1 ) *this << XATTRID(id);
}
XmlNodeIq::XmlNodeIq(const TCHAR *type, LPCTSTR idStr, LPCTSTR to) :
- XmlNode(_T("iq"))
+ XmlNode(L"iq")
{
- if (type != NULL) *this << XATTR(_T("type"), type );
- if (to != NULL) *this << XATTR(_T("to"), to );
- if (idStr != NULL) *this << XATTR(_T("id"), idStr);
+ if (type != NULL) *this << XATTR(L"type", type );
+ if (to != NULL) *this << XATTR(L"to", to );
+ if (idStr != NULL) *this << XATTR(L"id", idStr);
}
XmlNodeIq::XmlNodeIq(const TCHAR *type, HXML node, LPCTSTR to) :
- XmlNode(_T("iq"))
+ XmlNode(L"iq")
{
- if (type != NULL) *this << XATTR(_T("type"), type );
- if (to != NULL) *this << XATTR(_T("to"), to );
+ if (type != NULL) *this << XATTR(L"type", type );
+ if (to != NULL) *this << XATTR(L"to", to );
if (node != NULL) {
- const TCHAR *iqId = XmlGetAttrValue(*this, _T("id"));
- if (iqId != NULL) *this << XATTR(_T("id"), iqId);
+ const TCHAR *iqId = XmlGetAttrValue(*this, L"id");
+ if (iqId != NULL) *this << XATTR(L"id", iqId);
}
}
XmlNodeIq::XmlNodeIq(CJabberIqInfo *pInfo) :
- XmlNode(_T("iq"))
+ XmlNode(L"iq")
{
if (pInfo) {
- if (pInfo->GetCharIqType() != NULL) *this << XATTR(_T("type"), _A2T(pInfo->GetCharIqType()));
- if (pInfo->GetReceiver() != NULL) *this << XATTR(_T("to"), pInfo->GetReceiver());
+ if (pInfo->GetCharIqType() != NULL) *this << XATTR(L"type", _A2T(pInfo->GetCharIqType()));
+ if (pInfo->GetReceiver() != NULL) *this << XATTR(L"to", pInfo->GetReceiver());
if (pInfo->GetIqId() != -1) *this << XATTRID(pInfo->GetIqId());
}
}
XmlNodeIq::XmlNodeIq(const TCHAR *type, CJabberIqInfo *pInfo) :
- XmlNode(_T("iq"))
+ XmlNode(L"iq")
{
- if (type != NULL) *this << XATTR(_T("type"), type);
+ if (type != NULL) *this << XATTR(L"type", type);
if (pInfo) {
- if (pInfo->GetFrom() != NULL) *this << XATTR(_T("to"), pInfo->GetFrom());
- if (pInfo->GetIdStr() != NULL) *this << XATTR(_T("id"), pInfo->GetIdStr());
+ if (pInfo->GetFrom() != NULL) *this << XATTR(L"to", pInfo->GetFrom());
+ if (pInfo->GetIdStr() != NULL) *this << XATTR(L"id", pInfo->GetIdStr());
}
}
@@ -118,15 +118,15 @@ XmlNode::~XmlNode()
HXML __fastcall operator<<(HXML node, const XCHILDNS& child)
{
HXML res = XmlAddChild(node, child.name);
- XmlAddAttr(res, _T("xmlns"), child.ns);
+ XmlAddAttr(res, L"xmlns", child.ns);
return res;
}
HXML __fastcall operator<<(HXML node, const XQUERY& child)
{
- HXML n = XmlAddChild(node, _T("query"));
+ HXML n = XmlAddChild(node, L"query");
if (n)
- XmlAddAttr(n, _T("xmlns"), child.ns);
+ XmlAddAttr(n, L"xmlns", child.ns);
return n;
}
@@ -154,8 +154,8 @@ void __fastcall XmlAddAttr(HXML hXml, LPCTSTR pszName, unsigned __int64 value)
void __fastcall XmlAddAttrID(HXML hXml, int id)
{
TCHAR text[100];
- mir_sntprintf(text, _T(JABBER_IQID) _T("%d"), id);
- XmlAddAttr(hXml, _T("id"), text);
+ mir_sntprintf(text, _T(JABBER_IQID) L"%d", id);
+ XmlAddAttr(hXml, L"id", text);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -294,7 +294,7 @@ void XPath::ProcessPath(LookupInfo &info, bool bCreate)
}
else if (info.nodeIndex) {
int idx = _ttoi(info.nodeIndex.p);
- m_hXml = mir_tstrcmp(nodeName, _T("*")) ? XmlGetNthChild(m_hXml, nodeName, idx) : XmlGetChild(m_hXml, idx - 1);
+ m_hXml = mir_tstrcmp(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 d00df9a780..685336b35c 100644
--- a/protocols/JabberG/src/jabber_xml.h
+++ b/protocols/JabberG/src/jabber_xml.h
@@ -215,9 +215,9 @@ HXML __fastcall operator<<(HXML node, const XQUERY& child);
// Samples:
// LPCTSTR s = XPathT(node, "child/subchild[@attr='value']"); // get node text
// LPCTSTR s = XPathT(node, "child/subchild[2]/@attr"); // get attribute value
-// XPathT(node, "child/subchild[@name='test']/@attr") = _T("Hello"); // create path if needed and set attribute value
+// XPathT(node, "child/subchild[@name='test']/@attr") = L"Hello"; // create path if needed and set attribute value
//
-// XPathT(node, "child/subchild[@name='test']") = _T("Hello"); // TODO: create path if needed and set node text
+// XPathT(node, "child/subchild[@name='test']") = L"Hello"; // TODO: create path if needed and set node text
#define XPathT(a,b) XPath(a, _T(b))
diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp
index 4982f6fe1f..e9bacc1e5d 100644
--- a/protocols/JabberG/src/jabber_xstatus.cpp
+++ b/protocols/JabberG/src/jabber_xstatus.cpp
@@ -286,7 +286,7 @@ void CJabberDlgPepSimple::cbModes_OnChange(CCtrlData *)
mir_snprintf(szSetting, "PepMsg_%s", m_modes[m_cbModes.GetItemData(m_prevSelected)].m_name);
ptrT szDescr( m_proto->getTStringA(szSetting));
- m_txtDescription.SetText((szDescr != NULL) ? szDescr : _T(""));
+ m_txtDescription.SetText((szDescr != NULL) ? szDescr : L"");
m_txtDescription.Enable(true);
}
else {
@@ -341,7 +341,7 @@ 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, _T("%s [%s]"), m_modes[i].m_title, mode->m_title);
+ mir_sntprintf(text, L"%s [%s]", m_modes[i].m_title, mode->m_title);
break;
}
}
@@ -352,7 +352,7 @@ BOOL CJabberDlgPepSimple::OnWmDrawItem(UINT, WPARAM, LPARAM lParam)
}
else {
TCHAR text[128];
- mir_sntprintf(text, _T("...%s"), mode->m_title);
+ mir_sntprintf(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));
}
@@ -386,11 +386,11 @@ CPepService::~CPepService()
void CPepService::Publish()
{
- XmlNodeIq iq(_T("set"), m_proto->SerialNext());
+ XmlNodeIq iq(L"set", m_proto->SerialNext());
CreateData(
- iq << XCHILDNS(_T("pubsub"), JABBER_FEAT_PUBSUB)
- << XCHILD(_T("publish")) << XATTR(_T("node"), m_node)
- << XCHILD(_T("item")) << XATTR(_T("id"), _T("current")));
+ iq << XCHILDNS(L"pubsub", JABBER_FEAT_PUBSUB)
+ << XCHILD(L"publish") << XATTR(L"node", m_node)
+ << XCHILD(L"item") << XATTR(L"id", L"current"));
m_proto->m_ThreadInfo->send(iq);
m_wasPublished = true;
@@ -402,10 +402,10 @@ void CPepService::Retract()
_tcslwr(tempName);
m_proto->m_ThreadInfo->send(
- XmlNodeIq(_T("set"), m_proto->SerialNext())
- << XCHILDNS(_T("pubsub"), JABBER_FEAT_PUBSUB)
- << XCHILD(_T("publish")) << XATTR(_T("node"), m_node)
- << XCHILD(_T("item"))
+ XmlNodeIq(L"set", m_proto->SerialNext())
+ << XCHILDNS(L"pubsub", JABBER_FEAT_PUBSUB)
+ << XCHILD(L"publish") << XATTR(L"node", m_node)
+ << XCHILD(L"item")
<< XCHILDNS(tempName, m_node));
mir_free(tempName);
@@ -620,19 +620,19 @@ void CPepMood::ProcessItems(const TCHAR *from, HXML itemsNode)
}
else hSelfContact = m_proto->HContactFromJID(from);
- if (XmlGetChild(itemsNode, _T("retract"))) {
+ if (XmlGetChild(itemsNode, L"retract")) {
if (hSelfContact)
SetMood(hSelfContact, NULL, NULL);
SetMood(hContact, NULL, NULL);
return;
}
- HXML n, moodNode = XPath(itemsNode, _T("item/mood[@xmlns='") JABBER_FEAT_USER_MOOD _T("']"));
+ HXML n, moodNode = XPath(itemsNode, L"item/mood[@xmlns='" JABBER_FEAT_USER_MOOD L"']");
if (!moodNode) return;
LPCTSTR moodType = NULL, moodText = NULL;
for (int i=0; n = XmlGetChild(moodNode, i); i++) {
- if (!mir_tstrcmp(XmlGetName(n), _T("text")))
+ if (!mir_tstrcmp(XmlGetName(n), L"text"))
moodText = XmlGetText(n);
else
moodType = XmlGetName(n);
@@ -650,10 +650,10 @@ void CPepMood::ProcessItems(const TCHAR *from, HXML itemsNode)
void CPepMood::CreateData(HXML n)
{
- HXML moodNode = n << XCHILDNS(_T("mood"), JABBER_FEAT_USER_MOOD);
+ HXML moodNode = n << XCHILDNS(L"mood", JABBER_FEAT_USER_MOOD);
moodNode << XCHILD(_A2T(g_arrMoods[m_mode].szTag));
if (m_text)
- moodNode << XCHILD(_T("text"), m_text);
+ moodNode << XCHILD(L"text", m_text);
}
void CPepMood::ResetExtraIcon(MCONTACT hContact)
@@ -971,7 +971,7 @@ void ActivityBuildTitle(int id, TCHAR *buf, int size)
if (szFirst) {
if (szSecond)
- mir_sntprintf(buf, size, _T("%s [%s]"), TranslateTS(szFirst), TranslateTS(szSecond));
+ mir_sntprintf(buf, size, L"%s [%s]", TranslateTS(szFirst), TranslateTS(szSecond));
else
mir_tstrncpy(buf, TranslateTS(szFirst), size);
}
@@ -1007,7 +1007,7 @@ void CPepActivity::ProcessItems(const TCHAR *from, HXML itemsNode)
return;
}
- HXML actNode = XPath(itemsNode, _T("item/activity[@xmlns='") JABBER_FEAT_USER_ACTIVITY _T("']"));
+ HXML actNode = XPath(itemsNode, L"item/activity[@xmlns='" JABBER_FEAT_USER_ACTIVITY L"']");
if (!actNode)
return;
@@ -1016,7 +1016,7 @@ void CPepActivity::ProcessItems(const TCHAR *from, HXML itemsNode)
HXML n;
for (int i=0; n = XmlGetChild(actNode, i); i++) {
- if (mir_tstrcmp(XmlGetName(n), _T("text"))) {
+ if (mir_tstrcmp(XmlGetName(n), L"text")) {
szFirstNode = XmlGetName(n);
HXML secondNode = XmlGetChild(n, 0);
if (szFirstNode && secondNode && XmlGetName(secondNode))
@@ -1040,14 +1040,14 @@ void CPepActivity::CreateData(HXML n)
char *szFirstNode = ActivityGetFirst(m_mode);
char *szSecondNode = ActivityGetSecond(m_mode);
- HXML activityNode = n << XCHILDNS(_T("activity"), JABBER_FEAT_USER_ACTIVITY);
+ HXML activityNode = n << XCHILDNS(L"activity", JABBER_FEAT_USER_ACTIVITY);
HXML firstNode = activityNode << XCHILD(_A2T(szFirstNode));
if (firstNode && szSecondNode)
firstNode << XCHILD(_A2T(szSecondNode));
if (m_text)
- activityNode << XCHILD(_T("text"), m_text);
+ activityNode << XCHILD(L"text", m_text);
}
void CPepActivity::ResetExtraIcon(MCONTACT hContact)
@@ -1174,18 +1174,18 @@ BOOL CJabberProto::SendPepTune(TCHAR* szArtist, TCHAR* szLength, TCHAR* szSource
if (!m_bJabberOnline || !m_bPepSupported)
return FALSE;
- XmlNodeIq iq(_T("set"), SerialNext());
- HXML tuneNode = iq << XCHILDNS(_T("pubsub"), JABBER_FEAT_PUBSUB)
- << XCHILD(_T("publish")) << XATTR(_T("node"), JABBER_FEAT_USER_TUNE)
- << XCHILD(_T("item")) << XCHILDNS(_T("tune"), JABBER_FEAT_USER_TUNE);
+ XmlNodeIq iq(L"set", SerialNext());
+ HXML tuneNode = iq << XCHILDNS(L"pubsub", JABBER_FEAT_PUBSUB)
+ << XCHILD(L"publish") << XATTR(L"node", JABBER_FEAT_USER_TUNE)
+ << XCHILD(L"item") << XCHILDNS(L"tune", JABBER_FEAT_USER_TUNE);
if (szArtist || szLength || szSource || szTitle || szUri) {
- if (szArtist) tuneNode << XCHILD(_T("artist"), szArtist);
- if (szLength) tuneNode << XCHILD(_T("length"), szLength);
- if (szSource) tuneNode << XCHILD(_T("source"), szSource);
- if (szTitle) tuneNode << XCHILD(_T("title"), szTitle);
- if (szTrack) tuneNode << XCHILD(_T("track"), szTrack);
- if (szUri) tuneNode << XCHILD(_T("uri"), szUri);
+ if (szArtist) tuneNode << XCHILD(L"artist", szArtist);
+ if (szLength) tuneNode << XCHILD(L"length", szLength);
+ if (szSource) tuneNode << XCHILD(L"source", szSource);
+ if (szTitle) tuneNode << XCHILD(L"title", szTitle);
+ if (szTrack) tuneNode << XCHILD(L"track", szTrack);
+ if (szUri) tuneNode << XCHILD(L"uri", szUri);
}
m_ThreadInfo->send(iq);
@@ -1211,18 +1211,18 @@ void CJabberProto::SetContactTune(MCONTACT hContact, LPCTSTR szArtist, LPCTSTR s
li.ptszAlbum = (TCHAR*)szSource;
li.ptszTitle = (TCHAR*)szTitle;
li.ptszTrack = (TCHAR*)szTrack;
- szListeningTo = (TCHAR*)CallService(MS_LISTENINGTO_GETPARSEDTEXT, (WPARAM)_T("%title% - %artist%"), (LPARAM)&li);
+ szListeningTo = (TCHAR*)CallService(MS_LISTENINGTO_GETPARSEDTEXT, (WPARAM)L"%title% - %artist%", (LPARAM)&li);
}
else {
szListeningTo = (TCHAR*)mir_alloc(2048 * sizeof(TCHAR));
- mir_sntprintf(szListeningTo, 2047, _T("%s - %s"), szTitle ? szTitle : _T(""), szArtist ? szArtist : _T(""));
+ mir_sntprintf(szListeningTo, 2047, L"%s - %s", szTitle ? szTitle : L"", szArtist ? szArtist : L"");
}
setTString(hContact, "ListeningTo", szListeningTo);
char tuneIcon[128];
mir_snprintf(tuneIcon, "%s_%s", m_szModuleName, "main");
- WriteAdvStatus(hContact, ADVSTATUS_TUNE, _T("listening_to"), tuneIcon, TranslateT("Listening To"), szListeningTo);
+ WriteAdvStatus(hContact, ADVSTATUS_TUNE, L"listening_to", tuneIcon, TranslateT("Listening To"), szListeningTo);
mir_free(szListeningTo);
}
@@ -1286,7 +1286,7 @@ INT_PTR __cdecl CJabberProto::OnSetListeningTo(WPARAM, LPARAM lParam)
szTmp++;
}
}
- mir_sntprintf(szLengthInSec, _T("%d"), result);
+ mir_sntprintf(szLengthInSec, L"%d", result);
}
SendPepTune(szArtist, szLength ? szLengthInSec : NULL, szSource, szTitle, szTrack, NULL);
@@ -1505,15 +1505,15 @@ void g_XstatusIconsInit()
TCHAR szFile[MAX_PATH];
GetModuleFileName(hInst, szFile, _countof(szFile));
if (TCHAR *p = _tcsrchr(szFile, '\\'))
- mir_tstrcpy(p + 1, _T("..\\Icons\\xstatus_jabber.dll"));
+ mir_tstrcpy(p + 1, L"..\\Icons\\xstatus_jabber.dll");
TCHAR szSection[100];
- mir_tstrcpy(szSection, _T("Protocols/Jabber/") LPGENT("Moods"));
+ mir_tstrcpy(szSection, L"Protocols/Jabber/" LPGENT("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, _T("Protocols/Jabber/") LPGENT("Activities"));
+ mir_tstrcpy(szSection, L"Protocols/Jabber/" LPGENT("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 dcc9ee3107..194a4c71de 100644
--- a/protocols/JabberG/src/jabber_xstatus.h
+++ b/protocols/JabberG/src/jabber_xstatus.h
@@ -69,7 +69,7 @@ public:
for (int i=0; i < getCount(); i++)
{
CPepService &pepSvc = (*this)[i];
- HXML itemsNode = XmlGetChildByTag(eventNode, _T("items"), _T("node"), pepSvc.GetNode());
+ HXML itemsNode = XmlGetChildByTag(eventNode, L"items", L"node", pepSvc.GetNode());
if (itemsNode)
pepSvc.ProcessItems(from, itemsNode);
}