summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_groupchat.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-07-25 10:31:04 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-07-25 10:31:04 +0000
commit8ae3679aa1339ce9abee53adb69902bd6b7513dc (patch)
tree94ef8927e12043ed6dcc15e1e640d68a8add520e /protocols/JabberG/src/jabber_groupchat.cpp
parent1e273e28d89b5838e3d0f0cafac9676577cb71ce (diff)
hello, Unix.
phase 1: removing _T() git-svn-id: http://svn.miranda-ng.org/main/trunk@17127 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src/jabber_groupchat.cpp')
-rw-r--r--protocols/JabberG/src/jabber_groupchat.cpp116
1 files changed, 58 insertions, 58 deletions
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp
index e4f81a4d68..6394f8a022 100644
--- a/protocols/JabberG/src/jabber_groupchat.cpp
+++ b/protocols/JabberG/src/jabber_groupchat.cpp
@@ -84,10 +84,10 @@ struct JabberGcRecentInfo
void fillForm(HWND hwndDlg)
{
- SetDlgItemText(hwndDlg, IDC_SERVER, m_server ? m_server : _T(""));
- SetDlgItemText(hwndDlg, IDC_ROOM, m_room ? m_room : _T(""));
- SetDlgItemText(hwndDlg, IDC_NICK, m_nick ? m_nick : _T(""));
- SetDlgItemText(hwndDlg, IDC_PASSWORD, m_password ? m_password : _T(""));
+ SetDlgItemText(hwndDlg, IDC_SERVER, m_server ? m_server : L"");
+ SetDlgItemText(hwndDlg, IDC_ROOM, m_room ? m_room : L"");
+ SetDlgItemText(hwndDlg, IDC_NICK, m_nick ? m_nick : L"");
+ SetDlgItemText(hwndDlg, IDC_PASSWORD, m_password ? m_password : L"");
}
void fillData(const TCHAR *room, const TCHAR *server, const TCHAR *nick = NULL, const TCHAR *password = NULL)
@@ -246,7 +246,7 @@ void CJabberProto::GroupchatJoinRoom(const TCHAR *server, const TCHAR *room, con
}
TCHAR text[JABBER_MAX_JID_LEN + 1];
- mir_sntprintf(text, _T("%s@%s/%s"), room, server, nick);
+ mir_sntprintf(text, L"%s@%s/%s", room, server, nick);
JABBER_LIST_ITEM *item = ListAdd(LIST_CHATROOM, text);
item->bAutoJoin = autojoin;
@@ -254,9 +254,9 @@ void CJabberProto::GroupchatJoinRoom(const TCHAR *server, const TCHAR *room, con
replaceStrT(item->password, info.m_password);
int status = (m_iStatus == ID_STATUS_INVISIBLE) ? ID_STATUS_ONLINE : m_iStatus;
- XmlNode x(_T("x")); x << XATTR(_T("xmlns"), JABBER_FEAT_MUC);
+ XmlNode x(L"x"); x << XATTR(L"xmlns", JABBER_FEAT_MUC);
if (info.m_password && info.m_password[0])
- x << XCHILD(_T("password"), info.m_password);
+ x << XCHILD(L"password", info.m_password);
SendPresenceTo(status, text, x);
}
@@ -301,23 +301,23 @@ void CJabberProto::OnIqResultDiscovery(HXML iqNode, CJabberIqInfo *pInfo)
sttRoomListAppend(hwndList, RoomInfo::ROOM_FAIL,
TranslateT("Jabber Error"),
TranslateT("Failed to retrieve room list from server."),
- _T(""));
+ L"");
}
else {
bool found = false;
HXML item;
- for (int i = 1; item = XmlGetNthChild(query, _T("item"), i); i++) {
- const TCHAR *jid = XmlGetAttrValue(item, _T("jid"));
+ for (int i = 1; item = XmlGetNthChild(query, L"item", i); i++) {
+ const TCHAR *jid = XmlGetAttrValue(item, L"jid");
TCHAR *name = NEWTSTR_ALLOCA(jid);
if (name) {
if (TCHAR *p = _tcschr(name, _T('@')))
*p = 0;
}
- else name = _T("");
+ else name = L"";
sttRoomListAppend(hwndList,
ListGetItemPtr(LIST_BOOKMARK, jid) ? RoomInfo::ROOM_BOOKMARK : RoomInfo::ROOM_DEFAULT,
- XmlGetAttrValue(item, _T("name")),
+ XmlGetAttrValue(item, L"name"),
jid, name);
found = true;
@@ -327,7 +327,7 @@ void CJabberProto::OnIqResultDiscovery(HXML iqNode, CJabberIqInfo *pInfo)
sttRoomListAppend(hwndList, RoomInfo::ROOM_FAIL,
TranslateT("Jabber Error"),
TranslateT("No rooms available on server."),
- _T(""));
+ L"");
}
}
}
@@ -337,14 +337,14 @@ void CJabberProto::OnIqResultDiscovery(HXML iqNode, CJabberIqInfo *pInfo)
sttRoomListAppend(hwndList, RoomInfo::ROOM_FAIL,
TranslateT("Jabber Error"),
str,
- _T(""));
+ L"");
mir_free(str);
}
else
sttRoomListAppend(hwndList, RoomInfo::ROOM_FAIL,
TranslateT("Jabber Error"),
TranslateT("Room list request timed out."),
- _T(""));
+ L"");
SendMessage(hwndList, CB_SHOWDROPDOWN, TRUE, 0);
}
@@ -471,7 +471,7 @@ void CJabberDlgGcJoin::OnInitDialog()
if (!info.loadRecent(i))
break;
- mir_sntprintf(jid, _T("%s@%s (%s)"), info.m_room, info.m_server, info.m_nick ? info.m_nick : TranslateT("<no nick>"));
+ mir_sntprintf(jid, L"%s@%s (%s)", info.m_room, info.m_server, info.m_nick ? info.m_nick : TranslateT("<no nick>"));
SetDlgItemText(m_hwnd, IDC_RECENT1 + i, jid);
}
sttJoinDlgShowRecentItems(m_hwnd, i);
@@ -624,7 +624,7 @@ INT_PTR CJabberDlgGcJoin::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
GetDlgItemText(m_hwnd, IDC_SERVER, server, len);
if (*server) {
- sttRoomListAppend(GetDlgItem(m_hwnd, IDC_ROOM), RoomInfo::ROOM_WAIT, TranslateT("Loading..."), TranslateT("Please wait for room list to download."), _T(""));
+ sttRoomListAppend(GetDlgItem(m_hwnd, IDC_ROOM), RoomInfo::ROOM_WAIT, TranslateT("Loading..."), TranslateT("Please wait for room list to download."), L"");
CJabberIqInfo *pInfo = m_proto->AddIQ(&CJabberProto::OnIqResultDiscovery, JABBER_IQ_TYPE_GET, server, 0, -1, (void*)GetDlgItem(m_hwnd, IDC_ROOM));
pInfo->SetTimeout(30000);
@@ -638,7 +638,7 @@ INT_PTR CJabberDlgGcJoin::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
sttRoomListAppend(GetDlgItem(m_hwnd, IDC_ROOM), RoomInfo::ROOM_FAIL,
TranslateT("Jabber Error"),
TranslateT("Please specify group chat directory first."),
- _T(""));
+ L"");
}
break;
}
@@ -652,7 +652,7 @@ INT_PTR CJabberDlgGcJoin::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
{
JABBER_LIST_ITEM *item = 0;
if (item = m_proto->ListGetItemPtrFromIndex(i))
- if (!mir_tstrcmp(item->type, _T("conference")))
+ if (!mir_tstrcmp(item->type, L"conference"))
AppendMenu(hMenu, MF_STRING, (UINT_PTR)item, item->name);
}
AppendMenu(hMenu, MF_SEPARATOR, 0, NULL);
@@ -754,7 +754,7 @@ static VOID CALLBACK JabberGroupchatChangeNickname(void* arg)
if (param->ppro->EnterString(szBuffer, szTitle, ESF_COMBO, "gcNick_")) {
replaceStrT(item->nick, szBuffer);
- param->ppro->SendPresenceTo(param->ppro->m_iStatus, CMString(FORMAT, _T("%s/%s"), item->jid, szBuffer), NULL);
+ param->ppro->SendPresenceTo(param->ppro->m_iStatus, CMString(FORMAT, L"%s/%s", item->jid, szBuffer), NULL);
}
}
@@ -767,7 +767,7 @@ static int sttGetStatusCode(HXML node)
if (statusNode == NULL)
return -1;
- const TCHAR *statusCode = XmlGetAttrValue(statusNode, _T("code"));
+ const TCHAR *statusCode = XmlGetAttrValue(statusNode, L"code");
if (statusCode == NULL)
return -1;
@@ -776,8 +776,8 @@ static int sttGetStatusCode(HXML node)
void CJabberProto::RenameParticipantNick(JABBER_LIST_ITEM *item, const TCHAR *oldNick, HXML itemNode)
{
- const TCHAR *jid = XmlGetAttrValue(itemNode, _T("jid"));
- const TCHAR *newNick = XmlGetAttrValue(itemNode, _T("nick"));
+ const TCHAR *jid = XmlGetAttrValue(itemNode, L"jid");
+ const TCHAR *newNick = XmlGetAttrValue(itemNode, L"nick");
if (newNick == NULL)
return;
@@ -815,8 +815,8 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
{
const TCHAR *from;
- if (!node || !XmlGetName(node) || mir_tstrcmp(XmlGetName(node), _T("presence"))) return;
- if ((from = XmlGetAttrValue(node, _T("from"))) == NULL) return;
+ if (!node || !XmlGetName(node) || mir_tstrcmp(XmlGetName(node), L"presence")) return;
+ if ((from = XmlGetAttrValue(node, L"from")) == NULL) return;
const TCHAR *resource = _tcschr(from, '/');
if (resource == NULL || *++resource == '\0')
@@ -839,10 +839,10 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
HXML xNode = XmlGetChildByTag(node, "x", "xmlns", JABBER_FEAT_MUC_USER);
HXML itemNode = XmlGetChild(xNode, "item");
- const TCHAR *type = XmlGetAttrValue(node, _T("type"));
+ const TCHAR *type = XmlGetAttrValue(node, L"type");
// entering room or a usual room presence
- if (type == NULL || !mir_tstrcmp(type, _T("available"))) {
+ if (type == NULL || !mir_tstrcmp(type, L"available")) {
if (ptrT(JabberNickFromJID(from)) == NULL)
return;
@@ -853,10 +853,10 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
int status = ID_STATUS_ONLINE;
LPCTSTR ptszShow = XmlGetText(XmlGetChild(node, "show"));
if (ptszShow) {
- if (!mir_tstrcmp(ptszShow, _T("away"))) status = ID_STATUS_AWAY;
- else if (!mir_tstrcmp(ptszShow, _T("xa"))) status = ID_STATUS_NA;
- else if (!mir_tstrcmp(ptszShow, _T("dnd"))) status = ID_STATUS_DND;
- else if (!mir_tstrcmp(ptszShow, _T("chat"))) status = ID_STATUS_FREECHAT;
+ if (!mir_tstrcmp(ptszShow, L"away")) status = ID_STATUS_AWAY;
+ else if (!mir_tstrcmp(ptszShow, L"xa")) status = ID_STATUS_NA;
+ else if (!mir_tstrcmp(ptszShow, L"dnd")) status = ID_STATUS_DND;
+ else if (!mir_tstrcmp(ptszShow, L"chat")) status = ID_STATUS_FREECHAT;
}
LPCTSTR str = XmlGetText(XmlGetChild(node, "status"));
@@ -880,17 +880,17 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
JABBER_GC_AFFILIATION affiliation = r->m_affiliation;
JABBER_GC_ROLE role = r->m_role;
- if ((str = XmlGetAttrValue(itemNode, _T("affiliation"))) != NULL) {
- if (!mir_tstrcmp(str, _T("owner"))) affiliation = AFFILIATION_OWNER;
- else if (!mir_tstrcmp(str, _T("admin"))) affiliation = AFFILIATION_ADMIN;
- else if (!mir_tstrcmp(str, _T("member"))) affiliation = AFFILIATION_MEMBER;
- else if (!mir_tstrcmp(str, _T("none"))) affiliation = AFFILIATION_NONE;
- else if (!mir_tstrcmp(str, _T("outcast"))) affiliation = AFFILIATION_OUTCAST;
+ if ((str = XmlGetAttrValue(itemNode, L"affiliation")) != NULL) {
+ if (!mir_tstrcmp(str, L"owner")) affiliation = AFFILIATION_OWNER;
+ else if (!mir_tstrcmp(str, L"admin")) affiliation = AFFILIATION_ADMIN;
+ else if (!mir_tstrcmp(str, L"member")) affiliation = AFFILIATION_MEMBER;
+ else if (!mir_tstrcmp(str, L"none")) affiliation = AFFILIATION_NONE;
+ else if (!mir_tstrcmp(str, L"outcast")) affiliation = AFFILIATION_OUTCAST;
}
- if ((str = XmlGetAttrValue(itemNode, _T("role"))) != NULL) {
- if (!mir_tstrcmp(str, _T("moderator"))) role = ROLE_MODERATOR;
- else if (!mir_tstrcmp(str, _T("participant"))) role = ROLE_PARTICIPANT;
- else if (!mir_tstrcmp(str, _T("visitor"))) role = ROLE_VISITOR;
+ if ((str = XmlGetAttrValue(itemNode, L"role")) != NULL) {
+ if (!mir_tstrcmp(str, L"moderator")) role = ROLE_MODERATOR;
+ else if (!mir_tstrcmp(str, L"participant")) role = ROLE_PARTICIPANT;
+ else if (!mir_tstrcmp(str, L"visitor")) role = ROLE_VISITOR;
else role = ROLE_NONE;
}
@@ -910,7 +910,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
bRoleChanged = true;
}
- if (str = XmlGetAttrValue(itemNode, _T("jid")))
+ if (str = XmlGetAttrValue(itemNode, L"jid"))
r->m_tszRealJid = mir_tstrdup(str);
}
}
@@ -936,7 +936,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
// Check <created/>
if (bRoomCreated) {
HXML n = XmlGetChild(node, "created");
- if (n != NULL && (str = XmlGetAttrValue(n, _T("xmlns"))) != NULL && !mir_tstrcmp(str, JABBER_FEAT_MUC_OWNER))
+ if (n != NULL && (str = XmlGetAttrValue(n, L"xmlns")) != NULL && !mir_tstrcmp(str, JABBER_FEAT_MUC_OWNER))
// A new room just created by me
// Request room config
m_ThreadInfo->send(
@@ -946,11 +946,11 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
}
// leaving room
- else if (!mir_tstrcmp(type, _T("unavailable"))) {
+ else if (!mir_tstrcmp(type, L"unavailable")) {
const TCHAR *str = 0;
if (xNode != NULL && item->nick != NULL) {
HXML reasonNode = XmlGetChild(itemNode, "reason");
- str = XmlGetAttrValue(itemNode, _T("jid"));
+ str = XmlGetAttrValue(itemNode, L"jid");
int iStatus = sttGetStatusCode(xNode);
if (iStatus == 301 && r != NULL)
@@ -994,7 +994,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
}
// processing room errors
- else if (!mir_tstrcmp(type, _T("error"))) {
+ else if (!mir_tstrcmp(type, L"error")) {
int errorCode = 0;
HXML errorNode = XmlGetChild(node, "error");
ptrT str(JabberErrorMsg(errorNode, &errorCode));
@@ -1004,7 +1004,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
if (++item->iChatState == 1 && newNick != NULL && newNick[0] != 0) {
replaceStrT(item->nick, newNick);
TCHAR text[1024] = { 0 };
- mir_sntprintf(text, _T("%s/%s"), item->jid, newNick);
+ mir_sntprintf(text, L"%s/%s", item->jid, newNick);
SendPresenceTo(m_iStatus, text, NULL);
}
else {
@@ -1028,12 +1028,12 @@ void CJabberProto::GroupchatProcessMessage(HXML node)
JABBER_LIST_ITEM *item;
CMString imgLink;
- if (!XmlGetName(node) || mir_tstrcmp(XmlGetName(node), _T("message"))) return;
- if ((from = XmlGetAttrValue(node, _T("from"))) == NULL) return;
+ if (!XmlGetName(node) || mir_tstrcmp(XmlGetName(node), L"message")) return;
+ if ((from = XmlGetAttrValue(node, L"from")) == NULL) return;
if ((item = ListGetItemPtr(LIST_CHATROOM, from)) == NULL) return;
- if ((type = XmlGetAttrValue(node, _T("type"))) == NULL) return;
- if (!mir_tstrcmp(type, _T("error")))
+ if ((type = XmlGetAttrValue(node, L"type")) == NULL) return;
+ if (!mir_tstrcmp(type, L"error"))
return;
GCDEST gcd = { m_szModuleName, item->jid, 0 };
@@ -1056,7 +1056,7 @@ void CJabberProto::GroupchatProcessMessage(HXML node)
if (tmpnick == NULL || *tmpnick == 0)
return;
- const TCHAR *tmptr = _tcsstr(tmpnick, _T("has set the subject to:")); //ejabberd
+ const TCHAR *tmptr = _tcsstr(tmpnick, L"has set the subject to:"); //ejabberd
if (tmptr == NULL)
tmptr = _tcsstr(tmpnick, TranslateT("has set the subject to:")); //ejabberd
if (tmptr != NULL && *tmptr != 0) {
@@ -1079,7 +1079,7 @@ void CJabberProto::GroupchatProcessMessage(HXML node)
if (resource == NULL)
gcd.iType = GC_EVENT_INFORMATION;
- else if (_tcsncmp(msgText, _T("/me "), 4) == 0 && mir_tstrlen(msgText) > 4) {
+ else if (_tcsncmp(msgText, L"/me ", 4) == 0 && mir_tstrlen(msgText) > 4) {
msgText += 4;
gcd.iType = GC_EVENT_ACTION;
}
@@ -1090,8 +1090,8 @@ void CJabberProto::GroupchatProcessMessage(HXML node)
time_t msgTime = 0;
if (!JabberReadXep203delay(node, msgTime)) {
- HXML xDelay = XmlGetChildByTag(node, "x", "xmlns", _T("jabber:x:delay"));
- if (xDelay && (p = XmlGetAttrValue(xDelay, _T("stamp"))) != NULL)
+ HXML xDelay = XmlGetChildByTag(node, "x", "xmlns", L"jabber:x:delay");
+ if (xDelay && (p = XmlGetAttrValue(xDelay, L"stamp")) != NULL)
msgTime = JabberIsoToUnixTime(p);
}
@@ -1107,7 +1107,7 @@ void CJabberProto::GroupchatProcessMessage(HXML node)
else nick = NULL;
CMString tszText(msgText);
- tszText.Replace(_T("%"), _T("%%"));
+ tszText.Replace(L"%", L"%%");
tszText += imgLink;
GCEVENT gce = { sizeof(gce), &gcd };
@@ -1207,7 +1207,7 @@ void CJabberProto::AcceptGroupchatInvite(const TCHAR *roomJid, const TCHAR *reas
{
TCHAR room[256], *server, *p;
_tcsncpy_s(room, roomJid, _TRUNCATE);
- p = _tcstok(room, _T("@"));
- server = _tcstok(NULL, _T("@"));
+ p = _tcstok(room, L"@");
+ server = _tcstok(NULL, L"@");
GroupchatJoinRoom(server, p, reason, password);
}