summaryrefslogtreecommitdiff
path: root/protocols/Sametime/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-07-27 14:23:31 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-07-27 14:23:31 +0000
commit2f261839b60692e33d0e160344d0d636d49c90ba (patch)
tree187921722698b681d29df3f6e60fb18394a5e9d5 /protocols/Sametime/src
parent2e931a0b2780587d85f3902468c935f5adba70c8 (diff)
less TCHARs
git-svn-id: http://svn.miranda-ng.org/main/trunk@17138 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Sametime/src')
-rw-r--r--protocols/Sametime/src/conference.cpp42
-rw-r--r--protocols/Sametime/src/files.cpp6
-rw-r--r--protocols/Sametime/src/messaging.cpp4
-rw-r--r--protocols/Sametime/src/options.cpp10
-rw-r--r--protocols/Sametime/src/sametime_proto.cpp12
-rw-r--r--protocols/Sametime/src/sametime_session.cpp12
-rw-r--r--protocols/Sametime/src/userlist.cpp4
-rw-r--r--protocols/Sametime/src/utils.cpp10
8 files changed, 50 insertions, 50 deletions
diff --git a/protocols/Sametime/src/conference.cpp b/protocols/Sametime/src/conference.cpp
index 71c0528eb0..dcf7aa0b27 100644
--- a/protocols/Sametime/src/conference.cpp
+++ b/protocols/Sametime/src/conference.cpp
@@ -51,7 +51,7 @@ void mwServiceConf_on_invited(mwConference* conf, mwLoginInfo* inviter, const ch
}
else {
proto->debugLog(L"mwServiceConf_on_invited() mwConference_reject");
- char* temp = mir_utf8encodeT(TranslateT("Your invitation has been rejected."));
+ char* temp = mir_utf8encodeW(TranslateT("Your invitation has been rejected."));
mwConference_reject(conf, 0, temp);
mir_free(temp);
}
@@ -108,8 +108,8 @@ void mwServiceConf_conf_opened(mwConference* conf, GList* members)
CSametimeProto* proto = getProtoFromMwConference(conf);
proto->debugLog(L"mwServiceConf_conf_opened() start");
- wchar_t* tszConfId = mir_utf8decodeT(mwConference_getName(conf));
- wchar_t* tszConfTitle = mir_utf8decodeT(mwConference_getTitle(conf));
+ wchar_t* tszConfId = mir_utf8decodeW(mwConference_getName(conf));
+ wchar_t* tszConfTitle = mir_utf8decodeW(mwConference_getTitle(conf));
// create new chat session
GCSESSION gcs = { sizeof(gcs) };
@@ -141,8 +141,8 @@ void mwServiceConf_conf_opened(mwConference* conf, GList* members)
for (;user; user=user->next) {
proto->debugLog(L"mwServiceConf_conf_opened() add user");
- wchar_t* tszUserName = mir_utf8decodeT(((mwLoginInfo*)user->data)->user_name);
- wchar_t* tszUserId = mir_utf8decodeT(((mwLoginInfo*)user->data)->login_id);
+ wchar_t* tszUserName = mir_utf8decodeW(((mwLoginInfo*)user->data)->user_name);
+ wchar_t* tszUserId = mir_utf8decodeW(((mwLoginInfo*)user->data)->login_id);
gce.ptszNick = tszUserName;
gce.ptszUID = tszUserId;
gce.bIsMe = (strcmp(((mwLoginInfo*)user->data)->login_id, proto->my_login_info->login_id) == 0);
@@ -173,7 +173,7 @@ void mwServiceConf_conf_closed(mwConference* conf, guint32 reason)
CSametimeProto* proto = getProtoFromMwConference(conf);
proto->debugLog(L"mwServiceConf_conf_closed() start");
- wchar_t* tszConfId = mir_utf8decodeT(mwConference_getName(conf));
+ wchar_t* tszConfId = mir_utf8decodeW(mwConference_getName(conf));
GCDEST gcd = { proto->m_szModuleName };
gcd.ptszID = tszConfId;
@@ -208,9 +208,9 @@ void mwServiceConf_on_peer_joined(mwConference* conf, mwLoginInfo *user)
mwSametimeList_free(user_list);
}
- ptrT tszConfId(mir_utf8decodeT(mwConference_getName(conf)));
- ptrT tszUserName(mir_utf8decodeT(user->user_name));
- ptrT tszUserId(mir_utf8decodeT(user->login_id));
+ ptrW tszConfId(mir_utf8decodeW(mwConference_getName(conf)));
+ ptrW tszUserName(mir_utf8decodeW(user->user_name));
+ ptrW tszUserId(mir_utf8decodeW(user->login_id));
// add user
GCDEST gcd = { proto->m_szModuleName };
@@ -237,9 +237,9 @@ void mwServiceConf_on_peer_parted(mwConference* conf, mwLoginInfo* user)
CSametimeProto* proto = getProtoFromMwConference(conf);
proto->debugLog(L"mwServiceConf_on_peer_parted() start");
- ptrT tszConfId(mir_utf8decodeT(mwConference_getName(conf)));
- ptrT tszUserName(mir_utf8decodeT(user->user_name));
- ptrT tszUserId(mir_utf8decodeT(user->login_id));
+ ptrW tszConfId(mir_utf8decodeW(mwConference_getName(conf)));
+ ptrW tszUserName(mir_utf8decodeW(user->user_name));
+ ptrW tszUserId(mir_utf8decodeW(user->login_id));
// remove user
GCDEST gcd = { proto->m_szModuleName };
@@ -261,7 +261,7 @@ void mwServiceConf_on_text(mwConference* conf, mwLoginInfo* user, const char* wh
CSametimeProto* proto = getProtoFromMwConference(conf);
proto->debugLog(L"mwServiceConf_on_text() start");
- wchar_t* tszConfId = mir_utf8decodeT(mwConference_getName(conf));
+ wchar_t* tszConfId = mir_utf8decodeW(mwConference_getName(conf));
GCDEST gcd = { proto->m_szModuleName };
gcd.ptszID = tszConfId;
@@ -270,9 +270,9 @@ void mwServiceConf_on_text(mwConference* conf, mwLoginInfo* user, const char* wh
GCEVENT gce = { sizeof(gce), &gcd };
gce.dwFlags = GCEF_ADDTOLOG;
- wchar_t* textT = mir_utf8decodeT(what);
- wchar_t* tszUserName = mir_utf8decodeT(user->user_name);
- wchar_t* tszUserId = mir_utf8decodeT(user->login_id);
+ wchar_t* textT = mir_utf8decodeW(what);
+ wchar_t* tszUserName = mir_utf8decodeW(user->user_name);
+ wchar_t* tszUserId = mir_utf8decodeW(user->login_id);
gce.ptszText = textT;
gce.ptszNick = tszUserName;
gce.ptszUID = tszUserId;
@@ -319,7 +319,7 @@ void CSametimeProto::TerminateConference(char* name)
for (;conf;conf = conf->next) {
if (strcmp(name, mwConference_getName((mwConference*)conf->data)) == 0) {
- wchar_t* idt = mir_utf8decodeT(name);
+ wchar_t* idt = mir_utf8decodeW(name);
GCDEST gcd = {m_szModuleName, idt, GC_EVENT_CONTROL};
GCEVENT gce = { sizeof(gce), &gcd };
@@ -341,8 +341,8 @@ int CSametimeProto::GcEventHook(WPARAM wParam, LPARAM lParam) {
GList *conferences = mwServiceConference_getConferences(service_conference);
for (GList *conf = conferences;conf;conf = conf->next) {
- wchar_t* tszConfId = mir_utf8decodeT(mwConference_getName((mwConference*)conf->data));
- if (mir_tstrcmp(gch->pDest->ptszID, tszConfId) == 0) {
+ wchar_t* tszConfId = mir_utf8decodeW(mwConference_getName((mwConference*)conf->data));
+ if (mir_wstrcmp(gch->pDest->ptszID, tszConfId) == 0) {
switch(gch->pDest->iType) {
case GC_USER_MESSAGE:
{
@@ -406,8 +406,8 @@ INT_PTR CSametimeProto::onMenuCreateChat(WPARAM wParam, LPARAM lParam)
mwIdBlock idb;
if (my_login_info && GetAwareIdFromContact(hContact, &id_block)) {
wchar_t title[512];
- wchar_t* ts = mir_utf8decodeT(my_login_info->user_name);
- mir_sntprintf(title, TranslateT("%s's conference"), ts);
+ wchar_t* ts = mir_utf8decodeW(my_login_info->user_name);
+ mir_snwprintf(title, TranslateT("%s's conference"), ts);
mir_free(ts);
idb.user = id_block.user;
diff --git a/protocols/Sametime/src/files.cpp b/protocols/Sametime/src/files.cpp
index 567520469a..c606e0587e 100644
--- a/protocols/Sametime/src/files.cpp
+++ b/protocols/Sametime/src/files.cpp
@@ -28,12 +28,12 @@ void mwFileTransfer_offered(mwFileTransfer* ft)
proto->ProtoBroadcastAck(hContact, ACKTYPE_FILE, ACKRESULT_INITIALISING, (HANDLE)ft, 0);
- wchar_t* filenameT = mir_utf8decodeT(mwFileTransfer_getFileName(ft));
+ wchar_t* filenameT = mir_utf8decodeW(mwFileTransfer_getFileName(ft));
const char* message = mwFileTransfer_getMessage(ft);
wchar_t descriptionT[512];
if (message) {
- wchar_t* messageT = mir_utf8decodeT(message);
- mir_sntprintf(descriptionT, L"%s - %s", filenameT, messageT);
+ wchar_t* messageT = mir_utf8decodeW(message);
+ mir_snwprintf(descriptionT, L"%s - %s", filenameT, messageT);
mir_free(messageT);
} else
wcsncpy_s(descriptionT, filenameT, _TRUNCATE);
diff --git a/protocols/Sametime/src/messaging.cpp b/protocols/Sametime/src/messaging.cpp
index a6092c0c21..ee7cc4d659 100644
--- a/protocols/Sametime/src/messaging.cpp
+++ b/protocols/Sametime/src/messaging.cpp
@@ -95,10 +95,10 @@ void mwIm_place_invite(struct mwConversation* conv, const char* message, const c
///TODO unimplemented
- wchar_t* tszMessage = mir_utf8decodeT(message);
+ wchar_t* tszMessage = mir_utf8decodeW(message);
wchar_t msg[512];
- mir_sntprintf(msg, TranslateT("SERVICE NOT IMPLEMENTED. %s"), tszMessage);
+ mir_snwprintf(msg, TranslateT("SERVICE NOT IMPLEMENTED. %s"), tszMessage);
proto->showPopup(msg, SAMETIME_POPUP_INFO);
mir_free(tszMessage);
diff --git a/protocols/Sametime/src/options.cpp b/protocols/Sametime/src/options.cpp
index aa08112856..c848ee911b 100644
--- a/protocols/Sametime/src/options.cpp
+++ b/protocols/Sametime/src/options.cpp
@@ -103,20 +103,20 @@ static INT_PTR CALLBACK DlgProcOptNet(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
WORD client_ver = proto->GetClientVersion();
if (client_ver) {
wchar_t verbuf[100];
- mir_sntprintf(verbuf, TranslateT("Client protocol version: %03d.%03d"), (client_ver & 0xFF00) >> 8, client_ver & 0xFF);
+ mir_snwprintf(verbuf, TranslateT("Client protocol version: %03d.%03d"), (client_ver & 0xFF00) >> 8, client_ver & 0xFF);
SetDlgItemText(hwndDlg, IDC_ST_CLIENTVER, verbuf);
}
WORD server_ver = proto->GetServerVersion();
if (server_ver) {
wchar_t verbuf[100];
- mir_sntprintf(verbuf, TranslateT("Server protocol version: %03d.%03d"), (server_ver & 0xFF00) >> 8, server_ver & 0xFF);
+ mir_snwprintf(verbuf, TranslateT("Server protocol version: %03d.%03d"), (server_ver & 0xFF00) >> 8, server_ver & 0xFF);
SetDlgItemText(hwndDlg, IDC_ST_SERVERVER, verbuf);
}
- wchar_t *s = mir_utf8decodeT(proto->options.server_name); SetDlgItemText(hwndDlg, IDC_ED_SNAME, s); mir_free(s);
- s = mir_utf8decodeT(proto->options.id); SetDlgItemText(hwndDlg, IDC_ED_NAME, s); mir_free(s);
- s = mir_utf8decodeT(proto->options.pword); SetDlgItemText(hwndDlg, IDC_ED_PWORD, s); mir_free(s);
+ wchar_t *s = mir_utf8decodeW(proto->options.server_name); SetDlgItemText(hwndDlg, IDC_ED_SNAME, s); mir_free(s);
+ s = mir_utf8decodeW(proto->options.id); SetDlgItemText(hwndDlg, IDC_ED_NAME, s); mir_free(s);
+ s = mir_utf8decodeW(proto->options.pword); SetDlgItemText(hwndDlg, IDC_ED_PWORD, s); mir_free(s);
SetDlgItemInt(hwndDlg, IDC_ED_PORT, proto->options.port, FALSE);
CheckDlgButton(hwndDlg, IDC_CHK_GETSERVERCONTACTS, proto->options.get_server_contacts ? BST_CHECKED : BST_UNCHECKED);
diff --git a/protocols/Sametime/src/sametime_proto.cpp b/protocols/Sametime/src/sametime_proto.cpp
index ca84865901..aa3981f62b 100644
--- a/protocols/Sametime/src/sametime_proto.cpp
+++ b/protocols/Sametime/src/sametime_proto.cpp
@@ -15,7 +15,7 @@ CSametimeProto::CSametimeProto(const char* pszProtoName, const wchar_t* tszUserN
{
// Register m_hNetlibUser user
wchar_t name[128];
- mir_sntprintf(name, TranslateT("%s connection"), m_tszUserName);
+ mir_snwprintf(name, TranslateT("%s connection"), m_tszUserName);
NETLIBUSER nlu = { 0 };
nlu.cbSize = sizeof(nlu);
nlu.flags = NUF_TCHAR | NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS;
@@ -86,7 +86,7 @@ MCONTACT CSametimeProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
HANDLE CSametimeProto::FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szPath)
{
debugLog(L"CSametimeProto::FileAllow() hContact=[%x], szPath=[%s]", hContact, szPath);
- char* szPathA = mir_t2a(szPath);
+ char* szPathA = mir_u2a(szPath);
HANDLE res = AcceptFileTransfer(hContact, hTransfer, szPathA);
mir_free(szPathA);
return res;
@@ -159,7 +159,7 @@ int CSametimeProto::GetInfo(MCONTACT hContact, int infoType)
HANDLE CSametimeProto::SearchBasic(const wchar_t* id)
{
- debugLog(L"CSametimeProto::SearchBasic() id:len=[%d]", id == NULL ? -1 : mir_tstrlen(id));
+ debugLog(L"CSametimeProto::SearchBasic() id:len=[%d]", id == NULL ? -1 : mir_wstrlen(id));
return (HANDLE)SearchForUser(T2Utf(id), FALSE);
///TODO - add timeout (like at GGPROTO::searchthread)
}
@@ -168,7 +168,7 @@ HWND CSametimeProto::SearchAdvanced(HWND owner)
{
wchar_t buf[512];
if (GetDlgItemText(owner, IDC_EDIT1, buf, _countof(buf))) {
- debugLog(L"CSametimeProto::SearchAdvanced() buf:len=[%d]", mir_tstrlen(buf));
+ debugLog(L"CSametimeProto::SearchAdvanced() buf:len=[%d]", mir_wstrlen(buf));
return (HWND)SearchForUser(T2Utf(buf), TRUE);
}
return NULL;
@@ -277,14 +277,14 @@ int CSametimeProto::RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT* evt
{
debugLog(L"CSametimeProto::RecvAwayMsg() hContact=[%x], mode=[%d]", hContact, mode);
- ptrT pszMsg(mir_utf8decodeT(evt->szMessage));
+ ptrW pszMsg(mir_utf8decodeW(evt->szMessage));
ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)evt->lParam, pszMsg);
return 0;
}
int CSametimeProto::SetAwayMsg(int iStatus, const wchar_t* msg)
{
- debugLog(L"CSametimeProto::SetAwayMsg() iStatus=[%d], msg:len=[%d]", iStatus, msg == NULL ? -1 : mir_tstrlen(msg));
+ debugLog(L"CSametimeProto::SetAwayMsg() iStatus=[%d], msg:len=[%d]", iStatus, msg == NULL ? -1 : mir_wstrlen(msg));
SetSessionAwayMessage(iStatus, msg);
return 0;
}
diff --git a/protocols/Sametime/src/sametime_session.cpp b/protocols/Sametime/src/sametime_session.cpp
index 6fa0644c75..d9b8234596 100644
--- a/protocols/Sametime/src/sametime_session.cpp
+++ b/protocols/Sametime/src/sametime_session.cpp
@@ -137,7 +137,7 @@ void __cdecl SessionAdmin(struct mwSession* session, const char* text)
{
CSametimeProto* proto = (CSametimeProto*)mwSession_getProperty(session, "PROTO_STRUCT_PTR");
proto->debugLog(L"SessionAdmin()");
- wchar_t* tt = mir_utf8decodeT(text);
+ wchar_t* tt = mir_utf8decodeW(text);
MessageBox(0, tt, TranslateT("Sametime administrator message"), MB_OK);
mir_free(tt);
}
@@ -149,9 +149,9 @@ void __cdecl SessionAnnounce(struct mwSession* session, struct mwLoginInfo* from
wchar_t* stzFrom;
wchar_t* stzText;
wchar_t stzFromBuff[256];
- stzFrom = mir_utf8decodeT(from->user_name);
- stzText = mir_utf8decodeT(text);
- mir_sntprintf(stzFromBuff, TranslateT("Session announcement - from '%s'"), stzFrom);
+ stzFrom = mir_utf8decodeW(from->user_name);
+ stzText = mir_utf8decodeW(text);
+ mir_snwprintf(stzFromBuff, TranslateT("Session announcement - from '%s'"), stzFrom);
MessageBox(0, TranslateTS(stzText), stzFromBuff, MB_OK);
mir_free(stzText);
mir_free(stzFrom);
@@ -209,7 +209,7 @@ void __cdecl SessionSetUserStatus(struct mwSession* session)
default:
wchar_t buff[512];
- mir_sntprintf(buff, TranslateT("Unknown user status: %d"), us.status);
+ mir_snwprintf(buff, TranslateT("Unknown user status: %d"), us.status);
proto->showPopup(buff, SAMETIME_POPUP_ERROR);
proto->debugLog(buff);
@@ -313,7 +313,7 @@ int CSametimeProto::SetIdle(bool idle)
void CSametimeProto::SetSessionAwayMessage(int status, const wchar_t* msgT)
{
- debugLog(L"SetSessionAwayMessage() status=[%d], msgT:len=[%d]", status, msgT == NULL ? -1 : mir_tstrlen(msgT));
+ debugLog(L"SetSessionAwayMessage() status=[%d], msgT:len=[%d]", status, msgT == NULL ? -1 : mir_wstrlen(msgT));
T2Utf msg(msgT);
if (status == ID_STATUS_ONLINE)
diff --git a/protocols/Sametime/src/userlist.cpp b/protocols/Sametime/src/userlist.cpp
index 4660b68c8f..4d65b377da 100644
--- a/protocols/Sametime/src/userlist.cpp
+++ b/protocols/Sametime/src/userlist.cpp
@@ -48,7 +48,7 @@ void CSametimeProto::AddGroup(const char* name, bool expanded)
if (name && mir_strcmp(name, Translate("None")) == 0)
return;
- MGROUP hGroup = Clist_GroupCreate(NULL, ptrT(mir_utf8decodeT(name)));
+ MGROUP hGroup = Clist_GroupCreate(NULL, ptrW(mir_utf8decodeW(name)));
Clist_GroupSetExpanded(hGroup, expanded);
}
@@ -237,7 +237,7 @@ void CSametimeProto::ExportContactsToList(mwSametimeList* user_list)
//group_open = (db_get_b(0, szProtoGroups, buff, 0) == 1);
- ptrT ptszGroup(mir_utf8decodeT(group_alias));
+ ptrW ptszGroup(mir_utf8decodeW(group_alias));
MGROUP hGroup = Clist_GroupExists(ptszGroup);
if (hGroup) {
DWORD expanded;
diff --git a/protocols/Sametime/src/utils.cpp b/protocols/Sametime/src/utils.cpp
index 0e24204f8d..f876860fc0 100644
--- a/protocols/Sametime/src/utils.cpp
+++ b/protocols/Sametime/src/utils.cpp
@@ -41,7 +41,7 @@ void CSametimeProto::RegisterPopups()
puc.pszName = szName;
mir_snprintf(szName, "%s_%s", m_szModuleName, "Notify");
- mir_sntprintf(szDescr, L"%s/%s", m_tszUserName, TranslateT("Notification"));
+ mir_snwprintf(szDescr, L"%s/%s", m_tszUserName, TranslateT("Notification"));
puc.hIcon = CopyIcon(LoadIconEx("notify", FALSE));
ReleaseIconEx("notify", FALSE);
puc.iSeconds = 8;
@@ -50,7 +50,7 @@ void CSametimeProto::RegisterPopups()
hPopupNotify = Popup_RegisterClass(&puc);
mir_snprintf(szName, "%s_%s", m_szModuleName, "Error");
- mir_sntprintf(szDescr, L"%s/%s", m_tszUserName, TranslateT("Error"));
+ mir_snwprintf(szDescr, L"%s/%s", m_tszUserName, TranslateT("Error"));
puc.hIcon = CopyIcon(LoadIconEx("error", FALSE));
ReleaseIconEx("error", FALSE);
puc.iSeconds = 10;
@@ -131,8 +131,8 @@ void CSametimeProto::showPopup(const wchar_t* msg, SametimePopupEnum flag)
PopupData *puData = (PopupData*)mir_calloc(sizeof(PopupData));
puData->flag = flag;
- puData->title = mir_tstrdup(m_tszUserName);
- puData->text = mir_tstrdup(msg);
+ puData->title = mir_wstrdup(m_tszUserName);
+ puData->text = mir_wstrdup(msg);
puData->proto = this;
CallFunctionAsync(sttMainThreadCallback, puData);
@@ -144,7 +144,7 @@ void CSametimeProto::showPopup(guint32 code)
SametimePopupEnum flag = (rcDesc->type == mwReturnCodeError ? SAMETIME_POPUP_ERROR : SAMETIME_POPUP_INFO);
wchar_t buff[512];
- mir_sntprintf(buff, TranslateT("%s\n\nSametime error %S\n%s"), TranslateTS(_A2T(rcDesc->name)), rcDesc->codeString, TranslateTS(_A2T(rcDesc->description)));
+ mir_snwprintf(buff, TranslateT("%s\n\nSametime error %S\n%s"), TranslateTS(_A2T(rcDesc->name)), rcDesc->codeString, TranslateTS(_A2T(rcDesc->description)));
showPopup(buff, flag);
debugLog(buff);