summaryrefslogtreecommitdiff
path: root/protocols/JabberG
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/JabberG')
-rw-r--r--protocols/JabberG/src/jabber.cpp10
-rw-r--r--protocols/JabberG/src/jabber_adhoc.cpp8
-rw-r--r--protocols/JabberG/src/jabber_api.cpp4
-rw-r--r--protocols/JabberG/src/jabber_byte.cpp4
-rw-r--r--protocols/JabberG/src/jabber_caps.cpp8
-rw-r--r--protocols/JabberG/src/jabber_captcha.cpp2
-rw-r--r--protocols/JabberG/src/jabber_chat.cpp46
-rw-r--r--protocols/JabberG/src/jabber_console.cpp6
-rw-r--r--protocols/JabberG/src/jabber_disco.cpp26
-rw-r--r--protocols/JabberG/src/jabber_disco.h2
-rw-r--r--protocols/JabberG/src/jabber_events.cpp26
-rw-r--r--protocols/JabberG/src/jabber_file.cpp10
-rw-r--r--protocols/JabberG/src/jabber_form.cpp4
-rw-r--r--protocols/JabberG/src/jabber_frame.cpp12
-rw-r--r--protocols/JabberG/src/jabber_ft.cpp8
-rw-r--r--protocols/JabberG/src/jabber_groupchat.cpp46
-rw-r--r--protocols/JabberG/src/jabber_icolib.cpp10
-rw-r--r--protocols/JabberG/src/jabber_iq.cpp4
-rw-r--r--protocols/JabberG/src/jabber_iq_handlers.cpp18
-rw-r--r--protocols/JabberG/src/jabber_iqid.cpp132
-rw-r--r--protocols/JabberG/src/jabber_iqid_muc.cpp4
-rw-r--r--protocols/JabberG/src/jabber_list.cpp4
-rw-r--r--protocols/JabberG/src/jabber_menu.cpp64
-rw-r--r--protocols/JabberG/src/jabber_message_manager.cpp2
-rw-r--r--protocols/JabberG/src/jabber_misc.cpp52
-rw-r--r--protocols/JabberG/src/jabber_notes.cpp4
-rw-r--r--protocols/JabberG/src/jabber_opt.cpp34
-rw-r--r--protocols/JabberG/src/jabber_privacy.cpp26
-rwxr-xr-xprotocols/JabberG/src/jabber_proto.cpp30
-rw-r--r--protocols/JabberG/src/jabber_proto.h6
-rw-r--r--protocols/JabberG/src/jabber_rc.cpp12
-rw-r--r--protocols/JabberG/src/jabber_rc.h2
-rw-r--r--protocols/JabberG/src/jabber_search.cpp22
-rw-r--r--protocols/JabberG/src/jabber_svc.cpp22
-rwxr-xr-xprotocols/JabberG/src/jabber_thread.cpp56
-rw-r--r--protocols/JabberG/src/jabber_userinfo.cpp20
-rw-r--r--protocols/JabberG/src/jabber_util.cpp16
-rw-r--r--protocols/JabberG/src/jabber_vcard.cpp80
-rw-r--r--protocols/JabberG/src/jabber_ws.cpp2
-rw-r--r--protocols/JabberG/src/jabber_xstatus.cpp42
40 files changed, 443 insertions, 443 deletions
diff --git a/protocols/JabberG/src/jabber.cpp b/protocols/JabberG/src/jabber.cpp
index c074e502ef..18008f7313 100644
--- a/protocols/JabberG/src/jabber.cpp
+++ b/protocols/JabberG/src/jabber.cpp
@@ -124,7 +124,7 @@ static int OnModulesLoaded(WPARAM, LPARAM)
}
// init fontservice for info frame
- FontIDT fontid = { 0 };
+ FontIDW fontid = { 0 };
fontid.cbSize = sizeof(fontid);
wcsncpy_s(fontid.group, LPGENW("Jabber"), _TRUNCATE);
strncpy_s(fontid.dbSettingsGroup, GLOBAL_SETTING_MODULE, _TRUNCATE);
@@ -141,14 +141,14 @@ static int OnModulesLoaded(WPARAM, LPARAM)
wcsncpy_s(fontid.name, LPGENW("Frame title"), _TRUNCATE);
strncpy_s(fontid.prefix, "fntFrameTitle", _TRUNCATE);
fontid.deffontsettings.style = DBFONTF_BOLD;
- FontRegisterT(&fontid);
+ FontRegisterW(&fontid);
wcsncpy_s(fontid.name, LPGENW("Frame text"), _TRUNCATE);
strncpy_s(fontid.prefix, "fntFrameClock", _TRUNCATE);
fontid.deffontsettings.style = 0;
- FontRegisterT(&fontid);
+ FontRegisterW(&fontid);
- ColourIDT colourid = {0};
+ ColourIDW colourid = {0};
colourid.cbSize = sizeof(colourid);
wcsncpy_s(colourid.group, L"Jabber", _TRUNCATE);
strncpy_s(colourid.dbSettingsGroup, GLOBAL_SETTING_MODULE, _TRUNCATE);
@@ -156,7 +156,7 @@ static int OnModulesLoaded(WPARAM, LPARAM)
wcsncpy_s(colourid.name, L"Background", _TRUNCATE);
strncpy_s(colourid.setting, "clFrameBack", _TRUNCATE);
colourid.defcolour = GetSysColor(COLOR_WINDOW);
- ColourRegisterT(&colourid);
+ ColourRegisterW(&colourid);
return 0;
}
diff --git a/protocols/JabberG/src/jabber_adhoc.cpp b/protocols/JabberG/src/jabber_adhoc.cpp
index e29f3fde4e..b643adf547 100644
--- a/protocols/JabberG/src/jabber_adhoc.cpp
+++ b/protocols/JabberG/src/jabber_adhoc.cpp
@@ -181,7 +181,7 @@ int CJabberProto::AdHoc_OnJAHMCommandListResult(HWND hwndDlg, HXML iqNode, Jabbe
const wchar_t *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);
+ ypos = AdHoc_AddCommandRadio(GetDlgItem(hwndDlg, IDC_FRAME), TranslateW(name), nodeIdx, ypos, (nodeIdx == 1) ? 1 : 0);
dat->CurrentHeight = ypos;
}
}
@@ -232,7 +232,7 @@ int CJabberProto::AdHoc_OnJAHMProcessResult(HWND hwndDlg, HXML workNode, JabberA
else if (LPCTSTR ptszTitle = XmlGetText(XmlGetChild(xNode, "title")))
JabberFormSetInstruction(hwndDlg, ptszTitle);
else
- JabberFormSetInstruction(hwndDlg, TranslateTS(status));
+ JabberFormSetInstruction(hwndDlg, TranslateW(status));
JabberFormCreateUI(hFrame, xNode, &dat->CurrentHeight);
ShowDlgItem(hwndDlg, IDC_FRAME, SW_SHOW);
}
@@ -242,7 +242,7 @@ int CJabberProto::AdHoc_OnJAHMProcessResult(HWND hwndDlg, HXML workNode, JabberA
sttShowControls(hwndDlg, FALSE, toHide);
LPCTSTR noteText = XmlGetText(XmlGetChild(commandNode, "note"));
- JabberFormSetInstruction(hwndDlg, noteText ? noteText : TranslateTS(status));
+ JabberFormSetInstruction(hwndDlg, noteText ? noteText : TranslateW(status));
}
// check actions
@@ -513,7 +513,7 @@ int __cdecl CJabberProto::ContactMenuRunCommands(WPARAM hContact, LPARAM lParam)
int res = -1;
if ((hContact != NULL || lParam != 0) && m_bJabberOnline) {
- ptrW szJid(getTStringA(hContact, "jid"));
+ ptrW szJid(getWStringA(hContact, "jid"));
if (hContact && szJid != NULL) {
JABBER_LIST_ITEM *item = NULL;
int selected = 0;
diff --git a/protocols/JabberG/src/jabber_api.cpp b/protocols/JabberG/src/jabber_api.cpp
index 167c518bdc..45fcc27744 100644
--- a/protocols/JabberG/src/jabber_api.cpp
+++ b/protocols/JabberG/src/jabber_api.cpp
@@ -57,7 +57,7 @@ MCONTACT CJabberProto::ContactFromJID(LPCTSTR jid)
LPTSTR CJabberProto::ContactToJID(MCONTACT hContact)
{
- return getTStringA(hContact, isChatRoom(hContact) ? "ChatRoomID" : "jid");
+ return getWStringA(hContact, isChatRoom(hContact) ? "ChatRoomID" : "jid");
}
LPTSTR CJabberProto::GetBestResourceName(LPCTSTR jid)
@@ -87,7 +87,7 @@ LPTSTR CJabberProto::GetResourceList(LPCTSTR jid)
if (!item->arResources.getCount())
return NULL;
- CMString res;
+ CMStringW res;
for (int i=0; i < item->arResources.getCount(); i++) {
res.Append(item->arResources[i]->m_tszResourceName);
res.AppendChar(0);
diff --git a/protocols/JabberG/src/jabber_byte.cpp b/protocols/JabberG/src/jabber_byte.cpp
index a940fee985..c6cd6c33d2 100644
--- a/protocols/JabberG/src/jabber_byte.cpp
+++ b/protocols/JabberG/src/jabber_byte.cpp
@@ -153,7 +153,7 @@ void CJabberProto::ByteSendThread(JABBER_BYTE_TRANSFER *jbt)
BOOL bDirect = m_options.BsDirect;
if (m_options.BsProxyManual) {
- ptrW proxyJid( getTStringA("BsProxyServer"));
+ ptrW proxyJid( getWStringA("BsProxyServer"));
if (proxyJid) {
jbt->bProxyDiscovered = FALSE;
jbt->szProxyHost = NULL;
@@ -626,7 +626,7 @@ void __cdecl CJabberProto::ByteReceiveThread(JABBER_BYTE_TRANSFER *jbt)
port = (WORD)_wtoi(szPort);
replaceStrW(jbt->streamhostJID, str);
- debugLog(L"bytestream_recv connecting to %s:%d", szHost, port);
+ debugLogW(L"bytestream_recv connecting to %s:%d", szHost, port);
NETLIBOPENCONNECTION nloc = { 0 };
nloc.cbSize = sizeof(nloc);
nloc.szHost = mir_u2a(szHost);
diff --git a/protocols/JabberG/src/jabber_caps.cpp b/protocols/JabberG/src/jabber_caps.cpp
index f4457137c8..0a4e6b25a6 100644
--- a/protocols/JabberG/src/jabber_caps.cpp
+++ b/protocols/JabberG/src/jabber_caps.cpp
@@ -268,7 +268,7 @@ JabberCapsBits CJabberProto::GetResourceCapabilites(const wchar_t *jid, BOOL app
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(L"node", CMString(FORMAT, L"%s#%s", r->m_tszCapsNode, token)));
+ XmlNodeIq(pInfo) << XQUERY(JABBER_FEAT_DISCO_INFO) << XATTR(L"node", CMStringW(FORMAT, L"%s#%s", r->m_tszCapsNode, token)));
bRequestSent = TRUE;
}
@@ -558,12 +558,12 @@ JabberCapsBits CJabberClientCapsManager::GetClientCaps(wchar_t *szNode, wchar_t
CJabberClientCaps *pClient = FindClient(szNode);
if (!pClient) {
lck.unlock();
- ppro->debugLog(L"CAPS: get no caps for: %s, %s", szNode, szVer);
+ ppro->debugLogW(L"CAPS: get no caps for: %s, %s", szNode, szVer);
return JABBER_RESOURCE_CAPS_UNINIT;
}
JabberCapsBits jcbCaps = pClient->GetPartialCaps(szVer);
lck.unlock();
- ppro->debugLog(L"CAPS: get caps %I64x for: %s, %s", jcbCaps, szNode, szVer);
+ ppro->debugLogW(L"CAPS: get caps %I64x for: %s, %s", jcbCaps, szNode, szVer);
return jcbCaps;
}
@@ -581,7 +581,7 @@ BOOL CJabberClientCapsManager::SetClientCaps(const wchar_t *szNode, const wchar_
}
BOOL bOk = pClient->SetPartialCaps(szVer, jcbCaps, nIqId);
lck.unlock();
- ppro->debugLog(L"CAPS: set caps %I64x for: %s, %s", jcbCaps, szNode, szVer);
+ ppro->debugLogW(L"CAPS: set caps %I64x for: %s, %s", jcbCaps, szNode, szVer);
return bOk;
}
diff --git a/protocols/JabberG/src/jabber_captcha.cpp b/protocols/JabberG/src/jabber_captcha.cpp
index 0de9eda1bb..e775f43923 100644
--- a/protocols/JabberG/src/jabber_captcha.cpp
+++ b/protocols/JabberG/src/jabber_captcha.cpp
@@ -50,7 +50,7 @@ INT_PTR CALLBACK JabberCaptchaFormDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
LPCTSTR hint = params->hint;
if (hint == NULL)
hint = TranslateT("Enter the text you see");
- SetDlgItemText(hwndDlg, IDC_INSTRUCTION, TranslateTS(hint));
+ SetDlgItemText(hwndDlg, IDC_INSTRUCTION, TranslateW(hint));
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)params);
return TRUE;
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp
index 4f3cf9534c..d5599c001b 100644
--- a/protocols/JabberG/src/jabber_chat.cpp
+++ b/protocols/JabberG/src/jabber_chat.cpp
@@ -74,7 +74,7 @@ struct TRoleOrAffiliationInfo
}
void translate()
{
- this->title = TranslateTS(this->title_en);
+ this->title = TranslateW(this->title_en);
}
};
@@ -141,27 +141,27 @@ int CJabberProto::GcInit(JABBER_LIST_ITEM *item)
if (JABBER_LIST_ITEM *bookmark = ListGetItemPtr(LIST_BOOKMARK, item->jid)) {
if (bookmark->name) {
- ptrW myHandle(db_get_tsa(si->hContact, "CList", "MyHandle"));
+ ptrW myHandle(db_get_wsa(si->hContact, "CList", "MyHandle"));
if (myHandle == NULL)
- db_set_ts(si->hContact, "CList", "MyHandle", bookmark->name);
+ db_set_ws(si->hContact, "CList", "MyHandle", bookmark->name);
}
}
- ptrW tszNick(getTStringA(si->hContact, "MyNick"));
+ ptrW tszNick(getWStringA(si->hContact, "MyNick"));
if (tszNick != NULL) {
if (!mir_wstrcmp(tszNick, szNick))
delSetting(si->hContact, "MyNick");
else
- setTString(si->hContact, "MyNick", item->nick);
+ setWString(si->hContact, "MyNick", item->nick);
}
- else setTString(si->hContact, "MyNick", item->nick);
+ else setWString(si->hContact, "MyNick", item->nick);
- ptrW passw(getTStringA(si->hContact, "Password"));
+ ptrW passw(getWStringA(si->hContact, "Password"));
if (lstrcmp_null(passw, item->password)) {
if (!item->password || !item->password[0])
delSetting(si->hContact, "Password");
else
- setTString(si->hContact, "Password", item->password);
+ setWString(si->hContact, "Password", item->password);
}
}
@@ -170,7 +170,7 @@ int CJabberProto::GcInit(JABBER_LIST_ITEM *item)
GCDEST gcd = { m_szModuleName, item->jid, GC_EVENT_ADDGROUP };
GCEVENT gce = { sizeof(gce), &gcd };
for (int i = _countof(sttStatuses) - 1; i >= 0; i--) {
- gce.ptszStatus = TranslateTS(sttStatuses[i]);
+ gce.ptszStatus = TranslateW(sttStatuses[i]);
CallServiceSync(MS_GC_EVENT, NULL, (LPARAM)&gce);
}
@@ -184,7 +184,7 @@ void CJabberProto::GcLogShowInformation(JABBER_LIST_ITEM *item, pResourceStatus
{
if (!item || !user || (item->bChatActive != 2)) return;
- CMString buf;
+ CMStringW buf;
switch (type) {
case INFO_BAN:
@@ -300,7 +300,7 @@ void CJabberProto::GcLogUpdateMemberStatus(JABBER_LIST_ITEM *item, const wchar_t
}
gce.ptszText = TranslateT("Moderator");
}
- gce.ptszStatus = TranslateTS(sttStatuses[JabberGcGetStatus(JS)]);
+ gce.ptszStatus = TranslateW(sttStatuses[JabberGcGetStatus(JS)]);
gce.bIsMe = (mir_wstrcmp(nick, myNick) == 0);
statusToSet = JS->m_iStatus;
break;
@@ -331,11 +331,11 @@ void CJabberProto::GcQuit(JABBER_LIST_ITEM *item, int code, HXML reason)
wchar_t *szMessage = NULL;
if (code != 307 && code != 301) {
- ptrW tszMessage(getTStringA("GcMsgQuit"));
+ ptrW tszMessage(getWStringA("GcMsgQuit"));
if (tszMessage != NULL)
szMessage = NEWWSTR_ALLOCA(tszMessage);
else
- szMessage = TranslateTS(JABBER_GC_MSG_QUIT);
+ szMessage = TranslateW(JABBER_GC_MSG_QUIT);
}
else {
ptrW myNick(JabberNickFromJID(m_szJabberJID));
@@ -729,7 +729,7 @@ public:
{
CSuper::OnInitDialog();
- SetDlgItemText(m_hwnd, IDC_HEADERBAR, CMString(FORMAT, TranslateT("Invite Users to\n%s"), m_room));
+ SetDlgItemText(m_hwnd, IDC_HEADERBAR, CMStringW(FORMAT, TranslateT("Invite Users to\n%s"), m_room));
Window_SetIcon_IcoLib(m_hwnd, g_GetIconHandle(IDI_GROUP));
SetWindowLongPtr(GetDlgItem(m_hwnd, IDC_CLIST), GWL_STYLE,
@@ -786,7 +786,7 @@ public:
if (int hItem = SendMessage(hwndList, CLM_FINDCONTACT, hContact, 0)) {
if (SendMessage(hwndList, CLM_GETCHECKMARK, (WPARAM)hItem, 0)) {
- ptrW jid(m_proto->getTStringA(hContact, "jid"));
+ ptrW jid(m_proto->getWStringA(hContact, "jid"));
if (jid != NULL)
InviteUser(jid, text);
}
@@ -998,7 +998,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
enum { BAN_KICK_INTERVAL = 1000 };
static DWORD dwLastBanKickTime = 0;
- CMString szBuffer, szTitle;
+ CMStringW szBuffer, szTitle;
if ((gch->dwData >= CLISTMENUIDMIN) && (gch->dwData <= CLISTMENUIDMAX)) {
if (him->m_tszRealJid && *him->m_tszRealJid)
@@ -1010,9 +1010,9 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
switch (gch->dwData) {
case IDM_SLAP:
if (ppro->m_bJabberOnline) {
- ptrW szMessage(ppro->getTStringA("GcMsgSlap"));
+ ptrW szMessage(ppro->getWStringA("GcMsgSlap"));
if (szMessage == NULL)
- szMessage = mir_wstrdup(TranslateTS(JABBER_GC_MSG_SLAP));
+ szMessage = mir_wstrdup(TranslateW(JABBER_GC_MSG_SLAP));
wchar_t buf[256];
// do not use snprintf to avoid possible problems with % symbol
@@ -1031,10 +1031,10 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
case IDM_VCARD:
{
- CMString jid(FORMAT, L"%s/%s", item->jid, him->m_tszResourceName);
+ CMStringW jid(FORMAT, L"%s/%s", item->jid, him->m_tszResourceName);
MCONTACT hContact = ppro->AddToListByJID(jid, PALF_TEMPORARY);
- ppro->setTString(hContact, "Nick", him->m_tszResourceName);
+ ppro->setWString(hContact, "Nick", him->m_tszResourceName);
ppro->ListAdd(LIST_VCARD_TEMP, jid, hContact);
ppro->ListAddResource(LIST_VCARD_TEMP, jid, him->m_iStatus, him->m_tszStatusMessage, him->m_iPriority);
@@ -1217,7 +1217,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
if (him->m_tszRealJid && *him->m_tszRealJid) {
PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
- psr.flags = PSR_TCHAR;
+ psr.flags = PSR_UNICODE;
psr.id.w = NEWWSTR_ALLOCA(him->m_tszRealJid);
if (wchar_t *tmp = wcschr(psr.id.w, '/'))
*tmp = 0;
@@ -1235,7 +1235,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* gch)
{
- CMString szBuffer, szTitle;
+ CMStringW szBuffer, szTitle;
switch (gch->dwData) {
case IDM_LST_PARTICIPANT:
@@ -1372,7 +1372,7 @@ static void sttSendPrivateMessage(CJabberProto *ppro, JABBER_LIST_ITEM *item, co
ppro->setWord(hContact, "Status", r->m_iStatus);
db_set_b(hContact, "CList", "Hidden", 1);
- ppro->setTString(hContact, "Nick", nick);
+ ppro->setWString(hContact, "Nick", nick);
db_set_dw(hContact, "Ignore", "Mask1", 0);
CallService(MS_MSG_SENDMESSAGE, hContact, 0);
}
diff --git a/protocols/JabberG/src/jabber_console.cpp b/protocols/JabberG/src/jabber_console.cpp
index 28af8638a0..1a330e2ae7 100644
--- a/protocols/JabberG/src/jabber_console.cpp
+++ b/protocols/JabberG/src/jabber_console.cpp
@@ -346,7 +346,7 @@ void CJabberDlgConsole::OnInitDialog()
m_proto->m_filterInfo.type = (TFilterInfo::Type)m_proto->getByte("consoleWnd_ftype", TFilterInfo::T_OFF);
*m_proto->m_filterInfo.pattern = 0;
- ptrW tszPattern( m_proto->getTStringA("consoleWnd_fpattern"));
+ ptrW tszPattern( m_proto->getWStringA("consoleWnd_fpattern"));
if (tszPattern != NULL)
mir_wstrncpy(m_proto->m_filterInfo.pattern, tszPattern, _countof(m_proto->m_filterInfo.pattern));
@@ -397,7 +397,7 @@ void CJabberDlgConsole::OnClose()
m_proto->setByte("consoleWnd_presence", m_proto->m_filterInfo.presence);
m_proto->setByte("consoleWnd_iq", m_proto->m_filterInfo.iq);
m_proto->setByte("consoleWnd_ftype", m_proto->m_filterInfo.type);
- m_proto->setTString("consoleWnd_fpattern", m_proto->m_filterInfo.pattern);
+ m_proto->setWString("consoleWnd_fpattern", m_proto->m_filterInfo.pattern);
Utils_SaveWindowPosition(m_hwnd, NULL, m_proto->m_szModuleName, "consoleWnd_");
DestroyWindow(m_hwnd);
@@ -568,7 +568,7 @@ INT_PTR CJabberDlgConsole::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
for (i = 0; i < _countof(filter_modes); i++)
AppendMenu(hMenu,
MF_STRING | ((filter_modes[i].type == m_proto->m_filterInfo.type) ? MF_CHECKED : 0),
- filter_modes[i].type + 1, TranslateTS(filter_modes[i].title));
+ filter_modes[i].type + 1, TranslateW(filter_modes[i].title));
RECT rc; GetWindowRect(GetDlgItem(m_hwnd, IDC_BTN_FILTER), &rc);
CheckDlgButton(m_hwnd, IDC_BTN_FILTER, BST_CHECKED);
diff --git a/protocols/JabberG/src/jabber_disco.cpp b/protocols/JabberG/src/jabber_disco.cpp
index 9f2d52f03e..6fefdf6ca2 100644
--- a/protocols/JabberG/src/jabber_disco.cpp
+++ b/protocols/JabberG/src/jabber_disco.cpp
@@ -450,14 +450,14 @@ void CJabberProto::PerformBrowse(HWND hwndDlg)
for (int i = 0; i < count; i++) {
char setting[MAXMODULELABELLENGTH];
mir_snprintf(setting, "discoWnd_favName_%d", i);
- ptrW tszName(getTStringA(setting));
+ ptrW tszName(getWStringA(setting));
if (tszName == NULL)
continue;
mir_snprintf(setting, "discoWnd_favJID_%d", i);
- ptrW dbvJid(getTStringA(setting));
+ ptrW dbvJid(getWStringA(setting));
mir_snprintf(setting, "discoWnd_favNode_%d", i);
- ptrW dbvNode(getTStringA(setting));
+ ptrW dbvNode(getWStringA(setting));
CJabberSDNode *pNode = m_SDManager.AddPrimaryNode(dbvJid, dbvNode, tszName);
SendBothRequests(pNode, NULL);
}
@@ -802,7 +802,7 @@ void CJabberDlgDiscovery::btnBookmarks_OnClick(CCtrlButton *)
for (int i = 0; i < count; i++) {
char setting[MAXMODULELABELLENGTH];
mir_snprintf(setting, "discoWnd_favName_%d", i);
- ptrW tszName(m_proto->getTStringA(setting));
+ ptrW tszName(m_proto->getWStringA(setting));
if (tszName != NULL) {
HMENU hSubMenu = CreatePopupMenu();
AppendMenu(hSubMenu, MF_STRING, 100 + i * 10 + 0, TranslateT("Navigate"));
@@ -851,11 +851,11 @@ void CJabberDlgDiscovery::btnBookmarks_OnClick(CCtrlButton *)
char setting[MAXMODULELABELLENGTH];
mir_snprintf(setting, "discoWnd_favJID_%d", res);
- ptrW dbv(m_proto->getTStringA(setting));
+ ptrW dbv(m_proto->getWStringA(setting));
if (dbv) SetDlgItemText(m_hwnd, IDC_COMBO_JID, dbv);
mir_snprintf(setting, "discoWnd_favNode_%d", res);
- dbv = m_proto->getTStringA(setting);
+ dbv = m_proto->getWStringA(setting);
if (dbv) SetDlgItemText(m_hwnd, IDC_COMBO_NODE, dbv);
PostMessage(m_hwnd, WM_COMMAND, MAKEWPARAM(IDC_BUTTON_BROWSE, 0), 0);
@@ -1235,9 +1235,9 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM
MCONTACT hContact;
if ((items[i].action == SD_ACT_USERMENU) && (hContact = HContactFromJID(pNode->GetJid()))) {
HMENU hContactMenu = Menu_BuildContactMenu(hContact);
- AppendMenu(hMenu, MF_STRING | MF_POPUP, (UINT_PTR)hContactMenu, TranslateTS(items[i].title));
+ AppendMenu(hMenu, MF_STRING | MF_POPUP, (UINT_PTR)hContactMenu, TranslateW(items[i].title));
}
- else AppendMenu(hMenu, MF_STRING, items[i].action, TranslateTS(items[i].title));
+ else AppendMenu(hMenu, MF_STRING, items[i].action, TranslateW(items[i].title));
lastSeparator = FALSE;
}
else if (!lastSeparator) {
@@ -1257,7 +1257,7 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM
if (bFeatureOk) {
if (items[i].title) {
- AppendMenu(hMenu, MF_STRING, items[i].action, TranslateTS(items[i].title));
+ AppendMenu(hMenu, MF_STRING, items[i].action, TranslateW(items[i].title));
lastSeparator = FALSE;
}
else if (!lastSeparator) {
@@ -1341,11 +1341,11 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM
char setting[MAXMODULELABELLENGTH];
int count = getDword("discoWnd_favCount", 0);
mir_snprintf(setting, "discoWnd_favName_%d", count);
- setTString(setting, pNode->GetName() ? pNode->GetName() : pNode->GetJid());
+ setWString(setting, pNode->GetName() ? pNode->GetName() : pNode->GetJid());
mir_snprintf(setting, "discoWnd_favJID_%d", count);
- setTString(setting, pNode->GetJid());
+ setWString(setting, pNode->GetJid());
mir_snprintf(setting, "discoWnd_favNode_%d", count);
- setTString(setting, pNode->GetNode() ? pNode->GetNode() : L"");
+ setWString(setting, pNode->GetNode() ? pNode->GetNode() : L"");
setDword("discoWnd_favCount", ++count);
}
break;
@@ -1365,7 +1365,7 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM
case SD_ACT_PROXY:
m_options.BsDirect = FALSE;
m_options.BsProxyManual = TRUE;
- setTString("BsProxyServer", pNode->GetJid());
+ setWString("BsProxyServer", pNode->GetJid());
break;
case SD_ACT_JOIN:
diff --git a/protocols/JabberG/src/jabber_disco.h b/protocols/JabberG/src/jabber_disco.h
index ecc55393e6..dbef9300f7 100644
--- a/protocols/JabberG/src/jabber_disco.h
+++ b/protocols/JabberG/src/jabber_disco.h
@@ -347,7 +347,7 @@ public:
BOOL GetTooltipText(wchar_t *szText, int nMaxLength)
{
- CMString tszTmp;
+ CMStringW tszTmp;
tszTmp.AppendFormat(L"Jid: %s\r\n", m_szJid);
diff --git a/protocols/JabberG/src/jabber_events.cpp b/protocols/JabberG/src/jabber_events.cpp
index 61aecd3a6b..c02aed14c2 100644
--- a/protocols/JabberG/src/jabber_events.cpp
+++ b/protocols/JabberG/src/jabber_events.cpp
@@ -36,7 +36,7 @@ int CJabberProto::OnContactDeleted(WPARAM hContact, LPARAM)
if (!m_bJabberOnline) // should never happen
return 0;
- ptrW jid(getTStringA(hContact, isChatRoom(hContact) ? "ChatRoomID" : "jid"));
+ ptrW jid(getWStringA(hContact, isChatRoom(hContact) ? "ChatRoomID" : "jid"));
if (jid == NULL)
return 0;
@@ -76,13 +76,13 @@ static wchar_t* sttSettingToTchar(DBCONTACTWRITESETTING *cws)
void __cdecl CJabberProto::OnRenameGroup(DBCONTACTWRITESETTING *cws, MCONTACT hContact)
{
- JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, ptrW(getTStringA(hContact, "jid")));
+ JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, ptrW(getWStringA(hContact, "jid")));
if (item == NULL)
return;
- ptrW tszNick(db_get_tsa(hContact, "CList", "MyHandle"));
+ ptrW tszNick(db_get_wsa(hContact, "CList", "MyHandle"));
if (tszNick == NULL)
- tszNick = getTStringA(hContact, "Nick");
+ tszNick = getWStringA(hContact, "Nick");
if (tszNick == NULL)
tszNick = JabberNickFromJID(item->jid);
if (tszNick == NULL)
@@ -97,7 +97,7 @@ void __cdecl CJabberProto::OnRenameGroup(DBCONTACTWRITESETTING *cws, MCONTACT hC
else {
wchar_t *p = sttSettingToTchar(cws);
if (cws->value.pszVal != NULL && mir_wstrcmp(p, item->group)) {
- debugLog(L"Group set to %s", p);
+ debugLogW(L"Group set to %s", p);
if (p)
AddContactToRoster(item->jid, tszNick, p);
}
@@ -107,7 +107,7 @@ void __cdecl CJabberProto::OnRenameGroup(DBCONTACTWRITESETTING *cws, MCONTACT hC
void __cdecl CJabberProto::OnRenameContact(DBCONTACTWRITESETTING *cws, MCONTACT hContact)
{
- JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, ptrW( getTStringA(hContact, "jid")));
+ JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, ptrW( getWStringA(hContact, "jid")));
if (item == NULL)
return;
@@ -120,7 +120,7 @@ void __cdecl CJabberProto::OnRenameContact(DBCONTACTWRITESETTING *cws, MCONTACT
ptrW newNick( sttSettingToTchar(cws));
if (newNick && mir_wstrcmp(item->nick, newNick)) {
- debugLog(L"Renaming contact %s: %s -> %s", item->jid, item->nick, newNick);
+ debugLogW(L"Renaming contact %s: %s -> %s", item->jid, item->nick, newNick);
AddContactToRoster(item->jid, newNick, item->group);
}
}
@@ -130,23 +130,23 @@ void __cdecl CJabberProto::OnAddContactForever(DBCONTACTWRITESETTING *cws, MCONT
if (cws->value.type != DBVT_DELETED && !(cws->value.type == DBVT_BYTE && cws->value.bVal == 0))
return;
- ptrW jid(getTStringA(hContact, "jid"));
+ ptrW jid(getWStringA(hContact, "jid"));
if (jid == NULL)
return;
- debugLog(L"Add %s permanently to list", jid);
- ptrW nick(db_get_tsa(hContact, "CList", "MyHandle"));
+ debugLogW(L"Add %s permanently to list", jid);
+ ptrW nick(db_get_wsa(hContact, "CList", "MyHandle"));
if (nick == NULL)
- nick = getTStringA(hContact, "Nick");
+ nick = getWStringA(hContact, "Nick");
if (nick == NULL)
nick = JabberNickFromJID(jid);
if (nick == NULL)
return;
- AddContactToRoster(jid, nick, ptrW(db_get_tsa(hContact, "CList", "Group")));
+ AddContactToRoster(jid, nick, ptrW(db_get_wsa(hContact, "CList", "Group")));
XmlNode xPresence(L"presence"); xPresence << XATTR(L"to", LPCTSTR(jid)) << XATTR(L"type", L"subscribe");
- ptrW myNick(getTStringA(NULL, "Nick"));
+ ptrW myNick(getWStringA(NULL, "Nick"));
if (myNick != NULL)
xPresence << XCHILD(L"nick", LPCTSTR(myNick)) << XATTR(L"xmlns", JABBER_FEAT_NICK);
m_ThreadInfo->send(xPresence);
diff --git a/protocols/JabberG/src/jabber_file.cpp b/protocols/JabberG/src/jabber_file.cpp
index 27eda280b2..efb423bb95 100644
--- a/protocols/JabberG/src/jabber_file.cpp
+++ b/protocols/JabberG/src/jabber_file.cpp
@@ -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(L"Requested file name does not matched ('%s' vs. '%s')", ft->httpPath, t);
+ debugLogW(L"Requested file name does not matched ('%s' vs. '%s')", ft->httpPath, t);
ft->state = FT_ERROR;
break;
}
- debugLog(L"Sending [%s]", ft->std.ptszFiles[currentFile]);
+ debugLogW(L"Sending [%s]", ft->std.ptszFiles[currentFile]);
_wstat64(ft->std.ptszFiles[currentFile], &statbuf); // file size in statbuf.st_size
if ((fileId = _wopen(ft->std.ptszFiles[currentFile], _O_BINARY | _O_RDONLY)) < 0) {
debugLogA("File cannot be opened");
@@ -448,7 +448,7 @@ filetransfer::filetransfer(CJabberProto *proto)
ppro = proto;
fileId = -1;
std.cbSize = sizeof(std);
- std.flags = PFTS_TCHAR;
+ std.flags = PFTS_UNICODE;
}
filetransfer::~filetransfer()
@@ -512,12 +512,12 @@ int filetransfer::create()
WaitForSingleObject(hWaitEvent, INFINITE);
if (fileId == -1) {
- ppro->debugLog(L"Saving to [%s]", std.tszCurrentFile);
+ ppro->debugLogW(L"Saving to [%s]", std.tszCurrentFile);
fileId = _wopen(std.tszCurrentFile, _O_BINARY | _O_CREAT | _O_TRUNC | _O_WRONLY, _S_IREAD | _S_IWRITE);
}
if (fileId == -1)
- ppro->debugLog(L"Cannot create file '%s' during a file transfer", filefull);
+ ppro->debugLogW(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_form.cpp b/protocols/JabberG/src/jabber_form.cpp
index ceabe55ba9..e1ee55f08a 100644
--- a/protocols/JabberG/src/jabber_form.cpp
+++ b/protocols/JabberG/src/jabber_form.cpp
@@ -727,7 +727,7 @@ static INT_PTR CALLBACK JabberFormDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
if (jfi->xNode != NULL && (n = XmlGetChild(jfi->xNode, L"title")) != NULL && XmlGetText(n) != NULL)
SetWindowText(hwndDlg, XmlGetText(n));
else
- SetWindowText(hwndDlg, TranslateTS(jfi->defTitle));
+ SetWindowText(hwndDlg, TranslateW(jfi->defTitle));
// Set instruction field
if (jfi->xNode != NULL && (n = XmlGetChild(jfi->xNode, L"instructions")) != NULL && XmlGetText(n) != NULL)
@@ -736,7 +736,7 @@ static INT_PTR CALLBACK JabberFormDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
if (jfi->xNode != NULL && (n = XmlGetChild(jfi->xNode, L"title")) != NULL && XmlGetText(n) != NULL)
JabberFormSetInstruction(hwndDlg, XmlGetText(n));
else
- JabberFormSetInstruction(hwndDlg, TranslateTS(jfi->defTitle));
+ JabberFormSetInstruction(hwndDlg, TranslateW(jfi->defTitle));
}
// Create form
diff --git a/protocols/JabberG/src/jabber_frame.cpp b/protocols/JabberG/src/jabber_frame.cpp
index e1da41f62c..d9e880c771 100644
--- a/protocols/JabberG/src/jabber_frame.cpp
+++ b/protocols/JabberG/src/jabber_frame.cpp
@@ -82,7 +82,7 @@ CJabberInfoFrame::CJabberInfoFrame(CJabberProto *proto):
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;
+ frame.Flags = F_VISIBLE|F_LOCKED|F_NOBORDER|F_UNICODE;
frame.tname = mir_a2u(proto->m_szModuleName);
frame.TBtname = proto->m_tszUserName;
m_frameId = CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&frame, 0);
@@ -240,24 +240,24 @@ void CJabberInfoFrame::ReloadFonts()
{
LOGFONT lfFont;
- FontIDT fontid = {0};
+ FontIDW fontid = {0};
fontid.cbSize = sizeof(fontid);
wcsncpy_s(fontid.group, L"Jabber", _TRUNCATE);
wcsncpy_s(fontid.name, L"Frame title", _TRUNCATE);
- m_clTitle = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)&lfFont);
+ m_clTitle = CallService(MS_FONT_GETW, (WPARAM)&fontid, (LPARAM)&lfFont);
DeleteObject(m_hfntTitle);
m_hfntTitle = CreateFontIndirect(&lfFont);
wcsncpy_s(fontid.name, L"Frame text", _TRUNCATE);
- m_clText = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)&lfFont);
+ m_clText = CallService(MS_FONT_GETW, (WPARAM)&fontid, (LPARAM)&lfFont);
DeleteObject(m_hfntText);
m_hfntText = CreateFontIndirect(&lfFont);
- ColourIDT colourid = {0};
+ ColourIDW colourid = {0};
colourid.cbSize = sizeof(colourid);
wcsncpy_s(colourid.group, L"Jabber", _TRUNCATE);
wcsncpy_s(colourid.name, L"Background", _TRUNCATE);
- m_clBack = CallService(MS_COLOUR_GETT, (WPARAM)&colourid, 0);
+ m_clBack = CallService(MS_COLOUR_GETW, (WPARAM)&colourid, 0);
UpdateSize();
}
diff --git a/protocols/JabberG/src/jabber_ft.cpp b/protocols/JabberG/src/jabber_ft.cpp
index 01ef6ac638..e68ce31eac 100644
--- a/protocols/JabberG/src/jabber_ft.cpp
+++ b/protocols/JabberG/src/jabber_ft.cpp
@@ -187,10 +187,10 @@ BOOL CJabberProto::FtSend(HANDLE hConn, filetransfer *ft)
char* buffer;
int numRead;
- debugLog(L"Sending [%s]", ft->std.ptszFiles[ft->std.currentFileNumber]);
+ debugLogW(L"Sending [%s]", ft->std.ptszFiles[ft->std.currentFileNumber]);
_wstat64(ft->std.ptszFiles[ft->std.currentFileNumber], &statbuf); // file size in statbuf.st_size
if ((fd = _wopen(ft->std.ptszFiles[ft->std.currentFileNumber], _O_BINARY | _O_RDONLY)) < 0) {
- debugLog(L"File cannot be opened");
+ debugLogW(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(L"Sending [%s]", ft->std.ptszFiles[ft->std.currentFileNumber]);
+ debugLogW(L"Sending [%s]", ft->std.ptszFiles[ft->std.currentFileNumber]);
struct _stati64 statbuf;
_wstat64(ft->std.ptszFiles[ft->std.currentFileNumber], &statbuf); // file size in statbuf.st_size
@@ -375,7 +375,7 @@ void CJabberProto::FtHandleSiRequest(HXML iqNode)
ft->std.totalBytes = ft->std.currentFileSize = filesize;
PROTORECVFILET pre = { 0 };
- pre.dwFlags = PRFF_TCHAR;
+ pre.dwFlags = PRFF_UNICODE;
pre.fileCount = 1;
pre.timestamp = time(NULL);
pre.files.w = (wchar_t**)&filename;
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp
index 52bef54a38..433414bb59 100644
--- a/protocols/JabberG/src/jabber_groupchat.cpp
+++ b/protocols/JabberG/src/jabber_groupchat.cpp
@@ -120,16 +120,16 @@ struct JabberGcRecentInfo
{
char setting[MAXMODULELABELLENGTH];
mir_snprintf(setting, "rcMuc_%d_server", iRecent);
- m_server = ppro->getTStringA(setting);
+ m_server = ppro->getWStringA(setting);
mir_snprintf(setting, "rcMuc_%d_room", iRecent);
- m_room = ppro->getTStringA(setting);
+ m_room = ppro->getWStringA(setting);
mir_snprintf(setting, "rcMuc_%d_nick", iRecent);
- m_nick = ppro->getTStringA(setting);
+ m_nick = ppro->getWStringA(setting);
mir_snprintf(setting, "password_rcMuc_%d", iRecent);
- m_password = ppro->getTStringA(NULL, setting);
+ m_password = ppro->getWStringA(NULL, setting);
return m_room || m_server || m_nick || m_password;
}
@@ -140,25 +140,25 @@ struct JabberGcRecentInfo
mir_snprintf(setting, "rcMuc_%d_server", iRecent);
if (m_server)
- ppro->setTString(setting, m_server);
+ ppro->setWString(setting, m_server);
else
ppro->delSetting(setting);
mir_snprintf(setting, "rcMuc_%d_room", iRecent);
if (m_room)
- ppro->setTString(setting, m_room);
+ ppro->setWString(setting, m_room);
else
ppro->delSetting(setting);
mir_snprintf(setting, "rcMuc_%d_nick", iRecent);
if (m_nick)
- ppro->setTString(setting, m_nick);
+ ppro->setWString(setting, m_nick);
else
ppro->delSetting(setting);
mir_snprintf(setting, "password_rcMuc_%d", iRecent);
if (m_password)
- ppro->setTString(setting, m_password);
+ ppro->setWString(setting, m_password);
else
ppro->delSetting(setting);
}
@@ -185,16 +185,16 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleJoinGroupchat(WPARAM, LPARAM)
INT_PTR __cdecl CJabberProto::OnJoinChat(WPARAM hContact, LPARAM)
{
- ptrW jid(getTStringA(hContact, "ChatRoomID"));
+ ptrW jid(getWStringA(hContact, "ChatRoomID"));
if (jid == NULL)
return 0;
- ptrW nick(getTStringA(hContact, "MyNick"));
+ ptrW nick(getWStringA(hContact, "MyNick"));
if (nick == NULL)
- if ((nick = getTStringA("Nick")) == NULL)
+ if ((nick = getWStringA("Nick")) == NULL)
return 0;
- ptrW password(getTStringA(hContact, "Password"));
+ ptrW password(getWStringA(hContact, "Password"));
if (getWord(hContact, "Status", 0) != ID_STATUS_ONLINE) {
wchar_t *p = wcschr(jid, '@');
@@ -209,7 +209,7 @@ INT_PTR __cdecl CJabberProto::OnJoinChat(WPARAM hContact, LPARAM)
INT_PTR __cdecl CJabberProto::OnLeaveChat(WPARAM hContact, LPARAM)
{
- ptrW jid(getTStringA(hContact, "ChatRoomID"));
+ ptrW jid(getWStringA(hContact, "ChatRoomID"));
if (jid != NULL) {
if (getWord(hContact, "Status", 0) != ID_STATUS_OFFLINE) {
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_CHATROOM, jid);
@@ -439,7 +439,7 @@ void CJabberDlgGcJoin::OnInitDialog()
delete pInfo;
}
- ptrW tszNick(m_proto->getTStringA("Nick"));
+ ptrW tszNick(m_proto->getWStringA("Nick"));
if (tszNick == NULL)
tszNick = JabberNickFromJID(m_proto->m_szJabberJID);
SetDlgItemText(m_hwnd, IDC_NICK, tszNick);
@@ -747,14 +747,14 @@ static VOID CALLBACK JabberGroupchatChangeNickname(void* arg)
JABBER_LIST_ITEM *item = param->ppro->ListGetItemPtr(LIST_CHATROOM, param->jid);
if (item != NULL) {
- CMString szBuffer, szTitle;
+ CMStringW szBuffer, szTitle;
szTitle.Format(TranslateT("Change nickname in <%s>"), item->name ? item->name : item->jid);
if (item->nick)
szBuffer = item->nick;
if (param->ppro->EnterString(szBuffer, szTitle, ESF_COMBO, "gcNick_")) {
replaceStrW(item->nick, szBuffer);
- param->ppro->SendPresenceTo(param->ppro->m_iStatus, CMString(FORMAT, L"%s/%s", item->jid, szBuffer), NULL);
+ param->ppro->SendPresenceTo(param->ppro->m_iStatus, CMStringW(FORMAT, L"%s/%s", item->jid, szBuffer), NULL);
}
}
@@ -792,7 +792,7 @@ void CJabberProto::RenameParticipantNick(JABBER_LIST_ITEM *item, const wchar_t *
MCONTACT hContact = HContactFromJID(item->jid);
if (hContact != NULL)
- setTString(hContact, "MyNick", newNick);
+ setWString(hContact, "MyNick", newNick);
}
GCDEST gcd = { m_szModuleName, item->jid, GC_EVENT_CHUID };
@@ -1000,7 +1000,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
ptrW str(JabberErrorMsg(errorNode, &errorCode));
if (errorCode == JABBER_ERROR_CONFLICT) {
- ptrW newNick(getTStringA("GcAltNick"));
+ ptrW newNick(getWStringA("GcAltNick"));
if (++item->iChatState == 1 && newNick != NULL && newNick[0] != 0) {
replaceStrW(item->nick, newNick);
wchar_t text[1024] = { 0 };
@@ -1026,7 +1026,7 @@ void CJabberProto::GroupchatProcessMessage(HXML node)
HXML n, m;
const wchar_t *from, *type, *p, *nick, *resource;
JABBER_LIST_ITEM *item;
- CMString imgLink;
+ CMStringW imgLink;
if (!XmlGetName(node) || mir_wstrcmp(XmlGetName(node), L"message")) return;
if ((from = XmlGetAttrValue(node, L"from")) == NULL) return;
@@ -1106,7 +1106,7 @@ void CJabberProto::GroupchatProcessMessage(HXML node)
}
else nick = NULL;
- CMString tszText(msgText);
+ CMStringW tszText(msgText);
tszText.Replace(L"%", L"%%");
tszText += imgLink;
@@ -1141,7 +1141,7 @@ class CGroupchatInviteAcceptDlg : public CJabberDlgBase
{
typedef CJabberDlgBase CSuper;
CCtrlButton m_accept;
- CMString m_roomJid, m_from, m_reason, m_password;
+ CMStringW m_roomJid, m_from, m_reason, m_password;
public:
CGroupchatInviteAcceptDlg(CJabberProto *ppro, const wchar_t *roomJid, const wchar_t *from, const wchar_t *reason, const wchar_t *password) :
@@ -1193,9 +1193,9 @@ void CJabberProto::GroupchatProcessInvite(const wchar_t *roomJid, const wchar_t
return;
if (m_options.AutoAcceptMUC) {
- ptrW nick(getTStringA(HContactFromJID(m_szJabberJID), "MyNick"));
+ ptrW nick(getWStringA(HContactFromJID(m_szJabberJID), "MyNick"));
if (nick == NULL)
- nick = getTStringA("Nick");
+ nick = getWStringA("Nick");
if (nick == NULL)
nick = JabberNickFromJID(m_szJabberJID);
AcceptGroupchatInvite(roomJid, nick, password);
diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp
index 64aae7a25b..1a83ffad04 100644
--- a/protocols/JabberG/src/jabber_icolib.cpp
+++ b/protocols/JabberG/src/jabber_icolib.cpp
@@ -124,7 +124,7 @@ void CIconPool::RegisterIcon(const char *name, wchar_t *filename, int iconid, wc
sid.pszName = szSettingName;
sid.section.w = szSection;
sid.description.w = szDescription;
- sid.flags = SIDF_ALL_TCHAR;
+ sid.flags = SIDF_ALL_UNICODE;
sid.iDefaultIndex = iconid;
item->m_hIcolibItem = IcoLib_AddIcon(&sid);
@@ -292,7 +292,7 @@ static HICON LoadTransportIcon(char *filename, int i, char *IconName, wchar_t *S
sid.description.w = Description;
sid.defaultFile.a = szMyPath;
sid.iDefaultIndex = i;
- sid.flags = SIDF_TCHAR;
+ sid.flags = SIDF_UNICODE;
IcoLib_AddIcon(&sid);
}
return IcoLib_GetIcon(IconName);
@@ -389,7 +389,7 @@ INT_PTR __cdecl CJabberProto::JGetAdvancedStatusIcon(WPARAM hContact, LPARAM)
if (!getByte(hContact, "IsTransported", 0))
return -1;
- int iID = GetTransportProtoID(ptrW(getTStringA(hContact, "Transport")));
+ int iID = GetTransportProtoID(ptrW(getWStringA(hContact, "Transport")));
if (iID < 0)
return -1;
@@ -436,7 +436,7 @@ BOOL CJabberProto::DBCheckIsTransportedContact(const wchar_t *jid, MCONTACT hCon
}
if (isTransported) {
- setTString(hContact, "Transport", domain);
+ setWString(hContact, "Transport", domain);
setByte(hContact, "IsTransported", 1);
}
return isTransported;
@@ -445,7 +445,7 @@ BOOL CJabberProto::DBCheckIsTransportedContact(const wchar_t *jid, MCONTACT hCon
void CJabberProto::CheckAllContactsAreTransported()
{
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
- ptrW jid(getTStringA(hContact, "jid"));
+ ptrW jid(getWStringA(hContact, "jid"));
if (jid)
DBCheckIsTransportedContact(jid, hContact);
}
diff --git a/protocols/JabberG/src/jabber_iq.cpp b/protocols/JabberG/src/jabber_iq.cpp
index 79db2a2232..a34fa92b9f 100644
--- a/protocols/JabberG/src/jabber_iq.cpp
+++ b/protocols/JabberG/src/jabber_iq.cpp
@@ -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(L"Expiring iq id %d, sent to %s", pInfo->m_nIqId, pInfo->m_szReceiver ? pInfo->m_szReceiver : L"server");
+ ppro->debugLogW(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);
@@ -336,7 +336,7 @@ bool CJabberIqManager::HandleIqPermanent(HXML pNode)
if ((pInfo.m_dwParamsToParse & JABBER_IQ_PARSE_HCONTACT) && (iqInfo.m_szFrom))
iqInfo.m_hContact = ppro->HContactFromJID(iqInfo.m_szFrom);
- ppro->debugLog(L"Handling iq id %s, type %s, from %s", iqInfo.m_szId, szType, iqInfo.m_szFrom);
+ ppro->debugLogW(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 84e5c93ef8..301b24e15b 100644
--- a/protocols/JabberG/src/jabber_iq_handlers.cpp
+++ b/protocols/JabberG/src/jabber_iq_handlers.cpp
@@ -227,7 +227,7 @@ BOOL CJabberProto::OnRosterPushRequest(HXML, CJabberIqInfo *pInfo)
// invalid JID
if (!bRetVal) {
- debugLog(L"<iq/> attempt to hack via roster push from %s", pInfo->GetFrom());
+ debugLogW(L"<iq/> attempt to hack via roster push from %s", pInfo->GetFrom());
return TRUE;
}
}
@@ -256,7 +256,7 @@ BOOL CJabberProto::OnRosterPushRequest(HXML, CJabberIqInfo *pInfo)
if (hContact == NULL)
hContact = DBCreateContact(jid, nick, false, false);
else
- setTString(hContact, "jid", jid);
+ setWString(hContact, "jid", jid);
JABBER_LIST_ITEM *item = ListAdd(LIST_ROSTER, jid, hContact);
replaceStrW(item->nick, nick);
@@ -265,21 +265,21 @@ BOOL CJabberProto::OnRosterPushRequest(HXML, CJabberIqInfo *pInfo)
replaceStrW(item->group, XmlGetText(groupNode));
if (name != NULL) {
- ptrW tszNick(getTStringA(hContact, "Nick"));
+ ptrW tszNick(getWStringA(hContact, "Nick"));
if (tszNick != NULL) {
if (mir_wstrcmp(nick, tszNick) != 0)
- db_set_ts(hContact, "CList", "MyHandle", nick);
+ db_set_ws(hContact, "CList", "MyHandle", nick);
else
db_unset(hContact, "CList", "MyHandle");
}
- else db_set_ts(hContact, "CList", "MyHandle", nick);
+ else db_set_ws(hContact, "CList", "MyHandle", nick);
}
else db_unset(hContact, "CList", "MyHandle");
if (!m_options.IgnoreRosterGroups) {
if (item->group != NULL) {
Clist_GroupCreate(0, item->group);
- db_set_ts(hContact, "CList", "Group", item->group);
+ db_set_ws(hContact, "CList", "Group", item->group);
}
else db_unset(hContact, "CList", "Group");
}
@@ -291,7 +291,7 @@ BOOL CJabberProto::OnRosterPushRequest(HXML, CJabberIqInfo *pInfo)
else if (!mir_wstrcmp(str, L"to")) item->subscription = SUB_TO;
else if (!mir_wstrcmp(str, L"from")) item->subscription = SUB_FROM;
else item->subscription = SUB_NONE;
- debugLog(L"Roster push for jid=%s, set subscription to %s", jid, str);
+ debugLogW(L"Roster push for jid=%s, set subscription to %s", jid, str);
MCONTACT hContact = HContactFromJID(jid);
@@ -371,7 +371,7 @@ BOOL CJabberProto::OnIqRequestOOB(HXML, CJabberIqInfo *pInfo)
desc = (wchar_t*)XmlGetText(n);
wchar_t *str2;
- debugLog(L"description = %s", desc);
+ debugLogW(L"description = %s", desc);
if ((str2 = wcsrchr(ft->httpPath, '/')) != NULL)
str2++;
else
@@ -380,7 +380,7 @@ BOOL CJabberProto::OnIqRequestOOB(HXML, CJabberIqInfo *pInfo)
JabberHttpUrlDecode(str2);
PROTORECVFILET pre;
- pre.dwFlags = PRFF_TCHAR;
+ pre.dwFlags = PRFF_UNICODE;
pre.timestamp = time(NULL);
pre.descr.w = desc;
pre.files.w = &str2;
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp
index caa0532da6..1f94d96dc7 100644
--- a/protocols/JabberG/src/jabber_iqid.cpp
+++ b/protocols/JabberG/src/jabber_iqid.cpp
@@ -149,9 +149,9 @@ void CJabberProto::OnProcessLoginRq(ThreadData *info, DWORD rq)
if (item->nick && item->nick[0])
GroupchatJoinRoom(server, p, item->nick, item->password, true);
else {
- ptrW nick(getTStringA(HContactFromJID(m_szJabberJID), "MyNick"));
+ ptrW nick(getWStringA(HContactFromJID(m_szJabberJID), "MyNick"));
if (nick == NULL)
- nick = getTStringA("Nick");
+ nick = getWStringA("Nick");
if (nick == NULL)
nick = JabberNickFromJID(m_szJabberJID);
@@ -264,9 +264,9 @@ void CJabberProto::OnIqResultSetAuth(HXML iqNode, CJabberIqInfo*)
if ((type = XmlGetAttrValue(iqNode, L"type")) == NULL) return;
if (!mir_wstrcmp(type, L"result")) {
- ptrW tszNick(getTStringA("Nick"));
+ ptrW tszNick(getWStringA("Nick"));
if (tszNick == NULL)
- setTString("Nick", m_ThreadInfo->conn.username);
+ setWString("Nick", m_ThreadInfo->conn.username);
OnLoggedIn();
}
@@ -290,9 +290,9 @@ void CJabberProto::OnIqResultBind(HXML iqNode, CJabberIqInfo *pInfo)
LPCTSTR szJid = XPathT(iqNode, "bind[@xmlns='urn:ietf:params:xml:ns:xmpp-bind']/jid");
if (szJid) {
if (!wcsncmp(m_ThreadInfo->fullJID, szJid, _countof(m_ThreadInfo->fullJID)))
- debugLog(L"Result Bind: %s confirmed ", m_ThreadInfo->fullJID);
+ debugLogW(L"Result Bind: %s confirmed ", m_ThreadInfo->fullJID);
else {
- debugLog(L"Result Bind: %s changed to %s", m_ThreadInfo->fullJID, szJid);
+ debugLogW(L"Result Bind: %s changed to %s", m_ThreadInfo->fullJID, szJid);
wcsncpy_s(m_ThreadInfo->fullJID, szJid, _TRUNCATE);
}
}
@@ -318,7 +318,7 @@ void CJabberProto::OnIqResultSession(HXML, CJabberIqInfo *pInfo)
void CJabberProto::GroupchatJoinByHContact(MCONTACT hContact, bool autojoin)
{
- ptrW roomjid(getTStringA(hContact, "ChatRoomID"));
+ ptrW roomjid(getWStringA(hContact, "ChatRoomID"));
if (roomjid == NULL)
return;
@@ -329,14 +329,14 @@ void CJabberProto::GroupchatJoinByHContact(MCONTACT hContact, bool autojoin)
server[0] = 0; server++;
- ptrW nick(getTStringA(hContact, "MyNick"));
+ ptrW nick(getWStringA(hContact, "MyNick"));
if (nick == NULL) {
nick = JabberNickFromJID(m_szJabberJID);
if (nick == NULL)
return;
}
- GroupchatJoinRoom(server, room, nick, ptrW(getTStringA(hContact, "Password")), autojoin);
+ GroupchatJoinRoom(server, room, nick, ptrW(getWStringA(hContact, "Password")), autojoin);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -427,14 +427,14 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo)
}
if (name != NULL) {
- ptrW tszNick(getTStringA(hContact, "Nick"));
+ ptrW tszNick(getWStringA(hContact, "Nick"));
if (tszNick != NULL) {
if (mir_wstrcmp(nick, tszNick) != 0)
- db_set_ts(hContact, "CList", "MyHandle", nick);
+ db_set_ws(hContact, "CList", "MyHandle", nick);
else
db_unset(hContact, "CList", "MyHandle");
}
- else db_set_ts(hContact, "CList", "MyHandle", nick);
+ else db_set_ws(hContact, "CList", "MyHandle", nick);
}
else db_unset(hContact, "CList", "MyHandle");
@@ -461,12 +461,12 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo)
Clist_GroupCreate(0, item->group);
// Don't set group again if already correct, or Miranda may show wrong group count in some case
- ptrW tszGroup(db_get_tsa(hContact, "CList", "Group"));
+ ptrW tszGroup(db_get_wsa(hContact, "CList", "Group"));
if (tszGroup != NULL) {
if (mir_wstrcmp(tszGroup, item->group))
- db_set_ts(hContact, "CList", "Group", item->group);
+ db_set_ws(hContact, "CList", "Group", item->group);
}
- else db_set_ts(hContact, "CList", "Group", item->group);
+ else db_set_ws(hContact, "CList", "Group", item->group);
}
else db_unset(hContact, "CList", "Group");
}
@@ -492,9 +492,9 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo)
if (m_options.RosterSync == TRUE) {
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact;) {
MCONTACT hNext = db_find_next(hContact, m_szModuleName);
- ptrW jid(getTStringA(hContact, "jid"));
+ ptrW jid(getWStringA(hContact, "jid"));
if (jid != NULL && !ListGetItemPtr(LIST_ROSTER, jid)) {
- debugLog(L"Syncing roster: preparing to delete %s (hContact=0x%x)", jid, hContact);
+ debugLogW(L"Syncing roster: preparing to delete %s (hContact=0x%x)", jid, hContact);
CallService(MS_DB_CONTACT_DELETE, hContact, 0);
}
hContact = hNext;
@@ -601,7 +601,7 @@ void CJabberProto::OnIqResultGetVcardPhoto(HXML n, MCONTACT hContact, bool &hasP
wchar_t szAvatarFileName[MAX_PATH];
GetAvatarFileName(hContact, szAvatarFileName, _countof(szAvatarFileName));
- debugLog(L"Picture file name set to %s", szAvatarFileName);
+ debugLogW(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,10 +618,10 @@ void CJabberProto::OnIqResultGetVcardPhoto(HXML n, MCONTACT hContact, bool &hasP
hasPhoto = true;
CallService(MS_AV_SETMYAVATART, (WPARAM)m_szModuleName, (LPARAM)szAvatarFileName);
- debugLog(L"My picture saved to %s", szAvatarFileName);
+ debugLogW(L"My picture saved to %s", szAvatarFileName);
}
else {
- ptrW jid(getTStringA(hContact, "jid"));
+ ptrW jid(getWStringA(hContact, "jid"));
if (jid != NULL) {
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, jid);
if (item == NULL) {
@@ -634,7 +634,7 @@ void CJabberProto::OnIqResultGetVcardPhoto(HXML n, MCONTACT hContact, bool &hasP
if (item->photoFileName && mir_wstrcmp(item->photoFileName, szAvatarFileName))
DeleteFile(item->photoFileName);
replaceStrW(item->photoFileName, szAvatarFileName);
- debugLog(L"Contact's picture saved to %s", szAvatarFileName);
+ debugLogW(L"Contact's picture saved to %s", szAvatarFileName);
OnIqResultGotAvatar(hContact, o, szPicType);
}
}
@@ -672,7 +672,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
if (!mir_wstrcmp(type, L"result")) {
PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
- psr.flags = PSR_TCHAR;
+ psr.flags = PSR_UNICODE;
psr.nick.w = sttGetText(vCardNode, "NICKNAME");
psr.firstName.w = sttGetText(vCardNode, "FN");
psr.lastName.w = L"";
@@ -726,13 +726,13 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
if (!mir_wstrcmp(XmlGetName(n), L"FN")) {
if (XmlGetText(n) != NULL) {
hasFn = true;
- setTString(hContact, "FullName", XmlGetText(n));
+ setWString(hContact, "FullName", XmlGetText(n));
}
}
else if (!mir_wstrcmp(XmlGetName(n), L"NICKNAME")) {
if (XmlGetText(n) != NULL) {
hasNick = true;
- setTString(hContact, "Nick", XmlGetText(n));
+ setWString(hContact, "Nick", XmlGetText(n));
}
}
else if (!mir_wstrcmp(XmlGetName(n), L"N")) {
@@ -740,15 +740,15 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
if (!hasGiven && !hasFamily && !hasMiddle) {
if ((m = XmlGetChild(n, "GIVEN")) != NULL && XmlGetText(m) != NULL) {
hasGiven = true;
- setTString(hContact, "FirstName", XmlGetText(m));
+ setWString(hContact, "FirstName", XmlGetText(m));
}
if ((m = XmlGetChild(n, "FAMILY")) != NULL && XmlGetText(m) != NULL) {
hasFamily = true;
- setTString(hContact, "LastName", XmlGetText(m));
+ setWString(hContact, "LastName", XmlGetText(m));
}
if ((m = XmlGetChild(n, "MIDDLE")) != NULL && XmlGetText(m) != NULL) {
hasMiddle = true;
- setTString(hContact, "MiddleName", XmlGetText(m));
+ setWString(hContact, "MiddleName", XmlGetText(m));
}
}
}
@@ -765,7 +765,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
mir_snprintf(text, "e-mail%d", nEmail - 1);
}
else mir_snprintf(text, "e-mail%d", nEmail);
- setTString(hContact, text, XmlGetText(m));
+ setWString(hContact, text, XmlGetText(m));
if (hContact == NULL) {
mir_snprintf(text, "e-mailFlag%d", nEmail);
@@ -800,7 +800,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
}
else {
hasBday = true;
- setTString("BirthDate", XmlGetText(n));
+ setWString("BirthDate", XmlGetText(n));
}
}
}
@@ -815,7 +815,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
}
else {
hasGender = true;
- setTString("GenderString", XmlGetText(n));
+ setWString("GenderString", XmlGetText(n));
}
}
}
@@ -834,36 +834,36 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
else
wcsncpy_s(text, XmlGetText(m), _TRUNCATE);
text[_countof(text) - 1] = '\0';
- setTString(hContact, "Street", text);
+ setWString(hContact, "Street", text);
}
else {
- setTString(hContact, "Street", XmlGetText(m));
+ setWString(hContact, "Street", XmlGetText(m));
if ((m = XmlGetChild(n, "EXTADR")) == NULL)
m = XmlGetChild(n, "EXTADD");
if (m != NULL && XmlGetText(m) != NULL) {
hasHomeStreet2 = true;
- setTString(hContact, "Street2", XmlGetText(m));
+ setWString(hContact, "Street2", XmlGetText(m));
}
}
}
if ((m = XmlGetChild(n, "LOCALITY")) != NULL && XmlGetText(m) != NULL) {
hasHomeLocality = true;
- setTString(hContact, "City", XmlGetText(m));
+ setWString(hContact, "City", XmlGetText(m));
}
if ((m = XmlGetChild(n, "REGION")) != NULL && XmlGetText(m) != NULL) {
hasHomeRegion = true;
- setTString(hContact, "State", XmlGetText(m));
+ setWString(hContact, "State", XmlGetText(m));
}
if ((m = XmlGetChild(n, "PCODE")) != NULL && XmlGetText(m) != NULL) {
hasHomePcode = true;
- setTString(hContact, "ZIP", XmlGetText(m));
+ setWString(hContact, "ZIP", XmlGetText(m));
}
if ((m = XmlGetChild(n, "CTRY")) == NULL || XmlGetText(m) == NULL) // Some bad client use <COUNTRY/> instead of <CTRY/>
m = XmlGetChild(n, "COUNTRY");
if (m != NULL && XmlGetText(m) != NULL) {
hasHomeCtry = true;
- setTString(hContact, "Country", XmlGetText(m));
+ setWString(hContact, "Country", XmlGetText(m));
}
}
@@ -881,36 +881,36 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
else
wcsncpy_s(text, XmlGetText(m), _TRUNCATE);
text[_countof(text) - 1] = '\0';
- setTString(hContact, "CompanyStreet", text);
+ setWString(hContact, "CompanyStreet", text);
}
else {
- setTString(hContact, "CompanyStreet", XmlGetText(m));
+ setWString(hContact, "CompanyStreet", XmlGetText(m));
if ((m = XmlGetChild(n, "EXTADR")) == NULL)
m = XmlGetChild(n, "EXTADD");
if (m != NULL && XmlGetText(m) != NULL) {
hasWorkStreet2 = true;
- setTString(hContact, "CompanyStreet2", XmlGetText(m));
+ setWString(hContact, "CompanyStreet2", XmlGetText(m));
}
}
}
if ((m = XmlGetChild(n, "LOCALITY")) != NULL && XmlGetText(m) != NULL) {
hasWorkLocality = true;
- setTString(hContact, "CompanyCity", XmlGetText(m));
+ setWString(hContact, "CompanyCity", XmlGetText(m));
}
if ((m = XmlGetChild(n, "REGION")) != NULL && XmlGetText(m) != NULL) {
hasWorkRegion = true;
- setTString(hContact, "CompanyState", XmlGetText(m));
+ setWString(hContact, "CompanyState", XmlGetText(m));
}
if ((m = XmlGetChild(n, "PCODE")) != NULL && XmlGetText(m) != NULL) {
hasWorkPcode = true;
- setTString(hContact, "CompanyZIP", XmlGetText(m));
+ setWString(hContact, "CompanyZIP", XmlGetText(m));
}
if ((m = XmlGetChild(n, "CTRY")) == NULL || XmlGetText(m) == NULL) // Some bad client use <COUNTRY/> instead of <CTRY/>
m = XmlGetChild(n, "COUNTRY");
if (m != NULL && XmlGetText(m) != NULL) {
hasWorkCtry = true;
- setTString(hContact, "CompanyCountry", XmlGetText(m));
+ setWString(hContact, "CompanyCountry", XmlGetText(m));
}
}
}
@@ -920,11 +920,11 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
if (hContact != NULL) {
if (!hasFax && XmlGetChild(n, "FAX") != NULL) {
hasFax = true;
- setTString(hContact, "Fax", XmlGetText(m));
+ setWString(hContact, "Fax", XmlGetText(m));
}
else if (!hasCell && XmlGetChild(n, "CELL") != NULL) {
hasCell = true;
- setTString(hContact, "Cellular", XmlGetText(m));
+ setWString(hContact, "Cellular", XmlGetText(m));
}
else if (!hasPhone &&
(XmlGetChild(n, "HOME") != NULL || XmlGetChild(n, "WORK") != NULL || XmlGetChild(n, "VOICE") != NULL ||
@@ -939,13 +939,13 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
XmlGetChild(n, "PCS") == NULL)))
{
hasPhone = true;
- setTString(hContact, "Phone", XmlGetText(m));
+ setWString(hContact, "Phone", XmlGetText(m));
}
}
else {
char text[100];
mir_snprintf(text, "Phone%d", nPhone);
- setTString(text, XmlGetText(m));
+ setWString(text, XmlGetText(m));
mir_snprintf(text, "PhoneFlag%d", nPhone);
int nFlag = 0;
@@ -970,39 +970,39 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
// Homepage
if (!hasUrl && XmlGetText(n) != NULL) {
hasUrl = true;
- setTString(hContact, "Homepage", XmlGetText(n));
+ setWString(hContact, "Homepage", XmlGetText(n));
}
}
else if (!mir_wstrcmp(XmlGetName(n), L"ORG")) {
if (!hasOrgname && !hasOrgunit) {
if ((m = XmlGetChild(n, "ORGNAME")) != NULL && XmlGetText(m) != NULL) {
hasOrgname = true;
- setTString(hContact, "Company", XmlGetText(m));
+ setWString(hContact, "Company", XmlGetText(m));
}
if ((m = XmlGetChild(n, "ORGUNIT")) != NULL && XmlGetText(m) != NULL) { // The real vCard can have multiple <ORGUNIT/> but we will only display the first one
hasOrgunit = true;
- setTString(hContact, "CompanyDepartment", XmlGetText(m));
+ setWString(hContact, "CompanyDepartment", XmlGetText(m));
}
}
}
else if (!mir_wstrcmp(XmlGetName(n), L"ROLE")) {
if (!hasRole && XmlGetText(n) != NULL) {
hasRole = true;
- setTString(hContact, "Role", XmlGetText(n));
+ setWString(hContact, "Role", XmlGetText(n));
}
}
else if (!mir_wstrcmp(XmlGetName(n), L"TITLE")) {
if (!hasTitle && XmlGetText(n) != NULL) {
hasTitle = true;
- setTString(hContact, "CompanyPosition", XmlGetText(n));
+ setWString(hContact, "CompanyPosition", XmlGetText(n));
}
}
else if (!mir_wstrcmp(XmlGetName(n), L"DESC")) {
if (!hasDesc && XmlGetText(n) != NULL) {
hasDesc = true;
- CMString tszMemo(XmlGetText(n));
+ CMStringW tszMemo(XmlGetText(n));
tszMemo.Replace(L"\n", L"\r\n");
- setTString(hContact, "About", tszMemo);
+ setWString(hContact, "About", tszMemo);
}
}
else if (!mir_wstrcmp(XmlGetName(n), L"PHOTO"))
@@ -1011,10 +1011,10 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
}
if (hasFn && !hasNick) {
- ptrW nick(getTStringA(hContact, "Nick"));
+ ptrW nick(getWStringA(hContact, "Nick"));
ptrW jidNick(JabberNickFromJID(jid));
if (!nick || (jidNick && !mir_wstrcmpi(nick, jidNick)))
- setTString(hContact, "Nick", ptrW(getTStringA(hContact, "FullName")));
+ setWString(hContact, "Nick", ptrW(getWStringA(hContact, "FullName")));
}
if (!hasFn)
delSetting(hContact, "FullName");
@@ -1125,7 +1125,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
debugLogA("Has no avatar");
delSetting(hContact, "AvatarHash");
- if (ptrW(getTStringA(hContact, "AvatarSaved")) != NULL) {
+ if (ptrW(getWStringA(hContact, "AvatarSaved")) != NULL) {
delSetting(hContact, "AvatarSaved");
ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, NULL, NULL);
}
@@ -1173,7 +1173,7 @@ void CJabberProto::OnIqResultSetSearch(HXML iqNode, CJabberIqInfo*)
if (!mir_wstrcmp(XmlGetName(itemNode), L"item")) {
if ((jid = XmlGetAttrValue(itemNode, L"jid")) != NULL) {
psr.id.w = (wchar_t*)jid;
- debugLog(L"Result jid = %s", jid);
+ debugLogW(L"Result jid = %s", jid);
if ((n = XmlGetChild(itemNode, "nick")) != NULL && XmlGetText(n) != NULL)
psr.nick.w = (wchar_t*)XmlGetText(n);
else
@@ -1190,7 +1190,7 @@ void CJabberProto::OnIqResultSetSearch(HXML iqNode, CJabberIqInfo*)
psr.email.w = (wchar_t*)XmlGetText(n);
else
psr.email.w = L"";
- psr.flags = PSR_TCHAR;
+ psr.flags = PSR_UNICODE;
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)id, (LPARAM)&psr);
}
}
@@ -1227,7 +1227,7 @@ void CJabberProto::OnIqResultExtSearch(HXML iqNode, CJabberIqInfo*)
PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
- psr.flags = PSR_TCHAR;
+ psr.flags = PSR_UNICODE;
for (int j = 0;; j++) {
HXML fieldNode = XmlGetChild(itemNode, j);
@@ -1247,7 +1247,7 @@ void CJabberProto::OnIqResultExtSearch(HXML iqNode, CJabberIqInfo*)
if (!mir_wstrcmp(fieldName, L"jid")) {
psr.id.w = (wchar_t*)XmlGetText(n);
- debugLog(L"Result jid = %s", psr.id.w);
+ debugLogW(L"Result jid = %s", psr.id.w);
}
else if (!mir_wstrcmp(fieldName, L"nickname"))
psr.nick.w = (XmlGetText(n) != NULL) ? (wchar_t*)XmlGetText(n) : L"";
@@ -1309,7 +1309,7 @@ void CJabberProto::OnIqResultGetVCardAvatar(HXML iqNode, CJabberIqInfo*)
if (XmlGetChildCount(vCard) == 0) {
delSetting(hContact, "AvatarHash");
- if (ptrW(getTStringA(hContact, "AvatarSaved")) != NULL) {
+ if (ptrW(getWStringA(hContact, "AvatarSaved")) != NULL) {
delSetting(hContact, "AvatarSaved");
ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, NULL, NULL);
}
@@ -1420,7 +1420,7 @@ void CJabberProto::OnIqResultGotAvatar(MCONTACT hContact, HXML n, const wchar_t
else if (!mir_wstrcmp(mimeType, L"image/bmp")) pictureType = PA_FORMAT_BMP;
else {
LBL_ErrFormat:
- debugLog(L"Invalid mime type specified for picture: %s", mimeType);
+ debugLogW(L"Invalid mime type specified for picture: %s", mimeType);
return;
}
}
@@ -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(L"Broadcast new avatar: %s", ai.filename);
+ debugLogW(L"Broadcast new avatar: %s", ai.filename);
}
else ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, HANDLE(&ai), NULL);
}
@@ -1622,7 +1622,7 @@ void CJabberProto::OnIqResultEntityTime(HXML pIqNode, CJabberIqInfo *pInfo)
LPCTSTR szTz = XPathFmt(pIqNode, L"time[@xmlns='%s']/tz", JABBER_FEAT_ENTITY_TIME);
if (szTz)
- setTString(pInfo->m_hContact, "TzName", szTz);
+ setWString(pInfo->m_hContact, "TzName", szTz);
else
delSetting(pInfo->m_hContact, "TzName");
return;
diff --git a/protocols/JabberG/src/jabber_iqid_muc.cpp b/protocols/JabberG/src/jabber_iqid_muc.cpp
index 1904cb0cf7..afbdfe383b 100644
--- a/protocols/JabberG/src/jabber_iqid_muc.cpp
+++ b/protocols/JabberG/src/jabber_iqid_muc.cpp
@@ -322,7 +322,7 @@ static INT_PTR CALLBACK JabberMucJidListDlgProc(HWND hwndDlg, UINT msg, WPARAM w
lvi.cchTextMax = _countof(text);
ListView_GetItem(nm->hdr.hwndFrom, &lvi);
if (lvi.lParam == -1) {
- CMString szBuffer(dat->type2str());
+ CMStringW szBuffer(dat->type2str());
if (!dat->ppro->EnterString(szBuffer, NULL, ESF_COMBO, "gcAddNick_"))
break;
@@ -331,7 +331,7 @@ static INT_PTR CALLBACK JabberMucJidListDlgProc(HWND hwndDlg, UINT msg, WPARAM w
if (szBuffer.IsEmpty())
break;
- CMString rsn(dat->type2str());
+ CMStringW rsn(dat->type2str());
if (dat->type == MUC_BANLIST) {
dat->ppro->EnterString(rsn, TranslateT("Reason to ban"), ESF_COMBO, "gcAddReason_");
if (szBuffer)
diff --git a/protocols/JabberG/src/jabber_list.cpp b/protocols/JabberG/src/jabber_list.cpp
index 1e4c95f77f..1df982ec43 100644
--- a/protocols/JabberG/src/jabber_list.cpp
+++ b/protocols/JabberG/src/jabber_list.cpp
@@ -91,12 +91,12 @@ void CJabberProto::ListInit(void)
{
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
if (isChatRoom(hContact)) {
- ptrW jid(getTStringA(hContact, "ChatRoomID"));
+ ptrW jid(getWStringA(hContact, "ChatRoomID"));
if (jid != NULL)
ListAdd(LIST_CHATROOM, jid, hContact);
}
else {
- ptrW jid(getTStringA(hContact, "jid"));
+ ptrW jid(getWStringA(hContact, "jid"));
if (jid != NULL)
ListAdd(LIST_ROSTER, jid, hContact);
}
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp
index 512ec95593..7a91ec5498 100644
--- a/protocols/JabberG/src/jabber_menu.cpp
+++ b/protocols/JabberG/src/jabber_menu.cpp
@@ -303,7 +303,7 @@ void g_MenuInit(void)
g_hMenuDirectPresence[0] = Menu_AddContactMenuItem(&mi);
UNSET_UID(mi);
- mi.flags |= CMIF_TCHAR | CMIF_SYSTEM;
+ mi.flags |= CMIF_UNICODE | CMIF_SYSTEM;
mi.root = g_hMenuDirectPresence[0];
for (int i = 0; i < _countof(PresenceModeArray); i++) {
char buf[] = "Jabber/DirectPresenceX";
@@ -374,7 +374,7 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM)
bool bIsTransport = getBool(hContact, "IsTransport", false);
if ((bIsChatRoom == GCW_CHATROOM) || bIsChatRoom == 0) {
- if (ptrW(getTStringA(hContact, bIsChatRoom ? (char*)"ChatRoomID" : (char*)"jid")) != NULL) {
+ if (ptrW(getWStringA(hContact, bIsChatRoom ? (char*)"ChatRoomID" : (char*)"jid")) != NULL) {
Menu_ShowItem(g_hMenuConvert, TRUE);
Menu_ModifyItem(g_hMenuConvert, bIsChatRoom ? LPGENW("&Convert to Contact") : LPGENW("&Convert to Chat Room"));
}
@@ -388,7 +388,7 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM)
Menu_ModifyItem(g_hMenuDirectPresence[i + 1], NULL, Skin_LoadProtoIcon(m_szModuleName, PresenceModeArray[i].mode));
if (bIsChatRoom) {
- ptrW roomid(getTStringA(hContact, "ChatRoomID"));
+ ptrW roomid(getWStringA(hContact, "ChatRoomID"));
if (roomid != NULL) {
Menu_ShowItem(g_hMenuRosterAdd, FALSE);
@@ -406,7 +406,7 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM)
Menu_ShowItem(g_hMenuRefresh, TRUE);
}
- ptrW jid(getTStringA(hContact, "jid"));
+ ptrW jid(getWStringA(hContact, "jid"));
if (jid == NULL)
return 0;
@@ -441,7 +441,7 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM)
mi.flags = CMIF_SYSTEM;
mi.pszService = text;
- CMString szTmp;
+ CMStringW szTmp;
for (int i = 0; i < nMenuResourceItemsNew; i++) {
mir_snprintf(text, "/UseResource_%d", i);
if (i >= m_nMenuResourceItems) {
@@ -477,10 +477,10 @@ INT_PTR __cdecl CJabberProto::OnMenuConvertChatContact(WPARAM hContact, LPARAM)
BYTE bIsChatRoom = isChatRoom(hContact);
const char *szSetting = (bIsChatRoom) ? "ChatRoomID" : "jid";
- ptrW jid(getTStringA(hContact, szSetting));
+ ptrW jid(getWStringA(hContact, szSetting));
if (jid != NULL) {
delSetting(hContact, szSetting);
- setTString(hContact, szSetting, jid);
+ setWString(hContact, szSetting, jid);
setByte(hContact, "ChatRoom", !bIsChatRoom);
}
return 0;
@@ -491,13 +491,13 @@ INT_PTR __cdecl CJabberProto::OnMenuRosterAdd(WPARAM hContact, LPARAM)
if (!hContact)
return 0; // we do not add ourself to the roster. (buggy situation - should not happen)
- ptrW roomID(getTStringA(hContact, "ChatRoomID"));
+ ptrW roomID(getWStringA(hContact, "ChatRoomID"));
if (roomID == NULL)
return 0;
if (ListGetItemPtr(LIST_ROSTER, roomID) == NULL) {
- ptrW group(db_get_tsa(hContact, "CList", "Group"));
- ptrW nick(getTStringA(hContact, "Nick"));
+ ptrW group(db_get_wsa(hContact, "CList", "Group"));
+ ptrW nick(getWStringA(hContact, "Nick"));
AddContactToRoster(roomID, nick, group);
if (m_options.AddRoster2Bookmarks == TRUE) {
@@ -506,7 +506,7 @@ INT_PTR __cdecl CJabberProto::OnMenuRosterAdd(WPARAM hContact, LPARAM)
item = new JABBER_LIST_ITEM();
item->jid = mir_wstrdup(roomID);
item->name = mir_wstrdup(nick);
- item->nick = getTStringA(hContact, "MyNick");
+ item->nick = getWStringA(hContact, "MyNick");
AddEditBookmark(item);
delete item;
}
@@ -518,7 +518,7 @@ INT_PTR __cdecl CJabberProto::OnMenuRosterAdd(WPARAM hContact, LPARAM)
INT_PTR __cdecl CJabberProto::OnMenuHandleRequestAuth(WPARAM hContact, LPARAM)
{
if (hContact != NULL && m_bJabberOnline) {
- ptrW jid(getTStringA(hContact, "jid"));
+ ptrW jid(getWStringA(hContact, "jid"));
if (jid != NULL)
m_ThreadInfo->send(XmlNode(L"presence") << XATTR(L"to", jid) << XATTR(L"type", L"subscribe"));
}
@@ -528,7 +528,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleRequestAuth(WPARAM hContact, LPARAM)
INT_PTR __cdecl CJabberProto::OnMenuHandleGrantAuth(WPARAM hContact, LPARAM)
{
if (hContact != NULL && m_bJabberOnline) {
- ptrW jid(getTStringA(hContact, "jid"));
+ ptrW jid(getWStringA(hContact, "jid"));
if (jid != NULL)
m_ThreadInfo->send(XmlNode(L"presence") << XATTR(L"to", jid) << XATTR(L"type", L"subscribed"));
}
@@ -538,7 +538,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleGrantAuth(WPARAM hContact, LPARAM)
INT_PTR __cdecl CJabberProto::OnMenuRevokeAuth(WPARAM hContact, LPARAM)
{
if (hContact != NULL && m_bJabberOnline) {
- ptrW jid(getTStringA(hContact, "jid"));
+ ptrW jid(getWStringA(hContact, "jid"));
if (jid != NULL)
m_ThreadInfo->send(XmlNode(L"presence") << XATTR(L"to", jid) << XATTR(L"type", L"unsubscribed"));
}
@@ -550,7 +550,7 @@ INT_PTR __cdecl CJabberProto::OnMenuTransportLogin(WPARAM hContact, LPARAM)
if (!getByte(hContact, "IsTransport", 0))
return 0;
- JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, ptrW(getTStringA(hContact, "jid")));
+ JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, ptrW(getWStringA(hContact, "jid")));
if (item != NULL) {
XmlNode p(L"presence"); XmlAddAttr(p, L"to", item->jid);
if (item->getTemp()->m_iStatus == ID_STATUS_ONLINE)
@@ -565,7 +565,7 @@ INT_PTR __cdecl CJabberProto::OnMenuTransportResolve(WPARAM hContact, LPARAM)
if (!getByte(hContact, "IsTransport", 0))
return 0;
- ptrW jid(getTStringA(hContact, "jid"));
+ ptrW jid(getWStringA(hContact, "jid"));
if (jid != NULL)
ResolveTransportNicks(jid);
return 0;
@@ -576,7 +576,7 @@ INT_PTR __cdecl CJabberProto::OnMenuBookmarkAdd(WPARAM hContact, LPARAM)
if (!hContact)
return 0; // we do not add ourself to the roster. (buggy situation - should not happen)
- ptrW roomID(getTStringA(hContact, "ChatRoomID"));
+ ptrW roomID(getWStringA(hContact, "ChatRoomID"));
if (roomID == NULL)
return 0;
@@ -585,7 +585,7 @@ INT_PTR __cdecl CJabberProto::OnMenuBookmarkAdd(WPARAM hContact, LPARAM)
item->jid = mir_wstrdup(roomID);
item->name = pcli->pfnGetContactDisplayName(hContact, 0);
item->type = L"conference";
- item->nick = getTStringA(hContact, "MyNick");
+ item->nick = getWStringA(hContact, "MyNick");
AddEditBookmark(item);
delete item;
}
@@ -706,7 +706,7 @@ void CJabberProto::MenuInit()
mi.pszService = srvFce;
mi.name.w = szName;
mi.position = 2000040000;
- mi.flags = CMIF_UNMOVABLE | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
+ mi.flags = CMIF_UNMOVABLE | CMIF_UNICODE | CMIF_KEEPUNTRANSLATED;
mi.root = m_hMenuPriorityRoot;
mir_snprintf(srvFce, "/menuSetPriority/%d", 0);
@@ -786,7 +786,7 @@ void CJabberProto::GlobalMenuInit()
// Account chooser menu
CMenuItem mi;
- mi.flags = CMIF_UNMOVABLE | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
+ mi.flags = CMIF_UNMOVABLE | CMIF_UNICODE | CMIF_KEEPUNTRANSLATED;
mi.position = iChooserMenuPos++;
mi.name.w = m_tszUserName;
m_hChooseMenuItem = Menu_AddItem(hChooserMenu, &mi, this);
@@ -801,23 +801,23 @@ void CJabberProto::GlobalMenuInit()
HOTKEYDESC hkd = { sizeof(hkd) };
hkd.pszName = text;
hkd.pszService = text;
- hkd.ptszSection = m_tszUserName;
- hkd.dwFlags = HKD_TCHAR;
+ hkd.pwszSection = m_tszUserName;
+ hkd.dwFlags = HKD_UNICODE;
mir_strcpy(tDest, "/Groupchat");
- hkd.ptszDescription = LPGENW("Join conference");
+ hkd.pwszDescription = LPGENW("Join conference");
Hotkey_Register(&hkd);
mir_strcpy(tDest, "/Bookmarks");
- hkd.ptszDescription = LPGENW("Open bookmarks");
+ hkd.pwszDescription = LPGENW("Open bookmarks");
Hotkey_Register(&hkd);
mir_strcpy(tDest, "/PrivacyLists");
- hkd.ptszDescription = LPGENW("Privacy lists");
+ hkd.pwszDescription = LPGENW("Privacy lists");
Hotkey_Register(&hkd);
mir_strcpy(tDest, "/ServiceDiscovery");
- hkd.ptszDescription = LPGENW("Service discovery");
+ hkd.pwszDescription = LPGENW("Service discovery");
Hotkey_Register(&hkd);
}
@@ -941,7 +941,7 @@ int CJabberProto::OnProcessSrmmEvent(WPARAM, LPARAM lParam)
hDialogsList = WindowList_Create();
WindowList_Add(hDialogsList, event->hwndWindow, event->hContact);
- ptrW jid(getTStringA(event->hContact, "jid"));
+ ptrW jid(getWStringA(event->hContact, "jid"));
if (jid != NULL) {
JABBER_LIST_ITEM *pItem = ListGetItemPtr(LIST_ROSTER, jid);
if (pItem && m_ThreadInfo && (m_ThreadInfo->jabberServerCaps & JABBER_CAPS_ARCHIVE_AUTO) && m_options.EnableMsgArchive)
@@ -991,7 +991,7 @@ int CJabberProto::OnProcessSrmmIconClick(WPARAM hContact, LPARAM lParam)
if (!hContact)
return 0;
- JABBER_LIST_ITEM *LI = ListGetItemPtr(LIST_ROSTER, ptrW(getTStringA(hContact, "jid")));
+ JABBER_LIST_ITEM *LI = ListGetItemPtr(LIST_ROSTER, ptrW(getWStringA(hContact, "jid")));
if (LI == NULL)
return 0;
@@ -1041,7 +1041,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleResource(WPARAM hContact, LPARAM, LPAR
if (!m_bJabberOnline || !hContact)
return 0;
- ptrW tszJid(getTStringA(hContact, "jid"));
+ ptrW tszJid(getWStringA(hContact, "jid"));
if (tszJid == NULL)
return 0;
@@ -1073,9 +1073,9 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleDirectPresence(WPARAM hContact, LPARAM
return 0;
wchar_t *jid, text[1024];
- ptrW tszJid(getTStringA(hContact, "jid"));
+ ptrW tszJid(getWStringA(hContact, "jid"));
if (tszJid == NULL) {
- ptrW roomid(getTStringA(hContact, "ChatRoomID"));
+ ptrW roomid(getWStringA(hContact, "ChatRoomID"));
if (roomid == NULL)
return 0;
@@ -1088,7 +1088,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleDirectPresence(WPARAM hContact, LPARAM
}
else jid = tszJid;
- CMString szValue;
+ CMStringW szValue;
if (EnterString(szValue, TranslateT("Status Message"), ESF_MULTILINE))
SendPresenceTo(res, jid, NULL, szValue);
return 0;
diff --git a/protocols/JabberG/src/jabber_message_manager.cpp b/protocols/JabberG/src/jabber_message_manager.cpp
index 99b853bca9..e443c6ce73 100644
--- a/protocols/JabberG/src/jabber_message_manager.cpp
+++ b/protocols/JabberG/src/jabber_message_manager.cpp
@@ -100,7 +100,7 @@ bool CJabberMessageManager::HandleMessagePermanent(HXML node, ThreadData *pThrea
messageInfo.m_hContact = ppro->HContactFromJID(messageInfo.m_szFrom);
if (messageInfo.m_szFrom)
- ppro->debugLog(L"Handling message from %s", messageInfo.m_szFrom);
+ ppro->debugLogW(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 ac90da7561..0a4600cecb 100644
--- a/protocols/JabberG/src/jabber_misc.cpp
+++ b/protocols/JabberG/src/jabber_misc.cpp
@@ -103,9 +103,9 @@ MCONTACT CJabberProto::DBCreateContact(const wchar_t *jid, const wchar_t *nick,
MCONTACT hNewContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
Proto_AddToContact(hNewContact, m_szModuleName);
- setTString(hNewContact, "jid", szJid);
+ setWString(hNewContact, "jid", szJid);
if (nick != NULL && *nick != '\0')
- setTString(hNewContact, "Nick", nick);
+ setWString(hNewContact, "Nick", nick);
if (temporary)
db_set_b(hNewContact, "CList", "NotOnList", 1);
else
@@ -114,7 +114,7 @@ MCONTACT CJabberProto::DBCreateContact(const wchar_t *jid, const wchar_t *nick,
if (JABBER_LIST_ITEM *pItem = ListAdd(LIST_ROSTER, jid, hNewContact))
pItem->bUseResource = wcschr(szJid, '/') != 0;
- debugLog(L"Create Jabber contact jid=%s, nick=%s", szJid, nick);
+ debugLogW(L"Create Jabber contact jid=%s, nick=%s", szJid, nick);
DBCheckIsTransportedContact(szJid, hNewContact);
return hNewContact;
}
@@ -156,11 +156,11 @@ BOOL CJabberProto::AddDbPresenceEvent(MCONTACT hContact, BYTE btEventType)
void CJabberProto::GetAvatarFileName(MCONTACT hContact, wchar_t* pszDest, size_t cbLen)
{
- int tPathLen = mir_snwprintf(pszDest, cbLen, L"%s\\%S", VARST(L"%miranda_avatarcache%"), m_szModuleName);
+ int tPathLen = mir_snwprintf(pszDest, cbLen, L"%s\\%S", VARSW(L"%miranda_avatarcache%"), m_szModuleName);
DWORD dwAttributes = GetFileAttributes(pszDest);
if (dwAttributes == 0xffffffff || (dwAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
- CreateDirectoryTreeT(pszDest);
+ CreateDirectoryTreeW(pszDest);
pszDest[tPathLen++] = '\\';
@@ -203,8 +203,8 @@ void CJabberProto::ResolveTransportNicks(const wchar_t *jid)
if (!getByte(hContact, "IsTransported", 0))
continue;
- ptrW dbJid(getTStringA(hContact, "jid")); if (dbJid == NULL) continue;
- ptrW dbNick(getTStringA(hContact, "Nick")); if (dbNick == NULL) continue;
+ ptrW dbJid(getWStringA(hContact, "jid")); if (dbJid == NULL) continue;
+ ptrW dbNick(getWStringA(hContact, "Nick")); if (dbNick == NULL) continue;
wchar_t *p = wcschr(dbJid, '@');
if (p == NULL)
@@ -300,7 +300,7 @@ void CJabberProto::UpdateMirVer(JABBER_LIST_ITEM *item)
if (!hContact)
return;
- debugLog(L"JabberUpdateMirVer: for jid %s", item->jid);
+ debugLogW(L"JabberUpdateMirVer: for jid %s", item->jid);
pResourceStatus p(NULL);
if (item->resourceMode == RSMODE_LASTSEEN)
@@ -312,7 +312,7 @@ void CJabberProto::UpdateMirVer(JABBER_LIST_ITEM *item)
UpdateMirVer(hContact, p);
}
-void CJabberProto::FormatMirVer(pResourceStatus &resource, CMString &res)
+void CJabberProto::FormatMirVer(pResourceStatus &resource, CMStringW &res)
{
res.Empty();
if (resource == NULL)
@@ -320,7 +320,7 @@ void CJabberProto::FormatMirVer(pResourceStatus &resource, CMString &res)
// jabber:iq:version info requested and exists?
if (resource->m_dwVersionRequestTime && resource->m_tszSoftware) {
- debugLog(L"JabberUpdateMirVer: for iq:version rc %s: %s", resource->m_tszResourceName, resource->m_tszSoftware);
+ debugLogW(L"JabberUpdateMirVer: for iq:version rc %s: %s", resource->m_tszResourceName, resource->m_tszSoftware);
if (!resource->m_tszSoftwareVersion || wcsstr(resource->m_tszSoftware, resource->m_tszSoftwareVersion))
res = resource->m_tszSoftware;
else
@@ -328,13 +328,13 @@ void CJabberProto::FormatMirVer(pResourceStatus &resource, CMString &res)
}
// no version info and no caps info? set MirVer = resource name
else if (!resource->m_tszCapsNode || !resource->m_tszCapsVer) {
- debugLog(L"JabberUpdateMirVer: for rc %s: %s", resource->m_tszResourceName, resource->m_tszResourceName);
+ debugLogW(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(L"JabberUpdateMirVer: for rc %s: %s#%s", resource->m_tszResourceName, resource->m_tszCapsNode, resource->m_tszCapsVer);
+ debugLogW(L"JabberUpdateMirVer: for rc %s: %s#%s", resource->m_tszResourceName, resource->m_tszCapsNode, resource->m_tszCapsVer);
int i;
@@ -374,12 +374,12 @@ void CJabberProto::FormatMirVer(pResourceStatus &resource, CMString &res)
void CJabberProto::UpdateMirVer(MCONTACT hContact, pResourceStatus &resource)
{
- CMString tszMirVer;
+ CMStringW tszMirVer;
FormatMirVer(resource, tszMirVer);
if (!tszMirVer.IsEmpty())
- setTString(hContact, "MirVer", tszMirVer);
+ setWString(hContact, "MirVer", tszMirVer);
- ptrW jid(getTStringA(hContact, "jid"));
+ ptrW jid(getWStringA(hContact, "jid"));
if (jid == NULL)
return;
@@ -388,32 +388,32 @@ void CJabberProto::UpdateMirVer(MCONTACT hContact, pResourceStatus &resource)
mir_snwprintf(szFullJid, L"%s/%s", jid, resource->m_tszResourceName);
else
mir_wstrncpy(szFullJid, jid, _countof(szFullJid));
- setTString(hContact, DBSETTING_DISPLAY_UID, szFullJid);
+ setWString(hContact, DBSETTING_DISPLAY_UID, szFullJid);
}
void CJabberProto::UpdateSubscriptionInfo(MCONTACT hContact, JABBER_LIST_ITEM *item)
{
switch (item->subscription) {
case SUB_TO:
- setTString(hContact, "SubscriptionText", TranslateT("To"));
+ setWString(hContact, "SubscriptionText", TranslateT("To"));
setString(hContact, "Subscription", "to");
setByte(hContact, "Auth", 0);
setByte(hContact, "Grant", 1);
break;
case SUB_FROM:
- setTString(hContact, "SubscriptionText", TranslateT("From"));
+ setWString(hContact, "SubscriptionText", TranslateT("From"));
setString(hContact, "Subscription", "from");
setByte(hContact, "Auth", 1);
setByte(hContact, "Grant", 0);
break;
case SUB_BOTH:
- setTString(hContact, "SubscriptionText", TranslateT("Both"));
+ setWString(hContact, "SubscriptionText", TranslateT("Both"));
setString(hContact, "Subscription", "both");
setByte(hContact, "Auth", 0);
setByte(hContact, "Grant", 0);
break;
case SUB_NONE:
- setTString(hContact, "SubscriptionText", TranslateT("None"));
+ setWString(hContact, "SubscriptionText", TranslateT("None"));
setString(hContact, "Subscription", "none");
setByte(hContact, "Auth", 1);
setByte(hContact, "Grant", 1);
@@ -445,7 +445,7 @@ void CJabberProto::InitPopups(void)
POPUPCLASS ppc = { sizeof(ppc) };
ppc.flags = PCF_TCHAR;
- ppc.ptszDescription = desc;
+ ppc.pwszDescription = desc;
ppc.pszName = name;
ppc.hIcon = LoadIconEx("main");
ppc.colorBack = RGB(191, 0, 0); //Red
@@ -476,25 +476,25 @@ void CJabberProto::MsgPopup(MCONTACT hContact, const wchar_t *szMsg, const wchar
}
}
-CMString CJabberProto::ExtractImage(HXML node)
+CMStringW CJabberProto::ExtractImage(HXML node)
{
HXML nHtml, nBody, nImg;
LPCTSTR src;
- CMString link;
+ CMStringW link;
if ((nHtml = XmlGetChild(node, "html")) != NULL &&
(nBody = XmlGetChild(nHtml, "body")) != NULL &&
(nImg = XmlGetChild(nBody, "img")) != NULL &&
(src = XmlGetAttrValue(nImg, L"src")) != NULL) {
- CMString strSrc(src);
+ CMStringW strSrc(src);
if (strSrc.Left(11).Compare(L"data:image/") == 0) {
int end = strSrc.Find(L';');
if (end != -1) {
- CMString ext(strSrc.c_str() + 11, end - 11);
+ CMStringW ext(strSrc.c_str() + 11, end - 11);
int comma = strSrc.Find(L',', end);
if (comma != -1) {
- CMString image(strSrc.c_str() + comma + 1, strSrc.GetLength() - comma - 1);
+ CMStringW image(strSrc.c_str() + comma + 1, strSrc.GetLength() - comma - 1);
image.Replace(L"%2B", L"+");
image.Replace(L"%2F", L"/");
image.Replace(L"%3D", L"=");
diff --git a/protocols/JabberG/src/jabber_notes.cpp b/protocols/JabberG/src/jabber_notes.cpp
index 66f16d6f1a..36f780f87e 100644
--- a/protocols/JabberG/src/jabber_notes.cpp
+++ b/protocols/JabberG/src/jabber_notes.cpp
@@ -240,7 +240,7 @@ void CJabberDlgNoteItem::OnInitDialog()
Window_SetIcon_IcoLib(m_hwnd, g_GetIconHandle(IDI_NOTES));
if (m_fnProcess) {
- CMString buf;
+ CMStringW buf;
if (m_fnProcess == &CJabberProto::ProcessIncomingNote)
buf.Format(TranslateT("Incoming note from %s"), m_pNote->GetFrom());
else
@@ -815,7 +815,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleNotes(WPARAM, LPARAM)
INT_PTR __cdecl CJabberProto::OnMenuSendNote(WPARAM wParam, LPARAM)
{
if (wParam) {
- CNoteItem *pItem = new CNoteItem(NULL, ptrW(getTStringA(wParam, "jid")));
+ CNoteItem *pItem = new CNoteItem(NULL, ptrW(getWStringA(wParam, "jid")));
CJabberDlgBase *pDlg = new CJabberDlgNoteItem(this, pItem, &CJabberProto::ProcessOutgoingNote);
pDlg->Show();
}
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp
index 66fb8e5e49..c1a9ab062b 100644
--- a/protocols/JabberG/src/jabber_opt.cpp
+++ b/protocols/JabberG/src/jabber_opt.cpp
@@ -331,7 +331,7 @@ CCtrlEditJid::CCtrlEditJid(CDlgBase* dlg, int ctrlId):
static void sttStoreJidFromUI(CJabberProto *ppro, CCtrlEdit &txtUsername, CCtrlCombo &cbServer)
{
- ppro->setTString("jid", CMString(FORMAT, L"%s@%s", ptrW(txtUsername.GetText()), ptrW(cbServer.GetText())));
+ ppro->setWString("jid", CMStringW(FORMAT, L"%s@%s", ptrW(txtUsername.GetText()), ptrW(cbServer.GetText())));
}
class CDlgOptAccount : public CJabberDlgBase
@@ -425,7 +425,7 @@ protected:
SendDlgItemMessage(m_hwnd, IDC_PRIORITY_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(127, -128));
- wchar_t *passw = m_proto->getTStringA(NULL, "Password");
+ wchar_t *passw = m_proto->getWStringA(NULL, "Password");
if (passw) {
m_txtPassword.SetText(passw);
mir_free(passw);
@@ -444,7 +444,7 @@ protected:
if (GetComputerName(szCompName, &dwCompNameLength))
m_cbResource.AddString(szCompName);
- ptrW tszResource(m_proto->getTStringA("Resource"));
+ ptrW tszResource(m_proto->getWStringA("Resource"));
if (tszResource != NULL) {
if (CB_ERR == m_cbResource.FindString(tszResource, -1, true))
m_cbResource.AddString(tszResource);
@@ -453,7 +453,7 @@ protected:
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);
+ int iItem = m_cbLocale.AddString(TranslateW(g_LanguageCodes[i].szDescription), (LPARAM)g_LanguageCodes[i].szCode);
if (!mir_wstrcmp(m_proto->m_tszSelectedLang, g_LanguageCodes[i].szCode))
m_cbLocale.SetCurSel(iItem);
}
@@ -483,7 +483,7 @@ protected:
m_proto->m_savedPassword = NULL;
if (m_chkSavePassword.GetState() == BST_CHECKED)
- m_proto->setTString("Password", ptrW(m_txtPassword.GetText()));
+ m_proto->setWString("Password", ptrW(m_txtPassword.GetText()));
else
m_proto->delSetting("Password");
@@ -491,7 +491,7 @@ protected:
if (index >= 0) {
wchar_t *szLanguageCode = (wchar_t *)m_cbLocale.GetItemData(index);
if (szLanguageCode) {
- m_proto->setTString("XmlLang", szLanguageCode);
+ m_proto->setWString("XmlLang", szLanguageCode);
mir_free(m_proto->m_tszSelectedLang);
m_proto->m_tszSelectedLang = mir_wstrdup(szLanguageCode);
@@ -897,8 +897,8 @@ public:
m_otvOptions(this, IDC_OPTTREE)
{
CreateLink(m_txtAltNick, "GcAltNick", L"");
- CreateLink(m_txtSlap, "GcMsgSlap", TranslateTS(JABBER_GC_MSG_SLAP));
- CreateLink(m_txtQuit, "GcMsgQuit", TranslateTS(JABBER_GC_MSG_QUIT));
+ CreateLink(m_txtSlap, "GcMsgSlap", TranslateW(JABBER_GC_MSG_SLAP));
+ CreateLink(m_txtQuit, "GcMsgQuit", TranslateW(JABBER_GC_MSG_QUIT));
m_otvOptions.AddOption(LPGENW("General") L"/" LPGENW("Autoaccept multiuser chat invitations"), m_proto->m_options.AutoAcceptMUC);
m_otvOptions.AddOption(LPGENW("General") L"/" LPGENW("Automatically join bookmarks on login"), m_proto->m_options.AutoJoinBookmarks);
@@ -952,7 +952,7 @@ static int _RosterInsertListItem(HWND hList, const wchar_t * jid, const wchar_t
ListView_SetItemText(hList, index, 0, (wchar_t*)jid);
ListView_SetItemText(hList, index, 1, (wchar_t*)nick);
ListView_SetItemText(hList, index, 2, (wchar_t*)group);
- ListView_SetItemText(hList, index, 3, TranslateTS(subscr));
+ ListView_SetItemText(hList, index, 3, TranslateW(subscr));
return index;
}
@@ -1016,7 +1016,7 @@ void CJabberProto::_RosterHandleGetRequest(HXML node, CJabberIqInfo*)
// now it is require to process whole contact list to add not in roster contacts
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
- ptrW tszJid(getTStringA(hContact, "jid"));
+ ptrW tszJid(getWStringA(hContact, "jid"));
if (tszJid == NULL)
continue;
@@ -1029,8 +1029,8 @@ void CJabberProto::_RosterHandleGetRequest(HXML node, CJabberIqInfo*)
if (p) *p = 0;
}
if (ListView_FindItem(hList, -1, &lvfi) == -1) {
- ptrW tszName(db_get_tsa(hContact, "CList", "MyHandle"));
- ptrW tszGroup(db_get_tsa(hContact, "CList", "Group"));
+ ptrW tszName(db_get_wsa(hContact, "CList", "MyHandle"));
+ ptrW tszGroup(db_get_wsa(hContact, "CList", "Group"));
_RosterInsertListItem(hList, tszJid, tszName, tszGroup, NULL, FALSE);
}
}
@@ -1492,7 +1492,7 @@ int CJabberProto::OnOptionsInit(WPARAM wParam, LPARAM)
OPTIONSDIALOGPAGE odp = { 0 };
odp.pwszGroup = LPGENW("Network");
odp.pwszTitle = m_tszUserName;
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE;
odp.pwszTab = LPGENW("Account");
odp.pDialog = new CDlgOptAccount(this);
@@ -1569,7 +1569,7 @@ protected:
m_gotservers = false;
- wchar_t *passw = m_proto->getTStringA(NULL, "Password");
+ wchar_t *passw = m_proto->getWStringA(NULL, "Password");
if (passw) {
m_txtPassword.SetText(passw);
mir_free(passw);
@@ -1588,7 +1588,7 @@ protected:
if (GetComputerName(szCompName, &dwCompNameLength))
m_cbResource.AddString(szCompName);
- ptrW tszResource(m_proto->getTStringA("Resource"));
+ ptrW tszResource(m_proto->getWStringA("Resource"));
if (tszResource != NULL) {
if (CB_ERR == m_cbResource.FindString(tszResource, -1, true))
m_cbResource.AddString(tszResource);
@@ -1666,7 +1666,7 @@ protected:
m_txtManualHost.Enable();
m_txtPort.Enable();
- ptrW dbManualHost(m_proto->getTStringA("ManualHost"));
+ ptrW dbManualHost(m_proto->getWStringA("ManualHost"));
if (dbManualHost != NULL)
m_txtManualHost.SetText(dbManualHost);
@@ -1715,7 +1715,7 @@ protected:
if (m_chkSavePassword.GetState() == BST_CHECKED) {
wchar_t *text = m_txtPassword.GetText();
- m_proto->setTString("Password", text);
+ m_proto->setWString("Password", text);
mir_free(text);
}
else m_proto->delSetting("Password");
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp
index 8e9e009d1d..545c1cc81a 100644
--- a/protocols/JabberG/src/jabber_privacy.cpp
+++ b/protocols/JabberG/src/jabber_privacy.cpp
@@ -183,7 +183,7 @@ void CJabberProto::OnIqResultPrivacyListActive(HXML iqNode, CJabberIqInfo *pInfo
if (type == NULL)
return;
- CMString szText;
+ CMStringW szText;
if (!mir_wstrcmp(type, L"result")) {
mir_cslock lck(m_privacyListManager.m_cs);
@@ -370,7 +370,7 @@ public:
wchar_t *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]));
+ LRESULT nItem = SendDlgItemMessage(m_hwnd, IDC_COMBO_TYPE, CB_ADDSTRING, 0, (LPARAM)TranslateW(szTypes[i]));
SendDlgItemMessage(m_hwnd, IDC_COMBO_TYPE, CB_SETITEMDATA, nItem, nTypes[i]);
if (m_pRule->GetType() == nTypes[i])
SendDlgItemMessage(m_hwnd, IDC_COMBO_TYPE, CB_SETCURSEL, nItem, 0);
@@ -379,7 +379,7 @@ public:
SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUE, CB_RESETCONTENT, 0, 0);
wchar_t *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]));
+ LRESULT nItem = SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUE, CB_ADDSTRING, 0, (LPARAM)TranslateW(szSubscriptions[i]));
SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUE, CB_SETITEMDATA, nItem, (LPARAM)szSubscriptions[i]);
}
@@ -423,7 +423,7 @@ public:
SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUES, CB_RESETCONTENT, 0, 0);
{
for (MCONTACT hContact = db_find_first(m_proto->m_szModuleName); hContact; hContact = db_find_next(hContact, m_proto->m_szModuleName)) {
- ptrW jid( m_proto->getTStringA(hContact, "jid"));
+ ptrW jid( m_proto->getWStringA(hContact, "jid"));
if (jid != NULL)
SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUES, CB_ADDSTRING, 0, jid);
}
@@ -471,7 +471,7 @@ public:
ShowWindow(GetDlgItem(m_hwnd, IDC_COMBO_VALUE), SW_SHOW);
if (m_pRule->GetValue()) {
- LRESULT nSelected = SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUE, CB_SELECTSTRING, -1, (LPARAM)TranslateTS(m_pRule->GetValue()));
+ LRESULT nSelected = SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUE, CB_SELECTSTRING, -1, (LPARAM)TranslateW(m_pRule->GetValue()));
if (nSelected == CB_ERR)
SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUE, CB_SETCURSEL, 0, 0);
}
@@ -948,7 +948,7 @@ BOOL CJabberDlgPrivacyLists::OnWmDrawItem(UINT, WPARAM, LPARAM lParam)
int i, totalWidth = -5; // spacing for last item
for (i=0; i < _countof(drawItems); i++) {
SIZE sz = {0};
- drawItems[i].text = TranslateTS(drawItems[i].textEng);
+ drawItems[i].text = TranslateW(drawItems[i].textEng);
GetTextExtentPoint32(lpdis->hDC, drawItems[i].text, (int)mir_wstrlen(drawItems[i].text), &sz);
totalWidth += sz.cx + 18 + 5; // 18 pixels for icon, 5 pixel spacing
}
@@ -1462,9 +1462,9 @@ void CJabberDlgPrivacyLists::CListBuildList(HWND hwndList, CPrivacyList *pList)
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
hItem = m_clcClist.FindContact(hContact);
- ptrW jid( m_proto->getTStringA(hContact, "jid"));
+ ptrW jid( m_proto->getWStringA(hContact, "jid"));
if (jid == NULL)
- if ((jid = m_proto->getTStringA(hContact, "ChatRoomID")) == NULL)
+ if ((jid = m_proto->getWStringA(hContact, "ChatRoomID")) == NULL)
continue;
if (dwPackets = CListGetPackets(hwndList, hItem, true))
@@ -1663,7 +1663,7 @@ void CJabberDlgPrivacyLists::btnActivate_OnClick(CCtrlButton *)
active << XATTR(L"name", pList->GetListName());
lck.unlock();
- SetStatusText(TranslateTS(JABBER_PL_BUSY_MSG));
+ SetStatusText(TranslateW(JABBER_PL_BUSY_MSG));
m_proto->m_ThreadInfo->send(iq);
}
@@ -1690,7 +1690,7 @@ void CJabberDlgPrivacyLists::btnSetDefault_OnClick(CCtrlButton *)
XmlAddAttr(defaultTag, L"name", pList->GetListName());
lck.unlock();
- SetStatusText(TranslateTS(JABBER_PL_BUSY_MSG));
+ SetStatusText(TranslateW(JABBER_PL_BUSY_MSG));
m_proto->m_ThreadInfo->send(iq);
}
@@ -1958,7 +1958,7 @@ void CJabberDlgPrivacyLists::btnApply_OnClick(CCtrlButton *)
pList = pList->GetNext();
} }
- SetStatusText(TranslateTS(JABBER_PL_BUSY_MSG));
+ SetStatusText(TranslateW(JABBER_PL_BUSY_MSG));
PostMessage(m_hwnd, WM_JABBER_REFRESH, 0, 0);
}
@@ -2101,7 +2101,7 @@ void CJabberProto::BuildPrivacyMenu()
mi.pszService = "/PrivacyLists";
CreateProtoService(mi.pszService, &CJabberProto::OnMenuHandlePrivacyLists);
mi.position = 3000040000;
- mi.flags = CMIF_UNMOVABLE | CMIF_TCHAR;
+ mi.flags = CMIF_UNMOVABLE | CMIF_UNICODE;
mi.hIcolibItem = GetIconHandle(IDI_PRIVACY_LISTS);
mi.name.w = LPGENW("List Editor...");
mi.root = m_hPrivacyMenuRoot;
@@ -2122,7 +2122,7 @@ void CJabberProto::BuildPrivacyListsMenu(bool bDeleteOld)
CMenuItem mi;
mi.position = 2000040000;
- mi.flags = CMIF_UNMOVABLE | CMIF_TCHAR;
+ mi.flags = CMIF_UNMOVABLE | CMIF_UNICODE;
mi.root = m_hPrivacyMenuRoot;
mi.pszService = srvFce;
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index 198a8231d0..f66f63f151 100755
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -146,7 +146,7 @@ CJabberProto::CJabberProto(const char *aProtoName, const wchar_t *aUserName) :
db_set_resident(m_szModuleName, "Auth");
db_set_resident(m_szModuleName, "Grant");
- if ((m_tszSelectedLang = getTStringA("XmlLang")) == NULL)
+ if ((m_tszSelectedLang = getWStringA("XmlLang")) == NULL)
m_tszSelectedLang = mir_wstrdup(L"en");
}
@@ -242,7 +242,7 @@ int CJabberProto::OnModulesLoadedEx(WPARAM, LPARAM)
SetContactOfflineStatus(hContact);
if (getByte(hContact, "IsTransport", 0)) {
- ptrW jid(getTStringA(hContact, "jid"));
+ ptrW jid(getWStringA(hContact, "jid"));
if (jid == NULL)
continue;
@@ -297,7 +297,7 @@ int __cdecl CJabberProto::OnPreShutdown(WPARAM, LPARAM)
MCONTACT CJabberProto::AddToListByJID(const wchar_t *newJid, DWORD flags)
{
- debugLog(L"AddToListByJID jid = %s", newJid);
+ debugLogW(L"AddToListByJID jid = %s", newJid);
MCONTACT hContact = DBCreateContact(newJid, NULL, true, false);
if (flags & PALF_TEMPORARY)
@@ -371,7 +371,7 @@ int CJabberProto::Authorize(MEVENT hDbEvent)
char *lastName = firstName + mir_strlen(firstName) + 1;
char *jid = lastName + mir_strlen(lastName) + 1;
- debugLog(L"Send 'authorization allowed' to %s", jid);
+ debugLogW(L"Send 'authorization allowed' to %s", jid);
wchar_t *newJid = (dbei.flags & DBEF_UTF) ? mir_utf8decodeW(jid) : mir_a2u(jid);
@@ -382,7 +382,7 @@ int CJabberProto::Authorize(MEVENT hDbEvent)
JABBER_LIST_ITEM *item;
if ((item = ListGetItemPtr(LIST_ROSTER, newJid)) == NULL || (item->subscription != SUB_BOTH && item->subscription != SUB_TO)) {
- debugLog(L"Try adding contact automatically jid = %s", jid);
+ debugLogW(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().
@@ -659,7 +659,7 @@ void __cdecl CJabberProto::BasicSearchThread(JABBER_SEARCH_BASIC *jsb)
PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
- psr.flags = PSR_TCHAR;
+ psr.flags = PSR_UNICODE;
psr.nick.w = jsb->jid;
psr.firstName.w = L"";
psr.lastName.w = L"";
@@ -672,7 +672,7 @@ void __cdecl CJabberProto::BasicSearchThread(JABBER_SEARCH_BASIC *jsb)
HANDLE __cdecl CJabberProto::SearchBasic(const wchar_t *szJid)
{
- debugLog(L"JabberBasicSearch called with lParam = '%s'", szJid);
+ debugLogW(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)
@@ -687,7 +687,7 @@ HANDLE __cdecl CJabberProto::SearchBasic(const wchar_t *szJid)
numericjid = (*i >= '0') && (*i <= '9');
mir_free(szServer);
- szServer = getTStringA(NULL, "LoginServer");
+ szServer = getWStringA(NULL, "LoginServer");
if (szServer == NULL)
szServer = mir_wstrdup(L"jabber.org");
else if (numericjid && !mir_wstrcmpi(szServer, L"S.ms")) {
@@ -701,7 +701,7 @@ HANDLE __cdecl CJabberProto::SearchBasic(const wchar_t *szJid)
}
else wcsncpy_s(jsb->jid, szJid, _TRUNCATE);
- debugLog(L"Adding '%s' without validation", jsb->jid);
+ debugLogW(L"Adding '%s' without validation", jsb->jid);
jsb->hSearch = SerialNext();
ForkThread((MyThreadFunc)&CJabberProto::BasicSearchThread, jsb);
return (HANDLE)jsb->hSearch;
@@ -802,7 +802,7 @@ int __cdecl CJabberProto::SendContacts(MCONTACT hContact, int, int nContacts, MC
HXML x = m << XCHILDNS(L"x", JABBER_FEAT_ROSTER_EXCHANGE);
for (int i = 0; i < nContacts; i++) {
- ptrW jid(getTStringA(hContactsList[i], "jid"));
+ ptrW jid(getWStringA(hContactsList[i], "jid"));
if (jid != NULL)
x << XCHILD(L"item") << XATTR(L"action", L"add") << XATTR(L"jid", jid);
}
@@ -822,7 +822,7 @@ HANDLE __cdecl CJabberProto::SendFile(MCONTACT hContact, const wchar_t *szDescri
if (getWord(hContact, "Status", ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE)
return 0;
- ptrW jid(getTStringA(hContact, "jid"));
+ ptrW jid(getWStringA(hContact, "jid"));
if (jid == NULL)
return 0;
@@ -873,7 +873,7 @@ HANDLE __cdecl CJabberProto::SendFile(MCONTACT hContact, const wchar_t *szDescri
int i, j;
for (i = j = 0; i < ft->std.totalFiles; i++) {
if (_wstat64(ppszFiles[i], &statbuf))
- debugLog(L"'%s' is an invalid filename", ppszFiles[i]);
+ debugLogW(L"'%s' is an invalid filename", ppszFiles[i]);
else {
ft->std.ptszFiles[j] = mir_wstrdup(ppszFiles[i]);
ft->fileSize[j] = statbuf.st_size;
@@ -1031,7 +1031,7 @@ int __cdecl CJabberProto::SetApparentMode(MCONTACT hContact, int mode)
if (!m_bJabberOnline)
return 0;
- ptrW jid(getTStringA(hContact, "jid"));
+ ptrW jid(getWStringA(hContact, "jid"));
if (jid == NULL)
return 0;
@@ -1103,7 +1103,7 @@ void __cdecl CJabberProto::GetAwayMsgThread(void *param)
MCONTACT hContact = (DWORD_PTR)param;
- ptrW jid(getTStringA(hContact, "jid"));
+ ptrW jid(getWStringA(hContact, "jid"));
if (jid != NULL) {
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, jid);
if (item != NULL) {
@@ -1162,7 +1162,7 @@ HANDLE __cdecl CJabberProto::GetAwayMsg(MCONTACT hContact)
int __cdecl CJabberProto::SetAwayMsg(int status, const wchar_t *msg)
{
- debugLog(L"SetAwayMsg called, wParam=%d lParam=%s", status, msg);
+ debugLogW(L"SetAwayMsg called, wParam=%d lParam=%s", status, msg);
wchar_t **szMsg;
mir_cslockfull lck(m_csModeMsgMutex);
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h
index f0e36b64ff..dbdc84bab3 100644
--- a/protocols/JabberG/src/jabber_proto.h
+++ b/protocols/JabberG/src/jabber_proto.h
@@ -582,14 +582,14 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
void GetAvatarFileName(MCONTACT hContact, wchar_t* pszDest, size_t cbLen);
void ResolveTransportNicks(const wchar_t *jid);
void SetServerStatus(int iNewStatus);
- void FormatMirVer(pResourceStatus &resource, CMString&);
+ void FormatMirVer(pResourceStatus &resource, CMStringW&);
void UpdateMirVer(JABBER_LIST_ITEM *item);
void UpdateMirVer(MCONTACT hContact, pResourceStatus &resource);
void UpdateSubscriptionInfo(MCONTACT hContact, JABBER_LIST_ITEM *item);
void SetContactOfflineStatus(MCONTACT hContact);
void InitPopups(void);
void MsgPopup(MCONTACT hContact, const wchar_t *szMsg, const wchar_t *szTitle);
- CMString ExtractImage(HXML node);
+ CMStringW ExtractImage(HXML node);
//---- jabber_opt.cpp ----------------------------------------------------------------
INT_PTR __cdecl OnMenuHandleRosterControl(WPARAM wParam, LPARAM lParam);
@@ -746,7 +746,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface
void ComboLoadRecentStrings(HWND hwndDlg, UINT idcCombo, char *param, int recentCount=JABBER_DEFAULT_RECENT_COUNT);
void ComboAddRecentString(HWND hwndDlg, UINT idcCombo, char *param, const wchar_t *string, int recentCount=JABBER_DEFAULT_RECENT_COUNT);
- BOOL EnterString(CMString &result, LPCTSTR caption, int type, char *windowName=NULL, int recentCount=JABBER_DEFAULT_RECENT_COUNT, int timeout=0);
+ BOOL EnterString(CMStringW &result, LPCTSTR caption, int type, char *windowName=NULL, int recentCount=JABBER_DEFAULT_RECENT_COUNT, int timeout=0);
bool IsMyOwnJID(LPCTSTR szJID);
void __cdecl LoadHttpAvatars(void* param);
diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp
index 6cfb672dd0..7255b5cc63 100644
--- a/protocols/JabberG/src/jabber_rc.cpp
+++ b/protocols/JabberG/src/jabber_rc.cpp
@@ -322,7 +322,7 @@ int CJabberProto::AdhocSetStatusHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhoc
fieldNode = xNode << XCHILD(L"field") << XATTR(L"label", TranslateT("Change global status"))
<< XATTR(L"type", L"boolean") << XATTR(L"var", L"status-global");
- ptrW tszStatusMsg((wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGT, status, 0));
+ ptrW tszStatusMsg((wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGW, status, 0));
if (tszStatusMsg)
fieldNode << XCHILD(L"value", tszStatusMsg);
@@ -375,7 +375,7 @@ 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 : L"");
+ db_set_ws(NULL, "SRAway", StatusModeToDbSetting(status, "Msg"), szStatusMessage ? szStatusMessage : L"");
fieldNode = XmlGetChildByTag(xNode, "field", "var", L"status-global");
if (fieldNode && (valueNode = XmlGetChild(fieldNode , "value"))) {
@@ -465,7 +465,7 @@ int CJabberProto::RcGetUnreadEventsCount()
{
int nEventsSent = 0;
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
- ptrW jid( getTStringA(hContact, "jid"));
+ ptrW jid( getWStringA(hContact, "jid"));
if (jid == NULL) continue;
for (MEVENT hDbEvent = db_event_firstUnread(hContact); hDbEvent; hDbEvent = db_event_next(hContact, hDbEvent)) {
@@ -477,7 +477,7 @@ int CJabberProto::RcGetUnreadEventsCount()
dbei.pBlob = (PBYTE)mir_alloc(dbei.cbBlob + 1);
int nGetTextResult = db_event_get(hDbEvent, &dbei);
if (!nGetTextResult && dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_READ) && !(dbei.flags & DBEF_SENT)) {
- wchar_t *szEventText = DbGetEventTextT(&dbei, CP_ACP);
+ wchar_t *szEventText = DbGetEventTextW(&dbei, CP_ACP);
if (szEventText) {
nEventsSent++;
mir_free(szEventText);
@@ -551,7 +551,7 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe
int nEventsSent = 0;
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
- ptrW tszJid( getTStringA(hContact, "jid"));
+ ptrW tszJid( getWStringA(hContact, "jid"));
if (tszJid == NULL)
continue;
@@ -569,7 +569,7 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe
if (dbei.eventType != EVENTTYPE_MESSAGE || (dbei.flags & (DBEF_READ | DBEF_SENT)))
continue;
- ptrW szEventText( DbGetEventTextT(&dbei, CP_ACP));
+ ptrW szEventText( DbGetEventTextW(&dbei, CP_ACP));
if (szEventText == NULL)
continue;
diff --git a/protocols/JabberG/src/jabber_rc.h b/protocols/JabberG/src/jabber_rc.h
index fd4a6664d9..cd85c98039 100644
--- a/protocols/JabberG/src/jabber_rc.h
+++ b/protocols/JabberG/src/jabber_rc.h
@@ -42,7 +42,7 @@ typedef int (CJabberProto::*JABBER_ADHOC_HANDLER)(HXML iqNode, CJabberIqInfo *pI
class CJabberAdhocSession
{
protected:
- CMString m_szSessionId;
+ CMStringW m_szSessionId;
CJabberAdhocSession* m_pNext;
DWORD m_dwStartTime;
diff --git a/protocols/JabberG/src/jabber_search.cpp b/protocols/JabberG/src/jabber_search.cpp
index 69f3c6f3ee..2e950a0b26 100644
--- a/protocols/JabberG/src/jabber_search.cpp
+++ b/protocols/JabberG/src/jabber_search.cpp
@@ -105,7 +105,7 @@ static int JabberSearchAddField(HWND hwndDlg, Data* FieldDat)
int Order = (FieldDat->bHidden) ? -1 : FieldDat->Order;
- HWND hwndLabel = CreateWindowEx(0, L"STATIC", (LPCTSTR)TranslateTS(FieldDat->Label), WS_CHILD, CornerX, CornerY + Order * 40, width, 13, hwndParent, NULL, hInst, 0);
+ HWND hwndLabel = CreateWindowEx(0, L"STATIC", (LPCTSTR)TranslateW(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);
@@ -161,7 +161,7 @@ void CJabberProto::OnIqResultGetSearchFields(HXML iqNode, CJabberIqInfo*)
break;
if (!mir_wstrcmpi(XmlGetName(chNode), L"instructions") && XmlGetText(chNode))
- SetDlgItemText(searchHandleDlg, IDC_INSTRUCTIONS, TranslateTS(XmlGetText(chNode)));
+ SetDlgItemText(searchHandleDlg, IDC_INSTRUCTIONS, TranslateW(XmlGetText(chNode)));
else if (XmlGetName(chNode)) {
Data *MyData = (Data*)malloc(sizeof(Data));
memset(MyData, 0, sizeof(Data));
@@ -278,7 +278,7 @@ void CJabberProto::SearchReturnResults(HANDLE id, void * pvUsersInfo, U_TCHAR_M
nick = buff;
}
Results.psr.nick.w = nick;
- Results.psr.flags = PSR_TCHAR;
+ Results.psr.flags = PSR_UNICODE;
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SEARCHRESULT, id, (LPARAM)&Results);
Results.psr.nick.w = NULL;
@@ -494,16 +494,16 @@ void CJabberProto::SearchDeleteFromRecent(const wchar_t *szAddr, bool deleteLast
for (int i = 0; i < 10; i++) {
char key[30];
mir_snprintf(key, "RecentlySearched_%d", i);
- ptrW szValue(getTStringA(key));
+ ptrW szValue(getWStringA(key));
if (szValue == NULL || mir_wstrcmpi(szAddr, szValue))
continue;
for (int j = i; j < 10; j++) {
mir_snprintf(key, "RecentlySearched_%d", j + 1);
- szValue = getTStringA(key);
+ szValue = getWStringA(key);
if (szValue != NULL) {
mir_snprintf(key, "RecentlySearched_%d", j);
- setTString(NULL, key, szValue);
+ setWString(NULL, key, szValue);
}
else {
if (deleteLastFromDB) {
@@ -524,15 +524,15 @@ void CJabberProto::SearchAddToRecent(const wchar_t *szAddr, HWND hwndDialog)
for (int j = 9; j > 0; j--) {
mir_snprintf(key, "RecentlySearched_%d", j - 1);
- ptrW szValue(getTStringA(key));
+ ptrW szValue(getWStringA(key));
if (szValue != NULL) {
mir_snprintf(key, "RecentlySearched_%d", j);
- setTString(NULL, key, szValue);
+ setWString(NULL, key, szValue);
}
}
mir_snprintf(key, "RecentlySearched_%d", 0);
- setTString(key, szAddr);
+ setWString(key, szAddr);
if (hwndDialog)
JabberSearchAddUrlToRecentCombo(hwndDialog, szAddr);
}
@@ -564,7 +564,7 @@ static INT_PTR CALLBACK JabberSearchAdvancedDlgProc(HWND hwndDlg, UINT msg, WPAR
for (i = 0; i < 10; i++) {
char key[30];
mir_snprintf(key, "RecentlySearched_%d", i);
- ptrW szValue(dat->ppro->getTStringA(key));
+ ptrW szValue(dat->ppro->getWStringA(key));
if (szValue != NULL)
JabberSearchAddUrlToRecentCombo(hwndDlg, szValue);
}
@@ -714,7 +714,7 @@ static INT_PTR CALLBACK JabberSearchAdvancedDlgProc(HWND hwndDlg, UINT msg, WPAR
HWND __cdecl CJabberProto::CreateExtendedSearchUI(HWND parent)
{
if (parent && hInst) {
- ptrW szServer(getTStringA("LoginServer"));
+ ptrW szServer(getWStringA("LoginServer"));
if (szServer == NULL || mir_wstrcmpi(szServer, L"S.ms"))
return CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_SEARCHUSER), parent, JabberSearchAdvancedDlgProc, (LPARAM)this);
}
diff --git a/protocols/JabberG/src/jabber_svc.cpp b/protocols/JabberG/src/jabber_svc.cpp
index 9d5553db8f..29b2cef6b5 100644
--- a/protocols/JabberG/src/jabber_svc.cpp
+++ b/protocols/JabberG/src/jabber_svc.cpp
@@ -144,7 +144,7 @@ INT_PTR __cdecl CJabberProto::JabberGetAvatarInfo(WPARAM wParam, LPARAM lParam)
}
if ((wParam & GAIF_FORCE) != 0 && pai->hContact != NULL && m_bJabberOnline) {
- ptrW tszJid( getTStringA(pai->hContact, "jid"));
+ ptrW tszJid( getWStringA(pai->hContact, "jid"));
if (tszJid != NULL) {
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, tszJid);
if (item != NULL) {
@@ -158,7 +158,7 @@ INT_PTR __cdecl CJabberProto::JabberGetAvatarInfo(WPARAM wParam, LPARAM lParam)
if (szJid[0] == 0)
wcsncpy_s(szJid, tszJid, _TRUNCATE);
- debugLog(L"Rereading %s for %s", isXVcard ? JABBER_FEAT_VCARD_TEMP : JABBER_FEAT_AVATAR, szJid);
+ debugLogW(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(L"vCard", JABBER_FEAT_VCARD_TEMP) :
@@ -319,7 +319,7 @@ INT_PTR __cdecl CJabberProto::JabberSetNickname(WPARAM wParam, LPARAM lParam)
{
wchar_t *nickname = (wParam & SMNN_UNICODE) ? mir_wstrdup((WCHAR*)lParam) : mir_a2u((char*)lParam);
- setTString("Nick", nickname);
+ setWString("Nick", nickname);
SetServerVcard(FALSE, L"");
return 0;
}
@@ -338,15 +338,15 @@ INT_PTR __cdecl CJabberProto::ServiceSendXML(WPARAM, LPARAM lParam)
static const wchar_t *JabberEnum2AffilationStr[] = { LPGENW("None"), LPGENW("Outcast"), LPGENW("Member"), LPGENW("Admin"), LPGENW("Owner") },
*JabberEnum2RoleStr[] = { LPGENW("None"), LPGENW("Visitor"), LPGENW("Participant"), LPGENW("Moderator") };
-static void appendString(bool bIsTipper, const wchar_t *tszTitle, const wchar_t *tszValue, CMString &out)
+static void appendString(bool bIsTipper, const wchar_t *tszTitle, const wchar_t *tszValue, CMStringW &out)
{
if (!out.IsEmpty())
out.Append(bIsTipper ? L"\n" : L"\r\n");
if (bIsTipper)
- out.AppendFormat(L"<b>%s</b>\t%s", TranslateTS(tszTitle), tszValue);
+ out.AppendFormat(L"<b>%s</b>\t%s", TranslateW(tszTitle), tszValue);
else {
- wchar_t *p = TranslateTS(tszTitle);
+ wchar_t *p = TranslateW(tszTitle);
out.AppendFormat(L"%s%s\t%s", p, mir_wstrlen(p) <= 7 ? L"\t" : L"", tszValue);
}
}
@@ -374,7 +374,7 @@ INT_PTR __cdecl CJabberProto::JabberGCGetToolTipText(WPARAM wParam, LPARAM lPara
bool bIsTipper = db_get_b(NULL, "Tab_SRMsg", "adv_TipperTooltip", 0) && ServiceExists("mToolTip/HideTip");
//JID:
- CMString outBuf;
+ CMStringW outBuf;
if (wcschr(info->m_tszResourceName, '@') != NULL)
appendString(bIsTipper, LPGENW("JID:"), info->m_tszResourceName, outBuf);
else if (lParam) //or simple nick
@@ -389,10 +389,10 @@ INT_PTR __cdecl CJabberProto::JabberGCGetToolTipText(WPARAM wParam, LPARAM lPara
appendString(bIsTipper, LPGENW("Status message:"), info->m_tszStatusMessage, outBuf);
// Role
- appendString(bIsTipper, LPGENW("Role:"), TranslateTS(JabberEnum2RoleStr[info->m_role]), outBuf);
+ appendString(bIsTipper, LPGENW("Role:"), TranslateW(JabberEnum2RoleStr[info->m_role]), outBuf);
// Affiliation
- appendString(bIsTipper, LPGENW("Affiliation:"), TranslateTS(JabberEnum2AffilationStr[info->m_affiliation]), outBuf);
+ appendString(bIsTipper, LPGENW("Affiliation:"), TranslateW(JabberEnum2AffilationStr[info->m_affiliation]), outBuf);
// real jid
if (info->m_tszRealJid)
@@ -465,7 +465,7 @@ INT_PTR __cdecl CJabberProto::JabberServiceParseXmppURI(WPARAM, LPARAM lParam)
if (!HContactFromJID(szJid)) {
PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
- psr.flags = PSR_TCHAR;
+ psr.flags = PSR_UNICODE;
psr.nick.w = szJid;
psr.id.w = szJid;
@@ -525,7 +525,7 @@ INT_PTR __cdecl CJabberProto::JabberSendNudge(WPARAM hContact, LPARAM)
if (!m_bJabberOnline)
return 0;
- ptrW jid( getTStringA(hContact, "jid"));
+ ptrW jid( getWStringA(hContact, "jid"));
if (jid == NULL)
return 0;
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index bc3486fdf5..407def3d3d 100755
--- a/protocols/JabberG/src/jabber_thread.cpp
+++ b/protocols/JabberG/src/jabber_thread.cpp
@@ -97,7 +97,7 @@ static INT_PTR CALLBACK JabberPasswordDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa
BOOL savePassword = IsDlgButtonChecked(hwndDlg, IDC_SAVE_PERM);
param->pro->setByte("SavePassword", savePassword);
if (savePassword) {
- param->pro->setTString("Password", param->onlinePassword);
+ param->pro->setWString("Password", param->onlinePassword);
param->saveOnlinePassword = TRUE;
}
}
@@ -245,13 +245,13 @@ void CJabberProto::ServerThread(JABBER_CONN_DATA *pParam)
m_ThreadInfo = &info;
- if ((tszValue = getTStringA("LoginName")) != NULL)
+ if ((tszValue = getWStringA("LoginName")) != NULL)
wcsncpy_s(info.conn.username, tszValue, _TRUNCATE);
if (*rtrimw(info.conn.username) == '\0') {
DWORD dwSize = _countof(info.conn.username);
if (GetUserName(info.conn.username, &dwSize))
- setTString("LoginName", info.conn.username);
+ setWString("LoginName", info.conn.username);
else
info.conn.username[0] = 0;
}
@@ -282,7 +282,7 @@ LBL_FatalError:
mir_wstrcpy(info.resource, L"Miranda");
}
else {
- if ((tszValue = getTStringA("Resource")) != NULL)
+ if ((tszValue = getWStringA("Resource")) != NULL)
wcsncpy_s(info.resource, tszValue, _TRUNCATE);
else
mir_wstrcpy(info.resource, L"Miranda");
@@ -319,7 +319,7 @@ LBL_FatalError:
}
}
else {
- ptrW tszPassw(getTStringA(NULL, "Password"));
+ ptrW tszPassw(getWStringA(NULL, "Password"));
if (tszPassw == NULL) {
JLoginFailed(LOGINERR_BADUSERID);
debugLogA("Thread ended, password is not configured");
@@ -394,7 +394,7 @@ LBL_FatalError:
m_szJabberJID = (wchar_t*)mir_alloc(sizeof(wchar_t)*(len + 1));
mir_snwprintf(m_szJabberJID, len + 1, L"%s@%S", info.conn.username, info.conn.server);
m_bSendKeepAlive = m_options.KeepAlive != 0;
- setTString("jid", m_szJabberJID); // store jid in database
+ setWString("jid", m_szJabberJID); // store jid in database
ListInit();
}
@@ -830,13 +830,13 @@ void CJabberProto::OnProcessSuccess(HXML node, ThreadData *info)
}
debugLogA("Success: Logged-in.");
- ptrW tszNick(getTStringA("Nick"));
+ ptrW tszNick(getWStringA("Nick"));
if (tszNick == NULL)
- setTString("Nick", info->conn.username);
+ setWString("Nick", info->conn.username);
xmlStreamInitialize("after successful sasl");
}
- else debugLog(L"Success: unknown action %s.", type);
+ else debugLogW(L"Success: unknown action %s.", type);
}
void CJabberProto::OnProcessChallenge(HXML node, ThreadData *info)
@@ -1321,7 +1321,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
if (!mir_wstrcmp(action, L"add")) {
MCONTACT cc = DBCreateContact(jid, nick, false, false);
if (group)
- db_set_ts(cc, "CList", "Group", group);
+ db_set_ws(cc, "CList", "Group", group);
}
else if (!mir_wstrcmp(action, L"delete")) {
MCONTACT cc = HContactFromJID(jid);
@@ -1365,7 +1365,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
if (szMessage == NULL)
return;
- CMString tmp(szMessage);
+ CMStringW tmp(szMessage);
tmp += ExtractImage(node);
tmp.Replace(L"\n", L"\r\n");
ptrA buf(mir_utf8encodeW(tmp));
@@ -1407,7 +1407,7 @@ void CJabberProto::OnProcessPresenceCapabilites(HXML node)
if (from == NULL)
return;
- debugLog(L"presence: for jid %s", from);
+ debugLogW(L"presence: for jid %s", from);
pResourceStatus r(ResourceInfoFromJID(from));
if (r == NULL)
@@ -1449,7 +1449,7 @@ void CJabberProto::UpdateJidDbSettings(const wchar_t *jid)
if (wcschr(jid, '/') == NULL)
status = item->getTemp()->m_iStatus;
if (item->getTemp()->m_tszStatusMessage)
- db_set_ts(hContact, "CList", "StatusMsg", item->getTemp()->m_tszStatusMessage);
+ db_set_ws(hContact, "CList", "StatusMsg", item->getTemp()->m_tszStatusMessage);
else
db_unset(hContact, "CList", "StatusMsg");
}
@@ -1472,9 +1472,9 @@ void CJabberProto::UpdateJidDbSettings(const wchar_t *jid)
item->getTemp()->m_iStatus = status;
if (nSelectedResource != -1) {
pResourceStatus r(item->arResources[nSelectedResource]);
- debugLog(L"JabberUpdateJidDbSettings: updating jid %s to rc %s", item->jid, r->m_tszResourceName);
+ debugLogW(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);
+ db_set_ws(hContact, "CList", "StatusMsg", r->m_tszStatusMessage);
else
db_unset(hContact, "CList", "StatusMsg");
UpdateMirVer(hContact, r);
@@ -1530,13 +1530,13 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
if ((hContact = HContactFromJID(from)) == NULL) {
if (!mir_wstrcmpi(info->fullJID, from) || (!bSelfPresence && !ListGetItemPtr(LIST_ROSTER, from))) {
- debugLog(L"SKIP Receive presence online from %s (who is not in my roster and not in list - skiping)", from);
+ debugLogW(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(L"Receive presence online from %s (who is not in my roster)", from);
+ debugLogW(L"Receive presence online from %s (who is not in my roster)", from);
ListAdd(LIST_ROSTER, from, hContact);
}
DBCheckIsTransportedContact(from, hContact);
@@ -1564,7 +1564,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
if (wcschr(from, '@') == NULL) {
UI_SAFE_NOTIFY(m_pDlgServiceDiscovery, WM_JABBER_TRANSPORT_REFRESH);
}
- debugLog(L"%s (%s) online, set contact status to %s", nick, from, pcli->pfnGetStatusModeDescription(status, 0));
+ debugLogW(L"%s (%s) online, set contact status to %s", nick, from, pcli->pfnGetStatusModeDescription(status, 0));
HXML xNode;
if (m_options.EnableAvatars) {
@@ -1577,9 +1577,9 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
if (ptszHash != NULL) {
delSetting(hContact, "AvatarXVcard");
debugLogA("AvatarXVcard deleted");
- setTString(hContact, "AvatarHash", ptszHash);
+ setWString(hContact, "AvatarHash", ptszHash);
bHasAvatar = true;
- ptrW saved(getTStringA(hContact, "AvatarSaved"));
+ ptrW saved(getWStringA(hContact, "AvatarSaved"));
if (saved == NULL || mir_wstrcmp(saved, ptszHash)) {
debugLogA("Avatar was changed");
ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, NULL);
@@ -1597,9 +1597,9 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
if (txt != NULL && txt[0] != 0) {
setByte(hContact, "AvatarXVcard", 1);
debugLogA("AvatarXVcard set");
- setTString(hContact, "AvatarHash", txt);
+ setWString(hContact, "AvatarHash", txt);
bHasAvatar = true;
- ptrW saved(getTStringA(hContact, "AvatarSaved"));
+ ptrW saved(getWStringA(hContact, "AvatarSaved"));
if (saved == NULL || mir_wstrcmp(saved, txt)) {
debugLogA("Avatar was changed. Using vcard-temp:x:update");
ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, NULL);
@@ -1612,7 +1612,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
debugLogA("Has no avatar");
delSetting(hContact, "AvatarHash");
- if (ptrW(getTStringA(hContact, "AvatarSaved")) != NULL) {
+ if (ptrW(getWStringA(hContact, "AvatarSaved")) != NULL) {
delSetting(hContact, "AvatarSaved");
ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, NULL, NULL);
} } }
@@ -1639,7 +1639,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
item->getTemp()->m_tszStatusMessage = mir_wstrdup(XmlGetText(XmlGetChild(node, "status")));
}
}
- else debugLog(L"SKIP Receive presence offline from %s (who is not in my roster)", from);
+ else debugLogW(L"SKIP Receive presence offline from %s (who is not in my roster)", from);
UpdateJidDbSettings(from);
@@ -1659,7 +1659,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
if (xNick != NULL) {
LPCTSTR xszNick = XmlGetText(xNick);
if (xszNick != NULL && *xszNick) {
- debugLog(L"Grabbed nick from presence: %s", xszNick);
+ debugLogW(L"Grabbed nick from presence: %s", xszNick);
tszNick = mir_wstrdup(xszNick);
}
}
@@ -1672,11 +1672,11 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
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(L"Try adding contact automatically jid = %s", from);
+ debugLogW(L"Try adding contact automatically jid = %s", from);
if ((hContact = AddToListByJID(from, 0)) != NULL) {
if (item)
item->hContact = hContact;
- setTString(hContact, "Nick", tszNick);
+ setWString(hContact, "Nick", tszNick);
db_unset(hContact, "CList", "NotOnList");
}
}
@@ -1684,7 +1684,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
RebuildInfoFrame();
}
else {
- debugLog(L"%s (%s) requests authorization", tszNick, from);
+ debugLogW(L"%s (%s) requests authorization", tszNick, from);
DBAddAuthRequest(from, tszNick);
}
return;
diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp
index 4a0f6e0046..bd464df117 100644
--- a/protocols/JabberG/src/jabber_userinfo.cpp
+++ b/protocols/JabberG/src/jabber_userinfo.cpp
@@ -279,7 +279,7 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti
if (jcb & g_JabberFeatCapPairs[i].jcbCap) {
wchar_t szDescription[ 1024 ];
if (g_JabberFeatCapPairs[i].tszDescription)
- mir_snwprintf(szDescription, L"%s (%s)", TranslateTS(g_JabberFeatCapPairs[i].tszDescription), g_JabberFeatCapPairs[i].szFeature);
+ mir_snwprintf(szDescription, L"%s (%s)", TranslateW(g_JabberFeatCapPairs[i].tszDescription), g_JabberFeatCapPairs[i].szFeature);
else
wcsncpy_s(szDescription, g_JabberFeatCapPairs[i].szFeature, _TRUNCATE);
sttFillInfoLine(hwndTree, htiCaps, NULL, NULL, szDescription, sttInfoLineId(resource, INFOLINE_CAPS, i));
@@ -289,7 +289,7 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti
if (jcb & ppro->m_lstJabberFeatCapPairsDynamic[j]->jcbCap) {
wchar_t szDescription[ 1024 ];
if (ppro->m_lstJabberFeatCapPairsDynamic[j]->szDescription)
- mir_snwprintf(szDescription, L"%s (%s)", TranslateTS(ppro->m_lstJabberFeatCapPairsDynamic[j]->szDescription), ppro->m_lstJabberFeatCapPairsDynamic[j]->szFeature);
+ mir_snwprintf(szDescription, L"%s (%s)", TranslateW(ppro->m_lstJabberFeatCapPairsDynamic[j]->szDescription), ppro->m_lstJabberFeatCapPairsDynamic[j]->szFeature);
else
wcsncpy_s(szDescription, ppro->m_lstJabberFeatCapPairsDynamic[j]->szFeature, _TRUNCATE);
sttFillInfoLine(hwndTree, htiCaps, NULL, NULL, szDescription, sttInfoLineId(resource, INFOLINE_CAPS, i));
@@ -320,9 +320,9 @@ static void sttFillAdvStatusInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM ht
if (szAdvStatusIcon && szAdvStatusTitle && *szAdvStatusTitle) {
wchar_t szText[2048];
if (szAdvStatusText && *szAdvStatusText)
- mir_snwprintf(szText, L"%s (%s)", TranslateTS(szAdvStatusTitle), szAdvStatusText);
+ mir_snwprintf(szText, L"%s (%s)", TranslateW(szAdvStatusTitle), szAdvStatusText);
else
- wcsncpy_s(szText, TranslateTS(szAdvStatusTitle), _TRUNCATE);
+ wcsncpy_s(szText, TranslateW(szAdvStatusTitle), _TRUNCATE);
sttFillInfoLine(hwndTree, htiRoot, IcoLib_GetIcon(szAdvStatusIcon), szTitle, szText, dwInfoLine);
}
@@ -470,7 +470,7 @@ static INT_PTR CALLBACK JabberUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa
if (dat == NULL) break;
if (dat->item == NULL) {
- ptrW jid(dat->ppro->getTStringA(dat->hContact, "jid"));
+ ptrW jid(dat->ppro->getWStringA(dat->hContact, "jid"));
if (jid == NULL)
break;
@@ -560,7 +560,7 @@ static INT_PTR CALLBACK JabberUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa
case PSN_PARAMCHANGED:
dat->ppro = (CJabberProto*)((PSHNOTIFY*)lParam)->lParam;
if (dat->hContact != NULL) {
- ptrW jid(dat->ppro->getTStringA(dat->hContact, "jid"));
+ ptrW jid(dat->ppro->getWStringA(dat->hContact, "jid"));
if (jid != NULL)
if (!(dat->item = dat->ppro->ListGetItemPtr(LIST_VCARD_TEMP, jid)))
dat->item = dat->ppro->ListGetItemPtr(LIST_ROSTER, jid);
@@ -642,14 +642,14 @@ static INT_PTR CALLBACK JabberUserPhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wP
}
ShowWindow(GetDlgItem(hwndDlg, IDC_SAVE), SW_HIDE);
{
- ptrW jid(photoInfo->ppro->getTStringA(photoInfo->hContact, "jid"));
+ ptrW jid(photoInfo->ppro->getWStringA(photoInfo->hContact, "jid"));
if (jid != NULL) {
JABBER_LIST_ITEM *item = photoInfo->ppro->ListGetItemPtr(LIST_VCARD_TEMP, jid);
if (item == NULL)
item = photoInfo->ppro->ListGetItemPtr(LIST_ROSTER, jid);
if (item != NULL) {
if (item->photoFileName) {
- photoInfo->ppro->debugLog(L"Showing picture from %s", item->photoFileName);
+ photoInfo->ppro->debugLogW(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);
@@ -666,7 +666,7 @@ static INT_PTR CALLBACK JabberUserPhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wP
case IDC_SAVE:
static wchar_t szFilter[512];
- ptrW jid(photoInfo->ppro->getTStringA(photoInfo->hContact, "jid"));
+ ptrW jid(photoInfo->ppro->getWStringA(photoInfo->hContact, "jid"));
if (jid == NULL)
break;
@@ -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(L"File selected is %s", szFileName);
+ photoInfo->ppro->debugLogW(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 c607e10c26..c2083fb050 100644
--- a/protocols/JabberG/src/jabber_util.cpp
+++ b/protocols/JabberG/src/jabber_util.cpp
@@ -283,9 +283,9 @@ wchar_t* __stdcall JabberErrorMsg(HXML errorNode, int* pErrorCode)
}
if (str != NULL)
- mir_snwprintf(errorStr, 256, L"%s %d: %s\r\n%s", TranslateT("Error"), errorCode, TranslateTS(JabberErrorStr(errorCode)), str);
+ mir_snwprintf(errorStr, 256, L"%s %d: %s\r\n%s", TranslateT("Error"), errorCode, TranslateW(JabberErrorStr(errorCode)), str);
else
- mir_snwprintf(errorStr, 256, L"%s %d: %s", TranslateT("Error"), errorCode, TranslateTS(JabberErrorStr(errorCode)));
+ mir_snwprintf(errorStr, 256, L"%s %d: %s", TranslateT("Error"), errorCode, TranslateW(JabberErrorStr(errorCode)));
if (pErrorCode)
*pErrorCode = errorCode;
@@ -425,7 +425,7 @@ void CJabberProto::SendPresenceTo(int status, const wchar_t* to, HXML extra, con
arrExtCaps.insert(m_lstJabberFeatCapPairsDynamic[i]->szExt);
if (arrExtCaps.getCount()) {
- CMString szExtCaps = arrExtCaps[0];
+ CMStringW szExtCaps = arrExtCaps[0];
for (int i = 1; i < arrExtCaps.getCount(); i++) {
szExtCaps.AppendChar(' ');
szExtCaps += arrExtCaps[i];
@@ -528,7 +528,7 @@ wchar_t* CJabberProto::GetClientJID(MCONTACT hContact, wchar_t *dest, size_t des
if (hContact == NULL)
return NULL;
- ptrW jid(getTStringA(hContact, "jid"));
+ ptrW jid(getWStringA(hContact, "jid"));
return GetClientJID(jid, dest, destLen);
}
@@ -658,7 +658,7 @@ void CJabberProto::ComboLoadRecentStrings(HWND hwndDlg, UINT idcCombo, char *par
for (int i = 0; i < recentCount; i++) {
char setting[MAXMODULELABELLENGTH];
mir_snprintf(setting, "%s%d", param, i);
- ptrW tszRecent(getTStringA(setting));
+ ptrW tszRecent(getWStringA(setting));
if (tszRecent != NULL)
SendDlgItemMessage(hwndDlg, idcCombo, CB_ADDSTRING, 0, tszRecent);
}
@@ -682,7 +682,7 @@ void CJabberProto::ComboAddRecentString(HWND hwndDlg, UINT idcCombo, char *param
id = getByte(param, 0);
char setting[MAXMODULELABELLENGTH];
mir_snprintf(setting, "%s%d", param, id);
- setTString(setting, string);
+ setWString(setting, string);
setByte(param, (id + 1) % recentCount);
}
@@ -809,7 +809,7 @@ void JabberCopyText(HWND hwnd, const wchar_t *text)
}
}
-BOOL CJabberProto::EnterString(CMString &result, LPCTSTR caption, int type, char *windowName, int recentCount, int timeout)
+BOOL CJabberProto::EnterString(CMStringW &result, LPCTSTR caption, int type, char *windowName, int recentCount, int timeout)
{
if (caption == NULL) {
caption = NEWWSTR_ALLOCA(result.GetString());
@@ -933,7 +933,7 @@ void __cdecl CJabberProto::LoadHttpAvatars(void* param)
fclose(out);
setString(ai.hContact, "AvatarSaved", buffer);
ProtoBroadcastAck(ai.hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, &ai, 0);
- debugLog(L"Broadcast new avatar: %s", ai.filename);
+ debugLogW(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 f48503739d..e4a6b04931 100644
--- a/protocols/JabberG/src/jabber_vcard.cpp
+++ b/protocols/JabberG/src/jabber_vcard.cpp
@@ -46,9 +46,9 @@ int CJabberProto::SendGetVcard(const wchar_t *jid)
static void SetDialogField(CJabberProto *ppro, HWND hwndDlg, int nDlgItem, char* key, bool bTranslate = false)
{
- ptrW tszValue(ppro->getTStringA(key));
+ ptrW tszValue(ppro->getWStringA(key));
if (tszValue != NULL)
- SetDlgItemText(hwndDlg, nDlgItem, (bTranslate) ? TranslateTS(tszValue) : tszValue);
+ SetDlgItemText(hwndDlg, nDlgItem, (bTranslate) ? TranslateW(tszValue) : tszValue);
else
SetDlgItemTextA(hwndDlg, nDlgItem, "");
}
@@ -127,7 +127,7 @@ static INT_PTR CALLBACK HomeDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
for (int i = 0; i < g_cbCountries; i++) {
if (g_countries[i].id != 0xFFFF && g_countries[i].id != 0) {
wchar_t *country = mir_a2u(g_countries[i].szName);
- SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_ADDSTRING, 0, (LPARAM)TranslateTS(country));
+ SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_ADDSTRING, 0, (LPARAM)TranslateW(country));
mir_free(country);
}
}
@@ -191,7 +191,7 @@ static INT_PTR CALLBACK WorkDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
for (int i = 0; i < g_cbCountries; i++) {
if (g_countries[i].id != 0xFFFF && g_countries[i].id != 0) {
wchar_t *country = mir_a2u(g_countries[i].szName);
- SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_ADDSTRING, 0, (LPARAM)TranslateTS(country));
+ SendDlgItemMessage(hwndDlg, IDC_COUNTRY, CB_ADDSTRING, 0, (LPARAM)TranslateW(country));
mir_free(country);
}
}
@@ -293,7 +293,7 @@ static INT_PTR CALLBACK PhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
if (GetTempPath(_countof(szTempPath), szTempPath) <= 0)
mir_wstrcpy(szTempPath, L".\\");
if (GetTempFileName(szTempPath, L"jab", 0, szTempFileName) > 0) {
- dat->ppro->debugLog(L"Temp file = %s", szTempFileName);
+ dat->ppro->debugLogW(L"Temp file = %s", szTempFileName);
if (CopyFile(szAvatarFileName, szTempFileName, FALSE) == TRUE) {
if ((dat->hBitmap = Bitmap_Load(szTempFileName)) != NULL) {
FIP->FI_Premultiply(dat->hBitmap);
@@ -349,7 +349,7 @@ static INT_PTR CALLBACK PhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
struct _stat st;
HBITMAP hNewBitmap;
- dat->ppro->debugLog(L"File selected is %s", szFileName);
+ dat->ppro->debugLogW(L"File selected is %s", szFileName);
if (_wstat(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;
@@ -358,7 +358,7 @@ static INT_PTR CALLBACK PhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
mir_wstrcpy(szTempPath, L".\\");
if (GetTempFileName(szTempPath, L"jab", 0, szTempFileName) > 0) {
- dat->ppro->debugLog(L"Temp file = %s", szTempFileName);
+ dat->ppro->debugLogW(L"Temp file = %s", szTempFileName);
if (CopyFile(szFileName, szTempFileName, FALSE) == TRUE) {
if ((hNewBitmap = Bitmap_Load(szTempFileName)) != NULL) {
if (dat->hBitmap) {
@@ -581,7 +581,7 @@ static INT_PTR CALLBACK EditEmailDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
wchar_t text[128];
GetDlgItemText(hwndDlg, IDC_EMAIL, text, _countof(text));
mir_snprintf(idstr, "e-mail%d", dat->id);
- dat->ppro->setTString(idstr, text);
+ dat->ppro->setWString(idstr, text);
{
WORD nFlag = 0;
if (IsDlgButtonChecked(hwndDlg, IDC_HOME)) nFlag |= JABBER_VCEMAIL_HOME;
@@ -730,7 +730,7 @@ static INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM, LPARAM lP
lvi.iItem = 0;
for (i=0;;i++) {
mir_snprintf(idstr, "e-mail%d", i);
- ptrW email( ppro->getTStringA(idstr));
+ ptrW email( ppro->getWStringA(idstr));
if (email == NULL) break;
mir_snwprintf(number, L"%d", i+1);
@@ -751,7 +751,7 @@ static INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM, LPARAM lP
lvi.iItem = 0;
for (i=0;;i++) {
mir_snprintf(idstr, "Phone%d", i);
- ptrW phone( ppro->getTStringA(idstr));
+ ptrW phone( ppro->getWStringA(idstr));
if (phone == NULL) break;
mir_snwprintf(number, L"%d", i+1);
@@ -922,44 +922,44 @@ void CJabberProto::SaveVcardToDB(HWND hwndPage, int iPage)
switch (iPage) {
case 0:
GetDlgItemText(hwndPage, IDC_FULLNAME, text, _countof(text));
- setTString("FullName", text);
+ setWString("FullName", text);
GetDlgItemText(hwndPage, IDC_NICKNAME, text, _countof(text));
- setTString("Nick", text);
+ setWString("Nick", text);
GetDlgItemText(hwndPage, IDC_FIRSTNAME, text, _countof(text));
- setTString("FirstName", text);
+ setWString("FirstName", text);
GetDlgItemText(hwndPage, IDC_MIDDLE, text, _countof(text));
- setTString("MiddleName", text);
+ setWString("MiddleName", text);
GetDlgItemText(hwndPage, IDC_LASTNAME, text, _countof(text));
- setTString("LastName", text);
+ setWString("LastName", text);
GetDlgItemText(hwndPage, IDC_BIRTH, text, _countof(text));
- setTString("BirthDate", text);
+ setWString("BirthDate", text);
switch (SendDlgItemMessage(hwndPage, IDC_GENDER, CB_GETCURSEL, 0, 0)) {
case 0: setString("GenderString", "Male"); break;
case 1: setString("GenderString", "Female"); break;
default: setString("GenderString", ""); break;
}
GetDlgItemText(hwndPage, IDC_OCCUPATION, text, _countof(text));
- setTString("Role", text);
+ setWString("Role", text);
GetDlgItemText(hwndPage, IDC_HOMEPAGE, text, _countof(text));
- setTString("Homepage", text);
+ setWString("Homepage", text);
break;
// Page 1: Home
case 1:
GetDlgItemText(hwndPage, IDC_ADDRESS1, text, _countof(text));
- setTString("Street", text);
+ setWString("Street", text);
GetDlgItemText(hwndPage, IDC_ADDRESS2, text, _countof(text));
- setTString("Street2", text);
+ setWString("Street2", text);
GetDlgItemText(hwndPage, IDC_CITY, text, _countof(text));
- setTString("City", text);
+ setWString("City", text);
GetDlgItemText(hwndPage, IDC_STATE, text, _countof(text));
- setTString("State", text);
+ setWString("State", text);
GetDlgItemText(hwndPage, IDC_ZIP, text, _countof(text));
- setTString("ZIP", text);
+ setWString("ZIP", text);
{
int i = SendDlgItemMessage(hwndPage, IDC_COUNTRY, CB_GETCURSEL, 0, 0);
wchar_t *country = mir_a2u((i) ? g_countries[i + 2].szName : g_countries[1].szName);
- setTString("Country", country);
+ setWString("Country", country);
mir_free(country);
}
break;
@@ -967,25 +967,25 @@ void CJabberProto::SaveVcardToDB(HWND hwndPage, int iPage)
// Page 2: Work
case 2:
GetDlgItemText(hwndPage, IDC_COMPANY, text, _countof(text));
- setTString("Company", text);
+ setWString("Company", text);
GetDlgItemText(hwndPage, IDC_DEPARTMENT, text, _countof(text));
- setTString("CompanyDepartment", text);
+ setWString("CompanyDepartment", text);
GetDlgItemText(hwndPage, IDC_TITLE, text, _countof(text));
- setTString("CompanyPosition", text);
+ setWString("CompanyPosition", text);
GetDlgItemText(hwndPage, IDC_ADDRESS1, text, _countof(text));
- setTString("CompanyStreet", text);
+ setWString("CompanyStreet", text);
GetDlgItemText(hwndPage, IDC_ADDRESS2, text, _countof(text));
- setTString("CompanyStreet2", text);
+ setWString("CompanyStreet2", text);
GetDlgItemText(hwndPage, IDC_CITY, text, _countof(text));
- setTString("CompanyCity", text);
+ setWString("CompanyCity", text);
GetDlgItemText(hwndPage, IDC_STATE, text, _countof(text));
- setTString("CompanyState", text);
+ setWString("CompanyState", text);
GetDlgItemText(hwndPage, IDC_ZIP, text, _countof(text));
- setTString("CompanyZIP", text);
+ setWString("CompanyZIP", text);
{
int i = SendDlgItemMessage(hwndPage, IDC_COUNTRY, CB_GETCURSEL, 0, 0);
wchar_t *country = mir_a2u((i) ? g_countries[i + 2].szName : g_countries[1].szName);
- setTString("CompanyCountry", country);
+ setWString("CompanyCountry", country);
mir_free(country);
}
break;
@@ -996,7 +996,7 @@ void CJabberProto::SaveVcardToDB(HWND hwndPage, int iPage)
// Page 4: Note
case 4:
GetDlgItemText(hwndPage, IDC_DESC, text, _countof(text));
- setTString("About", text);
+ setWString("About", text);
break;
}
}
@@ -1006,7 +1006,7 @@ void CJabberProto::AppendVcardFromDB(HXML n, char *tag, char *key)
if (n == NULL || tag == NULL || key == NULL)
return;
- ptrW tszValue(getTStringA(key));
+ ptrW tszValue(getWStringA(key));
n << XCHILD(_A2T(tag), tszValue);
}
@@ -1033,7 +1033,7 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, wchar_t* szPhotoFileName)
for (i = 0;; i++) {
mir_snprintf(idstr, "e-mail%d", i);
- ptrW email(getTStringA(idstr));
+ ptrW email(getWStringA(idstr));
if (email == NULL)
break;
@@ -1081,7 +1081,7 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, wchar_t* szPhotoFileName)
for (i = 0;; i++) {
mir_snprintf(idstr, "Phone%d", i);
- ptrW phone(getTStringA(idstr));
+ ptrW phone(getWStringA(idstr));
if (phone == NULL)
break;
@@ -1112,7 +1112,7 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, wchar_t* szPhotoFileName)
szFileName = szAvatarName;
// Set photo element, also update the global jabberVcardPhotoFileName to reflect the update
- debugLog(L"Before update, file name = %s", szFileName);
+ debugLogW(L"Before update, file name = %s", szFileName);
if (szFileName == NULL || szFileName[0] == 0) {
v << XCHILD(L"PHOTO");
DeleteFile(szAvatarName);
@@ -1120,7 +1120,7 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, wchar_t* szPhotoFileName)
delSetting("AvatarHash");
}
else {
- debugLog(L"Saving picture from %s", szFileName);
+ debugLogW(L"Saving picture from %s", szFileName);
struct _stat st;
if (_wstat(szFileName, &st) >= 0) {
@@ -1187,7 +1187,7 @@ void CJabberProto::OnUserInfoInit_VCard(WPARAM wParam, LPARAM)
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
odp.dwInitParam = (LPARAM)this;
- odp.flags = ODPF_TCHAR | ODPF_USERINFOTAB | ODPF_DONTTRANSLATE;
+ odp.flags = ODPF_UNICODE | ODPF_USERINFOTAB | ODPF_DONTTRANSLATE;
odp.pwszTitle = m_tszUserName;
odp.pfnDlgProc = PersonalDlgProc;
diff --git a/protocols/JabberG/src/jabber_ws.cpp b/protocols/JabberG/src/jabber_ws.cpp
index 739fd07362..b3db55eb4d 100644
--- a/protocols/JabberG/src/jabber_ws.cpp
+++ b/protocols/JabberG/src/jabber_ws.cpp
@@ -32,7 +32,7 @@ BOOL CJabberProto::WsInit(void)
mir_snwprintf(name, TranslateT("%s connection"), m_tszUserName);
NETLIBUSER nlu = { sizeof(nlu) };
- nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_TCHAR; // | NUF_HTTPGATEWAY;
+ nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_UNICODE; // | NUF_HTTPGATEWAY;
nlu.ptszDescriptiveName = name;
nlu.szSettingsModule = m_szModuleName;
m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp
index 7a0c229662..8f88666661 100644
--- a/protocols/JabberG/src/jabber_xstatus.cpp
+++ b/protocols/JabberG/src/jabber_xstatus.cpp
@@ -277,7 +277,7 @@ void CJabberDlgPepSimple::cbModes_OnChange(CCtrlData *)
if ((m_prevSelected >= 0) && (m_modes[m_cbModes.GetItemData(m_prevSelected)].m_id >= 0)) {
wchar_t *txt = m_txtDescription.GetText();
mir_snprintf(szSetting, "PepMsg_%s", m_modes[m_cbModes.GetItemData(m_prevSelected)].m_name);
- m_proto->setTString(szSetting, txt);
+ m_proto->setWString(szSetting, txt);
mir_free(txt);
}
@@ -285,7 +285,7 @@ void CJabberDlgPepSimple::cbModes_OnChange(CCtrlData *)
if ((m_prevSelected >= 0) && (m_modes[m_cbModes.GetItemData(m_prevSelected)].m_id >= 0)) {
mir_snprintf(szSetting, "PepMsg_%s", m_modes[m_cbModes.GetItemData(m_prevSelected)].m_name);
- ptrW szDescr( m_proto->getTStringA(szSetting));
+ ptrW szDescr( m_proto->getWStringA(szSetting));
m_txtDescription.SetText((szDescr != NULL) ? szDescr : L"");
m_txtDescription.Enable(true);
}
@@ -469,7 +469,7 @@ void CPepGuiService::RebuildMenu()
mi.root = hJabberRoot;
mi.pszService = szService;
mi.position = 200010;
- mi.flags = CMIF_UNMOVABLE | CMIF_TCHAR | CMIF_HIDDEN;
+ mi.flags = CMIF_UNMOVABLE | CMIF_UNICODE | CMIF_HIDDEN;
mi.hIcolibItem = m_hIcolibItem;
mi.name.w = m_szText ? m_szText : LPGENW("<advanced status slot>");
m_hMenuItem = Menu_AddProtoMenuItem(&mi, m_proto->m_szModuleName);
@@ -693,7 +693,7 @@ void CPepMood::SetMood(MCONTACT hContact, const wchar_t *szMood, const wchar_t *
HANDLE hIcon;
wchar_t title[128];
if (mood >= 0) {
- mir_snwprintf(title, TranslateT("Mood: %s"), TranslateTS(g_arrMoods[mood].szName));
+ mir_snwprintf(title, TranslateT("Mood: %s"), TranslateW(g_arrMoods[mood].szName));
hIcon = g_MoodIcons.GetIcolibHandle(g_arrMoods[mood].szTag);
}
else {
@@ -709,13 +709,13 @@ void CPepMood::SetMood(MCONTACT hContact, const wchar_t *szMood, const wchar_t *
if (szMood) {
m_proto->setByte(hContact, DBSETTING_XSTATUSID, mood);
- m_proto->setTString(hContact, DBSETTING_XSTATUSNAME, TranslateTS(g_arrMoods[mood].szName));
+ m_proto->setWString(hContact, DBSETTING_XSTATUSNAME, TranslateW(g_arrMoods[mood].szName));
if (szText)
- m_proto->setTString(hContact, DBSETTING_XSTATUSMSG, szText);
+ m_proto->setWString(hContact, DBSETTING_XSTATUSMSG, szText);
else
m_proto->delSetting(hContact, DBSETTING_XSTATUSMSG);
- m_proto->WriteAdvStatus(hContact, ADVSTATUS_MOOD, szMood, g_MoodIcons.GetIcolibName(g_arrMoods[mood].szTag), TranslateTS(g_arrMoods[mood].szName), szText);
+ m_proto->WriteAdvStatus(hContact, ADVSTATUS_MOOD, szMood, g_MoodIcons.GetIcolibName(g_arrMoods[mood].szTag), TranslateW(g_arrMoods[mood].szName), szText);
}
else {
m_proto->delSetting(hContact, DBSETTING_XSTATUSID);
@@ -733,7 +733,7 @@ void CPepMood::ShowSetDialog(BYTE bQuiet)
if (!bQuiet) {
CJabberDlgPepSimple dlg(m_proto, TranslateT("Set Mood"));
for (int i = 1; i < _countof(g_arrMoods); i++)
- dlg.AddStatusMode(i, g_arrMoods[i].szTag, g_MoodIcons.GetIcon(g_arrMoods[i].szTag), TranslateTS(g_arrMoods[i].szName));
+ dlg.AddStatusMode(i, g_arrMoods[i].szTag, g_MoodIcons.GetIcon(g_arrMoods[i].szTag), TranslateW(g_arrMoods[i].szName));
dlg.SetActiveStatus(m_mode, m_text);
dlg.DoModal();
@@ -748,7 +748,7 @@ void CPepMood::ShowSetDialog(BYTE bQuiet)
wchar_t *ptszTitle;
if (m_mode >= 0) {
Publish();
- hIcon = g_MoodIcons.GetIcolibHandle(g_arrMoods[m_mode].szTag); ptszTitle = TranslateTS(g_arrMoods[m_mode].szName);
+ hIcon = g_MoodIcons.GetIcolibHandle(g_arrMoods[m_mode].szTag); ptszTitle = TranslateW(g_arrMoods[m_mode].szName);
}
else {
Retract();
@@ -971,9 +971,9 @@ void ActivityBuildTitle(int id, wchar_t *buf, int size)
if (szFirst) {
if (szSecond)
- mir_snwprintf(buf, size, L"%s [%s]", TranslateTS(szFirst), TranslateTS(szSecond));
+ mir_snwprintf(buf, size, L"%s [%s]", TranslateW(szFirst), TranslateW(szSecond));
else
- mir_wstrncpy(buf, TranslateTS(szFirst), size);
+ mir_wstrncpy(buf, TranslateW(szFirst), size);
}
else *buf = 0;
}
@@ -1109,7 +1109,7 @@ void CPepActivity::ShowSetDialog(BYTE)
CJabberDlgPepSimple dlg(m_proto, TranslateT("Set Activity"));
for (int i=0; i < _countof(g_arrActivities); i++)
if (g_arrActivities[i].szFirst || g_arrActivities[i].szSecond)
- dlg.AddStatusMode(i, ActivityGetId(i), g_ActivityIcons.GetIcon(returnActivity(i)), TranslateTS(g_arrActivities[i].szTitle), (g_arrActivities[i].szSecond != NULL));
+ dlg.AddStatusMode(i, ActivityGetId(i), g_ActivityIcons.GetIcon(returnActivity(i)), TranslateW(g_arrActivities[i].szTitle), (g_arrActivities[i].szSecond != NULL));
dlg.SetActiveStatus(m_mode, m_text);
dlg.DoModal();
@@ -1123,7 +1123,7 @@ void CPepActivity::ShowSetDialog(BYTE)
UpdateMenuItem(g_ActivityIcons.GetIcolibHandle(returnActivity(m_mode)), g_arrActivities[m_mode].szTitle);
if (m_proto->m_pInfoFrame)
- m_proto->m_pInfoFrame->UpdateInfoItem("$/PEP/activity", g_ActivityIcons.GetIcolibHandle(returnActivity(m_mode)), TranslateTS(g_arrActivities[m_mode].szTitle));
+ m_proto->m_pInfoFrame->UpdateInfoItem("$/PEP/activity", g_ActivityIcons.GetIcolibHandle(returnActivity(m_mode)), TranslateW(g_arrActivities[m_mode].szTitle));
}
else {
Retract();
@@ -1218,7 +1218,7 @@ void CJabberProto::SetContactTune(MCONTACT hContact, LPCTSTR szArtist, LPCTSTR s
mir_snwprintf(szListeningTo, 2047, L"%s - %s", szTitle ? szTitle : L"", szArtist ? szArtist : L"");
}
- setTString(hContact, "ListeningTo", szListeningTo);
+ setWString(hContact, "ListeningTo", szListeningTo);
char tuneIcon[128];
mir_snprintf(tuneIcon, "%s_%s", m_szModuleName, "main");
@@ -1468,17 +1468,17 @@ void CJabberProto::WriteAdvStatus(MCONTACT hContact, const char *pszSlot, const
char szSetting[128];
mir_snprintf(szSetting, "%s/%s/id", m_szModuleName, pszSlot);
- db_set_ts(hContact, "AdvStatus", szSetting, pszMode);
+ db_set_ws(hContact, "AdvStatus", szSetting, pszMode);
mir_snprintf(szSetting, "%s/%s/icon", m_szModuleName, pszSlot);
db_set_s(hContact, "AdvStatus", szSetting, pszIcon);
mir_snprintf(szSetting, "%s/%s/title", m_szModuleName, pszSlot);
- db_set_ts(hContact, "AdvStatus", szSetting, pszTitle);
+ db_set_ws(hContact, "AdvStatus", szSetting, pszTitle);
mir_snprintf(szSetting, "%s/%s/text", m_szModuleName, pszSlot);
if (pszText)
- db_set_ts(hContact, "AdvStatus", szSetting, pszText);
+ db_set_ws(hContact, "AdvStatus", szSetting, pszText);
else
db_unset(hContact, "AdvStatus", szSetting);
}
@@ -1494,7 +1494,7 @@ wchar_t* CJabberProto::ReadAdvStatusT(MCONTACT hContact, const char *pszSlot, co
{
char szSetting[128];
mir_snprintf(szSetting, "%s/%s/%s", m_szModuleName, pszSlot, pszValue);
- return db_get_tsa(hContact, "AdvStatus", szSetting);
+ return db_get_wsa(hContact, "AdvStatus", szSetting);
}
///////////////////////////////////////////////////////////////////////////////
@@ -1511,13 +1511,13 @@ void g_XstatusIconsInit()
mir_wstrcpy(szSection, L"Protocols/Jabber/" LPGENW("Moods"));
for (int i = 1; i < _countof(g_arrMoods); i++)
- g_MoodIcons.RegisterIcon(g_arrMoods[i].szTag, szFile, -(200 + i), szSection, TranslateTS(g_arrMoods[i].szName));
+ g_MoodIcons.RegisterIcon(g_arrMoods[i].szTag, szFile, -(200 + i), szSection, TranslateW(g_arrMoods[i].szName));
mir_wstrcpy(szSection, L"Protocols/Jabber/" LPGENW("Activities"));
for (int k = 0; k < _countof(g_arrActivities); k++) {
if (g_arrActivities[k].szFirst)
- g_ActivityIcons.RegisterIcon(g_arrActivities[k].szFirst, szFile, g_arrActivities[k].iconid, szSection, TranslateTS(g_arrActivities[k].szTitle));
+ g_ActivityIcons.RegisterIcon(g_arrActivities[k].szFirst, szFile, g_arrActivities[k].iconid, szSection, TranslateW(g_arrActivities[k].szTitle));
if (g_arrActivities[k].szSecond)
- g_ActivityIcons.RegisterIcon(g_arrActivities[k].szSecond, szFile, g_arrActivities[k].iconid, szSection, TranslateTS(g_arrActivities[k].szTitle));
+ g_ActivityIcons.RegisterIcon(g_arrActivities[k].szSecond, szFile, g_arrActivities[k].iconid, szSection, TranslateW(g_arrActivities[k].szTitle));
}
}