diff options
author | George Hazan <george.hazan@gmail.com> | 2013-07-20 16:42:11 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-07-20 16:42:11 +0000 |
commit | 8761e793032de3e266a0cb9582327367c6172467 (patch) | |
tree | 46174efdd3ccfff1be8efb3f926e7885727d1a7b /protocols/JabberG/src | |
parent | 5e4286f1becfb5ce52372f882a51ae8ea6f6ef6d (diff) |
constants went to Unicode (suddenly)
git-svn-id: http://svn.miranda-ng.org/main/trunk@5430 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src')
39 files changed, 568 insertions, 594 deletions
diff --git a/protocols/JabberG/src/jabber.h b/protocols/JabberG/src/jabber.h index 32a47f8b44..3ff45594ca 100644 --- a/protocols/JabberG/src/jabber.h +++ b/protocols/JabberG/src/jabber.h @@ -582,7 +582,6 @@ extern BOOL (WINAPI *JabberAlphaBlend)(HDC, int, int, int, int, HDC, int, int, i extern BOOL (WINAPI *JabberIsThemeActive)();
extern HRESULT (WINAPI *JabberDrawThemeParentBackground)(HWND, HDC, RECT *);
-extern const TCHAR xmlnsOwner[];
extern TCHAR szCoreVersion[];
extern int g_cbCountries;
diff --git a/protocols/JabberG/src/jabber_adhoc.cpp b/protocols/JabberG/src/jabber_adhoc.cpp index 462936715b..8f75503737 100644 --- a/protocols/JabberG/src/jabber_adhoc.cpp +++ b/protocols/JabberG/src/jabber_adhoc.cpp @@ -116,8 +116,8 @@ int CJabberProto::AdHoc_RequestListOfCommands(TCHAR * szResponder, HWND hwndDlg) {
int iqId = (int)hwndDlg;
IqAdd(iqId, IQ_PROC_DISCOCOMMANDS, &CJabberProto::OnIqResult_ListOfCommands);
- m_ThreadInfo->send( XmlNodeIq(_T("get"), iqId, szResponder) << XQUERY(_T(JABBER_FEAT_DISCO_ITEMS))
- << XATTR(_T("node"), _T(JABBER_FEAT_COMMANDS)));
+ m_ThreadInfo->send( XmlNodeIq(_T("get"), iqId, szResponder) << XQUERY(JABBER_FEAT_DISCO_ITEMS)
+ << XATTR(_T("node"), JABBER_FEAT_COMMANDS));
return iqId;
}
@@ -137,7 +137,7 @@ int CJabberProto::AdHoc_ExecuteCommand(HWND hwndDlg, TCHAR*, JabberAdHocData* da IqAdd(iqId, IQ_PROC_EXECCOMMANDS, &CJabberProto::OnIqResult_CommandExecution);
m_ThreadInfo->send(
XmlNodeIq(_T("set"), iqId, jid2)
- << XCHILDNS(_T("command"), _T(JABBER_FEAT_COMMANDS)) << XATTR(_T("node"), node) << XATTR(_T("action"), _T("execute")));
+ << XCHILDNS(_T("command"), JABBER_FEAT_COMMANDS) << XATTR(_T("node"), node) << XATTR(_T("action"), _T("execute")));
EnableDlgItem(hwndDlg, IDC_SUBMIT, FALSE);
SetDlgItemText(hwndDlg, IDC_SUBMIT, TranslateT("OK"));
@@ -177,8 +177,8 @@ int CJabberProto::AdHoc_OnJAHMCommandListResult(HWND hwndDlg, HXML iqNode, Jabbe const TCHAR *xmlns = xmlGetAttrValue(queryNode, _T("xmlns"));
const TCHAR *node = xmlGetAttrValue(queryNode, _T("node"));
if (xmlns && node
- && !_tcscmp(xmlns, _T(JABBER_FEAT_DISCO_ITEMS))
- && !_tcscmp(node, _T(JABBER_FEAT_COMMANDS)))
+ && !_tcscmp(xmlns, JABBER_FEAT_DISCO_ITEMS)
+ && !_tcscmp(node, JABBER_FEAT_COMMANDS))
validResponse = TRUE;
}
if (queryNode && xmlGetChild(queryNode ,0) && validResponse) {
@@ -310,7 +310,7 @@ int CJabberProto::AdHoc_SubmitCommandForm(HWND hwndDlg, JabberAdHocData* dat, TC int iqId = (int)hwndDlg;
XmlNodeIq iq(_T("set"), iqId, xmlGetAttrValue(dat->AdHocNode, _T("from")));
- HXML command = iq << XCHILDNS(_T("command"), _T(JABBER_FEAT_COMMANDS));
+ HXML command = iq << XCHILDNS(_T("command"), JABBER_FEAT_COMMANDS);
const TCHAR *sessionId = xmlGetAttrValue(commandNode, _T("sessionid"));
if (sessionId)
@@ -417,7 +417,7 @@ static INT_PTR CALLBACK JabberAdHoc_CommandDlgProc(HWND hwndDlg, UINT msg, WPARA dat->proto->IqAdd(iqId, IQ_PROC_EXECCOMMANDS, &CJabberProto::OnIqResult_CommandExecution);
dat->proto->m_ThreadInfo->send(
XmlNodeIq(_T("set"), iqId, pStartupParams->m_szJid)
- << XCHILDNS(_T("command"), _T(JABBER_FEAT_COMMANDS))
+ << XCHILDNS(_T("command"), JABBER_FEAT_COMMANDS)
<< XATTR(_T("node"), pStartupParams->m_szNode) << XATTR(_T("action"), _T("execute")));
EnableDlgItem(hwndDlg, IDC_SUBMIT, FALSE);
diff --git a/protocols/JabberG/src/jabber_agent.cpp b/protocols/JabberG/src/jabber_agent.cpp index 70f9b97506..39ec5f7872 100644 --- a/protocols/JabberG/src/jabber_agent.cpp +++ b/protocols/JabberG/src/jabber_agent.cpp @@ -103,7 +103,7 @@ public: int iqId = m_proto->SerialNext();
m_proto->IqAdd(iqId, IQ_PROC_GETREGISTER, &CJabberProto::OnIqResultGetRegister);
- m_proto->m_ThreadInfo->send( XmlNodeIq(_T("get"), iqId, m_jid) << XQUERY(_T(JABBER_FEAT_REGISTER)));
+ m_proto->m_ThreadInfo->send( XmlNodeIq(_T("get"), iqId, m_jid) << XQUERY(JABBER_FEAT_REGISTER));
// Enable WS_EX_CONTROLPARENT on IDC_FRAME (so tab stop goes through all its children)
LONG frameExStyle = GetWindowLongPtr(GetDlgItem(m_hwnd, IDC_FRAME), GWL_EXSTYLE);
@@ -238,7 +238,7 @@ public: m_proto->IqAdd(iqId, IQ_PROC_SETREGISTER, &CJabberProto::OnIqResultSetRegister);
XmlNodeIq iq(_T("set"), iqId, from);
- HXML query = iq << XQUERY(_T(JABBER_FEAT_REGISTER));
+ HXML query = iq << XQUERY(JABBER_FEAT_REGISTER);
if ((xNode = xmlGetChild(queryNode , "x")) != NULL) {
// use new jabber:x:data form
diff --git a/protocols/JabberG/src/jabber_archive.cpp b/protocols/JabberG/src/jabber_archive.cpp index af44cfad07..5359f67e51 100644 --- a/protocols/JabberG/src/jabber_archive.cpp +++ b/protocols/JabberG/src/jabber_archive.cpp @@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. void CJabberProto::EnableArchive(bool bEnable)
{
m_ThreadInfo->send( XmlNodeIq(_T("set"), SerialNext())
- << XCHILDNS( _T("auto"), _T(JABBER_FEAT_ARCHIVE)) << XATTR(_T("save"), (bEnable) ? _T("true") : _T("false")));
+ << XCHILDNS( _T("auto"), JABBER_FEAT_ARCHIVE) << XATTR(_T("save"), (bEnable) ? _T("true") : _T("false")));
}
void CJabberProto::RetrieveMessageArchive(HANDLE hContact, JABBER_LIST_ITEM *pItem)
@@ -40,7 +40,7 @@ void CJabberProto::RetrieveMessageArchive(HANDLE hContact, JABBER_LIST_ITEM *pIt int iqId = SerialNext();
XmlNodeIq iq(_T("get"), iqId);
- HXML list = iq << XCHILDNS( _T("list"), _T(JABBER_FEAT_ARCHIVE)) << XATTR(_T("with"), pItem->jid);
+ HXML list = iq << XCHILDNS( _T("list"), JABBER_FEAT_ARCHIVE) << XATTR(_T("with"), pItem->jid);
time_t tmLast = getDword(hContact, "LastCollection", 0);
if (tmLast) {
@@ -59,7 +59,7 @@ void CJabberProto::OnIqResultGetCollectionList(HXML iqNode) return;
HXML list = xmlGetChild(iqNode, "list");
- if (!list || lstrcmp( xmlGetAttrValue(list, _T("xmlns")), _T(JABBER_FEAT_ARCHIVE)))
+ if (!list || lstrcmp( xmlGetAttrValue(list, _T("xmlns")), JABBER_FEAT_ARCHIVE))
return;
HANDLE hContact = NULL;
@@ -86,7 +86,7 @@ void CJabberProto::OnIqResultGetCollectionList(HXML iqNode) IqAdd(iqId, IQ_PROC_NONE, &CJabberProto::OnIqResultGetCollection);
m_ThreadInfo->send(
XmlNodeIq(_T("get"), iqId)
- << XCHILDNS( _T("retrieve"), _T(JABBER_FEAT_ARCHIVE)) << XATTR(_T("with"), with) << XATTR(_T("start"), start));
+ << XCHILDNS( _T("retrieve"), JABBER_FEAT_ARCHIVE) << XATTR(_T("with"), with) << XATTR(_T("start"), start));
time_t tmThis = str2time(start);
if ( tmThis > tmLast) {
@@ -254,7 +254,7 @@ void CJabberProto::OnIqResultGetCollection(HXML iqNode) return;
HXML chatNode = xmlGetChild(iqNode, "chat");
- if (!chatNode || lstrcmp( xmlGetAttrValue(chatNode, _T("xmlns")), _T(JABBER_FEAT_ARCHIVE)))
+ if (!chatNode || lstrcmp( xmlGetAttrValue(chatNode, _T("xmlns")), JABBER_FEAT_ARCHIVE))
return;
const TCHAR* start = xmlGetAttrValue(chatNode, _T("start"));
diff --git a/protocols/JabberG/src/jabber_bookmarks.cpp b/protocols/JabberG/src/jabber_bookmarks.cpp index 2f7045cc6e..edc14e833d 100644 --- a/protocols/JabberG/src/jabber_bookmarks.cpp +++ b/protocols/JabberG/src/jabber_bookmarks.cpp @@ -115,7 +115,6 @@ static INT_PTR CALLBACK JabberAddBookmarkDlgProc(HWND hwndDlg, UINT msg, WPARAM param->ppro->ListRemove(LIST_BOOKMARK, param->m_item->jid);
item = param->ppro->ListAdd(LIST_BOOKMARK, roomJID);
- item->bUseResource = TRUE;
if (SendDlgItemMessage(hwndDlg, IDC_URL_RADIO, BM_GETCHECK,0, 0) == BST_CHECKED)
replaceStrT(item->type, _T("url"));
@@ -272,7 +271,7 @@ void CJabberDlgBookmarks::UpdateData() int iqId = m_proto->SerialNext();
m_proto->IqAdd(iqId, IQ_PROC_DISCOBOOKMARKS, &CJabberProto::OnIqResultDiscoBookmarks);
- m_proto->m_ThreadInfo->send( XmlNodeIq(_T("get"), iqId) << XQUERY(_T(JABBER_FEAT_PRIVATE_STORAGE))
+ m_proto->m_ThreadInfo->send( XmlNodeIq(_T("get"), iqId) << XQUERY(JABBER_FEAT_PRIVATE_STORAGE)
<< XCHILDNS(_T("storage"), _T("storage:bookmarks")));
}
diff --git a/protocols/JabberG/src/jabber_byte.cpp b/protocols/JabberG/src/jabber_byte.cpp index 79624317de..67492ecb3d 100644 --- a/protocols/JabberG/src/jabber_byte.cpp +++ b/protocols/JabberG/src/jabber_byte.cpp @@ -60,7 +60,7 @@ void CJabberProto::IqResultProxyDiscovery(HXML iqNode, CJabberIqInfo* pInfo) HXML queryNode = xmlGetChild(iqNode , "query");
if (queryNode) {
const TCHAR *queryXmlns = xmlGetAttrValue(queryNode, _T("xmlns"));
- if (queryXmlns && !_tcscmp(queryXmlns, _T(JABBER_FEAT_BYTESTREAMS))) {
+ if (queryXmlns && !_tcscmp(queryXmlns, JABBER_FEAT_BYTESTREAMS)) {
HXML streamHostNode = xmlGetChild(queryNode , "streamhost");
if (streamHostNode) {
const TCHAR *streamJid = xmlGetAttrValue(streamHostNode, _T("jid"));
@@ -170,7 +170,7 @@ void CJabberProto::ByteSendThread(JABBER_BYTE_TRANSFER *jbt) pInfo = m_iqManager.AddHandler(&CJabberProto::IqResultProxyDiscovery, JABBER_IQ_TYPE_GET, proxyJid, 0, -1, jbt);
nIqId = pInfo->GetIqId();
XmlNodeIq iq(pInfo);
- iq << XQUERY(_T(JABBER_FEAT_BYTESTREAMS));
+ iq << XQUERY(JABBER_FEAT_BYTESTREAMS);
m_ThreadInfo->send(iq);
WaitForSingleObject(jbt->hProxyEvent, INFINITE);
@@ -195,7 +195,7 @@ void CJabberProto::ByteSendThread(JABBER_BYTE_TRANSFER *jbt) nIqId = pInfo->GetIqId();
{
XmlNodeIq iq(pInfo);
- HXML query = iq << XQUERY(_T(JABBER_FEAT_BYTESTREAMS)) << XATTR(_T("sid"), jbt->sid);
+ HXML query = iq << XQUERY(JABBER_FEAT_BYTESTREAMS) << XATTR(_T("sid"), jbt->sid);
if (bDirect) {
if (m_options.BsDirectManual) {
@@ -310,7 +310,7 @@ void CJabberProto::ByteInitiateResult(HXML iqNode, CJabberIqInfo* pInfo) HXML queryNode = xmlGetChild(iqNode , "query");
if (queryNode) {
const TCHAR *queryXmlns = xmlGetAttrValue(queryNode, _T("xmlns"));
- if (queryXmlns && !_tcscmp(queryXmlns, _T(JABBER_FEAT_BYTESTREAMS))) {
+ if (queryXmlns && !_tcscmp(queryXmlns, JABBER_FEAT_BYTESTREAMS)) {
HXML streamHostNode = xmlGetChild(queryNode , "streamhost-used");
if (streamHostNode) {
const TCHAR *streamJid = xmlGetAttrValue(streamHostNode, _T("jid"));
@@ -576,7 +576,7 @@ int CJabberProto::ByteSendProxyParse(HANDLE hConn, JABBER_BYTE_TRANSFER *jbt, ch IqAdd(iqId, IQ_PROC_NONE, &CJabberProto::IqResultStreamActivate);
m_ThreadInfo->send(
- XmlNodeIq(_T("set"), iqId, jbt->streamhostJID) << XQUERY(_T(JABBER_FEAT_BYTESTREAMS))
+ XmlNodeIq(_T("set"), iqId, jbt->streamhostJID) << XQUERY(JABBER_FEAT_BYTESTREAMS)
<< XATTR(_T("sid"), jbt->sid) << XCHILD(_T("activate"), jbt->dstJID));
WaitForSingleObject(jbt->hProxyEvent, INFINITE);
@@ -760,7 +760,7 @@ int CJabberProto::ByteReceiveParse(HANDLE hConn, JABBER_BYTE_TRANSFER *jbt, char jbt->state = JBT_RECVING;
m_ThreadInfo->send(
- XmlNodeIq(_T("result"), jbt->iqId, jbt->srcJID) << XQUERY(_T(JABBER_FEAT_BYTESTREAMS))
+ XmlNodeIq(_T("result"), jbt->iqId, jbt->srcJID) << XQUERY(JABBER_FEAT_BYTESTREAMS)
<< XCHILD(_T("streamhost-used")) << XATTR(_T("jid"), jbt->streamhostJID));
}
else jbt->state = JBT_SOCKSERR;
diff --git a/protocols/JabberG/src/jabber_caps.cpp b/protocols/JabberG/src/jabber_caps.cpp index acb5fabab8..46210b8fb8 100644 --- a/protocols/JabberG/src/jabber_caps.cpp +++ b/protocols/JabberG/src/jabber_caps.cpp @@ -28,53 +28,53 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "version.h"
const JabberFeatCapPair g_JabberFeatCapPairs[] = {
- { _T(JABBER_FEAT_DISCO_INFO), JABBER_CAPS_DISCO_INFO, LPGENT("Supports Service Discovery info") },
- { _T(JABBER_FEAT_DISCO_ITEMS), JABBER_CAPS_DISCO_ITEMS, LPGENT("Supports Service Discovery items list") },
- { _T(JABBER_FEAT_ENTITY_CAPS), JABBER_CAPS_ENTITY_CAPS, LPGENT("Can inform about its Jabber capabilities") },
- { _T(JABBER_FEAT_SI), JABBER_CAPS_SI, LPGENT("Supports stream initiation (for filetransfers for ex.)") },
- { _T(JABBER_FEAT_SI_FT), JABBER_CAPS_SI_FT, LPGENT("Supports stream initiation for file transfers") },
- { _T(JABBER_FEAT_BYTESTREAMS), JABBER_CAPS_BYTESTREAMS, LPGENT("Supports file transfers via SOCKS5 Bytestreams") },
- { _T(JABBER_FEAT_IBB), JABBER_CAPS_IBB, LPGENT("Supports file transfers via In-Band Bytestreams") },
- { _T(JABBER_FEAT_OOB), JABBER_CAPS_OOB, LPGENT("Supports file transfers via Out-of-Band Bytestreams") },
- { _T(JABBER_FEAT_OOB2), JABBER_CAPS_OOB, LPGENT("Supports file transfers via Out-of-Band Bytestreams") },
- { _T(JABBER_FEAT_COMMANDS), JABBER_CAPS_COMMANDS, LPGENT("Supports execution of Ad-Hoc commands") },
- { _T(JABBER_FEAT_REGISTER), JABBER_CAPS_REGISTER, LPGENT("Supports in-band registration") },
- { _T(JABBER_FEAT_MUC), JABBER_CAPS_MUC, LPGENT("Supports multi-user chat") },
- { _T(JABBER_FEAT_CHATSTATES), JABBER_CAPS_CHATSTATES, LPGENT("Can report chat state in a chat session") },
- { _T(JABBER_FEAT_LAST_ACTIVITY), JABBER_CAPS_LAST_ACTIVITY, LPGENT("Can report information about the last activity of the user") },
- { _T(JABBER_FEAT_VERSION), JABBER_CAPS_VERSION, LPGENT("Can report own version information") },
- { _T(JABBER_FEAT_ENTITY_TIME), JABBER_CAPS_ENTITY_TIME, LPGENT("Can report local time of the user") },
- { _T(JABBER_FEAT_PING), JABBER_CAPS_PING, LPGENT("Can send and receive ping requests") },
- { _T(JABBER_FEAT_DATA_FORMS), JABBER_CAPS_DATA_FORMS, LPGENT("Supports data forms") },
- { _T(JABBER_FEAT_MESSAGE_EVENTS), JABBER_CAPS_MESSAGE_EVENTS, LPGENT("Can request and respond to events relating to the delivery, display, and composition of messages") },
- { _T(JABBER_FEAT_VCARD_TEMP), JABBER_CAPS_VCARD_TEMP, LPGENT("Supports vCard") },
- { _T(JABBER_FEAT_AVATAR), JABBER_CAPS_AVATAR, LPGENT("Supports iq-based avatars") },
- { _T(JABBER_FEAT_XHTML), JABBER_CAPS_XHTML, LPGENT("Supports XHTML formatting of chat messages") },
- { _T(JABBER_FEAT_AGENTS), JABBER_CAPS_AGENTS, LPGENT("Supports Jabber Browsing") },
- { _T(JABBER_FEAT_BROWSE), JABBER_CAPS_BROWSE, LPGENT("Supports Jabber Browsing") },
- { _T(JABBER_FEAT_FEATURE_NEG), JABBER_CAPS_FEATURE_NEG, LPGENT("Can negotiate options for specific features") },
- { _T(JABBER_FEAT_AMP), JABBER_CAPS_AMP, LPGENT("Can request advanced processing of message stanzas") },
- { _T(JABBER_FEAT_USER_MOOD), JABBER_CAPS_USER_MOOD, LPGENT("Can report information about user moods") },
- { _T(JABBER_FEAT_USER_MOOD_NOTIFY), JABBER_CAPS_USER_MOOD_NOTIFY, LPGENT("Receives information about user moods") },
- { _T(JABBER_FEAT_PUBSUB), JABBER_CAPS_PUBSUB, LPGENT("Supports generic publish-subscribe functionality") },
- { _T(JABBER_FEAT_SECUREIM), JABBER_CAPS_SECUREIM, LPGENT("Supports SecureIM plugin for Miranda NG") },
- { _T(JABBER_FEAT_MIROTR), JABBER_CAPS_MIROTR, LPGENT("Supports MirOTR plugin for Miranda NG") },
- { _T(JABBER_FEAT_NEWGPG), JABBER_CAPS_NEWGPG, LPGENT("Supports New_GPG plugin for Miranda NG") },
- { _T(JABBER_FEAT_PRIVACY_LISTS), JABBER_CAPS_PRIVACY_LISTS, LPGENT("Can block communications from particular other users using Privacy lists") },
- { _T(JABBER_FEAT_MESSAGE_RECEIPTS), JABBER_CAPS_MESSAGE_RECEIPTS, LPGENT("Supports Message Receipts") },
- { _T(JABBER_FEAT_USER_TUNE), JABBER_CAPS_USER_TUNE, LPGENT("Can report information about the music to which a user is listening") },
- { _T(JABBER_FEAT_USER_TUNE_NOTIFY), JABBER_CAPS_USER_TUNE_NOTIFY, LPGENT("Receives information about the music to which a user is listening") },
- { _T(JABBER_FEAT_PRIVATE_STORAGE), JABBER_CAPS_PRIVATE_STORAGE, LPGENT("Supports private XML Storage (for bookmakrs and other)") },
- { _T(JABBER_FEAT_ATTENTION), JABBER_CAPS_ATTENTION, LPGENT("Supports attention requests ('nudge')") },
- { _T(JABBER_FEAT_ATTENTION_0), JABBER_CAPS_ATTENTION_0, LPGENT("Supports attention requests ('nudge')") },
- { _T(JABBER_FEAT_ARCHIVE_AUTO), JABBER_CAPS_ARCHIVE_AUTO, LPGENT("Supports chat history retrieving") },
- { _T(JABBER_FEAT_ARCHIVE_MANAGE), JABBER_CAPS_ARCHIVE_MANAGE, LPGENT("Supports chat history management") },
- { _T(JABBER_FEAT_USER_ACTIVITY), JABBER_CAPS_USER_ACTIVITY, LPGENT("Can report information about user activity") },
- { _T(JABBER_FEAT_USER_ACTIVITY_NOTIFY), JABBER_CAPS_USER_ACTIVITY_NOTIFY, LPGENT("Receives information about user activity") },
- { _T(JABBER_FEAT_MIRANDA_NOTES), JABBER_CAPS_MIRANDA_NOTES, LPGENT("Supports Miranda NG notes extension") },
- { _T(JABBER_FEAT_JINGLE), JABBER_CAPS_JINGLE, LPGENT("Supports Jingle") },
- { _T(JABBER_FEAT_ROSTER_EXCHANGE), JABBER_CAPS_ROSTER_EXCHANGE, LPGENT("Supports Roster Exchange") },
- { _T(JABBER_FEAT_GTALK_PMUC), JABBER_CAPS_GTALK_PMUC, LPGENT("Supports GTalk private multi-user chat") },
+ { JABBER_FEAT_DISCO_INFO, JABBER_CAPS_DISCO_INFO, LPGENT("Supports Service Discovery info") },
+ { JABBER_FEAT_DISCO_ITEMS, JABBER_CAPS_DISCO_ITEMS, LPGENT("Supports Service Discovery items list") },
+ { JABBER_FEAT_ENTITY_CAPS, JABBER_CAPS_ENTITY_CAPS, LPGENT("Can inform about its Jabber capabilities") },
+ { JABBER_FEAT_SI, JABBER_CAPS_SI, LPGENT("Supports stream initiation (for filetransfers for ex.)") },
+ { JABBER_FEAT_SI_FT, JABBER_CAPS_SI_FT, LPGENT("Supports stream initiation for file transfers") },
+ { JABBER_FEAT_BYTESTREAMS, JABBER_CAPS_BYTESTREAMS, LPGENT("Supports file transfers via SOCKS5 Bytestreams") },
+ { JABBER_FEAT_IBB, JABBER_CAPS_IBB, LPGENT("Supports file transfers via In-Band Bytestreams") },
+ { JABBER_FEAT_OOB, JABBER_CAPS_OOB, LPGENT("Supports file transfers via Out-of-Band Bytestreams") },
+ { JABBER_FEAT_OOB2, JABBER_CAPS_OOB, LPGENT("Supports file transfers via Out-of-Band Bytestreams") },
+ { JABBER_FEAT_COMMANDS, JABBER_CAPS_COMMANDS, LPGENT("Supports execution of Ad-Hoc commands") },
+ { JABBER_FEAT_REGISTER, JABBER_CAPS_REGISTER, LPGENT("Supports in-band registration") },
+ { JABBER_FEAT_MUC, JABBER_CAPS_MUC, LPGENT("Supports multi-user chat") },
+ { JABBER_FEAT_CHATSTATES, JABBER_CAPS_CHATSTATES, LPGENT("Can report chat state in a chat session") },
+ { JABBER_FEAT_LAST_ACTIVITY, JABBER_CAPS_LAST_ACTIVITY, LPGENT("Can report information about the last activity of the user") },
+ { JABBER_FEAT_VERSION, JABBER_CAPS_VERSION, LPGENT("Can report own version information") },
+ { JABBER_FEAT_ENTITY_TIME, JABBER_CAPS_ENTITY_TIME, LPGENT("Can report local time of the user") },
+ { JABBER_FEAT_PING, JABBER_CAPS_PING, LPGENT("Can send and receive ping requests") },
+ { JABBER_FEAT_DATA_FORMS, JABBER_CAPS_DATA_FORMS, LPGENT("Supports data forms") },
+ { JABBER_FEAT_MESSAGE_EVENTS, JABBER_CAPS_MESSAGE_EVENTS, LPGENT("Can request and respond to events relating to the delivery, display, and composition of messages") },
+ { JABBER_FEAT_VCARD_TEMP, JABBER_CAPS_VCARD_TEMP, LPGENT("Supports vCard") },
+ { JABBER_FEAT_AVATAR, JABBER_CAPS_AVATAR, LPGENT("Supports iq-based avatars") },
+ { JABBER_FEAT_XHTML, JABBER_CAPS_XHTML, LPGENT("Supports XHTML formatting of chat messages") },
+ { JABBER_FEAT_AGENTS, JABBER_CAPS_AGENTS, LPGENT("Supports Jabber Browsing") },
+ { JABBER_FEAT_BROWSE, JABBER_CAPS_BROWSE, LPGENT("Supports Jabber Browsing") },
+ { JABBER_FEAT_FEATURE_NEG, JABBER_CAPS_FEATURE_NEG, LPGENT("Can negotiate options for specific features") },
+ { JABBER_FEAT_AMP, JABBER_CAPS_AMP, LPGENT("Can request advanced processing of message stanzas") },
+ { JABBER_FEAT_USER_MOOD, JABBER_CAPS_USER_MOOD, LPGENT("Can report information about user moods") },
+ { JABBER_FEAT_USER_MOOD_NOTIFY, JABBER_CAPS_USER_MOOD_NOTIFY, LPGENT("Receives information about user moods") },
+ { JABBER_FEAT_PUBSUB, JABBER_CAPS_PUBSUB, LPGENT("Supports generic publish-subscribe functionality") },
+ { JABBER_FEAT_SECUREIM, JABBER_CAPS_SECUREIM, LPGENT("Supports SecureIM plugin for Miranda NG") },
+ { JABBER_FEAT_MIROTR, JABBER_CAPS_MIROTR, LPGENT("Supports MirOTR plugin for Miranda NG") },
+ { JABBER_FEAT_NEWGPG, JABBER_CAPS_NEWGPG, LPGENT("Supports New_GPG plugin for Miranda NG") },
+ { JABBER_FEAT_PRIVACY_LISTS, JABBER_CAPS_PRIVACY_LISTS, LPGENT("Can block communications from particular other users using Privacy lists") },
+ { JABBER_FEAT_MESSAGE_RECEIPTS, JABBER_CAPS_MESSAGE_RECEIPTS, LPGENT("Supports Message Receipts") },
+ { JABBER_FEAT_USER_TUNE, JABBER_CAPS_USER_TUNE, LPGENT("Can report information about the music to which a user is listening") },
+ { JABBER_FEAT_USER_TUNE_NOTIFY, JABBER_CAPS_USER_TUNE_NOTIFY, LPGENT("Receives information about the music to which a user is listening") },
+ { JABBER_FEAT_PRIVATE_STORAGE, JABBER_CAPS_PRIVATE_STORAGE, LPGENT("Supports private XML Storage (for bookmakrs and other)") },
+ { JABBER_FEAT_ATTENTION, JABBER_CAPS_ATTENTION, LPGENT("Supports attention requests ('nudge')") },
+ { JABBER_FEAT_ATTENTION_0, JABBER_CAPS_ATTENTION_0, LPGENT("Supports attention requests ('nudge')") },
+ { JABBER_FEAT_ARCHIVE_AUTO, JABBER_CAPS_ARCHIVE_AUTO, LPGENT("Supports chat history retrieving") },
+ { JABBER_FEAT_ARCHIVE_MANAGE, JABBER_CAPS_ARCHIVE_MANAGE, LPGENT("Supports chat history management") },
+ { JABBER_FEAT_USER_ACTIVITY, JABBER_CAPS_USER_ACTIVITY, LPGENT("Can report information about user activity") },
+ { JABBER_FEAT_USER_ACTIVITY_NOTIFY, JABBER_CAPS_USER_ACTIVITY_NOTIFY, LPGENT("Receives information about user activity") },
+ { JABBER_FEAT_MIRANDA_NOTES, JABBER_CAPS_MIRANDA_NOTES, LPGENT("Supports Miranda NG notes extension") },
+ { JABBER_FEAT_JINGLE, JABBER_CAPS_JINGLE, LPGENT("Supports Jingle") },
+ { JABBER_FEAT_ROSTER_EXCHANGE, JABBER_CAPS_ROSTER_EXCHANGE, LPGENT("Supports Roster Exchange") },
+ { JABBER_FEAT_GTALK_PMUC, JABBER_CAPS_GTALK_PMUC, LPGENT("Supports GTalk private multi-user chat") },
{ NULL, 0, NULL}
};
@@ -257,7 +257,7 @@ JabberCapsBits CJabberProto::GetResourceCapabilites(const TCHAR *jid, BOOL appen TCHAR queryNode[512];
mir_sntprintf(queryNode, SIZEOF(queryNode), _T("%s#%s"), r->szCapsNode, r->szCapsVer);
- m_ThreadInfo->send( XmlNodeIq(pInfo) << XQUERY(_T(JABBER_FEAT_DISCO_INFO)) << XATTR(_T("node"), queryNode));
+ m_ThreadInfo->send( XmlNodeIq(pInfo) << XQUERY(JABBER_FEAT_DISCO_INFO) << XATTR(_T("node"), queryNode));
bRequestSent = TRUE;
}
@@ -286,7 +286,7 @@ JabberCapsBits CJabberProto::GetResourceCapabilites(const TCHAR *jid, BOOL appen TCHAR queryNode[512];
mir_sntprintf(queryNode, SIZEOF(queryNode), _T("%s#%s"), r->szCapsNode, token);
m_ThreadInfo->send(
- XmlNodeIq(pInfo) << XQUERY(_T(JABBER_FEAT_DISCO_INFO)) << XATTR(_T("node"), queryNode));
+ XmlNodeIq(pInfo) << XQUERY(JABBER_FEAT_DISCO_INFO) << XATTR(_T("node"), queryNode));
bRequestSent = TRUE;
break;
@@ -324,7 +324,7 @@ JabberCapsBits CJabberProto::GetResourceCapabilites(const TCHAR *jid, BOOL appen r->dwVersionRequestTime = pInfo->GetRequestTime();
XmlNodeIq iq(pInfo);
- iq << XQUERY(_T(JABBER_FEAT_VERSION));
+ iq << XQUERY(JABBER_FEAT_VERSION);
m_ThreadInfo->send(iq);
return JABBER_RESOURCE_CAPS_IN_PROGRESS;
}
@@ -346,7 +346,7 @@ JabberCapsBits CJabberProto::GetResourceCapabilites(const TCHAR *jid, BOOL appen r->dwDiscoInfoRequestTime = pInfo->GetRequestTime();
XmlNodeIq iq(pInfo);
- iq << XQUERY(_T(JABBER_FEAT_DISCO_INFO));
+ iq << XQUERY(JABBER_FEAT_DISCO_INFO);
m_ThreadInfo->send(iq);
return JABBER_RESOURCE_CAPS_IN_PROGRESS;
@@ -390,7 +390,7 @@ JabberCapsBits CJabberProto::GetResourceCapabilites(const TCHAR *jid, BOOL appen r->dwDiscoInfoRequestTime = pInfo->GetRequestTime();
XmlNodeIq iq(pInfo);
- iq << XQUERY(_T(JABBER_FEAT_DISCO_INFO));
+ iq << XQUERY(JABBER_FEAT_DISCO_INFO);
m_ThreadInfo->send(iq);
jcbMainCaps = JABBER_RESOURCE_CAPS_IN_PROGRESS;
@@ -563,10 +563,10 @@ CJabberClientCaps * CJabberClientCapsManager::FindClient(const TCHAR *szNode) void CJabberClientCapsManager::AddDefaultCaps()
{
- SetClientCaps(_T(JABBER_CAPS_MIRANDA_NODE), szCoreVersion, JABBER_CAPS_MIRANDA_ALL);
+ SetClientCaps(JABBER_CAPS_MIRANDA_NODE, szCoreVersion, JABBER_CAPS_MIRANDA_ALL);
for (int i = 0; g_JabberFeatCapPairsExt[i].szFeature; i++)
- SetClientCaps(_T(JABBER_CAPS_MIRANDA_NODE), g_JabberFeatCapPairsExt[i].szFeature, g_JabberFeatCapPairsExt[i].jcbCap);
+ SetClientCaps(JABBER_CAPS_MIRANDA_NODE, g_JabberFeatCapPairsExt[i].szFeature, g_JabberFeatCapPairsExt[i].jcbCap);
}
JabberCapsBits CJabberClientCapsManager::GetClientCaps(TCHAR *szNode, TCHAR *szVer)
@@ -632,7 +632,7 @@ BOOL CJabberClientCapsManager::HandleInfoRequest(HXML, CJabberIqInfo* pInfo, con if (szNode) {
for (i = 0; g_JabberFeatCapPairsExt[i].szFeature; i++) {
TCHAR szExtCap[ 512 ];
- mir_sntprintf(szExtCap, SIZEOF(szExtCap), _T("%s#%s"), _T(JABBER_CAPS_MIRANDA_NODE), g_JabberFeatCapPairsExt[i].szFeature);
+ mir_sntprintf(szExtCap, SIZEOF(szExtCap), _T("%s#%s"), JABBER_CAPS_MIRANDA_NODE, g_JabberFeatCapPairsExt[i].szFeature);
if ( !_tcscmp(szNode, szExtCap)) {
jcb = g_JabberFeatCapPairsExt[i].jcbCap;
break;
@@ -642,7 +642,7 @@ BOOL CJabberClientCapsManager::HandleInfoRequest(HXML, CJabberIqInfo* pInfo, con // check features registered through IJabberNetInterface::RegisterFeature() and IJabberNetInterface::AddFeatures()
for (i = 0; i < ppro->m_lstJabberFeatCapPairsDynamic.getCount(); i++) {
TCHAR szExtCap[ 512 ];
- mir_sntprintf(szExtCap, SIZEOF(szExtCap), _T("%s#%s"), _T(JABBER_CAPS_MIRANDA_NODE), ppro->m_lstJabberFeatCapPairsDynamic[i]->szExt);
+ mir_sntprintf(szExtCap, SIZEOF(szExtCap), _T("%s#%s"), JABBER_CAPS_MIRANDA_NODE, ppro->m_lstJabberFeatCapPairsDynamic[i]->szExt);
if ( !_tcscmp(szNode, szExtCap)) {
jcb = ppro->m_lstJabberFeatCapPairsDynamic[i]->jcbCap;
break;
@@ -664,7 +664,7 @@ BOOL CJabberClientCapsManager::HandleInfoRequest(HXML, CJabberIqInfo* pInfo, con XmlNodeIq iq(_T("result"), pInfo);
- HXML query = iq << XQUERY(_T(JABBER_FEAT_DISCO_INFO));
+ HXML query = iq << XQUERY(JABBER_FEAT_DISCO_INFO);
if (szNode)
query << XATTR(_T("node"), szNode);
@@ -694,7 +694,7 @@ BOOL CJabberClientCapsManager::HandleInfoRequest(HXML, CJabberIqInfo* pInfo, con }
}
- HXML form = query << XCHILDNS(_T("x"), _T(JABBER_FEAT_DATA_FORMS)) << XATTR(_T("type"), _T("result"));
+ HXML form = query << XCHILDNS(_T("x"), JABBER_FEAT_DATA_FORMS) << XATTR(_T("type"), _T("result"));
form << XCHILD(_T("field")) << XATTR(_T("var"), _T("FORM_TYPE")) << XATTR(_T("type"), _T("hidden"))
<< XCHILD(_T("value"), _T("urn:xmpp:dataforms:softwareinfo"));
diff --git a/protocols/JabberG/src/jabber_caps.h b/protocols/JabberG/src/jabber_caps.h index de3d64525c..6322fd4170 100644 --- a/protocols/JabberG/src/jabber_caps.h +++ b/protocols/JabberG/src/jabber_caps.h @@ -45,116 +45,116 @@ typedef unsigned __int64 JabberCapsBits; #define JABBER_RESOURCE_CAPS_NONE 0x0000000000000000
#endif
-#define JABBER_FEAT_DISCO_INFO "http://jabber.org/protocol/disco#info"
+#define JABBER_FEAT_DISCO_INFO _T("http://jabber.org/protocol/disco#info")
#define JABBER_CAPS_DISCO_INFO ((JabberCapsBits)1)
-#define JABBER_FEAT_DISCO_ITEMS "http://jabber.org/protocol/disco#items"
+#define JABBER_FEAT_DISCO_ITEMS _T("http://jabber.org/protocol/disco#items")
#define JABBER_CAPS_DISCO_ITEMS ((JabberCapsBits)1<<1)
-#define JABBER_FEAT_ENTITY_CAPS "http://jabber.org/protocol/caps"
+#define JABBER_FEAT_ENTITY_CAPS _T("http://jabber.org/protocol/caps")
#define JABBER_CAPS_ENTITY_CAPS ((JabberCapsBits)1<<2)
-#define JABBER_FEAT_SI "http://jabber.org/protocol/si"
+#define JABBER_FEAT_SI _T("http://jabber.org/protocol/si")
#define JABBER_CAPS_SI ((JabberCapsBits)1<<3)
-#define JABBER_FEAT_SI_FT "http://jabber.org/protocol/si/profile/file-transfer"
+#define JABBER_FEAT_SI_FT _T("http://jabber.org/protocol/si/profile/file-transfer")
#define JABBER_CAPS_SI_FT ((JabberCapsBits)1<<4)
-#define JABBER_FEAT_BYTESTREAMS "http://jabber.org/protocol/bytestreams"
+#define JABBER_FEAT_BYTESTREAMS _T("http://jabber.org/protocol/bytestreams")
#define JABBER_CAPS_BYTESTREAMS ((JabberCapsBits)1<<5)
-#define JABBER_FEAT_IBB "http://jabber.org/protocol/ibb"
+#define JABBER_FEAT_IBB _T("http://jabber.org/protocol/ibb")
#define JABBER_CAPS_IBB ((JabberCapsBits)1<<6)
-#define JABBER_FEAT_OOB "jabber:iq:oob"
-#define JABBER_FEAT_OOB2 "jabber:x:oob"
+#define JABBER_FEAT_OOB _T("jabber:iq:oob")
+#define JABBER_FEAT_OOB2 _T("jabber:x:oob")
#define JABBER_CAPS_OOB ((JabberCapsBits)1<<7)
-#define JABBER_FEAT_COMMANDS "http://jabber.org/protocol/commands"
+#define JABBER_FEAT_COMMANDS _T("http://jabber.org/protocol/commands")
#define JABBER_CAPS_COMMANDS ((JabberCapsBits)1<<8)
-#define JABBER_FEAT_REGISTER "jabber:iq:register"
+#define JABBER_FEAT_REGISTER _T("jabber:iq:register")
#define JABBER_CAPS_REGISTER ((JabberCapsBits)1<<9)
-#define JABBER_FEAT_MUC "http://jabber.org/protocol/muc"
+#define JABBER_FEAT_MUC _T("http://jabber.org/protocol/muc")
#define JABBER_CAPS_MUC ((JabberCapsBits)1<<10)
-#define JABBER_FEAT_CHATSTATES "http://jabber.org/protocol/chatstates"
+#define JABBER_FEAT_CHATSTATES _T("http://jabber.org/protocol/chatstates")
#define JABBER_CAPS_CHATSTATES ((JabberCapsBits)1<<11)
-#define JABBER_FEAT_LAST_ACTIVITY "jabber:iq:last"
+#define JABBER_FEAT_LAST_ACTIVITY _T("jabber:iq:last")
#define JABBER_CAPS_LAST_ACTIVITY ((JabberCapsBits)1<<12)
-#define JABBER_FEAT_VERSION "jabber:iq:version"
+#define JABBER_FEAT_VERSION _T("jabber:iq:version")
#define JABBER_CAPS_VERSION ((JabberCapsBits)1<<13)
-#define JABBER_FEAT_ENTITY_TIME "urn:xmpp:time"
+#define JABBER_FEAT_ENTITY_TIME _T("urn:xmpp:time")
#define JABBER_CAPS_ENTITY_TIME ((JabberCapsBits)1<<14)
-#define JABBER_FEAT_PING "urn:xmpp:ping"
+#define JABBER_FEAT_PING _T("urn:xmpp:ping")
#define JABBER_CAPS_PING ((JabberCapsBits)1<<15)
-#define JABBER_FEAT_DATA_FORMS "jabber:x:data"
+#define JABBER_FEAT_DATA_FORMS _T("jabber:x:data")
#define JABBER_CAPS_DATA_FORMS ((JabberCapsBits)1<<16)
-#define JABBER_FEAT_MESSAGE_EVENTS "jabber:x:event"
+#define JABBER_FEAT_MESSAGE_EVENTS _T("jabber:x:event")
#define JABBER_CAPS_MESSAGE_EVENTS ((JabberCapsBits)1<<17)
-#define JABBER_FEAT_VCARD_TEMP "vcard-temp"
+#define JABBER_FEAT_VCARD_TEMP _T("vcard-temp")
#define JABBER_CAPS_VCARD_TEMP ((JabberCapsBits)1<<18)
-#define JABBER_FEAT_AVATAR "jabber:iq:avatar"
-#define JABBER_FEAT_SERVER_AVATAR "storage:client:avatar"
+#define JABBER_FEAT_AVATAR _T("jabber:iq:avatar")
+#define JABBER_FEAT_SERVER_AVATAR _T("storage:client:avatar")
#define JABBER_CAPS_AVATAR ((JabberCapsBits)1<<19)
-#define JABBER_FEAT_XHTML "http://jabber.org/protocol/xhtml-im"
+#define JABBER_FEAT_XHTML _T("http://jabber.org/protocol/xhtml-im")
#define JABBER_CAPS_XHTML ((JabberCapsBits)1<<20)
-#define JABBER_FEAT_AGENTS "jabber:iq:agents"
+#define JABBER_FEAT_AGENTS _T("jabber:iq:agents")
#define JABBER_CAPS_AGENTS ((JabberCapsBits)1<<21)
-#define JABBER_FEAT_BROWSE "jabber:iq:browse"
+#define JABBER_FEAT_BROWSE _T("jabber:iq:browse")
#define JABBER_CAPS_BROWSE ((JabberCapsBits)1<<22)
-#define JABBER_FEAT_FEATURE_NEG "http://jabber.org/protocol/feature-neg"
+#define JABBER_FEAT_FEATURE_NEG _T("http://jabber.org/protocol/feature-neg")
#define JABBER_CAPS_FEATURE_NEG ((JabberCapsBits)1<<23)
-#define JABBER_FEAT_AMP "http://jabber.org/protocol/amp"
+#define JABBER_FEAT_AMP _T("http://jabber.org/protocol/amp")
#define JABBER_CAPS_AMP ((JabberCapsBits)1<<24)
-#define JABBER_FEAT_USER_MOOD "http://jabber.org/protocol/mood"
+#define JABBER_FEAT_USER_MOOD _T("http://jabber.org/protocol/mood")
#define JABBER_CAPS_USER_MOOD ((JabberCapsBits)1<<25)
-#define JABBER_FEAT_USER_MOOD_NOTIFY "http://jabber.org/protocol/mood+notify"
+#define JABBER_FEAT_USER_MOOD_NOTIFY _T("http://jabber.org/protocol/mood+notify")
#define JABBER_CAPS_USER_MOOD_NOTIFY ((JabberCapsBits)1<<26)
-#define JABBER_FEAT_PUBSUB "http://jabber.org/protocol/pubsub"
+#define JABBER_FEAT_PUBSUB _T("http://jabber.org/protocol/pubsub")
#define JABBER_CAPS_PUBSUB ((JabberCapsBits)1<<27)
-#define JABBER_FEAT_SECUREIM "http://miranda-ng.org/caps/secureim"
+#define JABBER_FEAT_SECUREIM _T("http://miranda-ng.org/caps/secureim")
#define JABBER_CAPS_SECUREIM ((JabberCapsBits)1<<28)
-#define JABBER_FEAT_MIROTR "http://miranda-ng.org/caps/mirotr"
+#define JABBER_FEAT_MIROTR _T("http://miranda-ng.org/caps/mirotr")
#define JABBER_CAPS_MIROTR ((JabberCapsBits)1<<42)
-#define JABBER_FEAT_NEWGPG "http://miranda-ng.org/caps/new_gpg"
+#define JABBER_FEAT_NEWGPG _T("http://miranda-ng.org/caps/new_gpg")
#define JABBER_CAPS_NEWGPG ((JabberCapsBits)1<<43)
#define JABBER_CAPS_PLATFORMX86 ((JabberCapsBits)1<<44)
#define JABBER_CAPS_PLATFORMX64 ((JabberCapsBits)1<<45)
-#define JABBER_FEAT_PRIVACY_LISTS "jabber:iq:privacy"
+#define JABBER_FEAT_PRIVACY_LISTS _T("jabber:iq:privacy")
#define JABBER_CAPS_PRIVACY_LISTS ((JabberCapsBits)1<<29)
-#define JABBER_FEAT_MESSAGE_RECEIPTS "urn:xmpp:receipts"
+#define JABBER_FEAT_MESSAGE_RECEIPTS _T("urn:xmpp:receipts")
#define JABBER_CAPS_MESSAGE_RECEIPTS ((JabberCapsBits)1<<30)
-#define JABBER_FEAT_USER_TUNE "http://jabber.org/protocol/tune"
+#define JABBER_FEAT_USER_TUNE _T("http://jabber.org/protocol/tune")
#define JABBER_CAPS_USER_TUNE ((JabberCapsBits)1<<31)
-#define JABBER_FEAT_USER_TUNE_NOTIFY "http://jabber.org/protocol/tune+notify"
+#define JABBER_FEAT_USER_TUNE_NOTIFY _T("http://jabber.org/protocol/tune+notify")
#define JABBER_CAPS_USER_TUNE_NOTIFY ((JabberCapsBits)1<<32)
-#define JABBER_FEAT_PRIVATE_STORAGE "jabber:iq:private"
+#define JABBER_FEAT_PRIVATE_STORAGE _T("jabber:iq:private")
#define JABBER_CAPS_PRIVATE_STORAGE ((JabberCapsBits)1<<33)
-#define JABBER_FEAT_ARCHIVE "urn:xmpp:archive"
-#define JABBER_FEAT_ARCHIVE_AUTO "urn:xmpp:archive:auto"
+#define JABBER_FEAT_ARCHIVE _T("urn:xmpp:archive")
+#define JABBER_FEAT_ARCHIVE_AUTO _T("urn:xmpp:archive:auto")
#define JABBER_CAPS_ARCHIVE_AUTO ((JabberCapsBits)1<<34)
-#define JABBER_FEAT_ARCHIVE_MANAGE "urn:xmpp:archive:manage"
+#define JABBER_FEAT_ARCHIVE_MANAGE _T("urn:xmpp:archive:manage")
#define JABBER_CAPS_ARCHIVE_MANAGE ((JabberCapsBits)1<<35)
-#define JABBER_FEAT_CAPTCHA "urn:xmpp:captcha"
+#define JABBER_FEAT_CAPTCHA _T("urn:xmpp:captcha")
// deferred
-#define JABBER_FEAT_ATTENTION "http://www.xmpp.org/extensions/xep-0224.html#ns"
+#define JABBER_FEAT_ATTENTION _T("http://www.xmpp.org/extensions/xep-0224.html#ns")
#define JABBER_CAPS_ATTENTION ((JabberCapsBits)1<<34)
-#define JABBER_FEAT_USER_ACTIVITY "http://jabber.org/protocol/activity"
+#define JABBER_FEAT_USER_ACTIVITY _T("http://jabber.org/protocol/activity")
#define JABBER_CAPS_USER_ACTIVITY ((JabberCapsBits)1<<35)
-#define JABBER_FEAT_USER_ACTIVITY_NOTIFY "http://jabber.org/protocol/activity+notify"
+#define JABBER_FEAT_USER_ACTIVITY_NOTIFY _T("http://jabber.org/protocol/activity+notify")
#define JABBER_CAPS_USER_ACTIVITY_NOTIFY ((JabberCapsBits)1<<36)
-#define JABBER_FEAT_ATTENTION_0 "urn:xmpp:attention:0"
+#define JABBER_FEAT_ATTENTION_0 _T("urn:xmpp:attention:0")
#define JABBER_CAPS_ATTENTION_0 ((JabberCapsBits)1<<37)
-#define JABBER_FEAT_MIRANDA_NOTES "http://miranda-ng.org/storage#notes"
+#define JABBER_FEAT_MIRANDA_NOTES _T("http://miranda-ng.org/storage#notes")
#define JABBER_CAPS_MIRANDA_NOTES ((JabberCapsBits)1<<38)
-#define JABBER_FEAT_JINGLE "urn:xmpp:jingle:1"
+#define JABBER_FEAT_JINGLE _T("urn:xmpp:jingle:1")
#define JABBER_CAPS_JINGLE ((JabberCapsBits)1<<39)
-#define JABBER_FEAT_ROSTER_EXCHANGE "http://jabber.org/protocol/rosterx"
+#define JABBER_FEAT_ROSTER_EXCHANGE _T("http://jabber.org/protocol/rosterx")
#define JABBER_CAPS_ROSTER_EXCHANGE ((JabberCapsBits)1<<40)
-#define JABBER_FEAT_GTALK_PMUC "http://www.google.com/xmpp/protocol/pmuc/v1"
+#define JABBER_FEAT_GTALK_PMUC _T("http://www.google.com/xmpp/protocol/pmuc/v1")
#define JABBER_CAPS_GTALK_PMUC ((JabberCapsBits)1<<41)
-#define JABBER_FEAT_PUBSUB_EVENT "http://jabber.org/protocol/pubsub#event"
-#define JABBER_FEAT_PUBSUB_NODE_CONFIG "http://jabber.org/protocol/pubsub#node_config"
+#define JABBER_FEAT_PUBSUB_EVENT _T("http://jabber.org/protocol/pubsub#event")
+#define JABBER_FEAT_PUBSUB_NODE_CONFIG _T("http://jabber.org/protocol/pubsub#node_config")
#define JABBER_CAPS_MESSAGE_EVENTS_NO_DELIVERY ((JabberCapsBits)1<<62)
#define JABBER_CAPS_OTHER_SPECIAL (JABBER_CAPS_MESSAGE_EVENTS_NO_DELIVERY|JABBER_RESOURCE_CAPS_ERROR) // must contain all the caps not listed in g_JabberFeatCapPairs, to prevent using these bits for features registered through IJabberNetInterface::RegisterFeature()
-#define JABBER_CAPS_MIRANDA_NODE "http://miranda-ng.org/caps"
+#define JABBER_CAPS_MIRANDA_NODE _T("http://miranda-ng.org/caps")
#define JABBER_CAPS_MIRANDA_ALL (JABBER_CAPS_DISCO_INFO|JABBER_CAPS_DISCO_ITEMS|JABBER_CAPS_MUC|JABBER_CAPS_ENTITY_CAPS|JABBER_CAPS_SI|JABBER_CAPS_SI_FT|JABBER_CAPS_BYTESTREAMS|JABBER_CAPS_IBB|JABBER_CAPS_OOB|JABBER_CAPS_CHATSTATES|JABBER_CAPS_AGENTS|JABBER_CAPS_BROWSE|JABBER_CAPS_VERSION|JABBER_CAPS_LAST_ACTIVITY|JABBER_CAPS_DATA_FORMS|JABBER_CAPS_MESSAGE_EVENTS|JABBER_CAPS_VCARD_TEMP|JABBER_CAPS_ENTITY_TIME|JABBER_CAPS_PING|JABBER_CAPS_PRIVACY_LISTS|JABBER_CAPS_MESSAGE_RECEIPTS|JABBER_CAPS_PRIVATE_STORAGE|JABBER_CAPS_ATTENTION_0|JABBER_CAPS_JINGLE|JABBER_CAPS_ROSTER_EXCHANGE|JABBER_CAPS_SECUREIM|JABBER_CAPS_MIROTR|JABBER_CAPS_NEWGPG|JABBER_CAPS_COMMANDS|JABBER_CAPS_USER_MOOD_NOTIFY|JABBER_CAPS_USER_TUNE_NOTIFY|JABBER_CAPS_USER_ACTIVITY_NOTIFY|JABBER_CAPS_PLATFORMX86|JABBER_CAPS_PLATFORMX64)
#define JABBER_CAPS_MIRANDA_PARTIAL (JABBER_CAPS_DISCO_INFO|JABBER_CAPS_DISCO_ITEMS|JABBER_CAPS_MUC|JABBER_CAPS_ENTITY_CAPS|JABBER_CAPS_SI|JABBER_CAPS_SI_FT|JABBER_CAPS_BYTESTREAMS|JABBER_CAPS_IBB|JABBER_CAPS_OOB|JABBER_CAPS_CHATSTATES|JABBER_CAPS_AGENTS|JABBER_CAPS_BROWSE|JABBER_CAPS_VERSION|JABBER_CAPS_LAST_ACTIVITY|JABBER_CAPS_DATA_FORMS|JABBER_CAPS_MESSAGE_EVENTS|JABBER_CAPS_VCARD_TEMP|JABBER_CAPS_ENTITY_TIME|JABBER_CAPS_PING|JABBER_CAPS_PRIVACY_LISTS|JABBER_CAPS_MESSAGE_RECEIPTS|JABBER_CAPS_PRIVATE_STORAGE|JABBER_CAPS_ATTENTION_0|JABBER_CAPS_JINGLE|JABBER_CAPS_ROSTER_EXCHANGE)
@@ -171,26 +171,29 @@ typedef unsigned __int64 JabberCapsBits; #define JABBER_EXT_PLATFORMX86 "x86"
#define JABBER_EXT_PLATFORMX64 "x64"
-#define JABBER_FEAT_EXT_ADDRESSING "http://jabber.org/protocol/address"
-#define JABBER_FEAT_NESTED_ROSTER_GROUPS "roster:delimiter"
+#define JABBER_FEAT_EXT_ADDRESSING _T("http://jabber.org/protocol/address")
+#define JABBER_FEAT_NESTED_ROSTER_GROUPS _T("roster:delimiter")
-#define JABBER_FEAT_RC "http://jabber.org/protocol/rc"
-#define JABBER_FEAT_RC_SET_STATUS "http://jabber.org/protocol/rc#set-status"
-#define JABBER_FEAT_RC_SET_OPTIONS "http://jabber.org/protocol/rc#set-options"
-#define JABBER_FEAT_RC_FORWARD "http://jabber.org/protocol/rc#forward"
-#define JABBER_FEAT_RC_LEAVE_GROUPCHATS "http://jabber.org/protocol/rc#leave-groupchats"
-#define JABBER_FEAT_RC_WS_LOCK "http://miranda-ng.org/rc#lock_workstation"
-#define JABBER_FEAT_RC_QUIT_MIRANDA "http://miranda-ng.org/rc#quit"
+#define JABBER_FEAT_RC _T("http://jabber.org/protocol/rc")
+#define JABBER_FEAT_RC_SET_STATUS _T("http://jabber.org/protocol/rc#set-status")
+#define JABBER_FEAT_RC_SET_OPTIONS _T("http://jabber.org/protocol/rc#set-options")
+#define JABBER_FEAT_RC_FORWARD _T("http://jabber.org/protocol/rc#forward")
+#define JABBER_FEAT_RC_LEAVE_GROUPCHATS _T("http://jabber.org/protocol/rc#leave-groupchats")
+#define JABBER_FEAT_RC_WS_LOCK _T("http://miranda-ng.org/rc#lock_workstation")
+#define JABBER_FEAT_RC_QUIT_MIRANDA _T("http://miranda-ng.org/rc#quit")
-#define JABBER_FEAT_IQ_ROSTER "jabber:iq:roster"
-#define JABBER_FEAT_DELAY "jabber:x:delay"
-#define JABBER_FEAT_ENTITY_TIME_OLD "jabber:iq:time"
-#define JABBER_FEAT_GTALK_SHARED_STATUS "google:shared-status"
+#define JABBER_FEAT_IQ_ROSTER _T("jabber:iq:roster")
+#define JABBER_FEAT_DELAY _T("jabber:x:delay")
+#define JABBER_FEAT_ENTITY_TIME_OLD _T("jabber:iq:time")
+#define JABBER_FEAT_GTALK_SHARED_STATUS _T("google:shared-status")
-#define JABBER_FEAT_MUC_USER "http://jabber.org/protocol/muc#user"
-#define JABBER_FEAT_NICK "http://jabber.org/protocol/nick"
+#define JABBER_FEAT_MUC_ADMIN _T("http://jabber.org/protocol/muc#admin")
+#define JABBER_FEAT_MUC_OWNER _T("http://jabber.org/protocol/muc#owner")
+#define JABBER_FEAT_MUC_USER _T("http://jabber.org/protocol/muc#user")
-#define JABBER_FEAT_HTTP_AUTH "http://jabber.org/protocol/http-auth"
+#define JABBER_FEAT_NICK _T("http://jabber.org/protocol/nick")
+
+#define JABBER_FEAT_HTTP_AUTH _T("http://jabber.org/protocol/http-auth")
class CJabberClientPartialCaps
diff --git a/protocols/JabberG/src/jabber_captcha.cpp b/protocols/JabberG/src/jabber_captcha.cpp index e36fb56050..e27c09db27 100644 --- a/protocols/JabberG/src/jabber_captcha.cpp +++ b/protocols/JabberG/src/jabber_captcha.cpp @@ -115,7 +115,7 @@ bool CJabberProto::ProcessCaptcha (HXML node, HXML parentNode, ThreadData* info) const TCHAR *PicType = 0;
TCHAR *CaptchaPath = 0;
- HXML x = xmlGetChildByTag(node, "x", "xmlns", _T(JABBER_FEAT_DATA_FORMS));
+ HXML x = xmlGetChildByTag(node, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
if (x == NULL)
return false;
@@ -215,7 +215,7 @@ LBL_Ret: void CJabberProto::sendCaptchaResult(TCHAR* buf, ThreadData* info, LPCTSTR from, LPCTSTR challenge, LPCTSTR fromjid, LPCTSTR sid){
XmlNodeIq iq(_T("set"), SerialNext());
- HXML query= iq <<XATTR(_T("to"), from) << XCHILD(_T("captcha")) << XATTR(_T("xmlns"), _T("urn:xmpp:captcha")) << XCHILD (_T("x")) << XATTR(_T("xmlns"), _T(JABBER_FEAT_DATA_FORMS)) << XATTR(_T("type"), _T("submit"));
+ HXML query= iq <<XATTR(_T("to"), from) << XCHILD(_T("captcha")) << XATTR(_T("xmlns"), _T("urn:xmpp:captcha")) << XCHILD (_T("x")) << XATTR(_T("xmlns"), JABBER_FEAT_DATA_FORMS) << XATTR(_T("type"), _T("submit"));
query << XCHILD(_T("field")) << XATTR (_T("var"), _T("FORM_TYPE")) << XCHILD(_T("value"), _T("urn:xmpp:captcha"));
query << XCHILD(_T("field")) << XATTR (_T("var"), _T("from")) << XCHILD(_T("value"), fromjid);
query << XCHILD(_T("field")) << XATTR (_T("var"), _T("challenge")) << XCHILD(_T("value"), challenge);
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index 48d1bf7e87..0da8edb038 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -27,9 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_addcontact.h>
-const TCHAR xmlnsAdmin[] = _T("http://jabber.org/protocol/muc#admin");
-const TCHAR xmlnsOwner[] = _T("http://jabber.org/protocol/muc#owner");
-
/////////////////////////////////////////////////////////////////////////////////////////
// Global definitions
@@ -722,7 +719,7 @@ class CGroupchatInviteDlg : public CJabberDlgBase {
XmlNode msg(_T("message"));
HXML invite = msg << XATTR(_T("to"), m_room) << XATTRID(m_proto->SerialNext())
- << XCHILDNS(_T("x"), _T(JABBER_FEAT_MUC_USER))
+ << XCHILDNS(_T("x"), JABBER_FEAT_MUC_USER)
<< XCHILD(_T("invite")) << XATTR(_T("to"), pUser);
if (text)
invite << XCHILD(_T("reason"), text);
@@ -966,27 +963,27 @@ static INT_PTR CALLBACK sttUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam switch (value) {
case AFFILIATION_NONE:
if (dat->him->szRealJid)
- dat->ppro->AdminSet(dat->item->jid, xmlnsAdmin, _T("jid"), szBareJid, _T("affiliation"), _T("none"));
+ dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("jid"), szBareJid, _T("affiliation"), _T("none"));
else
- dat->ppro->AdminSet(dat->item->jid, xmlnsAdmin, _T("nick"), dat->him->resourceName, _T("affiliation"), _T("none"));
+ dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), dat->him->resourceName, _T("affiliation"), _T("none"));
break;
case AFFILIATION_MEMBER:
if (dat->him->szRealJid)
- dat->ppro->AdminSet(dat->item->jid, xmlnsAdmin, _T("jid"), szBareJid, _T("affiliation"), _T("member"));
+ dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("jid"), szBareJid, _T("affiliation"), _T("member"));
else
- dat->ppro->AdminSet(dat->item->jid, xmlnsAdmin, _T("nick"), dat->him->resourceName, _T("affiliation"), _T("member"));
+ dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), dat->him->resourceName, _T("affiliation"), _T("member"));
break;
case AFFILIATION_ADMIN:
if (dat->him->szRealJid)
- dat->ppro->AdminSet(dat->item->jid, xmlnsAdmin, _T("jid"), szBareJid, _T("affiliation"), _T("admin"));
+ dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("jid"), szBareJid, _T("affiliation"), _T("admin"));
else
- dat->ppro->AdminSet(dat->item->jid, xmlnsAdmin, _T("nick"), dat->him->resourceName, _T("affiliation"), _T("admin"));
+ dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), dat->him->resourceName, _T("affiliation"), _T("admin"));
break;
case AFFILIATION_OWNER:
if (dat->him->szRealJid)
- dat->ppro->AdminSet(dat->item->jid, xmlnsAdmin, _T("jid"), szBareJid, _T("affiliation"), _T("owner"));
+ dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("jid"), szBareJid, _T("affiliation"), _T("owner"));
else
- dat->ppro->AdminSet(dat->item->jid, xmlnsAdmin, _T("nick"), dat->him->resourceName, _T("affiliation"), _T("owner"));
+ dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), dat->him->resourceName, _T("affiliation"), _T("owner"));
}
break;
@@ -1006,13 +1003,13 @@ static INT_PTR CALLBACK sttUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam switch (value) {
case ROLE_VISITOR:
- dat->ppro->AdminSet(dat->item->jid, xmlnsAdmin, _T("nick"), dat->him->resourceName, _T("role"), _T("visitor"));
+ dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), dat->him->resourceName, _T("role"), _T("visitor"));
break;
case ROLE_PARTICIPANT:
- dat->ppro->AdminSet(dat->item->jid, xmlnsAdmin, _T("nick"), dat->him->resourceName, _T("role"), _T("participant"));
+ dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), dat->him->resourceName, _T("role"), _T("participant"));
break;
case ROLE_MODERATOR:
- dat->ppro->AdminSet(dat->item->jid, xmlnsAdmin, _T("nick"), dat->him->resourceName, _T("role"), _T("moderator"));
+ dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), dat->him->resourceName, _T("role"), _T("moderator"));
break;
}
}
@@ -1096,7 +1093,6 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* jsr.hdr.cbSize = sizeof(JABBER_SEARCH_RESULT);
JABBER_LIST_ITEM *item = ppro->ListAdd(LIST_VCARD_TEMP, jsr.jid);
- item->bUseResource = TRUE;
ppro->ListAddResource(LIST_VCARD_TEMP, jsr.jid, him->status, him->statusMessage, him->priority);
hContact = (HANDLE)CallProtoService(ppro->m_szModuleName, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&jsr);
@@ -1124,7 +1120,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* TCHAR *resourceName_copy = mir_tstrdup(him->resourceName); // copy resource name to prevent possible crash if user list rebuilds
if (ppro->EnterString(szBuffer, SIZEOF(szBuffer), szTitle, JES_MULTINE, "gcReason_"))
ppro->m_ThreadInfo->send(
- XmlNodeIq(_T("set"), ppro->SerialNext(), item->jid) << XQUERY(xmlnsAdmin)
+ XmlNodeIq(_T("set"), ppro->SerialNext(), item->jid) << XQUERY(JABBER_FEAT_MUC_ADMIN)
<< XCHILD(_T("item")) << XATTR(_T("nick"), resourceName_copy) << XATTR(_T("role"), _T("none"))
<< XCHILD(_T("reason"), szBuffer));
@@ -1136,17 +1132,17 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* case IDM_SET_VISITOR:
if (him->role != ROLE_VISITOR)
- ppro->AdminSet(item->jid, xmlnsAdmin, _T("nick"), him->resourceName, _T("role"), _T("visitor"));
+ ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), him->resourceName, _T("role"), _T("visitor"));
break;
case IDM_SET_PARTICIPANT:
if (him->role != ROLE_PARTICIPANT)
- ppro->AdminSet(item->jid, xmlnsAdmin, _T("nick"), him->resourceName, _T("role"), _T("participant"));
+ ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), him->resourceName, _T("role"), _T("participant"));
break;
case IDM_SET_MODERATOR:
if (him->role != ROLE_MODERATOR)
- ppro->AdminSet(item->jid, xmlnsAdmin, _T("nick"), him->resourceName, _T("role"), _T("moderator"));
+ ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), him->resourceName, _T("role"), _T("moderator"));
break;
case IDM_SET_NONE:
@@ -1154,9 +1150,9 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* if (him->szRealJid) {
TCHAR szBareJid[JABBER_MAX_JID_LEN];
JabberStripJid(him->szRealJid, szBareJid, SIZEOF(szBareJid));
- ppro->AdminSet(item->jid, xmlnsAdmin, _T("jid"), szBareJid, _T("affiliation"), _T("none"));
+ ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("jid"), szBareJid, _T("affiliation"), _T("none"));
}
- else ppro->AdminSet(item->jid, xmlnsAdmin, _T("nick"), him->resourceName, _T("affiliation"), _T("none"));
+ else ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), him->resourceName, _T("affiliation"), _T("none"));
}
break;
@@ -1165,9 +1161,9 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* if (him->szRealJid) {
TCHAR szBareJid[JABBER_MAX_JID_LEN];
JabberStripJid(him->szRealJid, szBareJid, SIZEOF(szBareJid));
- ppro->AdminSet(item->jid, xmlnsAdmin, _T("jid"), szBareJid, _T("affiliation"), _T("member"));
+ ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("jid"), szBareJid, _T("affiliation"), _T("member"));
}
- else ppro->AdminSet(item->jid, xmlnsAdmin, _T("nick"), him->resourceName, _T("affiliation"), _T("member"));
+ else ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), him->resourceName, _T("affiliation"), _T("member"));
}
break;
@@ -1176,9 +1172,9 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* if (him->szRealJid) {
TCHAR szBareJid[JABBER_MAX_JID_LEN];
JabberStripJid(him->szRealJid, szBareJid, SIZEOF(szBareJid));
- ppro->AdminSet(item->jid, xmlnsAdmin, _T("jid"), szBareJid, _T("affiliation"), _T("admin"));
+ ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("jid"), szBareJid, _T("affiliation"), _T("admin"));
}
- else ppro->AdminSet(item->jid, xmlnsAdmin, _T("nick"), him->resourceName, _T("affiliation"), _T("admin"));
+ else ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), him->resourceName, _T("affiliation"), _T("admin"));
}
break;
@@ -1187,9 +1183,9 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* if (him->szRealJid) {
TCHAR szBareJid[JABBER_MAX_JID_LEN];
JabberStripJid(him->szRealJid, szBareJid, SIZEOF(szBareJid));
- ppro->AdminSet(item->jid, xmlnsAdmin, _T("jid"), szBareJid, _T("affiliation"), _T("owner"));
+ ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("jid"), szBareJid, _T("affiliation"), _T("owner"));
}
- else ppro->AdminSet(item->jid, xmlnsAdmin, _T("nick"), him->resourceName, _T("affiliation"), _T("owner"));
+ else ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), him->resourceName, _T("affiliation"), _T("owner"));
}
break;
@@ -1204,7 +1200,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* if (ppro->EnterString(szBuffer, SIZEOF(szBuffer), szTitle, JES_MULTINE, "gcReason_")) {
ppro->m_ThreadInfo->send(
- XmlNodeIq(_T("set"), ppro->SerialNext(), item->jid) << XQUERY(xmlnsAdmin)
+ XmlNodeIq(_T("set"), ppro->SerialNext(), item->jid) << XQUERY(JABBER_FEAT_MUC_ADMIN)
<< XCHILD(_T("item")) << XATTR(_T("jid"), szVictimBareJid) << XATTR(_T("affiliation"), _T("outcast"))
<< XCHILD(_T("reason"), szBuffer));
}
@@ -1272,7 +1268,6 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* if (TCHAR *tmp = _tcschr(jsr.jid, _T('/'))) *tmp = 0;
JABBER_LIST_ITEM *item = ppro->ListAdd(LIST_VCARD_TEMP, jsr.jid);
- item->bUseResource = TRUE;
ppro->ListAddResource(LIST_VCARD_TEMP, jsr.jid, him->status, him->statusMessage, him->priority);
hContact = (HANDLE)CallProtoService(ppro->m_szModuleName, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&jsr);
@@ -1306,27 +1301,27 @@ static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* g switch(gch->dwData) {
case IDM_LST_PARTICIPANT:
- ppro->AdminGet(gch->pDest->ptszID, xmlnsAdmin, _T("role"), _T("participant"), &CJabberProto::OnIqResultMucGetVoiceList);
+ ppro->AdminGet(gch->pDest->ptszID, JABBER_FEAT_MUC_ADMIN, _T("role"), _T("participant"), &CJabberProto::OnIqResultMucGetVoiceList);
break;
case IDM_LST_MEMBER:
- ppro->AdminGet(gch->pDest->ptszID, xmlnsAdmin, _T("affiliation"), _T("member"), &CJabberProto::OnIqResultMucGetMemberList);
+ ppro->AdminGet(gch->pDest->ptszID, JABBER_FEAT_MUC_ADMIN, _T("affiliation"), _T("member"), &CJabberProto::OnIqResultMucGetMemberList);
break;
case IDM_LST_MODERATOR:
- ppro->AdminGet(gch->pDest->ptszID, xmlnsAdmin, _T("role"), _T("moderator"), &CJabberProto::OnIqResultMucGetModeratorList);
+ ppro->AdminGet(gch->pDest->ptszID, JABBER_FEAT_MUC_ADMIN, _T("role"), _T("moderator"), &CJabberProto::OnIqResultMucGetModeratorList);
break;
case IDM_LST_BAN:
- ppro->AdminGet(gch->pDest->ptszID, xmlnsAdmin, _T("affiliation"), _T("outcast"), &CJabberProto::OnIqResultMucGetBanList);
+ ppro->AdminGet(gch->pDest->ptszID, JABBER_FEAT_MUC_ADMIN, _T("affiliation"), _T("outcast"), &CJabberProto::OnIqResultMucGetBanList);
break;
case IDM_LST_ADMIN:
- ppro->AdminGet(gch->pDest->ptszID, xmlnsAdmin, _T("affiliation"), _T("admin"), &CJabberProto::OnIqResultMucGetAdminList);
+ ppro->AdminGet(gch->pDest->ptszID, JABBER_FEAT_MUC_ADMIN, _T("affiliation"), _T("admin"), &CJabberProto::OnIqResultMucGetAdminList);
break;
case IDM_LST_OWNER:
- ppro->AdminGet(gch->pDest->ptszID, xmlnsAdmin, _T("affiliation"), _T("owner"), &CJabberProto::OnIqResultMucGetOwnerList);
+ ppro->AdminGet(gch->pDest->ptszID, JABBER_FEAT_MUC_ADMIN, _T("affiliation"), _T("owner"), &CJabberProto::OnIqResultMucGetOwnerList);
break;
case IDM_TOPIC:
@@ -1383,7 +1378,7 @@ static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* g ppro->IqAdd(iqId, IQ_PROC_NONE, &CJabberProto::OnIqResultGetMuc);
XmlNodeIq iq(_T("get"), iqId, gch->pDest->ptszID);
- iq << XQUERY(xmlnsOwner);
+ iq << XQUERY(JABBER_FEAT_MUC_OWNER);
ppro->m_ThreadInfo->send(iq);
break;
}
@@ -1407,7 +1402,7 @@ static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* g break;
ppro->m_ThreadInfo->send(
- XmlNodeIq(_T("set"), ppro->SerialNext(), gch->pDest->ptszID) << XQUERY(xmlnsOwner)
+ XmlNodeIq(_T("set"), ppro->SerialNext(), gch->pDest->ptszID) << XQUERY(JABBER_FEAT_MUC_OWNER)
<< XCHILD(_T("destroy")) << XCHILD(_T("reason"), szBuffer));
case IDM_LEAVE:
@@ -1523,7 +1518,7 @@ int CJabberProto::JabberGcEventHook(WPARAM, LPARAM lParam) case GC_USER_CHANMGR:
int iqId = SerialNext();
IqAdd(iqId, IQ_PROC_NONE, &CJabberProto::OnIqResultGetMuc);
- m_ThreadInfo->send( XmlNodeIq(_T("get"), iqId, item->jid) << XQUERY(xmlnsOwner));
+ m_ThreadInfo->send( XmlNodeIq(_T("get"), iqId, item->jid) << XQUERY(JABBER_FEAT_MUC_OWNER));
break;
}
@@ -1536,8 +1531,8 @@ void CJabberProto::AddMucListItem(JABBER_MUC_JIDLIST_INFO* jidListInfo, TCHAR* s const TCHAR *field = (jidListInfo->type == MUC_BANLIST || _tcschr(str,'@')) ? _T("jid") : _T("nick");
TCHAR* roomJid = jidListInfo->roomJid;
if (jidListInfo->type == MUC_BANLIST) {
- AdminSetReason(roomJid, xmlnsAdmin, field, str, _T("affiliation"), _T("outcast"), rsn);
- AdminGet(roomJid, xmlnsAdmin, _T("affiliation"), _T("outcast"), &CJabberProto::OnIqResultMucGetBanList);
+ AdminSetReason(roomJid, JABBER_FEAT_MUC_ADMIN, field, str, _T("affiliation"), _T("outcast"), rsn);
+ AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, _T("affiliation"), _T("outcast"), &CJabberProto::OnIqResultMucGetBanList);
} }
void CJabberProto::AddMucListItem(JABBER_MUC_JIDLIST_INFO* jidListInfo, TCHAR* str)
@@ -1547,28 +1542,28 @@ void CJabberProto::AddMucListItem(JABBER_MUC_JIDLIST_INFO* jidListInfo, TCHAR* s switch (jidListInfo->type) {
case MUC_VOICELIST:
- AdminSet(roomJid, xmlnsAdmin, field, str, _T("role"), _T("participant"));
- AdminGet(roomJid, xmlnsAdmin, _T("role"), _T("participant"), &CJabberProto::OnIqResultMucGetVoiceList);
+ AdminSet(roomJid, JABBER_FEAT_MUC_ADMIN, field, str, _T("role"), _T("participant"));
+ AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, _T("role"), _T("participant"), &CJabberProto::OnIqResultMucGetVoiceList);
break;
case MUC_MEMBERLIST:
- AdminSet(roomJid, xmlnsAdmin, field, str, _T("affiliation"), _T("member"));
- AdminGet(roomJid, xmlnsAdmin, _T("affiliation"), _T("member"), &CJabberProto::OnIqResultMucGetMemberList);
+ AdminSet(roomJid, JABBER_FEAT_MUC_ADMIN, field, str, _T("affiliation"), _T("member"));
+ AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, _T("affiliation"), _T("member"), &CJabberProto::OnIqResultMucGetMemberList);
break;
case MUC_MODERATORLIST:
- AdminSet(roomJid, xmlnsAdmin, field, str, _T("role"), _T("moderator"));
- AdminGet(roomJid, xmlnsAdmin, _T("role"), _T("moderator"), &CJabberProto::OnIqResultMucGetModeratorList);
+ AdminSet(roomJid, JABBER_FEAT_MUC_ADMIN, field, str, _T("role"), _T("moderator"));
+ AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, _T("role"), _T("moderator"), &CJabberProto::OnIqResultMucGetModeratorList);
break;
case MUC_BANLIST:
- AdminSet(roomJid, xmlnsAdmin, field, str, _T("affiliation"), _T("outcast"));
- AdminGet(roomJid, xmlnsAdmin, _T("affiliation"), _T("outcast"), &CJabberProto::OnIqResultMucGetBanList);
+ AdminSet(roomJid, JABBER_FEAT_MUC_ADMIN, field, str, _T("affiliation"), _T("outcast"));
+ AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, _T("affiliation"), _T("outcast"), &CJabberProto::OnIqResultMucGetBanList);
break;
case MUC_ADMINLIST:
- AdminSet(roomJid, xmlnsAdmin, field, str, _T("affiliation"), _T("admin"));
- AdminGet(roomJid, xmlnsAdmin, _T("affiliation"), _T("admin"), &CJabberProto::OnIqResultMucGetAdminList);
+ AdminSet(roomJid, JABBER_FEAT_MUC_ADMIN, field, str, _T("affiliation"), _T("admin"));
+ AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, _T("affiliation"), _T("admin"), &CJabberProto::OnIqResultMucGetAdminList);
break;
case MUC_OWNERLIST:
- AdminSet(roomJid, xmlnsAdmin, field, str, _T("affiliation"), _T("owner"));
- AdminGet(roomJid, xmlnsAdmin, _T("affiliation"), _T("owner"), &CJabberProto::OnIqResultMucGetOwnerList);
+ AdminSet(roomJid, JABBER_FEAT_MUC_ADMIN, field, str, _T("affiliation"), _T("owner"));
+ AdminGet(roomJid, JABBER_FEAT_MUC_ADMIN, _T("affiliation"), _T("owner"), &CJabberProto::OnIqResultMucGetOwnerList);
break;
} }
@@ -1578,19 +1573,19 @@ void CJabberProto::DeleteMucListItem(JABBER_MUC_JIDLIST_INFO* jidListInfo, TCHAR switch (jidListInfo->type) {
case MUC_VOICELIST: // change role to visitor (from participant)
- AdminSet(roomJid, xmlnsAdmin, _T("jid"), jid, _T("role"), _T("visitor"));
+ AdminSet(roomJid, JABBER_FEAT_MUC_ADMIN, _T("jid"), jid, _T("role"), _T("visitor"));
break;
case MUC_BANLIST: // change affiliation to none (from outcast)
case MUC_MEMBERLIST: // change affiliation to none (from member)
- AdminSet(roomJid, xmlnsAdmin, _T("jid"), jid, _T("affiliation"), _T("none"));
+ AdminSet(roomJid, JABBER_FEAT_MUC_ADMIN, _T("jid"), jid, _T("affiliation"), _T("none"));
break;
case MUC_MODERATORLIST: // change role to participant (from moderator)
- AdminSet(roomJid, xmlnsAdmin, _T("jid"), jid, _T("role"), _T("participant"));
+ AdminSet(roomJid, JABBER_FEAT_MUC_ADMIN, _T("jid"), jid, _T("role"), _T("participant"));
break;
case MUC_ADMINLIST: // change affiliation to member (from admin)
- AdminSet(roomJid, xmlnsAdmin, _T("jid"), jid, _T("affiliation"), _T("member"));
+ AdminSet(roomJid, JABBER_FEAT_MUC_ADMIN, _T("jid"), jid, _T("affiliation"), _T("member"));
break;
case MUC_OWNERLIST: // change affiliation to admin (from owner)
- AdminSet(roomJid, xmlnsAdmin, _T("jid"), jid, _T("affiliation"), _T("admin"));
+ AdminSet(roomJid, JABBER_FEAT_MUC_ADMIN, _T("jid"), jid, _T("affiliation"), _T("admin"));
break;
} }
diff --git a/protocols/JabberG/src/jabber_disco.cpp b/protocols/JabberG/src/jabber_disco.cpp index 1d12223d3f..ec85c64e51 100644 --- a/protocols/JabberG/src/jabber_disco.cpp +++ b/protocols/JabberG/src/jabber_disco.cpp @@ -157,10 +157,10 @@ static struct {NULL, _T("user"), NULL, NULL, SKINICON_STATUS_ONLINE},
// icon suggestions based on supported features
- {_T("jabber:iq:gateway"), NULL,NULL, "Agents", 0},
- {_T("jabber:iq:search"), NULL,NULL, NULL, SKINICON_OTHER_FINDUSER},
- {_T(JABBER_FEAT_COMMANDS), NULL,NULL, "adhoc", 0},
- {_T(JABBER_FEAT_REGISTER), NULL,NULL, "key", 0},
+ {_T("jabber:iq:gateway"), NULL, NULL, "Agents", 0},
+ {_T("jabber:iq:search"), NULL, NULL, NULL, SKINICON_OTHER_FINDUSER},
+ { JABBER_FEAT_COMMANDS, NULL, NULL, "adhoc", 0},
+ { JABBER_FEAT_REGISTER, NULL, NULL, "key", 0},
};
static void sttApplyNodeIcon(HTREELISTITEM hItem, CJabberSDNode *pNode);
@@ -294,7 +294,7 @@ void CJabberProto::OnIqResultServiceDiscoveryRootItems(HXML iqNode, CJabberIqInf pNewInfo->SetTimeout(30000);
XmlNodeIq iq(pNewInfo);
- iq << XQUERY(_T(JABBER_FEAT_DISCO_INFO)) << XATTR(_T("node"), szNode);
+ iq << XQUERY(JABBER_FEAT_DISCO_INFO) << XATTR(_T("node"), szNode);
xmlAddChild(packet, iq);
} } }
m_SDManager.Unlock();
@@ -315,7 +315,7 @@ BOOL CJabberProto::SendInfoRequest(CJabberSDNode* pNode, HXML parent) pNode->SetInfoRequestId(pInfo->GetIqId());
XmlNodeIq iq(pInfo);
- HXML query = iq << XQUERY(_T(JABBER_FEAT_DISCO_INFO));
+ HXML query = iq << XQUERY(JABBER_FEAT_DISCO_INFO);
if (pNode->GetNode())
xmlAddAttr(query, _T("node"), pNode->GetNode());
@@ -345,7 +345,7 @@ BOOL CJabberProto::SendBothRequests(CJabberSDNode* pNode, HXML parent) pNode->SetInfoRequestId(pInfo->GetIqId());
XmlNodeIq iq(pInfo);
- HXML query = iq << XQUERY(_T(JABBER_FEAT_DISCO_INFO));
+ HXML query = iq << XQUERY(JABBER_FEAT_DISCO_INFO);
if (pNode->GetNode())
xmlAddAttr(query, _T("node"), pNode->GetNode());
@@ -362,7 +362,7 @@ BOOL CJabberProto::SendBothRequests(CJabberSDNode* pNode, HXML parent) pNode->SetItemsRequestId(pInfo->GetIqId());
XmlNodeIq iq(pInfo);
- HXML query = iq << XQUERY(_T(JABBER_FEAT_DISCO_ITEMS));
+ HXML query = iq << XQUERY(JABBER_FEAT_DISCO_ITEMS);
if (pNode->GetNode())
xmlAddAttr(query, _T("node"), pNode->GetNode());
@@ -420,10 +420,10 @@ void CJabberProto::PerformBrowse(HWND hwndDlg) sttBrowseMode = SD_BROWSE_CONFERENCES;
TCHAR *szServerJid = mir_a2t(m_ThreadInfo->server);
CJabberIqInfo* pInfo = m_iqManager.AddHandler(&CJabberProto::OnIqResultServiceDiscoveryRootItems, JABBER_IQ_TYPE_GET, szServerJid);
- pInfo->m_pUserData = (void*)_T(JABBER_FEAT_MUC);
+ pInfo->m_pUserData = (void*)JABBER_FEAT_MUC;
pInfo->SetTimeout(30000);
XmlNodeIq iq(pInfo);
- iq << XQUERY(_T(JABBER_FEAT_DISCO_ITEMS));
+ iq << XQUERY(JABBER_FEAT_DISCO_ITEMS);
m_ThreadInfo->send(iq);
mir_free(szServerJid);
}
@@ -434,7 +434,7 @@ void CJabberProto::PerformBrowse(HWND hwndDlg) pInfo->m_pUserData = (void*)_T("jabber:iq:gateway");
pInfo->SetTimeout(30000);
XmlNodeIq iq(pInfo);
- iq << XQUERY(_T(JABBER_FEAT_DISCO_ITEMS));
+ iq << XQUERY(JABBER_FEAT_DISCO_ITEMS);
m_ThreadInfo->send(iq);
mir_free(szServerJid);
}
@@ -1190,29 +1190,29 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM }
static items[] =
{
- { NULL, LPGENT("Contact Menu..."), SD_ACT_USERMENU, SD_FLG_NONODE},
- { NULL, LPGENT("View vCard"), SD_ACT_VCARD, SD_FLG_NONODE},
- { _T(JABBER_FEAT_MUC), LPGENT("Join chatroom"), SD_ACT_JOIN, SD_FLG_NORESOURCE},
+ { NULL, LPGENT("Contact Menu..."), SD_ACT_USERMENU, SD_FLG_NONODE},
+ { NULL, LPGENT("View vCard"), SD_ACT_VCARD, SD_FLG_NONODE},
+ { JABBER_FEAT_MUC, LPGENT("Join chatroom"), SD_ACT_JOIN, SD_FLG_NORESOURCE},
{0},
- { NULL, LPGENT("Refresh Info"), SD_ACT_REFRESH},
- { NULL, LPGENT("Refresh Children"), SD_ACT_REFRESHCHILDREN},
+ { NULL, LPGENT("Refresh Info"), SD_ACT_REFRESH},
+ { NULL, LPGENT("Refresh Children"), SD_ACT_REFRESHCHILDREN},
{0},
- { NULL, LPGENT("Add to favorites"), SD_ACT_FAVORITE},
- { NULL, LPGENT("Add to roster"), SD_ACT_ROSTER, SD_FLG_NONODE|SD_FLG_NOTONROSTER},
- { _T(JABBER_FEAT_MUC), LPGENT("Bookmark chatroom"), SD_ACT_BOOKMARK, SD_FLG_NORESOURCE|SD_FLG_HASUSER},
- { _T("jabber:iq:search"), LPGENT("Add search directory"), SD_ACT_ADDDIRECTORY},
- { _T(JABBER_FEAT_BYTESTREAMS), LPGENT("Use this proxy"), SD_ACT_PROXY},
+ { NULL, LPGENT("Add to favorites"), SD_ACT_FAVORITE},
+ { NULL, LPGENT("Add to roster"), SD_ACT_ROSTER, SD_FLG_NONODE|SD_FLG_NOTONROSTER},
+ { JABBER_FEAT_MUC, LPGENT("Bookmark chatroom"), SD_ACT_BOOKMARK, SD_FLG_NORESOURCE|SD_FLG_HASUSER},
+ { _T("jabber:iq:search"), LPGENT("Add search directory"), SD_ACT_ADDDIRECTORY},
+ { JABBER_FEAT_BYTESTREAMS, LPGENT("Use this proxy"), SD_ACT_PROXY},
{0},
- { _T(JABBER_FEAT_REGISTER), LPGENT("Register"), SD_ACT_REGISTER},
- { _T("jabber:iq:gateway"), LPGENT("Unregister"), SD_ACT_UNREGISTER, SD_FLG_ONROSTER|SD_FLG_SUBSCRIBED},
- { _T(JABBER_FEAT_COMMANDS), LPGENT("Commands..."), SD_ACT_ADHOC},
+ { JABBER_FEAT_REGISTER, LPGENT("Register"), SD_ACT_REGISTER},
+ { _T("jabber:iq:gateway"), LPGENT("Unregister"), SD_ACT_UNREGISTER, SD_FLG_ONROSTER|SD_FLG_SUBSCRIBED},
+ { JABBER_FEAT_COMMANDS, LPGENT("Commands..."), SD_ACT_ADHOC},
{0},
- { _T("jabber:iq:gateway"), LPGENT("Logon"), SD_ACT_LOGON, SD_FLG_ONROSTER|SD_FLG_SUBSCRIBED|SD_FLG_ONLINE},
- { _T("jabber:iq:gateway"), LPGENT("Logoff"), SD_ACT_LOGOFF, SD_FLG_ONROSTER|SD_FLG_SUBSCRIBED|SD_FLG_NOTONLINE},
+ { _T("jabber:iq:gateway"), LPGENT("Logon"), SD_ACT_LOGON, SD_FLG_ONROSTER|SD_FLG_SUBSCRIBED|SD_FLG_ONLINE},
+ { _T("jabber:iq:gateway"), LPGENT("Logoff"), SD_ACT_LOGOFF, SD_FLG_ONROSTER|SD_FLG_SUBSCRIBED|SD_FLG_NOTONLINE},
{0},
- { NULL, LPGENT("Copy JID"), SD_ACT_COPYJID},
- { NULL, LPGENT("Copy node name"), SD_ACT_COPYNODE},
- { NULL, LPGENT("Copy node information"), SD_ACT_COPYINFO},
+ { NULL, LPGENT("Copy JID"), SD_ACT_COPYJID},
+ { NULL, LPGENT("Copy node name"), SD_ACT_COPYNODE},
+ { NULL, LPGENT("Copy node information"), SD_ACT_COPYINFO},
};
HMENU hMenu = CreatePopupMenu();
@@ -1464,9 +1464,9 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM break;
case SD_ACT_UNREGISTER:
- m_ThreadInfo->send( XmlNodeIq(_T("set"), SerialNext(), pNode->GetJid()) << XQUERY(_T(JABBER_FEAT_REGISTER)) << XCHILD(_T("remove")));
+ m_ThreadInfo->send( XmlNodeIq(_T("set"), SerialNext(), pNode->GetJid()) << XQUERY(JABBER_FEAT_REGISTER) << XCHILD(_T("remove")));
- m_ThreadInfo->send( XmlNodeIq(_T("set"), SerialNext()) << XQUERY(_T(JABBER_FEAT_IQ_ROSTER))
+ m_ThreadInfo->send( XmlNodeIq(_T("set"), SerialNext()) << XQUERY(JABBER_FEAT_IQ_ROSTER)
<< XCHILD(_T("item")) << XATTR(_T("jid"), pNode->GetJid()) << XATTR(_T("subscription"), _T("remove")));
break;
diff --git a/protocols/JabberG/src/jabber_events.cpp b/protocols/JabberG/src/jabber_events.cpp index 2a66c60b84..ecb18ef9e3 100644 --- a/protocols/JabberG/src/jabber_events.cpp +++ b/protocols/JabberG/src/jabber_events.cpp @@ -52,11 +52,11 @@ int CJabberProto::OnContactDeleted(WPARAM wParam, LPARAM) JabberStripJid(m_ThreadInfo->fullJID, szStrippedJid, SIZEOF(szStrippedJid));
TCHAR *szDog = _tcschr(szStrippedJid, _T('@'));
if (szDog && _tcsicmp(szDog + 1, dbv.ptszVal))
- m_ThreadInfo->send( XmlNodeIq(_T("set"), SerialNext(), dbv.ptszVal) << XQUERY(_T(JABBER_FEAT_REGISTER)) << XCHILD(_T("remove")));
+ m_ThreadInfo->send( XmlNodeIq(_T("set"), SerialNext(), dbv.ptszVal) << XQUERY(JABBER_FEAT_REGISTER) << XCHILD(_T("remove")));
}
// Remove from roster, server also handles the presence unsubscription process.
- m_ThreadInfo->send( XmlNodeIq(_T("set"), SerialNext()) << XQUERY(_T(JABBER_FEAT_IQ_ROSTER))
+ m_ThreadInfo->send( XmlNodeIq(_T("set"), SerialNext()) << XQUERY(JABBER_FEAT_IQ_ROSTER)
<< XCHILD(_T("item")) << XATTR(_T("jid"), dbv.ptszVal) << XATTR(_T("subscription"), _T("remove")));
}
diff --git a/protocols/JabberG/src/jabber_file.cpp b/protocols/JabberG/src/jabber_file.cpp index e7ed1f618f..159b0fae11 100644 --- a/protocols/JabberG/src/jabber_file.cpp +++ b/protocols/JabberG/src/jabber_file.cpp @@ -325,7 +325,7 @@ void __cdecl CJabberProto::FileServerThread(filetransfer *ft) wsprintf(fulljid, _T("%s/%s"), ft->jid, ptszResource);
XmlNodeIq iq(_T("set"), id, fulljid);
- HXML query = iq << XQUERY(_T(JABBER_FEAT_OOB));
+ HXML query = iq << XQUERY(JABBER_FEAT_OOB);
query << XCHILD(_T("url"), _A2T(szAddr));
query << XCHILD(_T("desc"), ft->szDescription);
m_ThreadInfo->send(iq);
diff --git a/protocols/JabberG/src/jabber_form.cpp b/protocols/JabberG/src/jabber_form.cpp index a24f0da353..7dc680f5d0 100644 --- a/protocols/JabberG/src/jabber_form.cpp +++ b/protocols/JabberG/src/jabber_form.cpp @@ -608,7 +608,7 @@ HXML JabberFormGetData(HWND hwndStatic, HXML xNode) hFrame = hwndStatic;
id = 0;
XmlNode x(_T("x"));
- x << XATTR(_T("xmlns"), _T(JABBER_FEAT_DATA_FORMS)) << XATTR(_T("type"), _T("submit"));
+ x << XATTR(_T("xmlns"), JABBER_FEAT_DATA_FORMS) << XATTR(_T("type"), _T("submit"));
for (int i=0; ; i++) {
n = xmlGetChild(xNode ,i);
diff --git a/protocols/JabberG/src/jabber_ft.cpp b/protocols/JabberG/src/jabber_ft.cpp index 9f32f62e2b..bb73cc35ee 100644 --- a/protocols/JabberG/src/jabber_ft.cpp +++ b/protocols/JabberG/src/jabber_ft.cpp @@ -106,13 +106,13 @@ void CJabberProto::FtInitiate(TCHAR* jid, filetransfer *ft) mir_sntprintf(tszJid, SIZEOF(tszJid), _T("%s/%s"), jid, rs);
XmlNodeIq iq(m_iqManager.AddHandler(&CJabberProto::OnFtSiResult, JABBER_IQ_TYPE_SET, tszJid, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_TO, -1, ft));
- HXML si = iq << XCHILDNS(_T("si"), _T(JABBER_FEAT_SI)) << XATTR(_T("id"), sid)
- << XATTR(_T("mime-type"), _T("binary/octet-stream")) << XATTR(_T("profile"), _T(JABBER_FEAT_SI_FT));
- si << XCHILDNS(_T("file"), _T(JABBER_FEAT_SI_FT)) << XATTR(_T("name"), filename)
+ HXML si = iq << XCHILDNS(_T("si"), JABBER_FEAT_SI) << XATTR(_T("id"), sid)
+ << XATTR(_T("mime-type"), _T("binary/octet-stream")) << XATTR(_T("profile"), JABBER_FEAT_SI_FT);
+ si << XCHILDNS(_T("file"), JABBER_FEAT_SI_FT) << XATTR(_T("name"), filename)
<< XATTRI64(_T("size"), ft->fileSize[ ft->std.currentFileNumber ]) << XCHILD(_T("desc"), ft->szDescription);
- HXML field = si << XCHILDNS(_T("feature"), _T(JABBER_FEAT_FEATURE_NEG))
- << XCHILDNS(_T("x"), _T(JABBER_FEAT_DATA_FORMS)) << XATTR(_T("type"), _T("form"))
+ HXML field = si << XCHILDNS(_T("feature"), JABBER_FEAT_FEATURE_NEG)
+ << XCHILDNS(_T("x"), JABBER_FEAT_DATA_FORMS) << XATTR(_T("type"), _T("form"))
<< XCHILD(_T("field")) << XATTR(_T("var"), _T("stream-method")) << XATTR(_T("type"), _T("list-single"));
BOOL bDirect = m_options.BsDirect;
@@ -120,9 +120,9 @@ void CJabberProto::FtInitiate(TCHAR* jid, filetransfer *ft) // bytestreams support?
if (bDirect || bProxy)
- field << XCHILD(_T("option")) << XCHILD(_T("value"), _T(JABBER_FEAT_BYTESTREAMS));
+ field << XCHILD(_T("option")) << XCHILD(_T("value"), JABBER_FEAT_BYTESTREAMS);
- field << XCHILD(_T("option")) << XCHILD(_T("value"), _T(JABBER_FEAT_IBB));
+ field << XCHILD(_T("option")) << XCHILD(_T("value"), JABBER_FEAT_IBB);
m_ThreadInfo->send(iq);
}
@@ -140,10 +140,10 @@ void CJabberProto::OnFtSiResult(HXML iqNode, CJabberIqInfo* pInfo) BOOL bProxy = m_options.BsProxyManual;
if ((featureNode = xmlGetChild(siNode , "feature")) != NULL) {
- if ((xNode = xmlGetChildByTag(featureNode, "x", "xmlns", _T(JABBER_FEAT_DATA_FORMS))) != NULL) {
+ if ((xNode = xmlGetChildByTag(featureNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS)) != NULL) {
if ((fieldNode = xmlGetChildByTag(xNode, "field", "var", _T("stream-method"))) != NULL) {
if ((valueNode = xmlGetChild(fieldNode , "value"))!=NULL && xmlGetText(valueNode)!=NULL) {
- if ((bDirect || bProxy) && !_tcscmp(xmlGetText(valueNode), _T(JABBER_FEAT_BYTESTREAMS))) {
+ if ((bDirect || bProxy) && !_tcscmp(xmlGetText(valueNode), JABBER_FEAT_BYTESTREAMS)) {
// Start Bytestream session
JABBER_BYTE_TRANSFER *jbt = new JABBER_BYTE_TRANSFER;
ZeroMemory(jbt, sizeof(JABBER_BYTE_TRANSFER));
@@ -156,7 +156,7 @@ void CJabberProto::OnFtSiResult(HXML iqNode, CJabberIqInfo* pInfo) ft->type = FT_BYTESTREAM;
ft->jbt = jbt;
ForkThread((MyThreadFunc)&CJabberProto::ByteSendThread, jbt);
- } else if ( !_tcscmp(xmlGetText(valueNode), _T(JABBER_FEAT_IBB))) {
+ } else if ( !_tcscmp(xmlGetText(valueNode), JABBER_FEAT_IBB)) {
JABBER_IBB_TRANSFER *jibb = (JABBER_IBB_TRANSFER *) mir_alloc(sizeof (JABBER_IBB_TRANSFER));
ZeroMemory(jibb, sizeof(JABBER_IBB_TRANSFER));
jibb->srcJID = mir_tstrdup(pInfo->m_szTo);
@@ -241,10 +241,10 @@ BOOL CJabberProto::FtIbbSend(int blocksize, filetransfer *ft) char *encoded = JabberBase64Encode(buffer, numRead);
- msg << XCHILD(_T("data"), _A2T(encoded)) << XATTR(_T("xmlns"), _T(JABBER_FEAT_IBB))
+ msg << XCHILD(_T("data"), _A2T(encoded)) << XATTR(_T("xmlns"), JABBER_FEAT_IBB)
<< XATTR(_T("sid"), ft->jibb->sid) << XATTRI(_T("seq"), ft->jibb->wPacketId);
- HXML ampNode = msg << XCHILDNS(_T("amp"), _T(JABBER_FEAT_AMP));
+ HXML ampNode = msg << XCHILDNS(_T("amp"), JABBER_FEAT_AMP);
ampNode << XCHILD(_T("rule")) << XATTR(_T("condition"), _T("deliver-at"))
<< XATTR(_T("value"), _T("stored")) << XATTR(_T("action"), _T("error"));
ampNode << XCHILD(_T("rule")) << XATTR(_T("condition"), _T("match-resource"))
@@ -305,18 +305,18 @@ void CJabberProto::FtHandleSiRequest(HXML iqNode) if ( !iqNode ||
(from = xmlGetAttrValue(iqNode, _T("from"))) == NULL ||
(str = xmlGetAttrValue(iqNode, _T("type"))) == NULL || _tcscmp(str, _T("set")) ||
- (siNode = xmlGetChildByTag(iqNode, "si", "xmlns", _T(JABBER_FEAT_SI))) == NULL)
+ (siNode = xmlGetChildByTag(iqNode, "si", "xmlns", JABBER_FEAT_SI)) == NULL)
return;
szId = xmlGetAttrValue(iqNode, _T("id"));
if ((sid = xmlGetAttrValue(siNode, _T("id"))) != NULL &&
- (fileNode = xmlGetChildByTag(siNode, "file", "xmlns", _T(JABBER_FEAT_SI_FT))) != NULL &&
+ (fileNode = xmlGetChildByTag(siNode, "file", "xmlns", JABBER_FEAT_SI_FT)) != NULL &&
(filename = xmlGetAttrValue(fileNode, _T("name"))) != NULL &&
(str = xmlGetAttrValue(fileNode, _T("size"))) != NULL) {
filesize = _ttoi64(str);
- if ((featureNode = xmlGetChildByTag(siNode, "feature", "xmlns", _T(JABBER_FEAT_FEATURE_NEG))) != NULL &&
- (xNode = xmlGetChildByTag(featureNode, "x", "xmlns", _T(JABBER_FEAT_DATA_FORMS)))!=NULL &&
+ if ((featureNode = xmlGetChildByTag(siNode, "feature", "xmlns", JABBER_FEAT_FEATURE_NEG)) != NULL &&
+ (xNode = xmlGetChildByTag(featureNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS)) != NULL &&
(fieldNode = xmlGetChildByTag(xNode, "field", "var", _T("stream-method")))!=NULL) {
BOOL bIbbOnly = m_options.BsOnlyIBB;
@@ -331,7 +331,7 @@ void CJabberProto::FtHandleSiRequest(HXML iqNode) if ( !lstrcmp(xmlGetName(optionNode), _T("option"))) {
if ((n = xmlGetChild(optionNode , "value")) != NULL && xmlGetText(n)) {
- if ( !_tcscmp(xmlGetText(n), _T(JABBER_FEAT_BYTESTREAMS))) {
+ if ( !_tcscmp(xmlGetText(n), JABBER_FEAT_BYTESTREAMS)) {
ftType = FT_BYTESTREAM;
break;
} } } } }
@@ -345,7 +345,7 @@ void CJabberProto::FtHandleSiRequest(HXML iqNode) if ( !lstrcmp(xmlGetName(optionNode), _T("option"))) {
if ((n = xmlGetChild(optionNode , "value")) != NULL && xmlGetText(n)) {
- if ( !_tcscmp(xmlGetText(n), _T(JABBER_FEAT_IBB))) {
+ if ( !_tcscmp(xmlGetText(n), JABBER_FEAT_IBB)) {
ftType = FT_IBB;
break;
} } } } }
@@ -380,7 +380,7 @@ void CJabberProto::FtHandleSiRequest(HXML iqNode) XmlNodeIq iq(_T("error"), szId, from);
HXML e = iq << XCHILD(_T("error")) << XATTRI(_T("code"), 400) << XATTR(_T("type"), _T("cancel"));
e << XCHILDNS(_T("bad-request"), _T("urn:ietf:params:xml:ns:xmpp-stanzas"));
- e << XCHILDNS(_T("no-valid-streams"), _T(JABBER_FEAT_SI));
+ e << XCHILDNS(_T("no-valid-streams"), JABBER_FEAT_SI);
m_ThreadInfo->send(iq);
return;
} } }
@@ -389,7 +389,7 @@ void CJabberProto::FtHandleSiRequest(HXML iqNode) XmlNodeIq iq(_T("error"), szId, from);
HXML e = iq << XCHILD(_T("error")) << XATTRI(_T("code"), 400) << XATTR(_T("type"), _T("cancel"));
e << XCHILDNS(_T("bad-request"), _T("urn:ietf:params:xml:ns:xmpp-stanzas"));
- e << XCHILDNS(_T("bad-profile"), _T(JABBER_FEAT_SI));
+ e << XCHILDNS(_T("bad-profile"), JABBER_FEAT_SI);
m_ThreadInfo->send(iq);
}
@@ -403,11 +403,11 @@ void CJabberProto::FtAcceptSiRequest(filetransfer *ft) m_ThreadInfo->send(
XmlNodeIq(_T("result"), ft->iqId, ft->jid)
- << XCHILDNS(_T("si"), _T(JABBER_FEAT_SI))
- << XCHILDNS(_T("feature"), _T(JABBER_FEAT_FEATURE_NEG))
- << XCHILDNS(_T("x"), _T(JABBER_FEAT_DATA_FORMS)) << XATTR(_T("type"), _T("submit"))
+ << XCHILDNS(_T("si"), JABBER_FEAT_SI)
+ << XCHILDNS(_T("feature"), JABBER_FEAT_FEATURE_NEG)
+ << XCHILDNS(_T("x"), JABBER_FEAT_DATA_FORMS) << XATTR(_T("type"), _T("submit"))
<< XCHILD(_T("field")) << XATTR(_T("var"), _T("stream-method"))
- << XCHILD(_T("value"), _T(JABBER_FEAT_BYTESTREAMS)));
+ << XCHILD(_T("value"), JABBER_FEAT_BYTESTREAMS));
} }
void CJabberProto::FtAcceptIbbRequest(filetransfer *ft)
@@ -420,11 +420,11 @@ void CJabberProto::FtAcceptIbbRequest(filetransfer *ft) m_ThreadInfo->send(
XmlNodeIq(_T("result"), ft->iqId, ft->jid)
- << XCHILDNS(_T("si"), _T(JABBER_FEAT_SI))
- << XCHILDNS(_T("feature"), _T(JABBER_FEAT_FEATURE_NEG))
- << XCHILDNS(_T("x"), _T(JABBER_FEAT_DATA_FORMS)) << XATTR(_T("type"), _T("submit"))
+ << XCHILDNS(_T("si"), JABBER_FEAT_SI)
+ << XCHILDNS(_T("feature"), JABBER_FEAT_FEATURE_NEG)
+ << XCHILDNS(_T("x"), JABBER_FEAT_DATA_FORMS) << XATTR(_T("type"), _T("submit"))
<< XCHILD(_T("field")) << XATTR(_T("var"), _T("stream-method"))
- << XCHILD(_T("value"), _T(JABBER_FEAT_IBB)));
+ << XCHILD(_T("value"), JABBER_FEAT_IBB));
} }
BOOL CJabberProto::FtHandleBytestreamRequest(HXML iqNode, CJabberIqInfo* pInfo)
@@ -461,7 +461,7 @@ BOOL CJabberProto::FtHandleIbbRequest(HXML iqNode, BOOL bOpen) const TCHAR *to = xmlGetAttrValue(iqNode, _T("to"));
if ( !id || !from || !to) return FALSE;
- HXML ibbNode = xmlGetChildByTag(iqNode, bOpen ? "open" : "close", "xmlns", _T(JABBER_FEAT_IBB));
+ HXML ibbNode = xmlGetChildByTag(iqNode, bOpen ? "open" : "close", "xmlns", JABBER_FEAT_IBB);
if ( !ibbNode) return FALSE;
const TCHAR *sid = xmlGetAttrValue(ibbNode, _T("sid"));
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp index 71dfb28880..5dc517a445 100644 --- a/protocols/JabberG/src/jabber_groupchat.cpp +++ b/protocols/JabberG/src/jabber_groupchat.cpp @@ -307,7 +307,7 @@ void CJabberProto::GroupchatJoinRoom(const TCHAR *server, const TCHAR *room, con replaceStrT(item->password, info.password);
int status = (m_iStatus == ID_STATUS_INVISIBLE) ? ID_STATUS_ONLINE : m_iStatus;
- XmlNode x(_T("x")); x << XATTR(_T("xmlns"), _T(JABBER_FEAT_MUC));
+ XmlNode x(_T("x")); x << XATTR(_T("xmlns"), JABBER_FEAT_MUC);
if (info.password && info.password[0])
x << XCHILD(_T("password"), info.password);
@@ -699,7 +699,7 @@ INT_PTR CJabberDlgGcJoin::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) CJabberIqInfo *pInfo = m_proto->m_iqManager.AddHandler(&CJabberProto::OnIqResultDiscovery, JABBER_IQ_TYPE_GET, server, 0, -1, (void*)GetDlgItem(m_hwnd, IDC_ROOM));
pInfo->SetTimeout(30000);
XmlNodeIq iq(pInfo);
- iq << XQUERY(_T(JABBER_FEAT_DISCO_ITEMS));
+ iq << XQUERY(JABBER_FEAT_DISCO_ITEMS);
m_proto->m_ThreadInfo->send(iq);
SetWindowLongPtr(GetDlgItem(m_hwnd, IDC_ROOM), GWLP_USERDATA, pInfo->GetIqId());
@@ -912,11 +912,7 @@ void CJabberProto::RenameParticipantNick(JABBER_LIST_ITEM *item, const TCHAR *ol void CJabberProto::GroupchatProcessPresence(HXML node)
{
- HXML showNode, statusNode, itemNode, n, priorityNode;
const TCHAR *from;
- int status, newRes = 0;
- bool bStatusChanged = false;
- BOOL roomCreated;
if ( !node || !xmlGetName(node) || lstrcmp(xmlGetName(node), _T("presence"))) return;
if ((from = xmlGetAttrValue(node, _T("from"))) == NULL) return;
@@ -931,9 +927,9 @@ void CJabberProto::GroupchatProcessPresence(HXML node) JABBER_RESOURCE_STATUS *r = GcFindResource(item, resource);
- HXML nNode = xmlGetChildByTag(node, "nick", "xmlns", _T(JABBER_FEAT_NICK));
+ HXML nNode = xmlGetChildByTag(node, "nick", "xmlns", JABBER_FEAT_NICK);
if (nNode == NULL)
- nNode = xmlGetChildByTag(node, "nick:nick", "xmlns:nick", _T(JABBER_FEAT_NICK));
+ nNode = xmlGetChildByTag(node, "nick:nick", "xmlns:nick", JABBER_FEAT_NICK);
const TCHAR *cnick = nNode ? xmlGetText(nNode) : NULL;
const TCHAR *nick = cnick ? cnick : (r && r->nick ? r->nick : resource);
@@ -942,12 +938,10 @@ void CJabberProto::GroupchatProcessPresence(HXML node) if (cnick && r && r->nick && _tcscmp(cnick, r->nick))
replaceStrT(r->nick, cnick);
- HXML xNode = xmlGetChildByTag(node, "x", "xmlns", _T(JABBER_FEAT_MUC_USER));
- HXML xUserNode = xmlGetChildByTag(node, "user:x", "xmlns:user", _T(JABBER_FEAT_MUC_USER));
+ HXML xNode = xmlGetChildByTag(node, "x", "xmlns", JABBER_FEAT_MUC_USER);
+ HXML xUserNode = xmlGetChildByTag(node, "user:x", "xmlns:user", JABBER_FEAT_MUC_USER);
- itemNode = xmlGetChild(xNode , "item");
- if (itemNode == NULL)
- itemNode = xmlGetChild(xUserNode , "user:item");
+ HXML itemNode = xmlGetChild(xNode , "item");
const TCHAR *type = xmlGetAttrValue(node, _T("type"));
@@ -961,36 +955,28 @@ void CJabberProto::GroupchatProcessPresence(HXML node) item->iChatState = 0;
// Update status of room participant
- status = ID_STATUS_ONLINE;
- if ((showNode = xmlGetChild(node , "show")) != NULL) {
- if (xmlGetText(showNode) != NULL) {
- if ( !_tcscmp(xmlGetText(showNode) , _T("away"))) status = ID_STATUS_AWAY;
- else if ( !_tcscmp(xmlGetText(showNode) , _T("xa"))) status = ID_STATUS_NA;
- else if ( !_tcscmp(xmlGetText(showNode) , _T("dnd"))) status = ID_STATUS_DND;
- else if ( !_tcscmp(xmlGetText(showNode) , _T("chat"))) status = ID_STATUS_FREECHAT;
- } }
-
- statusNode = xmlGetChild(node , "status");
- if (statusNode == NULL)
- statusNode = xmlGetChild(node , "user:status");
+ int status = ID_STATUS_ONLINE;
+ LPCTSTR ptszShow = xmlGetText( xmlGetChild(node , "show"));
+ if (ptszShow) {
+ if ( !_tcscmp(ptszShow, _T("away"))) status = ID_STATUS_AWAY;
+ else if ( !_tcscmp(ptszShow, _T("xa"))) status = ID_STATUS_NA;
+ else if ( !_tcscmp(ptszShow, _T("dnd"))) status = ID_STATUS_DND;
+ else if ( !_tcscmp(ptszShow, _T("chat"))) status = ID_STATUS_FREECHAT;
+ }
- const TCHAR *str = statusNode ? xmlGetText(statusNode) : NULL;
+ LPCTSTR str = xmlGetText( xmlGetChild(node , "status"));
char priority = 0;
- if ((priorityNode = xmlGetChild(node , "priority")) != NULL && xmlGetText(priorityNode) != NULL)
- priority = (char)_ttoi(xmlGetText(priorityNode));
+ if (LPCTSTR ptszPriority = xmlGetText( xmlGetChild(node , "priority")))
+ priority = (char)_ttoi(ptszPriority);
+
+ bool bStatusChanged = false, bRoomCreated = false, bAffiliationChanged = false, bRoleChanged = false;
+ int newRes = (ListAddResource(LIST_CHATROOM, from, status, str, priority, cnick) == 0) ? 0 : GC_EVENT_JOIN;
if (JABBER_RESOURCE_STATUS *oldRes = ListFindResource(LIST_CHATROOM, from))
if ((oldRes->status != status) || lstrcmp_null(oldRes->statusMessage, str))
bStatusChanged = true;
- newRes = (ListAddResource(LIST_CHATROOM, from, status, str, priority, cnick) == 0) ? 0 : GC_EVENT_JOIN;
-
- roomCreated = FALSE;
-
- bool bAffiliationChanged = false;
- bool bRoleChanged = false;
-
// Check additional MUC info for this user
if (itemNode != NULL) {
if (r == NULL)
@@ -1000,17 +986,17 @@ void CJabberProto::GroupchatProcessPresence(HXML node) JABBER_GC_ROLE role = r->role;
if ((str = xmlGetAttrValue(itemNode, _T("affiliation"))) != NULL) {
- if ( !_tcscmp(str, _T("owner"))) affiliation = AFFILIATION_OWNER;
+ if ( !_tcscmp(str, _T("owner"))) affiliation = AFFILIATION_OWNER;
else if ( !_tcscmp(str, _T("admin"))) affiliation = AFFILIATION_ADMIN;
else if ( !_tcscmp(str, _T("member"))) affiliation = AFFILIATION_MEMBER;
else if ( !_tcscmp(str, _T("none"))) affiliation = AFFILIATION_NONE;
else if ( !_tcscmp(str, _T("outcast"))) affiliation = AFFILIATION_OUTCAST;
}
if ((str = xmlGetAttrValue(itemNode, _T("role"))) != NULL) {
- if ( !_tcscmp(str, _T("moderator"))) role = ROLE_MODERATOR;
+ if ( !_tcscmp(str, _T("moderator"))) role = ROLE_MODERATOR;
else if ( !_tcscmp(str, _T("participant"))) role = ROLE_PARTICIPANT;
else if ( !_tcscmp(str, _T("visitor"))) role = ROLE_VISITOR;
- else role = ROLE_NONE;
+ else role = ROLE_NONE;
}
if ((role != ROLE_NONE) && (JabberGcGetStatus(r) != JabberGcGetStatus(affiliation, role))) {
@@ -1035,7 +1021,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node) }
if (sttGetStatusCode(xNode) == 201)
- roomCreated = TRUE;
+ bRoomCreated = true;
// show status change if needed
if (bStatusChanged)
@@ -1060,15 +1046,15 @@ void CJabberProto::GroupchatProcessPresence(HXML node) //}
// Check <created/>
- if (roomCreated ||
- ((n = xmlGetChild(node , "created"))!=NULL &&
- (str = xmlGetAttrValue(n, _T("xmlns")))!=NULL &&
- !_tcscmp(str, _T("http://jabber.org/protocol/muc#owner")))) {
- // A new room just created by me
- // Request room config
- int iqId = SerialNext();
- IqAdd(iqId, IQ_PROC_NONE, &CJabberProto::OnIqResultGetMuc);
- m_ThreadInfo->send( XmlNodeIq(_T("get"), iqId, item->jid) << XQUERY(xmlnsOwner));
+ if (bRoomCreated) {
+ HXML n = xmlGetChild(node , "created");
+ if (n != NULL && (str = xmlGetAttrValue(n, _T("xmlns"))) != NULL && !_tcscmp(str, JABBER_FEAT_MUC_OWNER)) {
+ // A new room just created by me
+ // Request room config
+ int iqId = SerialNext();
+ IqAdd(iqId, IQ_PROC_NONE, &CJabberProto::OnIqResultGetMuc);
+ m_ThreadInfo->send( XmlNodeIq(_T("get"), iqId, item->jid) << XQUERY(JABBER_FEAT_MUC_OWNER));
+ }
}
mir_free(room);
@@ -1110,7 +1096,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node) return;
} } }
- statusNode = xmlGetChild(node , "status");
+ HXML statusNode = xmlGetChild(node , "status");
GcLogUpdateMemberStatus(item, resource, nick, str, GC_EVENT_PART, statusNode);
ListRemoveResource(LIST_CHATROOM, from);
diff --git a/protocols/JabberG/src/jabber_ibb.cpp b/protocols/JabberG/src/jabber_ibb.cpp index b079e01b46..a6cf22333b 100644 --- a/protocols/JabberG/src/jabber_ibb.cpp +++ b/protocols/JabberG/src/jabber_ibb.cpp @@ -96,7 +96,7 @@ void CJabberProto::IbbSendThread(JABBER_IBB_TRANSFER *jibb) m_ThreadInfo->send(
XmlNodeIq(m_iqManager.AddHandler(&CJabberProto::OnIbbInitiateResult, JABBER_IQ_TYPE_SET, jibb->dstJID, 0, -1, jibb))
- << XCHILDNS(_T("open"), _T(JABBER_FEAT_IBB)) << XATTR(_T("sid"), jibb->sid) << XATTRI(_T("block-size"), JABBER_IBB_BLOCK_SIZE)
+ << XCHILDNS(_T("open"), JABBER_FEAT_IBB) << XATTR(_T("sid"), jibb->sid) << XATTRI(_T("block-size"), JABBER_IBB_BLOCK_SIZE)
<< XATTR(_T("stanza"), _T("message")));
WaitForSingleObject(jibb->hEvent, INFINITE);
@@ -115,7 +115,7 @@ void CJabberProto::IbbSendThread(JABBER_IBB_TRANSFER *jibb) m_ThreadInfo->send(
XmlNodeIq(m_iqManager.AddHandler(&CJabberProto::OnIbbCloseResult, JABBER_IQ_TYPE_SET, jibb->dstJID, 0, -1, jibb))
- << XCHILDNS(_T("close"), _T(JABBER_FEAT_IBB)) << XATTR(_T("sid"), jibb->sid));
+ << XCHILDNS(_T("close"), JABBER_FEAT_IBB) << XATTR(_T("sid"), jibb->sid));
WaitForSingleObject(jibb->hEvent, INFINITE);
CloseHandle(jibb->hEvent);
@@ -152,7 +152,7 @@ void __cdecl CJabberProto::IbbReceiveThread(JABBER_IBB_TRANSFER *jibb) jibb->hEvent = NULL;
if (jibb->state == JIBB_ERROR)
- m_ThreadInfo->send( XmlNodeIq(_T("set"), SerialNext(), jibb->dstJID) << XCHILDNS(_T("close"), _T(JABBER_FEAT_IBB)) << XATTR(_T("sid"), jibb->sid));
+ m_ThreadInfo->send( XmlNodeIq(_T("set"), SerialNext(), jibb->dstJID) << XCHILDNS(_T("close"), JABBER_FEAT_IBB) << XATTR(_T("sid"), jibb->sid));
if (jibb->bStreamClosed && jibb->dwTransferredSize == ft->dwExpectedRecvFileSize)
jibb->state = JIBB_DONE;
diff --git a/protocols/JabberG/src/jabber_iq.cpp b/protocols/JabberG/src/jabber_iq.cpp index bfe570201e..33792d81ad 100644 --- a/protocols/JabberG/src/jabber_iq.cpp +++ b/protocols/JabberG/src/jabber_iq.cpp @@ -128,52 +128,52 @@ BOOL CJabberIqManager::FillPermanentHandlers() AddPermanentHandler(&CJabberProto::OnIqSetGoogleSharedStatus, JABBER_IQ_TYPE_SET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_TO | JABBER_IQ_PARSE_ID_STR, _T("google:shared-status"), FALSE, _T("query"));
// version requests (XEP-0092)
- AddPermanentHandler(&CJabberProto::OnIqRequestVersion, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR, _T(JABBER_FEAT_VERSION), FALSE, _T("query"));
+ AddPermanentHandler(&CJabberProto::OnIqRequestVersion, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR, JABBER_FEAT_VERSION, FALSE, _T("query"));
// last activity (XEP-0012)
- AddPermanentHandler(&CJabberProto::OnIqRequestLastActivity, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR, _T(JABBER_FEAT_LAST_ACTIVITY), FALSE, _T("query"));
+ AddPermanentHandler(&CJabberProto::OnIqRequestLastActivity, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR, JABBER_FEAT_LAST_ACTIVITY, FALSE, _T("query"));
// ping requests (XEP-0199)
- AddPermanentHandler(&CJabberProto::OnIqRequestPing, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR, _T(JABBER_FEAT_PING), FALSE, _T("ping"));
+ AddPermanentHandler(&CJabberProto::OnIqRequestPing, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR, JABBER_FEAT_PING, FALSE, _T("ping"));
// entity time (XEP-0202)
- AddPermanentHandler(&CJabberProto::OnIqRequestTime, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR, _T(JABBER_FEAT_ENTITY_TIME), FALSE, _T("time"));
+ AddPermanentHandler(&CJabberProto::OnIqRequestTime, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR, JABBER_FEAT_ENTITY_TIME, FALSE, _T("time"));
// entity time (XEP-0090)
- AddPermanentHandler(&CJabberProto::OnIqProcessIqOldTime, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR, _T(JABBER_FEAT_ENTITY_TIME_OLD), FALSE, _T("query"));
+ AddPermanentHandler(&CJabberProto::OnIqProcessIqOldTime, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR, JABBER_FEAT_ENTITY_TIME_OLD, FALSE, _T("query"));
// old avatars support (deprecated XEP-0008)
- AddPermanentHandler(&CJabberProto::OnIqRequestAvatar, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR, _T(JABBER_FEAT_AVATAR), FALSE, _T("query"));
+ AddPermanentHandler(&CJabberProto::OnIqRequestAvatar, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR, JABBER_FEAT_AVATAR, FALSE, _T("query"));
// privacy lists (XEP-0016)
- AddPermanentHandler(&CJabberProto::OnIqRequestPrivacyLists, JABBER_IQ_TYPE_SET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR, _T(JABBER_FEAT_PRIVACY_LISTS), FALSE, _T("query"));
+ AddPermanentHandler(&CJabberProto::OnIqRequestPrivacyLists, JABBER_IQ_TYPE_SET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR, JABBER_FEAT_PRIVACY_LISTS, FALSE, _T("query"));
// in band bytestreams (XEP-0047)
- AddPermanentHandler(&CJabberProto::OnFtHandleIbbIq, JABBER_IQ_TYPE_SET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_CHILD_TAG_NODE | JABBER_IQ_PARSE_CHILD_TAG_NAME | JABBER_IQ_PARSE_CHILD_TAG_XMLNS, _T(JABBER_FEAT_IBB), FALSE, NULL);
+ AddPermanentHandler(&CJabberProto::OnFtHandleIbbIq, JABBER_IQ_TYPE_SET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_CHILD_TAG_NODE | JABBER_IQ_PARSE_CHILD_TAG_NAME | JABBER_IQ_PARSE_CHILD_TAG_XMLNS, JABBER_FEAT_IBB, FALSE, NULL);
// socks5-bytestreams (XEP-0065)
- AddPermanentHandler(&CJabberProto::FtHandleBytestreamRequest, JABBER_IQ_TYPE_SET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR | JABBER_IQ_PARSE_CHILD_TAG_NODE, _T(JABBER_FEAT_BYTESTREAMS), FALSE, _T("query"));
+ AddPermanentHandler(&CJabberProto::FtHandleBytestreamRequest, JABBER_IQ_TYPE_SET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR | JABBER_IQ_PARSE_CHILD_TAG_NODE, JABBER_FEAT_BYTESTREAMS, FALSE, _T("query"));
// session initiation (XEP-0095)
- AddPermanentHandler(&CJabberProto::OnSiRequest, JABBER_IQ_TYPE_SET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR | JABBER_IQ_PARSE_CHILD_TAG_NODE, _T(JABBER_FEAT_SI), FALSE, _T("si"));
+ AddPermanentHandler(&CJabberProto::OnSiRequest, JABBER_IQ_TYPE_SET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR | JABBER_IQ_PARSE_CHILD_TAG_NODE, JABBER_FEAT_SI, FALSE, _T("si"));
// roster push requests
- AddPermanentHandler(&CJabberProto::OnRosterPushRequest, JABBER_IQ_TYPE_SET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR | JABBER_IQ_PARSE_CHILD_TAG_NODE, _T(JABBER_FEAT_IQ_ROSTER), FALSE, _T("query"));
+ AddPermanentHandler(&CJabberProto::OnRosterPushRequest, JABBER_IQ_TYPE_SET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR | JABBER_IQ_PARSE_CHILD_TAG_NODE, JABBER_FEAT_IQ_ROSTER, FALSE, _T("query"));
// OOB file transfers
- AddPermanentHandler(&CJabberProto::OnIqRequestOOB, JABBER_IQ_TYPE_SET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_HCONTACT | JABBER_IQ_PARSE_ID_STR | JABBER_IQ_PARSE_CHILD_TAG_NODE, _T(JABBER_FEAT_OOB), FALSE, _T("query"));
+ AddPermanentHandler(&CJabberProto::OnIqRequestOOB, JABBER_IQ_TYPE_SET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_HCONTACT | JABBER_IQ_PARSE_ID_STR | JABBER_IQ_PARSE_CHILD_TAG_NODE, JABBER_FEAT_OOB, FALSE, _T("query"));
// disco#items requests (XEP-0030, XEP-0050)
- AddPermanentHandler(&CJabberProto::OnHandleDiscoItemsRequest, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_TO | JABBER_IQ_PARSE_ID_STR | JABBER_IQ_PARSE_CHILD_TAG_NODE, _T(JABBER_FEAT_DISCO_ITEMS), FALSE, _T("query"));
+ AddPermanentHandler(&CJabberProto::OnHandleDiscoItemsRequest, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_TO | JABBER_IQ_PARSE_ID_STR | JABBER_IQ_PARSE_CHILD_TAG_NODE, JABBER_FEAT_DISCO_ITEMS, FALSE, _T("query"));
// disco#info requests (XEP-0030, XEP-0050, XEP-0115)
- AddPermanentHandler(&CJabberProto::OnHandleDiscoInfoRequest, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_TO | JABBER_IQ_PARSE_ID_STR | JABBER_IQ_PARSE_CHILD_TAG_NODE, _T(JABBER_FEAT_DISCO_INFO), FALSE, _T("query"));
+ AddPermanentHandler(&CJabberProto::OnHandleDiscoInfoRequest, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_TO | JABBER_IQ_PARSE_ID_STR | JABBER_IQ_PARSE_CHILD_TAG_NODE, JABBER_FEAT_DISCO_INFO, FALSE, _T("query"));
// ad-hoc commands (XEP-0050) for remote controlling (XEP-0146)
- AddPermanentHandler(&CJabberProto::HandleAdhocCommandRequest, JABBER_IQ_TYPE_SET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_TO | JABBER_IQ_PARSE_ID_STR | JABBER_IQ_PARSE_CHILD_TAG_NODE, _T(JABBER_FEAT_COMMANDS), FALSE, _T("command"));
+ AddPermanentHandler(&CJabberProto::HandleAdhocCommandRequest, JABBER_IQ_TYPE_SET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_TO | JABBER_IQ_PARSE_ID_STR | JABBER_IQ_PARSE_CHILD_TAG_NODE, JABBER_FEAT_COMMANDS, FALSE, _T("command"));
// http auth (XEP-0070)
- AddPermanentHandler(&CJabberProto::OnIqHttpAuth, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR | JABBER_IQ_PARSE_CHILD_TAG_NODE, _T(JABBER_FEAT_HTTP_AUTH), FALSE, _T("confirm"));
+ AddPermanentHandler(&CJabberProto::OnIqHttpAuth, JABBER_IQ_TYPE_GET, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_ID_STR | JABBER_IQ_PARSE_CHILD_TAG_NODE, JABBER_FEAT_HTTP_AUTH, FALSE, _T("confirm"));
return TRUE;
}
diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp index 846208a241..962c864237 100644 --- a/protocols/JabberG/src/jabber_iq_handlers.cpp +++ b/protocols/JabberG/src/jabber_iq_handlers.cpp @@ -362,7 +362,7 @@ BOOL CJabberProto::OnIqRequestVersion(HXML, CJabberIqInfo* pInfo) return FALSE;
XmlNodeIq iq(_T("result"), pInfo);
- HXML query = iq << XQUERY(_T(JABBER_FEAT_VERSION));
+ HXML query = iq << XQUERY(JABBER_FEAT_VERSION);
query << XCHILD(_T("name"), _T("Miranda NG Jabber"));
query << XCHILD(_T("version"), szCoreVersion);
@@ -382,7 +382,7 @@ BOOL CJabberProto::OnIqRequestVersion(HXML, CJabberIqInfo* pInfo) BOOL CJabberProto::OnIqRequestLastActivity(HXML, CJabberIqInfo *pInfo)
{
m_ThreadInfo->send(
- XmlNodeIq(_T("result"), pInfo) << XQUERY(_T(JABBER_FEAT_LAST_ACTIVITY))
+ XmlNodeIq(_T("result"), pInfo) << XQUERY(JABBER_FEAT_LAST_ACTIVITY)
<< XATTRI(_T("seconds"), m_tmJabberIdleStartTime ? time(0) - m_tmJabberIdleStartTime : 0));
return TRUE;
}
@@ -433,7 +433,7 @@ BOOL CJabberProto::OnIqRequestTime(HXML, CJabberIqInfo *pInfo) mir_sntprintf(szTZ, SIZEOF(szTZ), _T("%+03d:%02d"), nGmtOffset / 60, nGmtOffset % 60);
XmlNodeIq iq(_T("result"), pInfo);
- HXML timeNode = iq << XCHILDNS(_T("time"), _T(JABBER_FEAT_ENTITY_TIME));
+ HXML timeNode = iq << XCHILDNS(_T("time"), JABBER_FEAT_ENTITY_TIME);
timeNode << XCHILD(_T("utc"), stime); timeNode << XCHILD(_T("tzo"), szTZ);
LPCTSTR szTZName = tmi.getTzName(NULL);
if (szTZName)
@@ -458,7 +458,7 @@ BOOL CJabberProto::OnIqProcessIqOldTime(HXML, CJabberIqInfo *pInfo) dtime[ 24 ] = 0;
XmlNodeIq iq(_T("result"), pInfo);
- HXML queryNode = iq << XQUERY(_T(JABBER_FEAT_ENTITY_TIME_OLD));
+ HXML queryNode = iq << XQUERY(JABBER_FEAT_ENTITY_TIME_OLD);
queryNode << XCHILD(_T("utc"), stime);
LPCTSTR szTZName = tmi.getTzName(NULL);
if (szTZName)
@@ -504,7 +504,7 @@ BOOL CJabberProto::OnIqRequestAvatar(HXML, CJabberIqInfo *pInfo) fclose(in);
char* str = JabberBase64Encode(buffer, bytes);
- m_ThreadInfo->send( XmlNodeIq(_T("result"), pInfo) << XQUERY(_T(JABBER_FEAT_AVATAR)) << XCHILD(_T("query"), _A2T(str)) << XATTR(_T("mimetype"), szMimeType));
+ m_ThreadInfo->send( XmlNodeIq(_T("result"), pInfo) << XQUERY(JABBER_FEAT_AVATAR) << XCHILD(_T("query"), _A2T(str)) << XATTR(_T("mimetype"), szMimeType));
mir_free(str);
mir_free(buffer);
return TRUE;
@@ -514,7 +514,7 @@ BOOL CJabberProto::OnSiRequest(HXML node, CJabberIqInfo *pInfo) {
const TCHAR *szProfile = xmlGetAttrValue(pInfo->GetChildNode(), _T("profile"));
- if (szProfile && !_tcscmp(szProfile, _T(JABBER_FEAT_SI_FT)))
+ if (szProfile && !_tcscmp(szProfile, JABBER_FEAT_SI_FT))
FtHandleSiRequest(node);
else {
XmlNodeIq iq(_T("error"), pInfo);
@@ -768,13 +768,13 @@ BOOL CJabberProto::OnHandleDiscoItemsRequest(HXML iqNode, CJabberIqInfo* pInfo) // another request, send empty result
XmlNodeIq iq(_T("result"), pInfo);
- HXML resultQuery = iq << XQUERY(_T(JABBER_FEAT_DISCO_ITEMS));
+ HXML resultQuery = iq << XQUERY(JABBER_FEAT_DISCO_ITEMS);
if (szNode)
xmlAddAttr(resultQuery, _T("node"), szNode);
if ( !szNode && m_options.EnableRemoteControl)
resultQuery << XCHILD(_T("item")) << XATTR(_T("jid"), m_ThreadInfo->fullJID)
- << XATTR(_T("node"), _T(JABBER_FEAT_COMMANDS)) << XATTR(_T("name"), _T("Ad-hoc commands"));
+ << XATTR(_T("node"), JABBER_FEAT_COMMANDS) << XATTR(_T("name"), _T("Ad-hoc commands"));
m_ThreadInfo->send(iq);
return TRUE;
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index 7dcb813a5c..664526e22d 100644 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -40,7 +40,7 @@ void CJabberProto::OnIqResultServerDiscoInfo(HXML iqNode) int i;
if ( !_tcscmp(type, _T("result"))) {
- HXML query = xmlGetChildByTag(iqNode, "query", "xmlns", _T(JABBER_FEAT_DISCO_INFO));
+ HXML query = xmlGetChildByTag(iqNode, "query", "xmlns", JABBER_FEAT_DISCO_INFO);
if ( !query)
return;
@@ -65,7 +65,7 @@ void CJabberProto::OnIqResultServerDiscoInfo(HXML iqNode) // Google Shared Status
m_ThreadInfo->send(
XmlNodeIq(m_iqManager.AddHandler(&CJabberProto::OnIqResultGoogleSharedStatus, JABBER_IQ_TYPE_GET))
- << XQUERY(_T(JABBER_FEAT_GTALK_SHARED_STATUS)) << XATTR(_T("version"), _T("2")));
+ << XQUERY(JABBER_FEAT_GTALK_SHARED_STATUS) << XATTR(_T("version"), _T("2")));
}
}
@@ -94,7 +94,7 @@ void CJabberProto::OnIqResultNestedRosterGroups(HXML iqNode, CJabberIqInfo* pInf if (iqNode && pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT) {
bPrivateStorageSupport = TRUE;
- szGroupDelimeter = XPathFmt(iqNode, _T("query[@xmlns='%s']/roster[@xmlns='%s']"), _T(JABBER_FEAT_PRIVATE_STORAGE), _T(JABBER_FEAT_NESTED_ROSTER_GROUPS));
+ szGroupDelimeter = XPathFmt(iqNode, _T("query[@xmlns='%s']/roster[@xmlns='%s']"), JABBER_FEAT_PRIVATE_STORAGE, JABBER_FEAT_NESTED_ROSTER_GROUPS);
if (szGroupDelimeter && !szGroupDelimeter[0])
szGroupDelimeter = NULL; // "" as roster delimeter is not supported :)
}
@@ -106,21 +106,21 @@ void CJabberProto::OnIqResultNestedRosterGroups(HXML iqNode, CJabberIqInfo* pInf // is our default delimiter?
if ((!szGroupDelimeter && bPrivateStorageSupport) || (szGroupDelimeter && _tcscmp(szGroupDelimeter, _T("\\"))))
m_ThreadInfo->send(
- XmlNodeIq(_T("set"), SerialNext()) << XQUERY(_T(JABBER_FEAT_PRIVATE_STORAGE))
- << XCHILD(_T("roster"), _T("\\")) << XATTR(_T("xmlns"), _T(JABBER_FEAT_NESTED_ROSTER_GROUPS)));
+ XmlNodeIq(_T("set"), SerialNext()) << XQUERY(JABBER_FEAT_PRIVATE_STORAGE)
+ << XCHILD(_T("roster"), _T("\\")) << XATTR(_T("xmlns"), JABBER_FEAT_NESTED_ROSTER_GROUPS));
// roster request
TCHAR *szUserData = mir_tstrdup(szGroupDelimeter ? szGroupDelimeter : _T("\\"));
m_ThreadInfo->send(
XmlNodeIq(m_iqManager.AddHandler(&CJabberProto::OnIqResultGetRoster, JABBER_IQ_TYPE_GET, NULL, 0, -1, (void*)szUserData))
- << XCHILDNS(_T("query"), _T(JABBER_FEAT_IQ_ROSTER)));
+ << XCHILDNS(_T("query"), JABBER_FEAT_IQ_ROSTER));
}
void CJabberProto::OnIqResultNotes(HXML iqNode, CJabberIqInfo* pInfo)
{
if (iqNode && pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT) {
HXML hXmlData = XPathFmt(iqNode, _T("query[@xmlns='%s']/storage[@xmlns='%s']"),
- _T(JABBER_FEAT_PRIVATE_STORAGE), _T(JABBER_FEAT_MIRANDA_NOTES));
+ JABBER_FEAT_PRIVATE_STORAGE, JABBER_FEAT_MIRANDA_NOTES);
if (hXmlData) m_notes.LoadXml(hXmlData);
}
}
@@ -183,29 +183,29 @@ void CJabberProto::OnLoggedIn() // ugly hack to prevent hangup during login process
pIqInfo->SetTimeout(30000);
m_ThreadInfo->send(
- XmlNodeIq(pIqInfo) << XQUERY(_T(JABBER_FEAT_PRIVATE_STORAGE))
- << XCHILDNS(_T("roster"), _T(JABBER_FEAT_NESTED_ROSTER_GROUPS)));
+ XmlNodeIq(pIqInfo) << XQUERY(JABBER_FEAT_PRIVATE_STORAGE)
+ << XCHILDNS(_T("roster"), JABBER_FEAT_NESTED_ROSTER_GROUPS));
}
// Server-side notes
{
m_ThreadInfo->send(
XmlNodeIq(m_iqManager.AddHandler(&CJabberProto::OnIqResultNotes, JABBER_IQ_TYPE_GET))
- << XQUERY(_T(JABBER_FEAT_PRIVATE_STORAGE))
- << XCHILDNS(_T("storage"), _T(JABBER_FEAT_MIRANDA_NOTES)));
+ << XQUERY(JABBER_FEAT_PRIVATE_STORAGE)
+ << XCHILDNS(_T("storage"), JABBER_FEAT_MIRANDA_NOTES));
}
int iqId = SerialNext();
IqAdd(iqId, IQ_PROC_DISCOBOOKMARKS, &CJabberProto::OnIqResultDiscoBookmarks);
m_ThreadInfo->send(
- XmlNodeIq(_T("get"), iqId) << XQUERY(_T(JABBER_FEAT_PRIVATE_STORAGE))
+ XmlNodeIq(_T("get"), iqId) << XQUERY(JABBER_FEAT_PRIVATE_STORAGE)
<< XCHILDNS(_T("storage"), _T("storage:bookmarks")));
m_bPepSupported = FALSE;
m_ThreadInfo->jabberServerCaps = JABBER_RESOURCE_CAPS_NONE;
iqId = SerialNext();
IqAdd(iqId, IQ_PROC_NONE, &CJabberProto::OnIqResultServerDiscoInfo);
- m_ThreadInfo->send( XmlNodeIq(_T("get"), iqId, _A2T(m_ThreadInfo->server)) << XQUERY(_T(JABBER_FEAT_DISCO_INFO)));
+ m_ThreadInfo->send( XmlNodeIq(_T("get"), iqId, _A2T(m_ThreadInfo->server)) << XQUERY(JABBER_FEAT_DISCO_INFO));
QueryPrivacyLists(m_ThreadInfo);
@@ -373,7 +373,7 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo* pInfo) return;
}
- if (lstrcmp(xmlGetAttrValue(queryNode, _T("xmlns")), _T(JABBER_FEAT_IQ_ROSTER))) {
+ if (lstrcmp(xmlGetAttrValue(queryNode, _T("xmlns")), JABBER_FEAT_IQ_ROSTER)) {
mir_free(szGroupDelimeter);
return;
}
@@ -1393,9 +1393,8 @@ void CJabberProto::OnIqResultGetClientAvatar(HXML iqNode) HXML queryNode = xmlGetChild(iqNode , "query");
if (queryNode != NULL) {
const TCHAR *xmlns = xmlGetAttrValue(queryNode, _T("xmlns"));
- if ( !lstrcmp(xmlns, _T(JABBER_FEAT_AVATAR))) {
+ if ( !lstrcmp(xmlns, JABBER_FEAT_AVATAR))
n = xmlGetChild(queryNode , "data");
- }
}
}
@@ -1411,7 +1410,7 @@ void CJabberProto::OnIqResultGetClientAvatar(HXML iqNode) IqAdd(iqId, IQ_PROC_NONE, &CJabberProto::OnIqResultGetServerAvatar);
XmlNodeIq iq(_T("get"), iqId, szJid);
- iq << XQUERY(_T(JABBER_FEAT_SERVER_AVATAR));
+ iq << XQUERY(JABBER_FEAT_SERVER_AVATAR);
m_ThreadInfo->send(iq);
return;
@@ -1441,9 +1440,8 @@ void CJabberProto::OnIqResultGetServerAvatar(HXML iqNode) HXML queryNode = xmlGetChild(iqNode , "query");
if (queryNode != NULL) {
const TCHAR *xmlns = xmlGetAttrValue(queryNode, _T("xmlns"));
- if ( !lstrcmp(xmlns, _T(JABBER_FEAT_SERVER_AVATAR))) {
+ if ( !lstrcmp(xmlns, JABBER_FEAT_SERVER_AVATAR))
n = xmlGetChild(queryNode , "data");
- }
}
}
@@ -1459,7 +1457,7 @@ void CJabberProto::OnIqResultGetServerAvatar(HXML iqNode) IqAdd(iqId, IQ_PROC_NONE, &CJabberProto::OnIqResultGetVCardAvatar);
XmlNodeIq iq(_T("get"), iqId, szJid);
- iq << XCHILDNS(_T("vCard"), _T(JABBER_FEAT_VCARD_TEMP));
+ iq << XCHILDNS(_T("vCard"), JABBER_FEAT_VCARD_TEMP);
m_ThreadInfo->send(iq);
return;
@@ -1592,7 +1590,7 @@ void CJabberProto::OnIqResultDiscoBookmarks(HXML iqNode) void CJabberProto::SetBookmarkRequest (XmlNodeIq& iq)
{
- HXML query = iq << XQUERY(_T(JABBER_FEAT_PRIVATE_STORAGE));
+ HXML query = iq << XQUERY(JABBER_FEAT_PRIVATE_STORAGE);
HXML storage = query << XCHILDNS(_T("storage"), _T("storage:bookmarks"));
LISTFOREACH(i, this, LIST_BOOKMARK)
@@ -1677,7 +1675,7 @@ void CJabberProto::OnIqResultEntityTime(HXML pIqNode, CJabberIqInfo* pInfo) return;
if (pInfo->m_nIqType == JABBER_IQ_TYPE_RESULT) {
- LPCTSTR szTzo = XPathFmt(pIqNode, _T("time[@xmlns='%s']/tzo"), _T(JABBER_FEAT_ENTITY_TIME));
+ LPCTSTR szTzo = XPathFmt(pIqNode, _T("time[@xmlns='%s']/tzo"), JABBER_FEAT_ENTITY_TIME);
if (szTzo && szTzo[0]) {
LPCTSTR szMin = _tcschr(szTzo, ':');
int nTz = _ttoi(szTzo) * -2;
@@ -1689,7 +1687,7 @@ void CJabberProto::OnIqResultEntityTime(HXML pIqNode, CJabberIqInfo* pInfo) setByte(pInfo->m_hContact, "Timezone", (signed char)nTz);
- LPCTSTR szTz = XPathFmt(pIqNode, _T("time[@xmlns='%s']/tz"), _T(JABBER_FEAT_ENTITY_TIME));
+ LPCTSTR szTz = XPathFmt(pIqNode, _T("time[@xmlns='%s']/tz"), JABBER_FEAT_ENTITY_TIME);
if (szTz)
setTString(pInfo->m_hContact, "TzName", szTz);
else
diff --git a/protocols/JabberG/src/jabber_iqid_muc.cpp b/protocols/JabberG/src/jabber_iqid_muc.cpp index 3d6d817ffc..b4aad02f26 100644 --- a/protocols/JabberG/src/jabber_iqid_muc.cpp +++ b/protocols/JabberG/src/jabber_iqid_muc.cpp @@ -30,7 +30,7 @@ void CJabberProto::SetMucConfig(HXML node, void *from) {
if (m_ThreadInfo && from) {
XmlNodeIq iq(_T("set"), SerialNext(), (TCHAR*)from);
- HXML query = iq << XQUERY(xmlnsOwner);
+ HXML query = iq << XQUERY(JABBER_FEAT_MUC_OWNER);
xmlAddChild(query, node);
m_ThreadInfo->send(iq);
} }
@@ -51,10 +51,10 @@ void CJabberProto::OnIqResultGetMuc(HXML iqNode) if ( !_tcscmp(type, _T("result"))) {
if ((queryNode = xmlGetChild(iqNode , "query")) != NULL) {
str = xmlGetAttrValue(queryNode, _T("xmlns"));
- if ( !lstrcmp(str, _T("http://jabber.org/protocol/muc#owner"))) {
+ if ( !lstrcmp(str, JABBER_FEAT_MUC_OWNER)) {
if ((xNode = xmlGetChild(queryNode , "x")) != NULL) {
str = xmlGetAttrValue(xNode, _T("xmlns"));
- if ( !lstrcmp(str, _T(JABBER_FEAT_DATA_FORMS)))
+ if ( !lstrcmp(str, JABBER_FEAT_DATA_FORMS))
//LaunchForm(xNode);
FormCreateDialog(xNode, _T("Jabber Conference Room Configuration"), &CJabberProto::SetMucConfig, mir_tstrdup(from));
} } } } }
diff --git a/protocols/JabberG/src/jabber_list.cpp b/protocols/JabberG/src/jabber_list.cpp index 9ad7c79bce..67ab77fcf1 100644 --- a/protocols/JabberG/src/jabber_list.cpp +++ b/protocols/JabberG/src/jabber_list.cpp @@ -91,7 +91,7 @@ void CJabberProto::ListWipe(void) JABBER_LIST_ITEM *CJabberProto::ListAdd(JABBER_LIST list, const TCHAR *jid)
{
- bool bUseResource = FALSE;
+ bool bUseResource = false;
mir_cslockfull lck(m_csLists);
JABBER_LIST_ITEM *item = ListGetItemPtr(list, jid);
diff --git a/protocols/JabberG/src/jabber_list.h b/protocols/JabberG/src/jabber_list.h index b73c09bf49..fec42d8b01 100644 --- a/protocols/JabberG/src/jabber_list.h +++ b/protocols/JabberG/src/jabber_list.h @@ -102,6 +102,7 @@ struct JABBER_RESOURCE_STATUS // XEP-0085 gone event support
BOOL bMessageSessionActive;
+
JABBER_XEP0232_SOFTWARE_INFO* pSoftwareInfo;
};
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index e4bc58399b..9f4775b609 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -1067,7 +1067,7 @@ int CJabberProto::OnProcessSrmmEvent(WPARAM, LPARAM lParam) if (GetResourceCapabilites(jid, TRUE) & JABBER_CAPS_CHATSTATES)
m_ThreadInfo->send(
XmlNode(_T("message")) << XATTR(_T("to"), jid) << XATTR(_T("type"), _T("chat")) << XATTRID( SerialNext())
- << XCHILDNS(_T("gone"), _T(JABBER_FEAT_CHATSTATES)));
+ << XCHILDNS(_T("gone"), JABBER_FEAT_CHATSTATES));
}
}
}
diff --git a/protocols/JabberG/src/jabber_message_manager.cpp b/protocols/JabberG/src/jabber_message_manager.cpp index f260004f87..910c76a0be 100644 --- a/protocols/JabberG/src/jabber_message_manager.cpp +++ b/protocols/JabberG/src/jabber_message_manager.cpp @@ -29,8 +29,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. BOOL CJabberMessageManager::FillPermanentHandlers()
{
AddPermanentHandler(&CJabberProto::OnMessageError, JABBER_MESSAGE_TYPE_ERROR, JABBER_MESSAGE_PARSE_FROM | JABBER_MESSAGE_PARSE_HCONTACT, NULL, FALSE, _T("error"));
- AddPermanentHandler(&CJabberProto::OnMessageIbb, 0, 0, _T(JABBER_FEAT_IBB), FALSE, _T("data"));
- AddPermanentHandler(&CJabberProto::OnMessagePubsubEvent, 0, 0, _T(JABBER_FEAT_PUBSUB_EVENT), FALSE, _T("event"));
+ AddPermanentHandler(&CJabberProto::OnMessageIbb, 0, 0, JABBER_FEAT_IBB, FALSE, _T("data"));
+ AddPermanentHandler(&CJabberProto::OnMessagePubsubEvent, 0, 0, JABBER_FEAT_PUBSUB_EVENT, FALSE, _T("event"));
AddPermanentHandler(&CJabberProto::OnMessageGroupchat, JABBER_MESSAGE_TYPE_GROUPCHAT, JABBER_MESSAGE_PARSE_FROM, NULL, FALSE, NULL);
return TRUE;
}
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp index 0d2c0e54a1..b8b42953de 100644 --- a/protocols/JabberG/src/jabber_misc.cpp +++ b/protocols/JabberG/src/jabber_misc.cpp @@ -32,7 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. void CJabberProto::AddContactToRoster(const TCHAR *jid, const TCHAR *nick, const TCHAR *grpName)
{
XmlNodeIq iq(_T("set"), SerialNext());
- HXML query = iq << XQUERY(_T(JABBER_FEAT_IQ_ROSTER))
+ HXML query = iq << XQUERY(JABBER_FEAT_IQ_ROSTER)
<< XCHILD(_T("item")) << XATTR(_T("jid"), jid) << XATTR(_T("name"), nick);
if (grpName)
query << XCHILD(_T("group"), grpName);
diff --git a/protocols/JabberG/src/jabber_notes.cpp b/protocols/JabberG/src/jabber_notes.cpp index 382c63cc98..d442ee8a46 100644 --- a/protocols/JabberG/src/jabber_notes.cpp +++ b/protocols/JabberG/src/jabber_notes.cpp @@ -631,8 +631,8 @@ private: void btnSave_OnClick(CCtrlButton *)
{
XmlNodeIq iq(_T("set"));
- HXML query = iq << XQUERY(_T(JABBER_FEAT_PRIVATE_STORAGE));
- HXML storage = query << XCHILDNS(_T("storage"), _T(JABBER_FEAT_MIRANDA_NOTES));
+ HXML query = iq << XQUERY(JABBER_FEAT_PRIVATE_STORAGE);
+ HXML storage = query << XCHILDNS(_T("storage"), JABBER_FEAT_MIRANDA_NOTES);
m_proto->m_notes.SaveXml(storage);
m_proto->m_ThreadInfo->send(iq);
EnableControls();
@@ -744,8 +744,8 @@ void CJabberProto::ProcessIncomingNote(CNoteItem *pNote, bool ok) m_notes.insert(pNote);
XmlNodeIq iq(_T("set"));
- HXML query = iq << XQUERY(_T(JABBER_FEAT_PRIVATE_STORAGE));
- HXML storage = query << XCHILDNS(_T("storage"), _T(JABBER_FEAT_MIRANDA_NOTES));
+ HXML query = iq << XQUERY(JABBER_FEAT_PRIVATE_STORAGE);
+ HXML storage = query << XCHILDNS(_T("storage"), JABBER_FEAT_MIRANDA_NOTES);
m_notes.SaveXml(storage);
m_ThreadInfo->send(iq);
} else
@@ -776,16 +776,16 @@ void CJabberProto::ProcessOutgoingNote(CNoteItem *pNote, bool ok) XmlNode m(_T("message"));
m << XATTR(_T("type"), _T("chat")) << XATTR(_T("to"), pNote->GetFrom()) << XATTRID(nMsgId);
m << XCHILD(_T("body"), buf);
- HXML hXmlItem = m << XCHILDNS(_T("x"), _T(JABBER_FEAT_MIRANDA_NOTES)) << XCHILD(_T("note"));
+ HXML hXmlItem = m << XCHILDNS(_T("x"), JABBER_FEAT_MIRANDA_NOTES) << XCHILD(_T("note"));
hXmlItem << XATTR(_T("tags"), pNote->GetTagsStr());
hXmlItem << XCHILD(_T("title"), pNote->GetTitle());
hXmlItem << XCHILD(_T("text"), pNote->GetText());
// message receipts XEP priority
if (jcb & JABBER_CAPS_MESSAGE_RECEIPTS)
- m << XCHILDNS(_T("request"), _T(JABBER_FEAT_MESSAGE_RECEIPTS));
+ m << XCHILDNS(_T("request"), JABBER_FEAT_MESSAGE_RECEIPTS);
else if (jcb & JABBER_CAPS_MESSAGE_EVENTS) {
- HXML x = m << XCHILDNS(_T("x"), _T(JABBER_FEAT_MESSAGE_EVENTS));
+ HXML x = m << XCHILDNS(_T("x"), JABBER_FEAT_MESSAGE_EVENTS);
x << XCHILD(_T("delivered")); x << XCHILD(_T("offline"));
}
else
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp index 69479e1f41..a929050869 100644 --- a/protocols/JabberG/src/jabber_opt.cpp +++ b/protocols/JabberG/src/jabber_opt.cpp @@ -611,7 +611,7 @@ private: if (res == IDYES)
m_proto->m_ThreadInfo->send(
- XmlNodeIq(_T("set"), m_proto->SerialNext(), m_proto->m_szJabberJID) << XQUERY(_T(JABBER_FEAT_REGISTER))
+ XmlNodeIq(_T("set"), m_proto->SerialNext(), m_proto->m_szJabberJID) << XQUERY(JABBER_FEAT_REGISTER)
<< XCHILD(_T("remove")));
}
@@ -1108,7 +1108,7 @@ void CJabberProto::_RosterHandleGetRequest(HXML node) xmlAddAttr(iq, _T("type"), _T("set"));
iq << XATTRID(iqId);
- HXML query = iq << XCHILDNS(_T("query"), _T(JABBER_FEAT_IQ_ROSTER));
+ HXML query = iq << XCHILDNS(_T("query"), JABBER_FEAT_IQ_ROSTER);
int itemCount=0;
int ListItemCount=ListView_GetItemCount(hList);
@@ -1187,7 +1187,7 @@ void CJabberProto::_RosterSendRequest(HWND hwndDlg, BYTE rrAction) int iqId = SerialNext();
IqAdd(iqId, IQ_PROC_NONE, &CJabberProto::_RosterHandleGetRequest);
- m_ThreadInfo->send(XmlNode(_T("iq")) << XATTR(_T("type"), _T("get")) << XATTRID(iqId) << XCHILDNS(_T("query"), _T(JABBER_FEAT_IQ_ROSTER)));
+ m_ThreadInfo->send(XmlNode(_T("iq")) << XATTR(_T("type"), _T("get")) << XATTRID(iqId) << XCHILDNS(_T("query"), JABBER_FEAT_IQ_ROSTER));
}
static void _RosterItemEditEnd(HWND hEditor, ROSTEREDITDAT * edat, BOOL bCancel)
diff --git a/protocols/JabberG/src/jabber_password.cpp b/protocols/JabberG/src/jabber_password.cpp index f3871b1fa0..3322f5b62f 100644 --- a/protocols/JabberG/src/jabber_password.cpp +++ b/protocols/JabberG/src/jabber_password.cpp @@ -75,7 +75,7 @@ static INT_PTR CALLBACK JabberChangePasswordDlgProc(HWND hwndDlg, UINT msg, WPAR ppro->IqAdd(iqId, IQ_PROC_NONE, &CJabberProto::OnIqResultSetPassword);
XmlNodeIq iq(_T("set"), iqId, _A2T(ppro->m_ThreadInfo->server));
- HXML q = iq << XQUERY(_T(JABBER_FEAT_REGISTER));
+ HXML q = iq << XQUERY(JABBER_FEAT_REGISTER);
q << XCHILD(_T("username"), ppro->m_ThreadInfo->username);
q << XCHILD(_T("password"), newPasswd);
ppro->m_ThreadInfo->send(iq);
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp index 69a816a2fd..5eead4a104 100644 --- a/protocols/JabberG/src/jabber_privacy.cpp +++ b/protocols/JabberG/src/jabber_privacy.cpp @@ -280,7 +280,7 @@ void CJabberProto::OnIqResultPrivacyLists(HXML iqNode, CJabberIqInfo* pInfo) if (m_pDlgPrivacyLists) {
int iqId = SerialNext();
IqAdd(iqId, IQ_PROC_NONE, &CJabberProto::OnIqResultPrivacyList);
- m_ThreadInfo->send( XmlNodeIq(_T("get"), iqId) << XQUERY(_T(JABBER_FEAT_PRIVACY_LISTS)) << XCHILD(_T("list")) << XATTR(_T("name"), listName));
+ m_ThreadInfo->send( XmlNodeIq(_T("get"), iqId) << XQUERY(JABBER_FEAT_PRIVACY_LISTS) << XCHILD(_T("list")) << XATTR(_T("name"), listName));
} } }
const TCHAR *szName = NULL;
@@ -1772,7 +1772,7 @@ void CJabberDlgPrivacyLists::btnActivate_OnClick(CCtrlButton *) EnableWindow(GetDlgItem(m_hwnd, IDC_ACTIVATE), FALSE);
SetWindowLongPtr(GetDlgItem(m_hwnd, IDC_ACTIVATE), GWLP_USERDATA, (LONG_PTR)pList);
XmlNodeIq iq(m_proto->m_iqManager.AddHandler(&CJabberProto::OnIqResultPrivacyListActive, JABBER_IQ_TYPE_SET, NULL, 0, -1, pList));
- HXML query = iq << XQUERY(_T(JABBER_FEAT_PRIVACY_LISTS));
+ HXML query = iq << XQUERY(JABBER_FEAT_PRIVACY_LISTS);
HXML active = query << XCHILD(_T("active"));
if (pList)
active << XATTR(_T("name"), pList->GetListName());
@@ -1799,7 +1799,7 @@ void CJabberDlgPrivacyLists::btnSetDefault_OnClick(CCtrlButton *) SetWindowLongPtr(GetDlgItem(m_hwnd, IDC_SET_DEFAULT), GWLP_USERDATA, (LONG_PTR)pList);
XmlNodeIq iq(m_proto->m_iqManager.AddHandler(&CJabberProto::OnIqResultPrivacyListDefault, JABBER_IQ_TYPE_SET, NULL, 0, -1, pList));
- HXML query = iq << XQUERY(_T(JABBER_FEAT_PRIVACY_LISTS));
+ HXML query = iq << XQUERY(JABBER_FEAT_PRIVACY_LISTS);
HXML defaultTag = query << XCHILD(_T("default"));
if (pList)
xmlAddAttr(defaultTag, _T("name"), pList->GetListName());
@@ -2042,7 +2042,7 @@ void CJabberDlgPrivacyLists::btnApply_OnClick(CCtrlButton *) pUserData->m_dwCount++;
XmlNodeIq iq(m_proto->m_iqManager.AddHandler(&CJabberProto::OnIqResultPrivacyListModify, JABBER_IQ_TYPE_SET, NULL, 0, -1, pUserData));
- HXML query = iq << XQUERY(_T(JABBER_FEAT_PRIVACY_LISTS));
+ HXML query = iq << XQUERY(JABBER_FEAT_PRIVACY_LISTS);
HXML listTag = query << XCHILD(_T("list")) << XATTR(_T("name"), pList->GetListName());
while (pRule) {
@@ -2181,7 +2181,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandlePrivacyLists(WPARAM, LPARAM) void CJabberProto::QueryPrivacyLists(ThreadData *pThreadInfo)
{
XmlNodeIq iq(m_iqManager.AddHandler(&CJabberProto::OnIqResultPrivacyLists));
- iq << XQUERY(_T(JABBER_FEAT_PRIVACY_LISTS));
+ iq << XQUERY(JABBER_FEAT_PRIVACY_LISTS);
if (pThreadInfo)
pThreadInfo->send(iq);
else if (m_ThreadInfo)
@@ -2204,7 +2204,7 @@ INT_PTR __cdecl CJabberProto::menuSetPrivacyList(WPARAM, LPARAM, LPARAM iList) }
XmlNodeIq iq(m_iqManager.AddHandler(&CJabberProto::OnIqResultPrivacyListActive, JABBER_IQ_TYPE_SET, NULL, 0, -1, pList));
- HXML query = iq << XQUERY(_T(JABBER_FEAT_PRIVACY_LISTS));
+ HXML query = iq << XQUERY(JABBER_FEAT_PRIVACY_LISTS);
HXML active = query << XCHILD(_T("active"));
if (pList)
active << XATTR(_T("name"), pList->GetListName());
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index e38e06cb8a..af504fcd53 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -717,11 +717,11 @@ int __cdecl CJabberProto::GetInfo(HANDLE hContact, int /*infoType*/) if (m_ThreadInfo) {
m_ThreadInfo->send(
XmlNodeIq(m_iqManager.AddHandler(&CJabberProto::OnIqResultEntityTime, JABBER_IQ_TYPE_GET, jid, JABBER_IQ_PARSE_HCONTACT))
- << XCHILDNS(_T("time"), _T(JABBER_FEAT_ENTITY_TIME)));
+ << XCHILDNS(_T("time"), JABBER_FEAT_ENTITY_TIME));
// XEP-0012, last logoff time
XmlNodeIq iq2(m_iqManager.AddHandler(&CJabberProto::OnIqResultLastActivity, JABBER_IQ_TYPE_GET, jid, JABBER_IQ_PARSE_FROM));
- iq2 << XQUERY(_T(JABBER_FEAT_LAST_ACTIVITY));
+ iq2 << XQUERY(JABBER_FEAT_LAST_ACTIVITY);
m_ThreadInfo->send(iq2);
JABBER_LIST_ITEM *item = NULL;
@@ -763,25 +763,25 @@ int __cdecl CJabberProto::GetInfo(HANDLE hContact, int /*infoType*/) mir_sntprintf(tmp, SIZEOF(tmp), _T("%s/%s"), szp1, item->pResources[i].resourceName);
XmlNodeIq iq3(m_iqManager.AddHandler(&CJabberProto::OnIqResultLastActivity, JABBER_IQ_TYPE_GET, tmp, JABBER_IQ_PARSE_FROM));
- iq3 << XQUERY(_T(JABBER_FEAT_LAST_ACTIVITY));
+ iq3 << XQUERY(JABBER_FEAT_LAST_ACTIVITY);
m_ThreadInfo->send(iq3);
if ( !item->pResources[i].dwVersionRequestTime) {
XmlNodeIq iq4(m_iqManager.AddHandler(&CJabberProto::OnIqResultVersion, JABBER_IQ_TYPE_GET, tmp, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_HCONTACT | JABBER_IQ_PARSE_CHILD_TAG_NODE));
- iq4 << XQUERY(_T(JABBER_FEAT_VERSION));
+ iq4 << XQUERY(JABBER_FEAT_VERSION);
m_ThreadInfo->send(iq4);
}
if ( !item->pResources[i].pSoftwareInfo) {
XmlNodeIq iq5(m_iqManager.AddHandler(&CJabberProto::OnIqResultCapsDiscoInfoSI, JABBER_IQ_TYPE_GET, tmp, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_CHILD_TAG_NODE | JABBER_IQ_PARSE_HCONTACT));
- iq5 << XQUERY(_T(JABBER_FEAT_DISCO_INFO));
+ iq5 << XQUERY(JABBER_FEAT_DISCO_INFO);
m_ThreadInfo->send(iq5);
}
}
}
else if ( !item->itemResource.dwVersionRequestTime) {
XmlNodeIq iq4(m_iqManager.AddHandler(&CJabberProto::OnIqResultVersion, JABBER_IQ_TYPE_GET, item->jid, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_HCONTACT | JABBER_IQ_PARSE_CHILD_TAG_NODE));
- iq4 << XQUERY(_T(JABBER_FEAT_VERSION));
+ iq4 << XQUERY(JABBER_FEAT_VERSION);
m_ThreadInfo->send(iq4);
}
}
@@ -895,7 +895,7 @@ HANDLE __cdecl CJabberProto::SearchByName(const TCHAR *nick, const TCHAR *firstN if (m_tszSelectedLang)
iq << XATTR(_T("xml:lang"), m_tszSelectedLang);
- HXML x = query << XCHILDNS(_T("x"), _T(JABBER_FEAT_DATA_FORMS)) << XATTR(_T("type"), _T("submit"));
+ HXML x = query << XCHILDNS(_T("x"), JABBER_FEAT_DATA_FORMS) << XATTR(_T("type"), _T("submit"));
if (nick[0] != '\0')
x << XCHILD(_T("field")) << XATTR(_T("var"), _T("user")) << XATTR(_T("value"), nick);
@@ -982,7 +982,7 @@ int __cdecl CJabberProto::SendContacts(HANDLE hContact, int flags, int nContacts XmlNode m(_T("message"));
// m << XCHILD(_T("body"), msg);
- HXML x = m << XCHILDNS(_T("x"), _T(JABBER_FEAT_ROSTER_EXCHANGE));
+ HXML x = m << XCHILDNS(_T("x"), JABBER_FEAT_ROSTER_EXCHANGE);
for (int i = 0; i < nContacts; i++) {
DBVARIANT dbv;
@@ -1178,7 +1178,7 @@ int __cdecl CJabberProto::SendMsg(HANDLE hContact, int flags, const char* pszSrc jcb = JABBER_RESOURCE_CAPS_NONE;
if (jcb & JABBER_CAPS_CHATSTATES)
- m << XCHILDNS(_T("active"), _T(JABBER_FEAT_CHATSTATES));
+ m << XCHILDNS(_T("active"), JABBER_FEAT_CHATSTATES);
if (
// if message delivery check disabled by entity caps manager
@@ -1205,9 +1205,9 @@ int __cdecl CJabberProto::SendMsg(HANDLE hContact, int flags, const char* pszSrc // message receipts XEP priority
if (jcb & JABBER_CAPS_MESSAGE_RECEIPTS)
- m << XCHILDNS(_T("request"), _T(JABBER_FEAT_MESSAGE_RECEIPTS));
+ m << XCHILDNS(_T("request"), JABBER_FEAT_MESSAGE_RECEIPTS);
else if (jcb & JABBER_CAPS_MESSAGE_EVENTS) {
- HXML x = m << XCHILDNS(_T("x"), _T(JABBER_FEAT_MESSAGE_EVENTS));
+ HXML x = m << XCHILDNS(_T("x"), JABBER_FEAT_MESSAGE_EVENTS);
x << XCHILD(_T("delivered")); x << XCHILD(_T("offline"));
}
@@ -1477,17 +1477,17 @@ int __cdecl CJabberProto::UserIsTyping(HANDLE hContact, int type) m << XATTR(_T("type"), _T("chat")) << XATTRID(SerialNext());
switch (type) {
case PROTOTYPE_SELFTYPING_OFF:
- m << XCHILDNS(_T("paused"), _T(JABBER_FEAT_CHATSTATES));
+ m << XCHILDNS(_T("paused"), JABBER_FEAT_CHATSTATES);
m_ThreadInfo->send(m);
break;
case PROTOTYPE_SELFTYPING_ON:
- m << XCHILDNS(_T("composing"), _T(JABBER_FEAT_CHATSTATES));
+ m << XCHILDNS(_T("composing"), JABBER_FEAT_CHATSTATES);
m_ThreadInfo->send(m);
break;
}
}
else if (jcb & JABBER_CAPS_MESSAGE_EVENTS) {
- HXML x = m << XCHILDNS(_T("x"), _T(JABBER_FEAT_MESSAGE_EVENTS));
+ HXML x = m << XCHILDNS(_T("x"), JABBER_FEAT_MESSAGE_EVENTS);
if (item->messageEventIdStr != NULL)
x << XCHILD(_T("id"), item->messageEventIdStr);
diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp index 917e5e0d80..3330c209f7 100644 --- a/protocols/JabberG/src/jabber_rc.cpp +++ b/protocols/JabberG/src/jabber_rc.cpp @@ -71,10 +71,9 @@ BOOL CJabberAdhocManager::HandleItemsRequest(HXML, CJabberIqInfo* pInfo, const T if ( !szNode || !m_pProto->m_options.EnableRemoteControl || !m_pProto->IsRcRequestAllowedByACL(pInfo))
return FALSE;
- if ( !_tcscmp(szNode, _T(JABBER_FEAT_COMMANDS)))
- {
+ if ( !_tcscmp(szNode, JABBER_FEAT_COMMANDS)) {
XmlNodeIq iq(_T("result"), pInfo);
- HXML resultQuery = iq << XQUERY(_T(JABBER_FEAT_DISCO_ITEMS)) << XATTR(_T("node"), _T(JABBER_FEAT_COMMANDS));
+ HXML resultQuery = iq << XQUERY(JABBER_FEAT_DISCO_ITEMS) << XATTR(_T("node"), JABBER_FEAT_COMMANDS);
Lock();
CJabberAdhocNode* pNode = GetFirstNode();
@@ -102,16 +101,16 @@ BOOL CJabberAdhocManager::HandleInfoRequest(HXML, CJabberIqInfo* pInfo, const TC return FALSE;
// FIXME: same code twice
- if ( !_tcscmp(szNode, _T(JABBER_FEAT_COMMANDS))) {
+ if ( !_tcscmp(szNode, JABBER_FEAT_COMMANDS)) {
XmlNodeIq iq(_T("result"), pInfo);
- HXML resultQuery = iq << XQUERY(_T(JABBER_FEAT_DISCO_INFO)) << XATTR(_T("node"), _T(JABBER_FEAT_COMMANDS));
+ HXML resultQuery = iq << XQUERY(JABBER_FEAT_DISCO_INFO) << XATTR(_T("node"), JABBER_FEAT_COMMANDS);
resultQuery << XCHILD(_T("identity")) << XATTR(_T("name"), _T("Ad-hoc commands"))
<< XATTR(_T("category"), _T("automation")) << XATTR(_T("type"), _T("command-node"));
- resultQuery << XCHILD(_T("feature")) << XATTR(_T("var"), _T(JABBER_FEAT_COMMANDS));
- resultQuery << XCHILD(_T("feature")) << XATTR(_T("var"), _T(JABBER_FEAT_DATA_FORMS));
- resultQuery << XCHILD(_T("feature")) << XATTR(_T("var"), _T(JABBER_FEAT_DISCO_INFO));
- resultQuery << XCHILD(_T("feature")) << XATTR(_T("var"), _T(JABBER_FEAT_DISCO_ITEMS));
+ resultQuery << XCHILD(_T("feature")) << XATTR(_T("var"), JABBER_FEAT_COMMANDS);
+ resultQuery << XCHILD(_T("feature")) << XATTR(_T("var"), JABBER_FEAT_DATA_FORMS);
+ resultQuery << XCHILD(_T("feature")) << XATTR(_T("var"), JABBER_FEAT_DISCO_INFO);
+ resultQuery << XCHILD(_T("feature")) << XATTR(_T("var"), JABBER_FEAT_DISCO_ITEMS);
m_pProto->m_ThreadInfo->send(iq);
return TRUE;
@@ -121,13 +120,13 @@ BOOL CJabberAdhocManager::HandleInfoRequest(HXML, CJabberIqInfo* pInfo, const TC CJabberAdhocNode *pNode = FindNode(szNode);
if (pNode) {
XmlNodeIq iq(_T("result"), pInfo);
- HXML resultQuery = iq << XQUERY(_T(JABBER_FEAT_DISCO_INFO)) << XATTR(_T("node"), _T(JABBER_FEAT_DISCO_INFO));
+ HXML resultQuery = iq << XQUERY(JABBER_FEAT_DISCO_INFO) << XATTR(_T("node"), JABBER_FEAT_DISCO_INFO);
resultQuery << XCHILD(_T("identity")) << XATTR(_T("name"), pNode->GetName())
<< XATTR(_T("category"), _T("automation")) << XATTR(_T("type"), _T("command-node"));
- resultQuery << XCHILD(_T("feature")) << XATTR(_T("var"), _T(JABBER_FEAT_COMMANDS));
- resultQuery << XCHILD(_T("feature")) << XATTR(_T("var"), _T(JABBER_FEAT_DATA_FORMS));
- resultQuery << XCHILD(_T("feature")) << XATTR(_T("var"), _T(JABBER_FEAT_DISCO_INFO));
+ resultQuery << XCHILD(_T("feature")) << XATTR(_T("var"), JABBER_FEAT_COMMANDS);
+ resultQuery << XCHILD(_T("feature")) << XATTR(_T("var"), JABBER_FEAT_DATA_FORMS);
+ resultQuery << XCHILD(_T("feature")) << XATTR(_T("var"), JABBER_FEAT_DISCO_INFO);
Unlock();
m_pProto->m_ThreadInfo->send(iq);
@@ -167,7 +166,7 @@ BOOL CJabberAdhocManager::HandleCommandRequest(HXML iqNode, CJabberIqInfo* pInfo XmlNodeIq iq(_T("error"), pInfo);
HXML errorNode = iq << XCHILD(_T("error")) << XATTR(_T("type"), _T("modify"));
errorNode << XCHILDNS(_T("bad-request"), _T("urn:ietf:params:xml:ns:xmpp-stanzas"));
- errorNode << XCHILDNS(_T("bad-sessionid"), _T(JABBER_FEAT_COMMANDS));
+ errorNode << XCHILDNS(_T("bad-sessionid"), JABBER_FEAT_COMMANDS);
m_pProto->m_ThreadInfo->send(iq);
return FALSE;
}
@@ -193,7 +192,7 @@ BOOL CJabberAdhocManager::HandleCommandRequest(HXML iqNode, CJabberIqInfo* pInfo if (nResultCode == JABBER_ADHOC_HANDLER_STATUS_COMPLETED) {
m_pProto->m_ThreadInfo->send(
XmlNodeIq(_T("result"), pInfo)
- << XCHILDNS(_T("command"), _T(JABBER_FEAT_COMMANDS)) << XATTR(_T("node"), szNode)
+ << XCHILDNS(_T("command"), JABBER_FEAT_COMMANDS) << XATTR(_T("node"), szNode)
<< XATTR(_T("sessionid"), pSession->GetSessionId()) << XATTR(_T("status"), _T("completed"))
<< XCHILD(_T("note"), TranslateT("Command completed successfully")) << XATTR(_T("type"), _T("info")));
@@ -203,7 +202,7 @@ BOOL CJabberAdhocManager::HandleCommandRequest(HXML iqNode, CJabberIqInfo* pInfo else if (nResultCode == JABBER_ADHOC_HANDLER_STATUS_CANCEL) {
m_pProto->m_ThreadInfo->send(
XmlNodeIq(_T("result"), pInfo)
- << XCHILDNS(_T("command"), _T(JABBER_FEAT_COMMANDS)) << XATTR(_T("node"), szNode)
+ << XCHILDNS(_T("command"), JABBER_FEAT_COMMANDS) << XATTR(_T("node"), szNode)
<< XATTR(_T("sessionid"), pSession->GetSessionId()) << XATTR(_T("status"), _T("canceled"))
<< XCHILD(_T("note"), TranslateT("Error occured during processing command")) << XATTR(_T("type"), _T("error")));
@@ -220,12 +219,12 @@ BOOL CJabberAdhocManager::HandleCommandRequest(HXML iqNode, CJabberIqInfo* pInfo BOOL CJabberAdhocManager::FillDefaultNodes()
{
- AddNode(NULL, _T(JABBER_FEAT_RC_SET_STATUS), TranslateT("Set status"), &CJabberProto::AdhocSetStatusHandler);
- AddNode(NULL, _T(JABBER_FEAT_RC_SET_OPTIONS), TranslateT("Set options"), &CJabberProto::AdhocOptionsHandler);
- AddNode(NULL, _T(JABBER_FEAT_RC_FORWARD), TranslateT("Forward unread messages"), &CJabberProto::AdhocForwardHandler);
- AddNode(NULL, _T(JABBER_FEAT_RC_LEAVE_GROUPCHATS), TranslateT("Leave groupchats"), &CJabberProto::AdhocLeaveGroupchatsHandler);
- AddNode(NULL, _T(JABBER_FEAT_RC_WS_LOCK), TranslateT("Lock workstation"), &CJabberProto::AdhocLockWSHandler);
- AddNode(NULL, _T(JABBER_FEAT_RC_QUIT_MIRANDA), TranslateT("Quit Miranda NG"), &CJabberProto::AdhocQuitMirandaHandler);
+ AddNode(NULL, JABBER_FEAT_RC_SET_STATUS, TranslateT("Set status"), &CJabberProto::AdhocSetStatusHandler);
+ AddNode(NULL, JABBER_FEAT_RC_SET_OPTIONS, TranslateT("Set options"), &CJabberProto::AdhocOptionsHandler);
+ AddNode(NULL, JABBER_FEAT_RC_FORWARD, TranslateT("Forward unread messages"), &CJabberProto::AdhocForwardHandler);
+ AddNode(NULL, JABBER_FEAT_RC_LEAVE_GROUPCHATS, TranslateT("Leave groupchats"), &CJabberProto::AdhocLeaveGroupchatsHandler);
+ AddNode(NULL, JABBER_FEAT_RC_WS_LOCK, TranslateT("Lock workstation"), &CJabberProto::AdhocLockWSHandler);
+ AddNode(NULL, JABBER_FEAT_RC_QUIT_MIRANDA, TranslateT("Quit Miranda NG"), &CJabberProto::AdhocQuitMirandaHandler);
return TRUE;
}
@@ -236,17 +235,17 @@ static char *StatusModeToDbSetting(int status,const char *suffix) static char str[64];
switch(status) {
- case ID_STATUS_AWAY: prefix="Away"; break;
- case ID_STATUS_NA: prefix="Na"; break;
- case ID_STATUS_DND: prefix="Dnd"; break;
- case ID_STATUS_OCCUPIED: prefix="Occupied"; break;
- case ID_STATUS_FREECHAT: prefix="FreeChat"; break;
- case ID_STATUS_ONLINE: prefix="On"; break;
- case ID_STATUS_OFFLINE: prefix="Off"; break;
- case ID_STATUS_INVISIBLE: prefix="Inv"; break;
- case ID_STATUS_ONTHEPHONE: prefix="Otp"; break;
- case ID_STATUS_OUTTOLUNCH: prefix="Otl"; break;
- case ID_STATUS_IDLE: prefix="Idl"; break;
+ case ID_STATUS_AWAY: prefix="Away"; break;
+ case ID_STATUS_NA: prefix="Na"; break;
+ case ID_STATUS_DND: prefix="Dnd"; break;
+ case ID_STATUS_OCCUPIED: prefix="Occupied"; break;
+ case ID_STATUS_FREECHAT: prefix="FreeChat"; break;
+ case ID_STATUS_ONLINE: prefix="On"; break;
+ case ID_STATUS_OFFLINE: prefix="Off"; break;
+ case ID_STATUS_INVISIBLE: prefix="Inv"; break;
+ case ID_STATUS_ONTHEPHONE: prefix="Otp"; break;
+ case ID_STATUS_OUTTOLUNCH: prefix="Otl"; break;
+ case ID_STATUS_IDLE: prefix="Idl"; break;
default: return NULL;
}
lstrcpyA(str,prefix); lstrcatA(str,suffix);
@@ -261,15 +260,15 @@ int CJabberProto::AdhocSetStatusHandler(HXML, CJabberIqInfo* pInfo, CJabberAdhoc XmlNodeIq iq(_T("result"), pInfo);
HXML xNode = iq
- << XCHILDNS(_T("command"), _T(JABBER_FEAT_COMMANDS)) << XATTR(_T("node"), _T(JABBER_FEAT_RC_SET_STATUS))
+ << XCHILDNS(_T("command"), JABBER_FEAT_COMMANDS) << XATTR(_T("node"), JABBER_FEAT_RC_SET_STATUS)
<< XATTR(_T("sessionid"), pSession->GetSessionId()) << XATTR(_T("status"), _T("executing"))
- << XCHILDNS(_T("x"), _T(JABBER_FEAT_DATA_FORMS)) << XATTR(_T("type"), _T("form"));
+ << XCHILDNS(_T("x"), JABBER_FEAT_DATA_FORMS) << XATTR(_T("type"), _T("form"));
xNode << XCHILD(_T("title"), TranslateT("Change Status"));
xNode << XCHILD(_T("instructions"), TranslateT("Choose the status and status message"));
xNode << XCHILD(_T("field")) << XATTR(_T("type"), _T("hidden")) << XATTR(_T("var"), _T("FORM_TYPE"))
- << XATTR(_T("value"), _T(JABBER_FEAT_RC));
+ << XATTR(_T("value"), JABBER_FEAT_RC);
HXML fieldNode = xNode << XCHILD(_T("field")) << XATTR(_T("label"), TranslateT("Status"))
<< XATTR(_T("type"), _T("list-single")) << XATTR(_T("var"), _T("status"));
@@ -336,7 +335,7 @@ int CJabberProto::AdhocSetStatusHandler(HXML, CJabberIqInfo* pInfo, CJabberAdhoc else if (pSession->GetStage() == 1) {
// result form here
HXML commandNode = pInfo->GetChildNode();
- HXML xNode = xmlGetChildByTag(commandNode, "x", "xmlns", _T(JABBER_FEAT_DATA_FORMS));
+ HXML xNode = xmlGetChildByTag(commandNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
if ( !xNode)
return JABBER_ADHOC_HANDLER_STATUS_CANCEL;
@@ -410,15 +409,15 @@ int CJabberProto::AdhocOptionsHandler(HXML, CJabberIqInfo* pInfo, CJabberAdhocSe XmlNodeIq iq(_T("result"), pInfo);
HXML xNode = iq
- << XCHILDNS(_T("command"), _T(JABBER_FEAT_COMMANDS)) << XATTR(_T("node"), _T(JABBER_FEAT_RC_SET_OPTIONS))
+ << XCHILDNS(_T("command"), JABBER_FEAT_COMMANDS) << XATTR(_T("node"), JABBER_FEAT_RC_SET_OPTIONS)
<< XATTR(_T("sessionid"), pSession->GetSessionId()) << XATTR(_T("status"), _T("executing"))
- << XCHILDNS(_T("x"), _T(JABBER_FEAT_DATA_FORMS)) << XATTR(_T("type"), _T("form"));
+ << XCHILDNS(_T("x"), JABBER_FEAT_DATA_FORMS) << XATTR(_T("type"), _T("form"));
xNode << XCHILD(_T("title"), TranslateT("Set Options"));
xNode << XCHILD(_T("instructions"), TranslateT("Set the desired options"));
xNode << XCHILD(_T("field")) << XATTR(_T("type"), _T("hidden")) << XATTR(_T("var"), _T("FORM_TYPE"))
- << XATTR(_T("value"), _T(JABBER_FEAT_RC));
+ << XATTR(_T("value"), JABBER_FEAT_RC);
// Automatically Accept File Transfers
TCHAR szTmpBuff[ 1024 ];
@@ -442,7 +441,7 @@ int CJabberProto::AdhocOptionsHandler(HXML, CJabberIqInfo* pInfo, CJabberAdhocSe if (pSession->GetStage() == 1) {
// result form here
HXML commandNode = pInfo->GetChildNode();
- HXML xNode = xmlGetChildByTag(commandNode, "x", "xmlns", _T(JABBER_FEAT_DATA_FORMS));
+ HXML xNode = xmlGetChildByTag(commandNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
if ( !xNode)
return JABBER_ADHOC_HANDLER_STATUS_CANCEL;
@@ -514,7 +513,7 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo* pInfo, CJabberAdhocSe m_ThreadInfo->send(
XmlNodeIq(_T("result"), pInfo)
- << XCHILDNS(_T("command"), _T(JABBER_FEAT_COMMANDS)) << XATTR(_T("node"), _T(JABBER_FEAT_RC_FORWARD))
+ << XCHILDNS(_T("command"), JABBER_FEAT_COMMANDS) << XATTR(_T("node"), JABBER_FEAT_RC_FORWARD)
<< XATTR(_T("sessionid"), pSession->GetSessionId()) << XATTR(_T("status"), _T("completed"))
<< XCHILD(_T("note"), szMsg) << XATTR(_T("type"), _T("info")));
@@ -526,9 +525,9 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo* pInfo, CJabberAdhocSe XmlNodeIq iq(_T("result"), pInfo);
HXML xNode = iq
- << XCHILDNS(_T("command"), _T(JABBER_FEAT_COMMANDS)) << XATTR(_T("node"), _T(JABBER_FEAT_RC_FORWARD))
+ << XCHILDNS(_T("command"), JABBER_FEAT_COMMANDS) << XATTR(_T("node"), JABBER_FEAT_RC_FORWARD)
<< XATTR(_T("sessionid"), pSession->GetSessionId()) << XATTR(_T("status"), _T("executing"))
- << XCHILDNS(_T("x"), _T(JABBER_FEAT_DATA_FORMS)) << XATTR(_T("type"), _T("form"));
+ << XCHILDNS(_T("x"), JABBER_FEAT_DATA_FORMS) << XATTR(_T("type"), _T("form"));
xNode << XCHILD(_T("title"), TranslateT("Forward options"));
@@ -536,7 +535,7 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo* pInfo, CJabberAdhocSe xNode << XCHILD(_T("instructions"), szMsg);
xNode << XCHILD(_T("field")) << XATTR(_T("type"), _T("hidden")) << XATTR(_T("var"), _T("FORM_TYPE"))
- << XCHILD(_T("value"), _T(JABBER_FEAT_RC));
+ << XCHILD(_T("value"), JABBER_FEAT_RC);
// remove clist events
xNode << XCHILD(_T("field")) << XATTR(_T("label"), TranslateT("Mark messages as read")) << XATTR(_T("type"), _T("boolean"))
@@ -550,7 +549,7 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo* pInfo, CJabberAdhocSe if (pSession->GetStage() == 1) {
// result form here
HXML commandNode = pInfo->GetChildNode();
- HXML xNode = xmlGetChildByTag(commandNode, "x", "xmlns", _T(JABBER_FEAT_DATA_FORMS));
+ HXML xNode = xmlGetChildByTag(commandNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
if ( !xNode)
return JABBER_ADHOC_HANDLER_STATUS_CANCEL;
@@ -588,7 +587,7 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo* pInfo, CJabberAdhocSe msg << XATTR(_T("to"), pInfo->GetFrom()) << XATTRID(SerialNext())
<< XCHILD(_T("body"), szEventText);
- HXML addressesNode = msg << XCHILDNS(_T("addresses"), _T(JABBER_FEAT_EXT_ADDRESSING));
+ HXML addressesNode = msg << XCHILDNS(_T("addresses"), JABBER_FEAT_EXT_ADDRESSING);
TCHAR szOFrom[JABBER_MAX_JID_LEN];
EnterCriticalSection(&m_csLastResourceMap);
TCHAR *szOResource = FindLastResourceByDbEvent(hDbEvent);
@@ -629,7 +628,7 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo* pInfo, CJabberAdhocSe m_ThreadInfo->send(
XmlNodeIq(_T("result"), pInfo)
- << XCHILDNS(_T("command"), _T(JABBER_FEAT_COMMANDS)) << XATTR(_T("node"), _T(JABBER_FEAT_RC_FORWARD))
+ << XCHILDNS(_T("command"), JABBER_FEAT_COMMANDS) << XATTR(_T("node"), JABBER_FEAT_RC_FORWARD)
<< XATTR(_T("sessionid"), pSession->GetSessionId()) << XATTR(_T("status"), _T("completed"))
<< XCHILD(_T("note"), szMsg) << XATTR(_T("type"), _T("info")));
@@ -660,7 +659,7 @@ int CJabberProto::AdhocLockWSHandler(HXML, CJabberIqInfo* pInfo, CJabberAdhocSes m_ThreadInfo->send(
XmlNodeIq(_T("result"), pInfo)
- << XCHILDNS(_T("command"), _T(JABBER_FEAT_COMMANDS)) << XATTR(_T("node"), _T(JABBER_FEAT_RC_WS_LOCK))
+ << XCHILDNS(_T("command"), JABBER_FEAT_COMMANDS) << XATTR(_T("node"), JABBER_FEAT_RC_WS_LOCK)
<< XATTR(_T("sessionid"), pSession->GetSessionId()) << XATTR(_T("status"), _T("completed"))
<< XCHILD(_T("note"), szMsg) << XATTR(_T("type"), bOk ? _T("info") : _T("error")));
@@ -680,15 +679,15 @@ int CJabberProto::AdhocQuitMirandaHandler(HXML, CJabberIqInfo* pInfo, CJabberAdh XmlNodeIq iq(_T("result"), pInfo);
HXML xNode = iq
- << XCHILDNS(_T("command"), _T(JABBER_FEAT_COMMANDS)) << XATTR(_T("node"), _T(JABBER_FEAT_RC_QUIT_MIRANDA))
+ << XCHILDNS(_T("command"), JABBER_FEAT_COMMANDS) << XATTR(_T("node"), JABBER_FEAT_RC_QUIT_MIRANDA)
<< XATTR(_T("sessionid"), pSession->GetSessionId()) << XATTR(_T("status"), _T("executing"))
- << XCHILDNS(_T("x"), _T(JABBER_FEAT_DATA_FORMS)) << XATTR(_T("type"), _T("form"));
+ << XCHILDNS(_T("x"), JABBER_FEAT_DATA_FORMS) << XATTR(_T("type"), _T("form"));
xNode << XCHILD(_T("title"), TranslateT("Confirmation needed"));
xNode << XCHILD(_T("instructions"), TranslateT("Please confirm Miranda NG shutdown"));
xNode << XCHILD(_T("field")) << XATTR(_T("type"), _T("hidden")) << XATTR(_T("var"), _T("FORM_TYPE"))
- << XCHILD(_T("value"), _T(JABBER_FEAT_RC));
+ << XCHILD(_T("value"), JABBER_FEAT_RC);
// I Agree checkbox
xNode << XCHILD(_T("field")) << XATTR(_T("label"), _T("I agree")) << XATTR(_T("type"), _T("boolean"))
@@ -701,7 +700,7 @@ int CJabberProto::AdhocQuitMirandaHandler(HXML, CJabberIqInfo* pInfo, CJabberAdh if (pSession->GetStage() == 1) {
// result form here
HXML commandNode = pInfo->GetChildNode();
- HXML xNode = xmlGetChildByTag(commandNode, "x", "xmlns", _T(JABBER_FEAT_DATA_FORMS));
+ HXML xNode = xmlGetChildByTag(commandNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
if ( !xNode)
return JABBER_ADHOC_HANDLER_STATUS_CANCEL;
@@ -740,7 +739,7 @@ int CJabberProto::AdhocLeaveGroupchatsHandler(HXML, CJabberIqInfo* pInfo, CJabbe m_ThreadInfo->send(
XmlNodeIq(_T("result"), pInfo)
- << XCHILDNS(_T("command"), _T(JABBER_FEAT_COMMANDS)) << XATTR(_T("node"), _T(JABBER_FEAT_RC_LEAVE_GROUPCHATS))
+ << XCHILDNS(_T("command"), JABBER_FEAT_COMMANDS) << XATTR(_T("node"), JABBER_FEAT_RC_LEAVE_GROUPCHATS)
<< XATTR(_T("sessionid"), pSession->GetSessionId()) << XATTR(_T("status"), _T("completed"))
<< XCHILD(_T("note"), szMsg) << XATTR(_T("type"), _T("info")));
@@ -751,15 +750,15 @@ int CJabberProto::AdhocLeaveGroupchatsHandler(HXML, CJabberIqInfo* pInfo, CJabbe XmlNodeIq iq(_T("result"), pInfo);
HXML xNode = iq
- << XCHILDNS(_T("command"), _T(JABBER_FEAT_COMMANDS)) << XATTR(_T("node"), _T(JABBER_FEAT_RC_LEAVE_GROUPCHATS))
+ << XCHILDNS(_T("command"), JABBER_FEAT_COMMANDS) << XATTR(_T("node"), JABBER_FEAT_RC_LEAVE_GROUPCHATS)
<< XATTR(_T("sessionid"), pSession->GetSessionId()) << XATTR(_T("status"), _T("executing"))
- << XCHILDNS(_T("x"), _T(JABBER_FEAT_DATA_FORMS)) << XATTR(_T("type"), _T("form"));
+ << XCHILDNS(_T("x"), JABBER_FEAT_DATA_FORMS) << XATTR(_T("type"), _T("form"));
xNode << XCHILD(_T("title"), TranslateT("Leave groupchats"));
xNode << XCHILD(_T("instructions"), TranslateT("Choose the groupchats you want to leave"));
xNode << XCHILD(_T("field")) << XATTR(_T("type"), _T("hidden")) << XATTR(_T("var"), _T("FORM_TYPE"))
- << XATTR(_T("value"), _T(JABBER_FEAT_RC));
+ << XATTR(_T("value"), JABBER_FEAT_RC);
// Groupchats
HXML fieldNode = xNode << XCHILD(_T("field")) << XATTR(_T("label"), NULL) << XATTR(_T("type"), _T("list-multi")) << XATTR(_T("var"), _T("groupchats"));
@@ -781,7 +780,7 @@ int CJabberProto::AdhocLeaveGroupchatsHandler(HXML, CJabberIqInfo* pInfo, CJabbe if (pSession->GetStage() == 1) {
// result form here
HXML commandNode = pInfo->GetChildNode();
- HXML xNode = xmlGetChildByTag(commandNode, "x", "xmlns", _T(JABBER_FEAT_DATA_FORMS));
+ HXML xNode = xmlGetChildByTag(commandNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
if ( !xNode)
return JABBER_ADHOC_HANDLER_STATUS_CANCEL;
diff --git a/protocols/JabberG/src/jabber_search.cpp b/protocols/JabberG/src/jabber_search.cpp index c88dca0013..0366291a25 100644 --- a/protocols/JabberG/src/jabber_search.cpp +++ b/protocols/JabberG/src/jabber_search.cpp @@ -142,7 +142,7 @@ void CJabberProto::OnIqResultGetSearchFields(HXML iqNode) if ( !lstrcmp(type, _T("result"))) {
HXML queryNode = xmlGetNthChild(iqNode, _T("query"), 1);
- HXML xNode = xmlGetChildByTag(queryNode, "x", "xmlns", _T(JABBER_FEAT_DATA_FORMS));
+ HXML xNode = xmlGetChildByTag(queryNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
ShowWindow(searchHandleDlg,SW_HIDE);
if (xNode) {
@@ -310,7 +310,7 @@ void CJabberProto::OnIqResultAdvancedSearch(HXML iqNode) if ( !lstrcmp(type, _T("result"))) {
HXML queryNode = xmlGetNthChild(iqNode, _T("query"), 1);
- HXML xNode = xmlGetChildByTag(queryNode, "x", "xmlns", _T(JABBER_FEAT_DATA_FORMS));
+ HXML xNode = xmlGetChildByTag(queryNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
if (xNode) {
//1. Form search results info
HXML reportNode = xmlGetNthChild(xNode, _T("reported"), 1);
diff --git a/protocols/JabberG/src/jabber_svc.cpp b/protocols/JabberG/src/jabber_svc.cpp index d1d5f9f6f8..dc7011bc7d 100644 --- a/protocols/JabberG/src/jabber_svc.cpp +++ b/protocols/JabberG/src/jabber_svc.cpp @@ -173,9 +173,9 @@ INT_PTR __cdecl CJabberProto::JabberGetAvatarInfo(WPARAM wParam, LPARAM lParam) XmlNodeIq iq(_T("get"), iqId, szJid);
if (isXVcard)
- iq << XCHILDNS(_T("vCard"), _T(JABBER_FEAT_VCARD_TEMP));
+ iq << XCHILDNS(_T("vCard"), JABBER_FEAT_VCARD_TEMP);
else
- iq << XQUERY(isXVcard ? _T("") : _T(JABBER_FEAT_AVATAR));
+ iq << XQUERY(isXVcard ? _T("") : JABBER_FEAT_AVATAR);
m_ThreadInfo->send(iq);
db_free(&dbv);
@@ -604,7 +604,7 @@ INT_PTR __cdecl CJabberProto::JabberSendNudge(WPARAM wParam, LPARAM) m_ThreadInfo->send(
XmlNode(_T("message")) << XATTR(_T("type"), _T("headline")) << XATTR(_T("to"), tszJid)
<< XCHILDNS(_T("attention"),
- jcb & JABBER_CAPS_ATTENTION ? _T(JABBER_FEAT_ATTENTION) : _T(JABBER_FEAT_ATTENTION_0)));
+ jcb & JABBER_CAPS_ATTENTION ? JABBER_FEAT_ATTENTION : JABBER_FEAT_ATTENTION_0));
}
return 0;
}
@@ -617,7 +617,7 @@ BOOL CJabberProto::SendHttpAuthReply(CJabberHttpAuthParams *pParams, BOOL bAutho if (pParams->m_nType == CJabberHttpAuthParams::IQ) {
XmlNodeIq iq(bAuthorized ? _T("result") : _T("error"), pParams->m_szIqId, pParams->m_szFrom);
if ( !bAuthorized) {
- iq << XCHILDNS(_T("confirm"), _T(JABBER_FEAT_HTTP_AUTH)) << XATTR(_T("id"), pParams->m_szId)
+ iq << XCHILDNS(_T("confirm"), JABBER_FEAT_HTTP_AUTH) << XATTR(_T("id"), pParams->m_szId)
<< XATTR(_T("method"), pParams->m_szMethod) << XATTR(_T("url"), pParams->m_szUrl);
iq << XCHILD(_T("error")) << XATTRI(_T("code"), 401) << XATTR(_T("type"), _T("auth"))
<< XCHILDNS(_T("not-authorized"), _T("urn:ietf:params:xml:xmpp-stanzas"));
@@ -632,7 +632,7 @@ BOOL CJabberProto::SendHttpAuthReply(CJabberHttpAuthParams *pParams, BOOL bAutho if (pParams->m_szThreadId)
msg << XCHILD(_T("thread"), pParams->m_szThreadId);
- msg << XCHILDNS(_T("confirm"), _T(JABBER_FEAT_HTTP_AUTH)) << XATTR(_T("id"), pParams->m_szId)
+ msg << XCHILDNS(_T("confirm"), JABBER_FEAT_HTTP_AUTH) << XATTR(_T("id"), pParams->m_szId)
<< XATTR(_T("method"), pParams->m_szMethod) << XATTR(_T("url"), pParams->m_szUrl);
if ( !bAuthorized)
@@ -998,7 +998,7 @@ int CJabberNetInterface::RegisterFeature(LPCTSTR szFeature, LPCTSTR szDescriptio if (_tcschr(_T("bcdfghjklmnpqrstvwxz0123456789"), *pSrc))
*pDst++ = *pSrc;
*pDst = 0;
- m_psProto->m_clientCapsManager.SetClientCaps(_T(JABBER_CAPS_MIRANDA_NODE), szExt, jcb);
+ m_psProto->m_clientCapsManager.SetClientCaps(JABBER_CAPS_MIRANDA_NODE, szExt, jcb);
fcp = new JabberFeatCapPairDynamic();
fcp->szExt = szExt; // will be deallocated along with other values of JabberFeatCapPairDynamic in CJabberProto destructor
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index 5ab49961be..7d7ce7d5a3 100644 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -489,7 +489,7 @@ LBL_FatalError: if (m_ThreadInfo->jabberServerCaps & JABBER_CAPS_PING) {
CJabberIqInfo* pInfo = m_iqManager.AddHandler(&CJabberProto::OnPingReply, JABBER_IQ_TYPE_GET, NULL, 0, -1, this);
pInfo->SetTimeout(m_options.ConnectionKeepAliveTimeout);
- info->send( XmlNodeIq(pInfo) << XATTR(_T("from"), m_ThreadInfo->fullJID) << XCHILDNS(_T("ping"), _T(JABBER_FEAT_PING)));
+ info->send( XmlNodeIq(pInfo) << XATTR(_T("from"), m_ThreadInfo->fullJID) << XCHILDNS(_T("ping"), JABBER_FEAT_PING));
}
else info->send(" \t ");
continue;
@@ -629,7 +629,7 @@ recvRest: void CJabberProto::PerformRegistration(ThreadData* info)
{
iqIdRegGetReg = SerialNext();
- info->send( XmlNodeIq(_T("get"), iqIdRegGetReg, NULL) << XQUERY(_T(JABBER_FEAT_REGISTER)));
+ info->send( XmlNodeIq(_T("get"), iqIdRegGetReg, NULL) << XQUERY(JABBER_FEAT_REGISTER));
SendMessage(info->reg_hwndDlg, WM_JABBER_REGDLG_UPDATE, 50, (LPARAM)TranslateT("Requesting registration instruction..."));
}
@@ -1024,7 +1024,7 @@ void CJabberProto::OnProcessPubsubEvent(HXML node) if ( !from)
return;
- HXML eventNode = xmlGetChildByTag(node, "event", "xmlns", _T(JABBER_FEAT_PUBSUB_EVENT));
+ HXML eventNode = xmlGetChildByTag(node, "event", "xmlns", JABBER_FEAT_PUBSUB_EVENT);
if ( !eventNode)
return;
@@ -1035,14 +1035,14 @@ void CJabberProto::OnProcessPubsubEvent(HXML node) return;
HXML itemsNode;
- if (m_options.EnableUserTune && (itemsNode = xmlGetChildByTag(eventNode, "items", "node", _T(JABBER_FEAT_USER_TUNE)))) {
+ if (m_options.EnableUserTune && (itemsNode = xmlGetChildByTag(eventNode, "items", "node", JABBER_FEAT_USER_TUNE))) {
// node retract?
if (xmlGetChild(itemsNode , "retract")) {
SetContactTune(hContact, NULL, NULL, NULL, NULL, NULL);
return;
}
- HXML tuneNode = XPath(itemsNode, _T("item/tune[@xmlns='") _T(JABBER_FEAT_USER_TUNE) _T("']"));
+ HXML tuneNode = XPath(itemsNode, _T("item/tune[@xmlns='") JABBER_FEAT_USER_TUNE _T("']"));
if ( !tuneNode)
return;
@@ -1114,34 +1114,32 @@ HANDLE CJabberProto::CreateTemporaryContact(const TCHAR *szJid, JABBER_LIST_ITEM void CJabberProto::OnProcessMessage(HXML node, ThreadData* info)
{
- HXML subjectNode, xNode, inviteNode, idNode, n;
- LPCTSTR from, type, idStr, fromResource;
- HANDLE hContact;
+ HXML xNode, n;
if ( !xmlGetName(node) || _tcscmp(xmlGetName(node), _T("message")))
return;
- type = xmlGetAttrValue(node, _T("type"));
+ LPCTSTR from, type = xmlGetAttrValue(node, _T("type"));
if ((from = xmlGetAttrValue(node, _T("from"))) == NULL)
return;
- idStr = xmlGetAttrValue(node, _T("id"));
- JABBER_RESOURCE_STATUS *resourceStatus = ResourceInfoFromJID(from);
+ LPCTSTR idStr = xmlGetAttrValue(node, _T("id"));
+ JABBER_RESOURCE_STATUS *pFromResource = ResourceInfoFromJID(from);
// Message receipts delivery request. Reply here, before a call to HandleMessagePermanent() to make sure message receipts are handled for external plugins too.
- if ((!type || _tcsicmp(type, _T("error"))) && xmlGetChildByTag(node, "request", "xmlns", _T(JABBER_FEAT_MESSAGE_RECEIPTS))) {
+ if ((!type || _tcsicmp(type, _T("error"))) && xmlGetChildByTag(node, "request", "xmlns", JABBER_FEAT_MESSAGE_RECEIPTS)) {
info->send(
XmlNode(_T("message")) << XATTR(_T("to"), from) << XATTR(_T("id"), idStr)
- << XCHILDNS(_T("received"), _T(JABBER_FEAT_MESSAGE_RECEIPTS)) << XATTR(_T("id"), idStr));
+ << XCHILDNS(_T("received"), JABBER_FEAT_MESSAGE_RECEIPTS) << XATTR(_T("id"), idStr));
- if (resourceStatus)
- resourceStatus->jcbManualDiscoveredCaps |= JABBER_CAPS_MESSAGE_RECEIPTS;
+ if (pFromResource)
+ pFromResource->jcbManualDiscoveredCaps |= JABBER_CAPS_MESSAGE_RECEIPTS;
}
if (m_messageManager.HandleMessagePermanent(node, info))
return;
- hContact = HContactFromJID(from);
+ HANDLE hContact = HContactFromJID(from);
JABBER_LIST_ITEM *chatItem = ListGetItemPtr(LIST_CHATROOM, from);
if (chatItem) {
HXML xCaptcha = xmlGetChild(node, "captcha");
@@ -1156,13 +1154,15 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData* info) bodyNode = xmlGetChild(node , "body");
if (bodyNode != NULL && xmlGetText(bodyNode))
szMessage = xmlGetText(bodyNode);
- if ((subjectNode = xmlGetChild(node , "subject")) && xmlGetText(subjectNode) && xmlGetText(subjectNode)[0] != _T('\0')) {
- size_t cbLen = (szMessage ? _tcslen(szMessage) : 0) + _tcslen(xmlGetText(subjectNode)) + 128;
+
+ LPCTSTR ptszSubject = xmlGetText( xmlGetChild(node , "subject"));
+ if (ptszSubject && *ptszSubject) {
+ size_t cbLen = (szMessage ? _tcslen(szMessage) : 0) + _tcslen(ptszSubject) + 128;
TCHAR* szTmp = (TCHAR *)alloca(sizeof(TCHAR) * cbLen);
szTmp[0] = _T('\0');
if (szMessage)
_tcscat(szTmp, _T("Subject: "));
- _tcscat(szTmp, xmlGetText(subjectNode));
+ _tcscat(szTmp, ptszSubject);
if (szMessage) {
_tcscat(szTmp, _T("\r\n"));
_tcscat(szTmp, szMessage);
@@ -1170,7 +1170,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData* info) szMessage = szTmp;
}
- if (szMessage && (n = xmlGetChildByTag(node, "addresses", "xmlns", _T(JABBER_FEAT_EXT_ADDRESSING)))) {
+ if (szMessage && (n = xmlGetChildByTag(node, "addresses", "xmlns", JABBER_FEAT_EXT_ADDRESSING))) {
HXML addressNode = xmlGetChildByTag(n, "address", "type", _T("ofrom"));
if (addressNode) {
const TCHAR *szJid = xmlGetAttrValue(addressNode, _T("jid"));
@@ -1200,23 +1200,26 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData* info) BOOL delivered = FALSE;
// check chatstates availability
- if (resourceStatus && xmlGetChildByTag(node, "active", "xmlns", _T(JABBER_FEAT_CHATSTATES)))
- resourceStatus->jcbManualDiscoveredCaps |= JABBER_CAPS_CHATSTATES;
+ if (pFromResource && xmlGetChildByTag(node, "active", "xmlns", JABBER_FEAT_CHATSTATES))
+ pFromResource->jcbManualDiscoveredCaps |= JABBER_CAPS_CHATSTATES;
// chatstates composing event
- if (hContact && xmlGetChildByTag(node, "composing", "xmlns", _T(JABBER_FEAT_CHATSTATES)))
+ if (hContact && xmlGetChildByTag(node, "composing", "xmlns", JABBER_FEAT_CHATSTATES))
CallService(MS_PROTO_CONTACTISTYPING, (WPARAM)hContact, 60);
// chatstates paused event
- if (hContact && xmlGetChildByTag(node, "paused", "xmlns", _T(JABBER_FEAT_CHATSTATES)))
+ if (hContact && xmlGetChildByTag(node, "paused", "xmlns", JABBER_FEAT_CHATSTATES))
CallService(MS_PROTO_CONTACTISTYPING, (WPARAM)hContact, PROTOTYPE_CONTACTTYPING_OFF);
// chatstates inactive event
- if (hContact && xmlGetChildByTag(node, "inactive", "xmlns", _T(JABBER_FEAT_CHATSTATES)))
+ if (hContact && xmlGetChildByTag(node, "inactive", "xmlns", JABBER_FEAT_CHATSTATES)) {
CallService(MS_PROTO_CONTACTISTYPING, (WPARAM)hContact, PROTOTYPE_CONTACTTYPING_OFF);
+ if (pFromResource)
+ pFromResource->bMessageSessionActive = false;
+ }
// message receipts delivery notification
- if (n = xmlGetChildByTag(node, "received", "xmlns", _T(JABBER_FEAT_MESSAGE_RECEIPTS))) {
+ if (n = xmlGetChildByTag(node, "received", "xmlns", JABBER_FEAT_MESSAGE_RECEIPTS)) {
int nPacketId = JabberGetPacketID(n);
if (nPacketId == -1)
nPacketId = JabberGetPacketID(node);
@@ -1227,8 +1230,8 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData* info) JabberReadXep203delay(node, msgTime);
// XEP-0224 support (Attention/Nudge)
- if (xmlGetChildByTag(node, "attention", "xmlns", _T(JABBER_FEAT_ATTENTION)) ||
- xmlGetChildByTag(node, "attention", "xmlns", _T(JABBER_FEAT_ATTENTION_0))) {
+ if (xmlGetChildByTag(node, "attention", "xmlns", JABBER_FEAT_ATTENTION) ||
+ xmlGetChildByTag(node, "attention", "xmlns", JABBER_FEAT_ATTENTION_0)) {
if ( !hContact)
hContact = CreateTemporaryContact(from, chatItem);
if (hContact)
@@ -1236,7 +1239,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData* info) }
// chatstates gone event
- if (hContact && xmlGetChildByTag(node, "gone", "xmlns", _T(JABBER_FEAT_CHATSTATES)) && m_options.LogChatstates) {
+ if (hContact && xmlGetChildByTag(node, "gone", "xmlns", JABBER_FEAT_CHATSTATES) && m_options.LogChatstates) {
BYTE bEventType = JABBER_DB_EVENT_CHATSTATES_GONE; // gone event
DBEVENTINFO dbei = { sizeof(dbei) };
dbei.pBlob = &bEventType;
@@ -1248,7 +1251,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData* info) db_event_add(hContact, &dbei);
}
- if ((n = xmlGetChildByTag(node, "confirm", "xmlns", _T(JABBER_FEAT_HTTP_AUTH))) && m_options.AcceptHttpAuth) {
+ if ((n = xmlGetChildByTag(node, "confirm", "xmlns", JABBER_FEAT_HTTP_AUTH)) && m_options.AcceptHttpAuth) {
const TCHAR *szId = xmlGetAttrValue(n, _T("id"));
const TCHAR *szMethod = xmlGetAttrValue(n, _T("method"));
const TCHAR *szUrl = xmlGetAttrValue(n, _T("url"));
@@ -1273,6 +1276,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData* info) return;
}
+ // parsing extensions
for (int i = 0; (xNode = xmlGetChild(node, i)) != NULL; i++) {
xNode = xmlGetNthChild(node, _T("x"), i + 1);
if (xNode == NULL) {
@@ -1287,7 +1291,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData* info) if (ptszXmlns == NULL)
continue;
- if ( !_tcscmp(ptszXmlns, _T(JABBER_FEAT_MIRANDA_NOTES))) {
+ if ( !_tcscmp(ptszXmlns, JABBER_FEAT_MIRANDA_NOTES)) {
if (OnIncomingNote(from, xmlGetChild(xNode, "note")))
return;
}
@@ -1303,23 +1307,23 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData* info) _tcsncpy(tempstring + _tcslen(prolog) + _tcslen(xmlGetText(xNode)), epilog, _tcslen(epilog) + 1);
szMessage = tempstring;
}
- else if ( !_tcscmp(ptszXmlns, _T(JABBER_FEAT_DELAY)) && msgTime == 0) {
+ else if ( !_tcscmp(ptszXmlns, JABBER_FEAT_DELAY) && msgTime == 0) {
const TCHAR *ptszTimeStamp = xmlGetAttrValue(xNode, _T("stamp"));
if (ptszTimeStamp != NULL)
msgTime = JabberIsoToUnixTime(ptszTimeStamp);
}
- else if ( !_tcscmp(ptszXmlns, _T(JABBER_FEAT_MESSAGE_EVENTS))) {
+ else if ( !_tcscmp(ptszXmlns, JABBER_FEAT_MESSAGE_EVENTS)) {
// set events support only if we discovered caps and if events not already set
JabberCapsBits jcbCaps = GetResourceCapabilites(from, TRUE);
if (jcbCaps & JABBER_RESOURCE_CAPS_ERROR)
jcbCaps = JABBER_RESOURCE_CAPS_NONE;
// FIXME: disabled due to expired XEP-0022 and problems with bombus delivery checks
-// if (jcbCaps && resourceStatus && (!(jcbCaps & JABBER_CAPS_MESSAGE_EVENTS)))
-// resourceStatus->jcbManualDiscoveredCaps |= (JABBER_CAPS_MESSAGE_EVENTS | JABBER_CAPS_MESSAGE_EVENTS_NO_DELIVERY);
+// if (jcbCaps && pFromResource && (!(jcbCaps & JABBER_CAPS_MESSAGE_EVENTS)))
+// pFromResource->jcbManualDiscoveredCaps |= (JABBER_CAPS_MESSAGE_EVENTS | JABBER_CAPS_MESSAGE_EVENTS_NO_DELIVERY);
if (bodyNode == NULL) {
- idNode = xmlGetChild(xNode , "id");
+ HXML idNode = xmlGetChild(xNode , "id");
if (xmlGetChild(xNode , "delivered") != NULL || xmlGetChild(xNode , "offline") != NULL) {
int id = -1;
if (idNode != NULL && xmlGetText(idNode) != NULL)
@@ -1344,7 +1348,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData* info) delivered = TRUE;
XmlNode m(_T("message")); m << XATTR(_T("to"), from);
- HXML x = m << XCHILDNS(_T("x"), _T(JABBER_FEAT_MESSAGE_EVENTS));
+ HXML x = m << XCHILDNS(_T("x"), JABBER_FEAT_MESSAGE_EVENTS);
x << XCHILD(_T("delivered"));
x << XCHILD(_T("id"), idStr);
info->send(m);
@@ -1355,7 +1359,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData* info) item->messageEventIdStr = (idStr==NULL)?NULL:mir_tstrdup(idStr);
} }
}
- else if ( !_tcscmp(ptszXmlns, _T(JABBER_FEAT_OOB2))) {
+ else if ( !_tcscmp(ptszXmlns, JABBER_FEAT_OOB2)) {
HXML urlNode;
if (((urlNode = xmlGetChild(xNode , "url")) != NULL) && xmlGetText(urlNode) && xmlGetText(urlNode)[0] != _T('\0')) {
size_t cbLen = (szMessage ? _tcslen(szMessage) : 0) + _tcslen(xmlGetText(urlNode)) + 32;
@@ -1368,8 +1372,8 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData* info) szMessage = szTmp;
}
}
- else if ( !_tcscmp(ptszXmlns, _T(JABBER_FEAT_MUC_USER))) {
- inviteNode = xmlGetChild(xNode , _T("invite"));
+ else if ( !_tcscmp(ptszXmlns, JABBER_FEAT_MUC_USER)) {
+ HXML inviteNode = xmlGetChild(xNode , _T("invite"));
if (inviteNode == NULL)
inviteNode = xmlGetChild(xNode , _T("user:invite"));
@@ -1388,7 +1392,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData* info) if ((n = xmlGetChild(xNode , "password")) != NULL)
invitePassword = xmlGetText(n);
}
- else if ( !_tcscmp(ptszXmlns, _T(JABBER_FEAT_ROSTER_EXCHANGE)) &&
+ else if ( !_tcscmp(ptszXmlns, JABBER_FEAT_ROSTER_EXCHANGE) &&
item != NULL && (item->subscription == SUB_BOTH || item->subscription == SUB_TO)) {
TCHAR chkJID[JABBER_MAX_JID_LEN] = _T("@");
JabberStripJid(from, chkJID + 1, SIZEOF(chkJID) - 1);
@@ -1405,9 +1409,6 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData* info) if (group)
db_set_ts(hContact, "CList", "Group", group);
}
- else if ( !_tcscmp(action, _T("modify"))) {
-// HANDLE hContact = HContactFromJID(jid);
- }
else if ( !_tcscmp(action, _T("delete"))) {
HANDLE hContact = HContactFromJID(jid);
if (hContact)
@@ -1447,58 +1448,51 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData* info) return;
}
- if (szMessage) {
- if ((szMessage = JabberUnixToDosT(szMessage)) == NULL)
- szMessage = mir_tstrdup(_T(""));
-
- char* buf = mir_utf8encodeW(szMessage);
-
- if (item != NULL) {
- if (resourceStatus) resourceStatus->bMessageSessionActive = TRUE;
- if (hContact != NULL)
- CallService(MS_PROTO_CONTACTISTYPING, (WPARAM)hContact, PROTOTYPE_CONTACTTYPING_OFF);
-
- // no we will monitor last resource in all modes
- if (/*item->resourceMode==RSMODE_LASTSEEN &&*/ (fromResource = _tcschr(from, '/'))!=NULL) {
- fromResource++;
- if (*fromResource != '\0') {
- for (int i=0; i < item->resourceCount; i++) {
- JABBER_RESOURCE_STATUS *r = &item->pResources[i];
- if ( lstrcmp(r->resourceName, fromResource))
- continue;
-
- JABBER_RESOURCE_STATUS *pLast = item->pLastSeenResource;
- item->pLastSeenResource = r;
- if (item->resourceMode == RSMODE_LASTSEEN && pLast == r)
- UpdateMirVer(item);
- break;
- } } } }
+ // all service info was already processed
+ if (szMessage == NULL)
+ return;
- // Create a temporary contact
- if (hContact == NULL)
- hContact = CreateTemporaryContact(from, chatItem);
+ if ((szMessage = JabberUnixToDosT(szMessage)) == NULL)
+ szMessage = mir_tstrdup(_T(""));
- time_t now = time(NULL);
- if ( !msgTime)
- msgTime = now;
+ char* buf = mir_utf8encodeW(szMessage);
- if (m_options.FixIncorrectTimestamps && (msgTime > now || (msgTime < (time_t)JabberGetLastContactMessageTime(hContact))))
- msgTime = now;
+ if (item != NULL) {
+ if (pFromResource) {
+ pFromResource->bMessageSessionActive = TRUE;
- PROTORECVEVENT recv;
- recv.flags = PREF_UTF;
- recv.timestamp = (DWORD)msgTime;
- recv.szMessage = buf;
+ JABBER_RESOURCE_STATUS *pLast = item->pLastSeenResource;
+ item->pLastSeenResource = pFromResource;
+ if (item->resourceMode == RSMODE_LASTSEEN && pLast == pFromResource)
+ UpdateMirVer(item);
+ }
+ }
- EnterCriticalSection(&m_csLastResourceMap);
- recv.lParam = (LPARAM)AddToLastResourceMap(from);
- LeaveCriticalSection(&m_csLastResourceMap);
+ // Create a temporary contact, if needed
+ if (hContact == NULL)
+ hContact = CreateTemporaryContact(from, chatItem);
+ CallService(MS_PROTO_CONTACTISTYPING, (WPARAM)hContact, PROTOTYPE_CONTACTTYPING_OFF);
- ProtoChainRecvMsg(hContact, &recv);
+ time_t now = time(NULL);
+ if ( !msgTime)
+ msgTime = now;
- mir_free((void*)szMessage);
- mir_free(buf);
- }
+ if (m_options.FixIncorrectTimestamps && (msgTime > now || (msgTime < (time_t)JabberGetLastContactMessageTime(hContact))))
+ msgTime = now;
+
+ PROTORECVEVENT recv;
+ recv.flags = PREF_UTF;
+ recv.timestamp = (DWORD)msgTime;
+ recv.szMessage = buf;
+
+ EnterCriticalSection(&m_csLastResourceMap);
+ recv.lParam = (LPARAM)AddToLastResourceMap(from);
+ LeaveCriticalSection(&m_csLastResourceMap);
+
+ ProtoChainRecvMsg(hContact, &recv);
+
+ mir_free((void*)szMessage);
+ mir_free(buf);
}
// XEP-0115: Entity Capabilities
@@ -1516,8 +1510,8 @@ void CJabberProto::OnProcessPresenceCapabilites(HXML node) HXML n;
// check XEP-0115 support, and old style:
- if ((n = xmlGetChildByTag(node, "c", "xmlns", _T(JABBER_FEAT_ENTITY_CAPS))) != NULL ||
- (n = xmlGetChildByTag(node, "caps:c", "xmlns:caps", _T(JABBER_FEAT_ENTITY_CAPS))) != NULL ||
+ if ((n = xmlGetChildByTag(node, "c", "xmlns", JABBER_FEAT_ENTITY_CAPS)) != NULL ||
+ (n = xmlGetChildByTag(node, "caps:c", "xmlns:caps", JABBER_FEAT_ENTITY_CAPS)) != NULL ||
(n = xmlGetChild(node, "c")) != NULL) {
const TCHAR *szNode = xmlGetAttrValue(n, _T("node"));
const TCHAR *szVer = xmlGetAttrValue(n, _T("ver"));
@@ -1862,7 +1856,7 @@ void CJabberProto::OnIqResultVersion(HXML /*node*/, CJabberIqInfo *pInfo) BOOL CJabberProto::OnProcessJingle(HXML node)
{
LPCTSTR type;
- HXML child = xmlGetChildByTag(node, _T("jingle"), _T("xmlns"), _T(JABBER_FEAT_JINGLE));
+ HXML child = xmlGetChildByTag(node, _T("jingle"), _T("xmlns"), JABBER_FEAT_JINGLE);
if (child) {
if ((type=xmlGetAttrValue(node, _T("type"))) == NULL) return FALSE;
@@ -1875,7 +1869,7 @@ BOOL CJabberProto::OnProcessJingle(HXML node) m_ThreadInfo->send( XmlNodeIq(_T("result"), idStr, from));
XmlNodeIq iq(_T("set"), SerialNext(), from);
- HXML jingleNode = iq << XCHILDNS(_T("jingle"), _T(JABBER_FEAT_JINGLE));
+ HXML jingleNode = iq << XCHILDNS(_T("jingle"), JABBER_FEAT_JINGLE);
jingleNode << XATTR(_T("action"), _T("session-terminate"));
LPCTSTR szInitiator = xmlGetAttrValue(child, _T("initiator"));
@@ -1985,7 +1979,7 @@ void CJabberProto::OnProcessRegIq(HXML node, ThreadData* info) iqIdRegSetReg = SerialNext();
XmlNodeIq iq(_T("set"), iqIdRegSetReg);
- HXML query = iq << XQUERY(_T(JABBER_FEAT_REGISTER));
+ HXML query = iq << XQUERY(JABBER_FEAT_REGISTER);
query << XCHILD(_T("password"), info->password);
query << XCHILD(_T("username"), info->username);
info->send(iq);
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index 3a89c0815e..f1f871966f 100644 --- a/protocols/JabberG/src/jabber_util.cpp +++ b/protocols/JabberG/src/jabber_util.cpp @@ -800,7 +800,7 @@ void CJabberProto::SendPresenceTo(int status, TCHAR* to, HXML extra, const TCHAR xmlAddChild(p, extra);
// XEP-0115:Entity Capabilities
- HXML c = p << XCHILDNS(_T("c"), _T(JABBER_FEAT_ENTITY_CAPS)) << XATTR(_T("node"), _T(JABBER_CAPS_MIRANDA_NODE))
+ HXML c = p << XCHILDNS(_T("c"), JABBER_FEAT_ENTITY_CAPS) << XATTR(_T("node"), JABBER_CAPS_MIRANDA_NODE)
<< XATTR(_T("ver"), szCoreVersion);
TCHAR szExtCaps[ 512 ] = _T("");
@@ -980,7 +980,7 @@ BOOL CJabberProto::OnIqSetGoogleSharedStatus(HXML iqNode, CJabberIqInfo* pInfo) void CJabberProto::SendIqGoogleSharedStatus(int status, const TCHAR *msg) {
XmlNodeIq iq(m_iqManager.AddHandler(&CJabberProto::OnIqResultGoogleSharedStatus, JABBER_IQ_TYPE_SET));
- HXML query = iq << XQUERY(_T(JABBER_FEAT_GTALK_SHARED_STATUS)) << XATTR(_T("version"), _T("2"));
+ HXML query = iq << XQUERY(JABBER_FEAT_GTALK_SHARED_STATUS) << XATTR(_T("version"), _T("2"));
query << XCHILD(_T("status"), msg);
if (status == ID_STATUS_INVISIBLE) {
query << XCHILD(_T("show"), _T("default"));
diff --git a/protocols/JabberG/src/jabber_vcard.cpp b/protocols/JabberG/src/jabber_vcard.cpp index 30909944e8..decf141c5e 100644 --- a/protocols/JabberG/src/jabber_vcard.cpp +++ b/protocols/JabberG/src/jabber_vcard.cpp @@ -39,7 +39,7 @@ int CJabberProto::SendGetVcard(const TCHAR *jid) IqAdd(iqId, procId, &CJabberProto::OnIqResultGetVcard);
m_ThreadInfo->send(
- XmlNodeIq(_T("get"), iqId, jid) << XCHILDNS(_T("vCard"), _T(JABBER_FEAT_VCARD_TEMP))
+ XmlNodeIq(_T("get"), iqId, jid) << XCHILDNS(_T("vCard"), JABBER_FEAT_VCARD_TEMP)
<< XATTR(_T("prodid"), _T("-//HandGen//NONSGML vGen v1.0//EN")) << XATTR(_T("version"), _T("2.0")));
return iqId;
@@ -1043,7 +1043,7 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, TCHAR* szPhotoFileName) IqAdd(iqId, IQ_PROC_SETVCARD, &CJabberProto::OnIqResultSetVcard);
XmlNodeIq iq(_T("set"), iqId);
- HXML v = iq << XCHILDNS(_T("vCard"), _T(JABBER_FEAT_VCARD_TEMP));
+ HXML v = iq << XCHILDNS(_T("vCard"), JABBER_FEAT_VCARD_TEMP);
AppendVcardFromDB(v, "FN", "FullName");
diff --git a/protocols/JabberG/src/jabber_xml.cpp b/protocols/JabberG/src/jabber_xml.cpp index 89dc4f9838..7ff95e1948 100644 --- a/protocols/JabberG/src/jabber_xml.cpp +++ b/protocols/JabberG/src/jabber_xml.cpp @@ -270,7 +270,7 @@ LPCTSTR __fastcall xmlGetName(HXML xml) LPCTSTR __fastcall xmlGetText(HXML xml)
{
- return xi.getText(xml);
+ return (xml) ? xi.getText(xml) : NULL;
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp index 50e4de28c9..1f9c30401a 100644 --- a/protocols/JabberG/src/jabber_xstatus.cpp +++ b/protocols/JabberG/src/jabber_xstatus.cpp @@ -399,7 +399,7 @@ void CPepService::Publish() {
XmlNodeIq iq(_T("set"), m_proto->SerialNext());
CreateData(
- iq << XCHILDNS(_T("pubsub"), _T(JABBER_FEAT_PUBSUB))
+ iq << XCHILDNS(_T("pubsub"), JABBER_FEAT_PUBSUB)
<< XCHILD(_T("publish")) << XATTR(_T("node"), m_node)
<< XCHILD(_T("item")) << XATTR(_T("id"), _T("current")));
m_proto->m_ThreadInfo->send(iq);
@@ -414,7 +414,7 @@ void CPepService::Retract() m_proto->m_ThreadInfo->send(
XmlNodeIq(_T("set"), m_proto->SerialNext())
- << XCHILDNS(_T("pubsub"), _T(JABBER_FEAT_PUBSUB))
+ << XCHILDNS(_T("pubsub"), JABBER_FEAT_PUBSUB)
<< XCHILD(_T("publish")) << XATTR(_T("node"), m_node)
<< XCHILD(_T("item"))
<< XCHILDNS(tempName, m_node));
@@ -616,7 +616,7 @@ static g_arrMoods[] = };
CPepMood::CPepMood(CJabberProto *proto) :
- CPepGuiService(proto, "Mood", _T(JABBER_FEAT_USER_MOOD)),
+ CPepGuiService(proto, "Mood", JABBER_FEAT_USER_MOOD),
m_text(NULL),
m_mode(-1)
{
@@ -644,7 +644,7 @@ void CPepMood::ProcessItems(const TCHAR *from, HXML itemsNode) return;
}
- HXML n, moodNode = XPath(itemsNode, _T("item/mood[@xmlns='") _T(JABBER_FEAT_USER_MOOD) _T("']"));
+ HXML n, moodNode = XPath(itemsNode, _T("item/mood[@xmlns='") JABBER_FEAT_USER_MOOD _T("']"));
if ( !moodNode) return;
LPCTSTR moodType = NULL, moodText = NULL;
@@ -667,7 +667,7 @@ void CPepMood::ProcessItems(const TCHAR *from, HXML itemsNode) void CPepMood::CreateData(HXML n)
{
- HXML moodNode = n << XCHILDNS(_T("mood"), _T(JABBER_FEAT_USER_MOOD));
+ HXML moodNode = n << XCHILDNS(_T("mood"), JABBER_FEAT_USER_MOOD);
moodNode << XCHILD(_A2T(g_arrMoods[m_mode].szTag));
if (m_text)
moodNode << XCHILD(_T("text"), m_text);
@@ -994,7 +994,7 @@ void ActivityBuildTitle(int id, TCHAR *buf, int size) }
CPepActivity::CPepActivity(CJabberProto *proto):
- CPepGuiService(proto, "Activity", _T(JABBER_FEAT_USER_ACTIVITY)),
+ CPepGuiService(proto, "Activity", JABBER_FEAT_USER_ACTIVITY),
m_text(NULL),
m_mode(-1)
{
@@ -1022,7 +1022,7 @@ void CPepActivity::ProcessItems(const TCHAR *from, HXML itemsNode) return;
}
- HXML actNode = XPath(itemsNode, _T("item/activity[@xmlns='") _T(JABBER_FEAT_USER_ACTIVITY) _T("']"));
+ HXML actNode = XPath(itemsNode, _T("item/activity[@xmlns='") JABBER_FEAT_USER_ACTIVITY _T("']"));
if ( !actNode)
return;
@@ -1055,7 +1055,7 @@ void CPepActivity::CreateData(HXML n) char *szFirstNode = ActivityGetFirst(m_mode);
char *szSecondNode = ActivityGetSecond(m_mode);
- HXML activityNode = n << XCHILDNS(_T("activity"), _T(JABBER_FEAT_USER_ACTIVITY));
+ HXML activityNode = n << XCHILDNS(_T("activity"), JABBER_FEAT_USER_ACTIVITY);
HXML firstNode = activityNode << XCHILD(_A2T(szFirstNode));
if (firstNode && szSecondNode)
@@ -1153,7 +1153,7 @@ void CPepActivity::ShowSetDialog(BYTE bQuiet) HICON CJabberProto::GetXStatusIcon(int bStatus, UINT flags)
{
- CPepMood *pepMood = (CPepMood*)m_pepServices.Find(_T(JABBER_FEAT_USER_MOOD));
+ CPepMood *pepMood = (CPepMood*)m_pepServices.Find(JABBER_FEAT_USER_MOOD);
HICON icon = g_MoodIcons.GetIcon(g_arrMoods[bStatus].szTag, (flags & LR_BIGICON) != 0);
return (flags & LR_SHARED) ? icon : CopyIcon(icon);
}
@@ -1170,7 +1170,7 @@ INT_PTR __cdecl CJabberProto::OnGetXStatusIcon(WPARAM wParam, LPARAM lParam) return 0;
if ( !wParam)
- wParam = ((CPepMood*)m_pepServices.Find(_T(JABBER_FEAT_USER_MOOD)))->m_mode;
+ wParam = ((CPepMood*)m_pepServices.Find(JABBER_FEAT_USER_MOOD))->m_mode;
if (wParam < 1 || wParam >= SIZEOF(g_arrMoods))
return 0;
@@ -1191,9 +1191,9 @@ BOOL CJabberProto::SendPepTune(TCHAR* szArtist, TCHAR* szLength, TCHAR* szSource return FALSE;
XmlNodeIq iq(_T("set"), SerialNext());
- HXML tuneNode = iq << XCHILDNS(_T("pubsub"), _T(JABBER_FEAT_PUBSUB))
- << XCHILD(_T("publish")) << XATTR(_T("node"), _T(JABBER_FEAT_USER_TUNE))
- << XCHILD(_T("item")) << XCHILDNS(_T("tune"), _T(JABBER_FEAT_USER_TUNE));
+ HXML tuneNode = iq << XCHILDNS(_T("pubsub"), JABBER_FEAT_PUBSUB)
+ << XCHILD(_T("publish")) << XATTR(_T("node"), JABBER_FEAT_USER_TUNE)
+ << XCHILD(_T("item")) << XCHILDNS(_T("tune"), JABBER_FEAT_USER_TUNE);
if (szArtist || szLength || szSource || szTitle || szUri) {
if (szArtist) tuneNode << XCHILD(_T("artist"), szArtist);
@@ -1322,12 +1322,12 @@ INT_PTR __cdecl CJabberProto::OnSetListeningTo(WPARAM, LPARAM lParam) void CJabberProto::InfoFrame_OnUserMood(CJabberInfoFrame_Event*)
{
- ((CPepGuiService *)m_pepServices.Find(_T(JABBER_FEAT_USER_MOOD)))->LaunchSetGui(0);
+ ((CPepGuiService *)m_pepServices.Find(JABBER_FEAT_USER_MOOD))->LaunchSetGui(0);
}
void CJabberProto::InfoFrame_OnUserActivity(CJabberInfoFrame_Event*)
{
- ((CPepGuiService *)m_pepServices.Find(_T(JABBER_FEAT_USER_ACTIVITY)))->LaunchSetGui(0);
+ ((CPepGuiService *)m_pepServices.Find(JABBER_FEAT_USER_ACTIVITY))->LaunchSetGui(0);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -1352,7 +1352,7 @@ INT_PTR __cdecl CJabberProto::OnGetXStatusEx(WPARAM wParam, LPARAM lParam) if (pData->cbSize < sizeof(CUSTOM_STATUS))
return 1;
- CPepMood *pepMood = (CPepMood*)m_pepServices.Find(_T(JABBER_FEAT_USER_MOOD));
+ CPepMood *pepMood = (CPepMood*)m_pepServices.Find(JABBER_FEAT_USER_MOOD);
if (pepMood == NULL)
return 1;
@@ -1434,7 +1434,7 @@ INT_PTR __cdecl CJabberProto::OnSetXStatusEx(WPARAM wParam, LPARAM lParam) if (pData->cbSize < sizeof(CUSTOM_STATUS))
return 1;
- CPepMood *pepMood = (CPepMood*)m_pepServices.Find(_T(JABBER_FEAT_USER_MOOD));
+ CPepMood *pepMood = (CPepMood*)m_pepServices.Find(JABBER_FEAT_USER_MOOD);
int status = (pData->flags & CSSF_MASK_STATUS) ? *pData->status : pepMood->m_mode;
if (status >= 0 && status < SIZEOF(g_arrMoods)) {
|