summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'protocols')
-rw-r--r--protocols/GTalkExt/src/GTalkExt.cpp1
-rw-r--r--protocols/GTalkExt/src/handlers.cpp186
-rw-r--r--protocols/Gadu-Gadu/src/avatar.cpp18
-rw-r--r--protocols/Gadu-Gadu/src/core.cpp12
-rw-r--r--protocols/Gadu-Gadu/src/gg.cpp2
-rw-r--r--protocols/Gadu-Gadu/src/oauth.cpp24
-rw-r--r--protocols/JabberG/src/jabber.cpp3
-rw-r--r--protocols/JabberG/src/jabber_adhoc.cpp86
-rw-r--r--protocols/JabberG/src/jabber_agent.cpp50
-rw-r--r--protocols/JabberG/src/jabber_archive.cpp34
-rw-r--r--protocols/JabberG/src/jabber_byte.cpp44
-rw-r--r--protocols/JabberG/src/jabber_caps.cpp6
-rw-r--r--protocols/JabberG/src/jabber_captcha.cpp30
-rw-r--r--protocols/JabberG/src/jabber_chat.cpp4
-rw-r--r--protocols/JabberG/src/jabber_console.cpp52
-rw-r--r--protocols/JabberG/src/jabber_disco.cpp64
-rw-r--r--protocols/JabberG/src/jabber_form.cpp112
-rw-r--r--protocols/JabberG/src/jabber_ft.cpp72
-rw-r--r--protocols/JabberG/src/jabber_groupchat.cpp80
-rw-r--r--protocols/JabberG/src/jabber_ibb.cpp8
-rw-r--r--protocols/JabberG/src/jabber_iq.cpp30
-rw-r--r--protocols/JabberG/src/jabber_iq_handlers.cpp46
-rw-r--r--protocols/JabberG/src/jabber_iqid.cpp448
-rw-r--r--protocols/JabberG/src/jabber_iqid_muc.cpp42
-rw-r--r--protocols/JabberG/src/jabber_menu.cpp4
-rw-r--r--protocols/JabberG/src/jabber_message_handlers.cpp14
-rw-r--r--protocols/JabberG/src/jabber_message_manager.cpp16
-rw-r--r--protocols/JabberG/src/jabber_misc.cpp8
-rw-r--r--protocols/JabberG/src/jabber_notes.cpp4
-rw-r--r--protocols/JabberG/src/jabber_opt.cpp82
-rw-r--r--protocols/JabberG/src/jabber_privacy.cpp46
-rw-r--r--protocols/JabberG/src/jabber_proto.cpp10
-rw-r--r--protocols/JabberG/src/jabber_rc.cpp80
-rw-r--r--protocols/JabberG/src/jabber_search.cpp80
-rw-r--r--protocols/JabberG/src/jabber_thread.cpp324
-rw-r--r--protocols/JabberG/src/jabber_util.cpp24
-rw-r--r--protocols/JabberG/src/jabber_xml.cpp114
-rw-r--r--protocols/JabberG/src/jabber_xml.h76
-rw-r--r--protocols/JabberG/src/jabber_xstatus.cpp24
-rw-r--r--protocols/JabberG/src/jabber_xstatus.h2
-rw-r--r--protocols/SkypeWeb/src/main.cpp2
-rw-r--r--protocols/SkypeWeb/src/skype_chatrooms.cpp52
-rw-r--r--protocols/SkypeWeb/src/skype_history_sync.cpp26
-rw-r--r--protocols/SkypeWeb/src/skype_messages.cpp26
44 files changed, 1229 insertions, 1239 deletions
diff --git a/protocols/GTalkExt/src/GTalkExt.cpp b/protocols/GTalkExt/src/GTalkExt.cpp
index c2ad8dcaaf..6d0eb2f435 100644
--- a/protocols/GTalkExt/src/GTalkExt.cpp
+++ b/protocols/GTalkExt/src/GTalkExt.cpp
@@ -79,7 +79,6 @@ LRESULT CALLBACK WndProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam)
extern "C" int __declspec(dllexport) Load(void)
{
mir_getLP(&pluginInfo);
- mir_getXI(&xi);
WNDCLASS cls = { 0 };
cls.lpfnWndProc = WndProc;
diff --git a/protocols/GTalkExt/src/handlers.cpp b/protocols/GTalkExt/src/handlers.cpp
index 0c835729f6..1f5c6f02e6 100644
--- a/protocols/GTalkExt/src/handlers.cpp
+++ b/protocols/GTalkExt/src/handlers.cpp
@@ -31,8 +31,6 @@
LRESULT CALLBACK PopupProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam);
-XML_API xi = { 0 };
-
#include <tchar.h>
GoogleTalkAcc* isGoogle(LPARAM lParam)
@@ -79,17 +77,17 @@ BOOL InternalListHandler(HXML node, LPCTSTR jid, LPCTSTR mailboxUrl)
ULONGLONG maxTid = 0;
LPCTSTR sMaxTid = NULL;
int unreadCount = 0;
- for (int i = 0; i < xi.getChildCount(node); i++) {
- LPCTSTR sTid = xi.getAttrValue(xi.getChild(node, i), ATTRNAME_TID);
+ for (int i = 0; i < xmlGetChildCount(node); i++) {
+ LPCTSTR sTid = xmlGetAttrValue(xmlGetChild(node, i), ATTRNAME_TID);
ULONGLONG tid = _tcstoui64(sTid, NULL, 10);
if (tid > maxTid) {
maxTid = tid;
sMaxTid = sTid;
}
- HXML senders = xi.getChildByPath(xi.getChild(node, i), NODENAME_SENDERS, FALSE);
- for (int j = 0; j < xi.getChildCount(senders); j++)
- if (xi.getAttrValue(xi.getChild(senders, j), ATTRNAME_UNREAD)) {
+ HXML senders = xmlGetChildByPath(xmlGetChild(node, i), NODENAME_SENDERS, FALSE);
+ for (int j = 0; j < xmlGetChildCount(senders); j++)
+ if (xmlGetAttrValue(xmlGetChild(senders, j), ATTRNAME_UNREAD)) {
unreadCount++;
break;
}
@@ -100,7 +98,7 @@ BOOL InternalListHandler(HXML node, LPCTSTR jid, LPCTSTR mailboxUrl)
return FALSE;
if (!unreadCount) {
- SetupPseudocontact(jid, xi.getAttrValue(node, ATTRNAME_TOTAL_MATCHED), acc);
+ SetupPseudocontact(jid, xmlGetAttrValue(node, ATTRNAME_TOTAL_MATCHED), acc);
return TRUE;
}
@@ -108,29 +106,29 @@ BOOL InternalListHandler(HXML node, LPCTSTR jid, LPCTSTR mailboxUrl)
if (unreadCount > 5) {
CloseNotifications(acc, mailboxUrl, jid, FALSE);
- UnreadMailNotification(acc, jid, mailboxUrl, xi.getAttrValue(node, ATTRNAME_TOTAL_MATCHED));
+ UnreadMailNotification(acc, jid, mailboxUrl, xmlGetAttrValue(node, ATTRNAME_TOTAL_MATCHED));
}
else
- for (int i = 0; i < xi.getChildCount(node); i++) {
+ for (int i = 0; i < xmlGetChildCount(node); i++) {
MAIL_THREAD_NOTIFICATION mtn = { 0 };
- HXML thread = xi.getChild(node, i);
+ HXML thread = xmlGetChild(node, i);
- mtn.subj = xi.getText(xi.getChildByPath(thread, NODENAME_SUBJECT, FALSE));
- mtn.snip = xi.getText(xi.getChildByPath(thread, NODENAME_SNIPPET, FALSE));
+ mtn.subj = xmlGetText(xmlGetChildByPath(thread, NODENAME_SUBJECT, FALSE));
+ mtn.snip = xmlGetText(xmlGetChildByPath(thread, NODENAME_SNIPPET, FALSE));
int threadUnreadCount = 0;
- HXML senders = xi.getChildByPath(thread, NODENAME_SENDERS, FALSE);
- for (int j = 0; threadUnreadCount < SENDER_COUNT && j < xi.getChildCount(senders); j++) {
- HXML sender = xi.getChild(senders, j);
- if (xi.getAttrValue(sender, ATTRNAME_UNREAD)) {
- mtn.senders[threadUnreadCount].name = xi.getAttrValue(sender, ATTRNAME_NAME);
- mtn.senders[threadUnreadCount].addr = xi.getAttrValue(sender, ATTRNAME_ADDRESS);
+ HXML senders = xmlGetChildByPath(thread, NODENAME_SENDERS, FALSE);
+ for (int j = 0; threadUnreadCount < SENDER_COUNT && j < xmlGetChildCount(senders); j++) {
+ HXML sender = xmlGetChild(senders, j);
+ if (xmlGetAttrValue(sender, ATTRNAME_UNREAD)) {
+ mtn.senders[threadUnreadCount].name = xmlGetAttrValue(sender, ATTRNAME_NAME);
+ mtn.senders[threadUnreadCount].addr = xmlGetAttrValue(sender, ATTRNAME_ADDRESS);
threadUnreadCount++;
}
}
- LPCTSTR url = xi.getAttrValue(thread, ATTRNAME_URL);
- LPCTSTR tid = xi.getAttrValue(thread, ATTRNAME_TID);
+ LPCTSTR url = xmlGetAttrValue(thread, ATTRNAME_URL);
+ LPCTSTR tid = xmlGetAttrValue(thread, ATTRNAME_TID);
if (ReadCheckbox(0, IDC_STANDARDVIEW, settings))
FormatMessageUrl(MESSAGE_URL_FORMAT_STANDARD, (LPTSTR)url, mailboxUrl, tid);
@@ -140,10 +138,10 @@ BOOL InternalListHandler(HXML node, LPCTSTR jid, LPCTSTR mailboxUrl)
MakeUrlHex((LPTSTR)url, tid);
CloseNotifications(acc, url, jid, i);
- UnreadThreadNotification(acc, jid, url, xi.getAttrValue(node, ATTRNAME_TOTAL_MATCHED), &mtn);
+ UnreadThreadNotification(acc, jid, url, xmlGetAttrValue(node, ATTRNAME_TOTAL_MATCHED), &mtn);
}
- LPCTSTR time = xi.getAttrValue(node, ATTRNAME_RESULT_TIME);
+ LPCTSTR time = xmlGetAttrValue(node, ATTRNAME_RESULT_TIME);
WriteJidSetting(LAST_MAIL_TIME_FROM_JID, jid, time);
WriteJidSetting(LAST_THREAD_ID_FROM_JID, jid, sMaxTid);
return TRUE;
@@ -151,17 +149,17 @@ BOOL InternalListHandler(HXML node, LPCTSTR jid, LPCTSTR mailboxUrl)
BOOL MailListHandler(IJabberInterface *ji, HXML node, void *)
{
- LPCTSTR jidWithRes = xi.getAttrValue(node, ATTRNAME_TO);
+ LPCTSTR jidWithRes = xmlGetAttrValue(node, ATTRNAME_TO);
__try {
- if (!node || mir_tstrcmp(xi.getAttrValue(node, ATTRNAME_TYPE), IQTYPE_RESULT)) return TRUE;
+ if (!node || mir_tstrcmp(xmlGetAttrValue(node, ATTRNAME_TYPE), IQTYPE_RESULT)) return TRUE;
- LPCTSTR jid = xi.getAttrValue(node, ATTRNAME_FROM);
+ LPCTSTR jid = xmlGetAttrValue(node, ATTRNAME_FROM);
assert(jid);
- node = xi.getChildByPath(node, NODENAME_MAILBOX, FALSE);
+ node = xmlGetChildByPath(node, NODENAME_MAILBOX, FALSE);
if (!node) return TRUE; // empty list
- LPCTSTR url = xi.getAttrValue(node, ATTRNAME_URL);
+ LPCTSTR url = xmlGetAttrValue(node, ATTRNAME_URL);
return InternalListHandler(node, jid, url);
}
@@ -176,13 +174,13 @@ BOOL MailListHandler(IJabberInterface *ji, HXML node, void *)
void RequestMail(LPCTSTR jidWithRes, IJabberInterface *ji)
{
HXML child = NULL;
- HXML node = xi.createNode(NODENAME_IQ, NULL, FALSE);
- xi.addAttr(node, ATTRNAME_TYPE, IQTYPE_GET);
- xi.addAttr(node, ATTRNAME_FROM, jidWithRes);
+ HXML node = xmlCreateNode(NODENAME_IQ, NULL, FALSE);
+ xmlAddAttr(node, ATTRNAME_TYPE, IQTYPE_GET);
+ xmlAddAttr(node, ATTRNAME_FROM, jidWithRes);
UINT uID = ji->SerialNext();
ptrT jid(ExtractJid(jidWithRes));
- xi.addAttr(node, ATTRNAME_TO, jid);
+ xmlAddAttr(node, ATTRNAME_TO, jid);
ptrT
lastMailTime(ReadJidSetting(LAST_MAIL_TIME_FROM_JID, jid)),
@@ -190,18 +188,18 @@ void RequestMail(LPCTSTR jidWithRes, IJabberInterface *ji)
TCHAR id[30];
mir_sntprintf(id, JABBER_IQID_FORMAT, uID);
- xi.addAttr(node, ATTRNAME_ID, id);
+ xmlAddAttr(node, ATTRNAME_ID, id);
- child = xi.addChild(node, NODENAME_QUERY, NULL);
- xi.addAttr(child, ATTRNAME_XMLNS, NOTIFY_FEATURE_XMLNS);
- xi.addAttr(child, ATTRNAME_NEWER_THAN_TIME, lastMailTime);
- xi.addAttr(child, ATTRNAME_NEWER_THAN_TID, lastThreadId);
+ child = xmlAddChild(node, NODENAME_QUERY, NULL);
+ xmlAddAttr(child, ATTRNAME_XMLNS, NOTIFY_FEATURE_XMLNS);
+ xmlAddAttr(child, ATTRNAME_NEWER_THAN_TIME, lastMailTime);
+ xmlAddAttr(child, ATTRNAME_NEWER_THAN_TID, lastThreadId);
if (ji->SendXmlNode(node))
ji->AddTemporaryIqHandler(MailListHandler, JABBER_IQ_TYPE_RESULT, (int)uID, NULL, RESPONSE_TIMEOUT);
- if (child) xi.destroyNode(child);
- if (node) xi.destroyNode(node);
+ if (child) xmlDestroyNode(child);
+ if (node) xmlDestroyNode(node);
}
BOOL TimerHandler(IJabberInterface *ji, HXML, void *pUserData)
@@ -213,70 +211,70 @@ BOOL TimerHandler(IJabberInterface *ji, HXML, void *pUserData)
BOOL NewMailHandler(IJabberInterface *ji, HXML node, void *)
{
- HXML response = xi.createNode(NODENAME_IQ, NULL, FALSE);
+ HXML response = xmlCreateNode(NODENAME_IQ, NULL, FALSE);
__try {
- xi.addAttr(response, ATTRNAME_TYPE, IQTYPE_RESULT);
+ xmlAddAttr(response, ATTRNAME_TYPE, IQTYPE_RESULT);
- LPCTSTR attr = xi.getAttrValue(node, ATTRNAME_ID);
+ LPCTSTR attr = xmlGetAttrValue(node, ATTRNAME_ID);
if (!attr) return FALSE;
- xi.addAttr(response, ATTRNAME_ID, attr);
+ xmlAddAttr(response, ATTRNAME_ID, attr);
- attr = xi.getAttrValue(node, ATTRNAME_FROM);
- if (attr) xi.addAttr(response, ATTRNAME_TO, attr);
+ attr = xmlGetAttrValue(node, ATTRNAME_FROM);
+ if (attr) xmlAddAttr(response, ATTRNAME_TO, attr);
- attr = xi.getAttrValue(node, ATTRNAME_TO);
+ attr = xmlGetAttrValue(node, ATTRNAME_TO);
if (!attr) return FALSE;
- xi.addAttr(response, ATTRNAME_FROM, attr);
+ xmlAddAttr(response, ATTRNAME_FROM, attr);
int bytesSent = ji->SendXmlNode(response);
RequestMail(attr, ji);
return bytesSent > 0;
}
__finally {
- xi.destroyNode(response);
+ xmlDestroyNode(response);
}
}
void SetNotificationSetting(LPCTSTR jidWithResource, IJabberInterface *ji)
{
HXML child = NULL;
- HXML node = xi.createNode(NODENAME_IQ, NULL, FALSE);
+ HXML node = xmlCreateNode(NODENAME_IQ, NULL, FALSE);
- xi.addAttr(node, ATTRNAME_TYPE, IQTYPE_SET);
- xi.addAttr(node, ATTRNAME_FROM, jidWithResource);
+ xmlAddAttr(node, ATTRNAME_TYPE, IQTYPE_SET);
+ xmlAddAttr(node, ATTRNAME_FROM, jidWithResource);
ptrT jid(ExtractJid(jidWithResource));
- xi.addAttr(node, ATTRNAME_TO, jid);
+ xmlAddAttr(node, ATTRNAME_TO, jid);
TCHAR id[30];
mir_sntprintf(id, JABBER_IQID_FORMAT, ji->SerialNext());
- xi.addAttr(node, ATTRNAME_ID, id);
+ xmlAddAttr(node, ATTRNAME_ID, id);
- child = xi.addChild(node, NODENAME_USERSETTING, NULL);
- xi.addAttr(child, ATTRNAME_XMLNS, SETTING_FEATURE_XMLNS);
+ child = xmlAddChild(node, NODENAME_USERSETTING, NULL);
+ xmlAddAttr(child, ATTRNAME_XMLNS, SETTING_FEATURE_XMLNS);
- child = xi.addChild(child, NODENAME_MAILNOTIFICATIONS, NULL);
- xi.addAttr(child, ATTRNAME_VALUE, SETTING_TRUE);
+ child = xmlAddChild(child, NODENAME_MAILNOTIFICATIONS, NULL);
+ xmlAddAttr(child, ATTRNAME_VALUE, SETTING_TRUE);
ji->SendXmlNode(node);
- if (child) xi.destroyNode(child);
- if (node) xi.destroyNode(node);
+ if (child) xmlDestroyNode(child);
+ if (node) xmlDestroyNode(node);
}
BOOL DiscoverHandler(IJabberInterface *ji, HXML node, void *)
{
if (!node) return FALSE;
- LPCTSTR jid = xi.getAttrValue(node, ATTRNAME_TO);
+ LPCTSTR jid = xmlGetAttrValue(node, ATTRNAME_TO);
assert(jid);
- node = xi.getChildByAttrValue(node, NODENAME_QUERY, ATTRNAME_XMLNS, DISCOVERY_XMLNS);
+ node = xmlGetChildByAttrValue(node, NODENAME_QUERY, ATTRNAME_XMLNS, DISCOVERY_XMLNS);
- HXML child = xi.getChildByAttrValue(node, NODENAME_FEATURE, ATTRNAME_VAR, SETTING_FEATURE_XMLNS);
+ HXML child = xmlGetChildByAttrValue(node, NODENAME_FEATURE, ATTRNAME_VAR, SETTING_FEATURE_XMLNS);
if (child)
SetNotificationSetting(jid, ji);
- child = xi.getChildByAttrValue(node, NODENAME_FEATURE, ATTRNAME_VAR, NOTIFY_FEATURE_XMLNS);
+ child = xmlGetChildByAttrValue(node, NODENAME_FEATURE, ATTRNAME_VAR, NOTIFY_FEATURE_XMLNS);
if (child) {
ji->AddIqHandler(NewMailHandler, JABBER_IQ_TYPE_SET, NOTIFY_FEATURE_XMLNS, NODENAME_NEW_MAIL);
RequestMail(jid, ji);
@@ -291,22 +289,22 @@ BOOL SendHandler(IJabberInterface *ji, HXML node, void *)
if (gta == NULL)
return FALSE;
- HXML queryNode = xi.getChildByAttrValue(node, NODENAME_QUERY, ATTRNAME_XMLNS, DISCOVERY_XMLNS);
+ HXML queryNode = xmlGetChildByAttrValue(node, NODENAME_QUERY, ATTRNAME_XMLNS, DISCOVERY_XMLNS);
if (queryNode) {
- LPCTSTR ptszId = xi.getAttrValue(node, ATTRNAME_ID);
+ LPCTSTR ptszId = xmlGetAttrValue(node, ATTRNAME_ID);
if (ptszId)
ji->AddTemporaryIqHandler(DiscoverHandler, JABBER_IQ_TYPE_RESULT, _ttoi(ptszId + 4), NULL, RESPONSE_TIMEOUT, 500);
}
- if (!mir_tstrcmp(xi.getName(node), _T("presence")) && xi.getAttrValue(node, ATTRNAME_TO) == 0) {
+ if (!mir_tstrcmp(xmlGetName(node), _T("presence")) && xmlGetAttrValue(node, ATTRNAME_TO) == 0) {
if (!gta->m_bGoogleSharedStatus)
return FALSE;
- HXML statNode = xi.getChildByPath(node, _T("status"), 0);
- HXML showNode = xi.getChildByPath(node, _T("show"), 0);
+ HXML statNode = xmlGetChildByPath(node, _T("status"), 0);
+ HXML showNode = xmlGetChildByPath(node, _T("show"), 0);
if (statNode) {
- LPCTSTR status = xi.getText(showNode);
- LPCTSTR msg = xi.getText(statNode);
+ LPCTSTR status = xmlGetText(showNode);
+ LPCTSTR msg = xmlGetText(statNode);
gta->SendIqGoogleSharedStatus(status, msg);
}
}
@@ -321,7 +319,7 @@ BOOL OnIqResultGoogleSharedStatus(IJabberInterface *ji, HXML node, void *)
{
GoogleTalkAcc *gta = isGoogle(LPARAM(ji));
if (gta != NULL) {
- gta->m_bGoogleSharedStatus = mir_tstrcmp(xi.getAttrValue(node, ATTRNAME_TYPE), IQTYPE_RESULT) == 0;
+ gta->m_bGoogleSharedStatus = mir_tstrcmp(xmlGetAttrValue(node, ATTRNAME_TYPE), IQTYPE_RESULT) == 0;
gta->m_bGoogleSharedStatusLock = FALSE;
}
return FALSE;
@@ -332,18 +330,18 @@ BOOL OnIqSetGoogleSharedStatus(IJabberInterface *ji, HXML iqNode, void *)
GoogleTalkAcc *gta = isGoogle(LPARAM(ji));
if (gta == NULL)
return FALSE;
- if (mir_tstrcmp(xi.getAttrValue(iqNode, ATTRNAME_TYPE), IQTYPE_SET))
+ if (mir_tstrcmp(xmlGetAttrValue(iqNode, ATTRNAME_TYPE), IQTYPE_SET))
return FALSE;
if (gta->m_bGoogleSharedStatusLock)
return TRUE;
int status;
- HXML query = xi.getChildByPath(iqNode, NODENAME_QUERY, 0);
- HXML node = xi.getChildByPath(query, _T("invisible"), 0);
- if (0 == mir_tstrcmpi(_T("true"), xi.getAttrValue(node, _T("value"))))
+ HXML query = xmlGetChildByPath(iqNode, NODENAME_QUERY, 0);
+ HXML node = xmlGetChildByPath(query, _T("invisible"), 0);
+ if (0 == mir_tstrcmpi(_T("true"), xmlGetAttrValue(node, _T("value"))))
status = ID_STATUS_INVISIBLE;
else {
- LPCTSTR txt = xi.getText(xi.getChildByPath(query, _T("show"), 0));
+ LPCTSTR txt = xmlGetText(xmlGetChildByPath(query, _T("show"), 0));
if (txt && 0 == mir_tstrcmpi(_T("dnd"), txt))
status = ID_STATUS_DND;
else if (gta->m_pa->ppro->m_iStatus == ID_STATUS_DND || gta->m_pa->ppro->m_iStatus == ID_STATUS_INVISIBLE)
@@ -360,29 +358,29 @@ BOOL OnIqSetGoogleSharedStatus(IJabberInterface *ji, HXML iqNode, void *)
void GoogleTalkAcc::SendIqGoogleSharedStatus(LPCTSTR status, LPCTSTR msg)
{
- HXML iq = xi.createNode(NODENAME_IQ, NULL, FALSE);
- xi.addAttr(iq, ATTRNAME_TYPE, IQTYPE_GET);
+ HXML iq = xmlCreateNode(NODENAME_IQ, NULL, FALSE);
+ xmlAddAttr(iq, ATTRNAME_TYPE, IQTYPE_GET);
- HXML query = xi.addChild(iq, NODENAME_QUERY, NULL);
- xi.addChild(query, ATTRNAME_XMLNS, JABBER_FEAT_GTALK_SHARED_STATUS);
- xi.addAttrInt(query, _T("version"), 2);
+ HXML query = xmlAddChild(iq, NODENAME_QUERY, NULL);
+ xmlAddChild(query, ATTRNAME_XMLNS, JABBER_FEAT_GTALK_SHARED_STATUS);
+ xmlAddAttrInt(query, _T("version"), 2);
- xi.addChild(query, _T("status"), msg);
+ xmlAddChild(query, _T("status"), msg);
if (!mir_tstrcmp(status, _T("invisible"))) {
- xi.addChild(query, _T("show"), _T("default"));
- xi.addAttr(xi.addChild(query, _T("invisible"), 0), _T("value"), _T("true"));
+ xmlAddChild(query, _T("show"), _T("default"));
+ xmlAddAttr(xmlAddChild(query, _T("invisible"), 0), _T("value"), _T("true"));
}
else {
if (!mir_tstrcmp(status, _T("dnd")))
- xi.addChild(query, _T("show"), _T("dnd"));
+ xmlAddChild(query, _T("show"), _T("dnd"));
else
- xi.addChild(query, _T("show"), _T("default"));
+ xmlAddChild(query, _T("show"), _T("default"));
- xi.addAttr(xi.addChild(query, _T("invisible"), 0), _T("value"), _T("false"));
+ xmlAddAttr(xmlAddChild(query, _T("invisible"), 0), _T("value"), _T("false"));
}
m_bGoogleSharedStatusLock = TRUE;
m_japi->SendXmlNode(iq);
- xi.destroyNode(iq);
+ xmlDestroyNode(iq);
}
int OnServerDiscoInfo(WPARAM wParam, LPARAM lParam)
@@ -395,14 +393,14 @@ int OnServerDiscoInfo(WPARAM wParam, LPARAM lParam)
JABBER_DISCO_FIELD *fld = (JABBER_DISCO_FIELD*)wParam;
if (!mir_tstrcmp(fld->category, _T("server")) && !mir_tstrcmp(fld->type, _T("im")) && !mir_tstrcmp(fld->name, _T("Google Talk"))) {
- HXML iq = xi.createNode(NODENAME_IQ, NULL, FALSE);
- xi.addAttr(iq, ATTRNAME_TYPE, IQTYPE_GET);
+ HXML iq = xmlCreateNode(NODENAME_IQ, NULL, FALSE);
+ xmlAddAttr(iq, ATTRNAME_TYPE, IQTYPE_GET);
- HXML query = xi.addChild(iq, NODENAME_QUERY, NULL);
- xi.addChild(query, ATTRNAME_XMLNS, JABBER_FEAT_GTALK_SHARED_STATUS);
- xi.addAttrInt(query, _T("version"), 2);
+ HXML query = xmlAddChild(iq, NODENAME_QUERY, NULL);
+ xmlAddChild(query, ATTRNAME_XMLNS, JABBER_FEAT_GTALK_SHARED_STATUS);
+ xmlAddAttrInt(query, _T("version"), 2);
gta->m_japi->SendXmlNode(iq);
- xi.destroyNode(iq);
+ xmlDestroyNode(iq);
}
return 0;
}
diff --git a/protocols/Gadu-Gadu/src/avatar.cpp b/protocols/Gadu-Gadu/src/avatar.cpp
index f054c5e0e9..c666bd591b 100644
--- a/protocols/Gadu-Gadu/src/avatar.cpp
+++ b/protocols/Gadu-Gadu/src/avatar.cpp
@@ -84,20 +84,20 @@ bool GGPROTO::getAvatarFileInfo(uin_t uin, char **avatarurl, char **avatarts)
//if this url returned xml data (before and after 11.2013 gg convention)
TCHAR *xmlAction = mir_a2t(resp->pData);
- HXML hXml = xi.parseString(xmlAction, 0, _T("result"));
+ HXML hXml = xmlParseString(xmlAction, 0, _T("result"));
if (hXml != NULL) {
- HXML node = xi.getChildByPath(hXml, _T("users/user/avatars/avatar"), 0);
- const TCHAR *blank = (node != NULL) ? xi.getAttrValue(node, _T("blank")) : NULL;
+ HXML node = xmlGetChildByPath(hXml, _T("users/user/avatars/avatar"), 0);
+ const TCHAR *blank = (node != NULL) ? xmlGetAttrValue(node, _T("blank")) : NULL;
if (blank != NULL && mir_tstrcmp(blank, _T("1"))) {
- node = xi.getChildByPath(hXml, _T("users/user/avatars/avatar/timestamp"), 0);
- *avatarts = node != NULL ? mir_t2a(xi.getText(node)) : NULL;
- node = xi.getChildByPath(hXml, _T("users/user/avatars/avatar/bigavatar"), 0); //new gg convention
+ node = xmlGetChildByPath(hXml, _T("users/user/avatars/avatar/timestamp"), 0);
+ *avatarts = node != NULL ? mir_t2a(xmlGetText(node)) : NULL;
+ node = xmlGetChildByPath(hXml, _T("users/user/avatars/avatar/bigavatar"), 0); //new gg convention
if (node == NULL){
- node = xi.getChildByPath(hXml, _T("users/user/avatars/avatar/originBigAvatar"), 0); //old gg convention
+ node = xmlGetChildByPath(hXml, _T("users/user/avatars/avatar/originBigAvatar"), 0); //old gg convention
}
- *avatarurl = node != NULL ? mir_t2a(xi.getText(node)) : NULL;
+ *avatarurl = node != NULL ? mir_t2a(xmlGetText(node)) : NULL;
}
- xi.destroyNode(hXml);
+ xmlDestroyNode(hXml);
}
mir_free(xmlAction);
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp
index dca61cd88b..efe7df5d0a 100644
--- a/protocols/Gadu-Gadu/src/core.cpp
+++ b/protocols/Gadu-Gadu/src/core.cpp
@@ -1153,7 +1153,7 @@ retry:
xmlAction = mir_a2t(e->event.xml_action.data);
tag = mir_a2t("events");
- hXml = xi.parseString(xmlAction, 0, tag);
+ hXml = xmlParseString(xmlAction, 0, tag);
if (hXml != NULL) {
HXML node;
@@ -1161,13 +1161,13 @@ retry:
mir_free(tag);
tag = mir_a2t("event/type");
- node = xi.getChildByPath(hXml, tag, 0);
- type = node != NULL ? mir_t2a(xi.getText(node)) : NULL;
+ node = xmlGetChildByPath(hXml, tag, 0);
+ type = node != NULL ? mir_t2a(xmlGetText(node)) : NULL;
mir_free(tag);
tag = mir_a2t("event/sender");
- node = xi.getChildByPath(hXml, tag, 0);
- sender = node != NULL ? mir_t2a(xi.getText(node)) : NULL;
+ node = xmlGetChildByPath(hXml, tag, 0);
+ sender = node != NULL ? mir_t2a(xmlGetText(node)) : NULL;
debugLogA("mainthread() (%x): XML Action type: %s.", this, type != NULL ? type : "unknown");
// Avatar change notify
if (type != NULL && !mir_strcmp(type, "28")) {
@@ -1176,7 +1176,7 @@ retry:
}
mir_free(type);
mir_free(sender);
- xi.destroyNode(hXml);
+ xmlDestroyNode(hXml);
}
mir_free(tag);
mir_free(xmlAction);
diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp
index 5d673107c0..b5f5c81243 100644
--- a/protocols/Gadu-Gadu/src/gg.cpp
+++ b/protocols/Gadu-Gadu/src/gg.cpp
@@ -41,7 +41,6 @@ PLUGININFOEX pluginInfo = {
// Other variables
HINSTANCE hInstance;
-XML_API xi;
SSL_API si;
CLIST_INTERFACE *pcli;
int hLangpack;
@@ -328,7 +327,6 @@ static int gg_proto_uninit(PROTO_INTERFACE *proto)
extern "C" int __declspec(dllexport) Load(void)
{
- mir_getXI(&xi);
mir_getLP(&pluginInfo);
mir_getCLI();
diff --git a/protocols/Gadu-Gadu/src/oauth.cpp b/protocols/Gadu-Gadu/src/oauth.cpp
index 773b3ade25..19c74c0acf 100644
--- a/protocols/Gadu-Gadu/src/oauth.cpp
+++ b/protocols/Gadu-Gadu/src/oauth.cpp
@@ -316,15 +316,15 @@ int GGPROTO::oauth_receivetoken()
nlc = resp->nlc;
if (resp->resultCode == 200 && resp->dataLength > 0 && resp->pData) {
TCHAR *xmlAction = mir_a2t(resp->pData);
- HXML hXml = xi.parseString(xmlAction, 0, _T("result"));
+ HXML hXml = xmlParseString(xmlAction, 0, _T("result"));
if (hXml != NULL) {
- HXML node = xi.getChildByPath(hXml, _T("oauth_token"), 0);
- token = node != NULL ? mir_t2a(xi.getText(node)) : NULL;
+ HXML node = xmlGetChildByPath(hXml, _T("oauth_token"), 0);
+ token = node != NULL ? mir_t2a(xmlGetText(node)) : NULL;
- node = xi.getChildByPath(hXml, _T("oauth_token_secret"), 0);
- token_secret = node != NULL ? mir_t2a(xi.getText(node)) : NULL;
+ node = xmlGetChildByPath(hXml, _T("oauth_token_secret"), 0);
+ token_secret = node != NULL ? mir_t2a(xmlGetText(node)) : NULL;
- xi.destroyNode(hXml);
+ xmlDestroyNode(hXml);
}
mir_free(xmlAction);
}
@@ -385,15 +385,15 @@ int GGPROTO::oauth_receivetoken()
if (resp) {
if (resp->resultCode == 200 && resp->dataLength > 0 && resp->pData) {
TCHAR *xmlAction = mir_a2t(resp->pData);
- HXML hXml = xi.parseString(xmlAction, 0, _T("result"));
+ HXML hXml = xmlParseString(xmlAction, 0, _T("result"));
if (hXml != NULL) {
- HXML node = xi.getChildByPath(hXml, _T("oauth_token"), 0);
- token = mir_t2a(xi.getText(node));
+ HXML node = xmlGetChildByPath(hXml, _T("oauth_token"), 0);
+ token = mir_t2a(xmlGetText(node));
- node = xi.getChildByPath(hXml, _T("oauth_token_secret"), 0);
- token_secret = mir_t2a(xi.getText(node));
+ node = xmlGetChildByPath(hXml, _T("oauth_token_secret"), 0);
+ token_secret = mir_t2a(xmlGetText(node));
- xi.destroyNode(hXml);
+ xmlDestroyNode(hXml);
}
mir_free(xmlAction);
}
diff --git a/protocols/JabberG/src/jabber.cpp b/protocols/JabberG/src/jabber.cpp
index a78d4512ef..10e21ebd18 100644
--- a/protocols/JabberG/src/jabber.cpp
+++ b/protocols/JabberG/src/jabber.cpp
@@ -58,8 +58,6 @@ PLUGININFOEX pluginInfo = {
{0x144e80a2, 0xd198, 0x428b, {0xac, 0xbe, 0x9d, 0x55, 0xda, 0xcc, 0x7f, 0xde}} // {144E80A2-D198-428b-ACBE-9D55DACC7FDE}
};
-XML_API xi;
-
CLIST_INTERFACE* pcli;
FI_INTERFACE *FIP = NULL;
@@ -182,7 +180,6 @@ static int jabberProtoUninit(CJabberProto *ppro)
extern "C" int __declspec(dllexport) Load()
{
// set the memory, lists & utf8 managers
- mir_getXI(&xi);
mir_getLP(&pluginInfo);
mir_getCLI();
diff --git a/protocols/JabberG/src/jabber_adhoc.cpp b/protocols/JabberG/src/jabber_adhoc.cpp
index 348f7cabf5..043fd4a265 100644
--- a/protocols/JabberG/src/jabber_adhoc.cpp
+++ b/protocols/JabberG/src/jabber_adhoc.cpp
@@ -98,12 +98,12 @@ static void JabberAdHoc_RefreshFrameScroll(HWND hwndDlg, JabberAdHocData * dat)
void CJabberProto::OnIqResult_ListOfCommands(HXML iqNode, CJabberIqInfo *pInfo)
{
- SendMessage(GetWindowFromIq(pInfo), JAHM_COMMANDLISTRESULT, 0, (LPARAM)xi.copyNode(iqNode));
+ SendMessage(GetWindowFromIq(pInfo), JAHM_COMMANDLISTRESULT, 0, (LPARAM)xmlCopyNode(iqNode));
}
void CJabberProto::OnIqResult_CommandExecution(HXML iqNode, CJabberIqInfo *pInfo)
{
- SendMessage(GetWindowFromIq(pInfo), JAHM_PROCESSRESULT, (WPARAM)xi.copyNode(iqNode), 0);
+ SendMessage(GetWindowFromIq(pInfo), JAHM_PROCESSRESULT, (WPARAM)xmlCopyNode(iqNode), 0);
}
void CJabberProto::AdHoc_RequestListOfCommands(TCHAR * szResponder, HWND hwndDlg)
@@ -115,16 +115,16 @@ void CJabberProto::AdHoc_RequestListOfCommands(TCHAR * szResponder, HWND hwndDlg
int CJabberProto::AdHoc_ExecuteCommand(HWND hwndDlg, TCHAR*, JabberAdHocData* dat)
{
for (int i = 1;; i++) {
- HXML itemNode = xmlGetNthChild(dat->CommandsNode, _T("item"), i);
+ HXML itemNode = XmlGetNthChild(dat->CommandsNode, _T("item"), i);
if (!itemNode)
break;
if (BST_UNCHECKED == IsDlgButtonChecked(GetDlgItem(hwndDlg, IDC_FRAME), i))
continue;
- const TCHAR *node = xmlGetAttrValue(itemNode, _T("node"));
+ const TCHAR *node = XmlGetAttrValue(itemNode, _T("node"));
if (node) {
- const TCHAR *jid2 = xmlGetAttrValue(itemNode, _T("jid"));
+ const TCHAR *jid2 = XmlGetAttrValue(itemNode, _T("jid"));
m_ThreadInfo->send(
XmlNodeIq(AddIQ(&CJabberProto::OnIqResult_CommandExecution, JABBER_IQ_TYPE_SET, jid2, 0, -1, hwndDlg))
<< XCHILDNS(_T("command"), JABBER_FEAT_COMMANDS) << XATTR(_T("node"), node) << XATTR(_T("action"), _T("execute")));
@@ -134,7 +134,7 @@ int CJabberProto::AdHoc_ExecuteCommand(HWND hwndDlg, TCHAR*, JabberAdHocData* da
}
}
- xi.destroyNode(dat->CommandsNode); dat->CommandsNode = NULL;
+ xmlDestroyNode(dat->CommandsNode); dat->CommandsNode = NULL;
return TRUE;
}
@@ -142,17 +142,17 @@ int CJabberProto::AdHoc_ExecuteCommand(HWND hwndDlg, TCHAR*, JabberAdHocData* da
int CJabberProto::AdHoc_OnJAHMCommandListResult(HWND hwndDlg, HXML iqNode, JabberAdHocData* dat)
{
int nodeIdx = 0;
- const TCHAR * type = xmlGetAttrValue(iqNode, _T("type"));
+ const TCHAR * type = XmlGetAttrValue(iqNode, _T("type"));
if (!type || !mir_tstrcmp(type, _T("error"))) {
// error occurred here
TCHAR buff[255];
const TCHAR *code = NULL;
const TCHAR *description = NULL;
- HXML errorNode = xmlGetChild(iqNode, "error");
+ HXML errorNode = XmlGetChild(iqNode, "error");
if (errorNode) {
- code = xmlGetAttrValue(errorNode, _T("code"));
- description = xmlGetText(errorNode);
+ code = XmlGetAttrValue(errorNode, _T("code"));
+ description = XmlGetText(errorNode);
}
mir_sntprintf(buff, TranslateT("Error %s %s"), (code) ? code : _T(""), (description) ? description : _T(""));
JabberFormSetInstruction(hwndDlg, buff);
@@ -163,24 +163,24 @@ int CJabberProto::AdHoc_OnJAHMCommandListResult(HWND hwndDlg, HXML iqNode, Jabbe
dat->CurrentHeight = 0;
dat->curPos = 0;
SetScrollPos(GetDlgItem(hwndDlg, IDC_VSCROLL), SB_CTL, 0, FALSE);
- HXML queryNode = xmlGetChild(iqNode, "query");
+ HXML queryNode = XmlGetChild(iqNode, "query");
if (queryNode) {
- const TCHAR *xmlns = xmlGetAttrValue(queryNode, _T("xmlns"));
- const TCHAR *node = xmlGetAttrValue(queryNode, _T("node"));
+ const TCHAR *xmlns = XmlGetAttrValue(queryNode, _T("xmlns"));
+ const TCHAR *node = XmlGetAttrValue(queryNode, _T("node"));
if (xmlns && node && !mir_tstrcmp(xmlns, JABBER_FEAT_DISCO_ITEMS) && !mir_tstrcmp(node, JABBER_FEAT_COMMANDS))
validResponse = TRUE;
}
- if (queryNode && xmlGetChild(queryNode, 0) && validResponse) {
- dat->CommandsNode = xi.copyNode(queryNode);
+ if (queryNode && XmlGetChild(queryNode, 0) && validResponse) {
+ dat->CommandsNode = xmlCopyNode(queryNode);
int ypos = 20;
for (nodeIdx = 1;; nodeIdx++) {
- HXML itemNode = xmlGetNthChild(queryNode, _T("item"), nodeIdx);
+ HXML itemNode = XmlGetNthChild(queryNode, _T("item"), nodeIdx);
if (!itemNode)
break;
- const TCHAR *name = xmlGetAttrValue(itemNode, _T("name"));
- if (!name) name = xmlGetAttrValue(itemNode, _T("node"));
+ const TCHAR *name = XmlGetAttrValue(itemNode, _T("name"));
+ if (!name) name = XmlGetAttrValue(itemNode, _T("node"));
ypos = AdHoc_AddCommandRadio(GetDlgItem(hwndDlg, IDC_FRAME), TranslateTS(name), nodeIdx, ypos, (nodeIdx == 1) ? 1 : 0);
dat->CurrentHeight = ypos;
}
@@ -209,27 +209,27 @@ int CJabberProto::AdHoc_OnJAHMProcessResult(HWND hwndDlg, HXML workNode, JabberA
if (workNode == NULL)
return TRUE;
- dat->AdHocNode = xi.copyNode(workNode);
+ dat->AdHocNode = xmlCopyNode(workNode);
const TCHAR *type;
- if ((type = xmlGetAttrValue(workNode, _T("type"))) == NULL) return TRUE;
+ if ((type = XmlGetAttrValue(workNode, _T("type"))) == NULL) return TRUE;
if (!mir_tstrcmp(type, _T("result"))) {
// wParam = <iq/> node from responder as a result of command execution
HXML commandNode, xNode;
- if ((commandNode = xmlGetChild(dat->AdHocNode, _T("command"))) == NULL)
+ if ((commandNode = XmlGetChild(dat->AdHocNode, _T("command"))) == NULL)
return TRUE;
- const TCHAR *status = xmlGetAttrValue(commandNode, _T("status"));
+ const TCHAR *status = XmlGetAttrValue(commandNode, _T("status"));
if (!status)
status = _T("completed");
- if ((xNode = xmlGetChild(commandNode, "x"))) {
+ if ((xNode = XmlGetChild(commandNode, "x"))) {
// use jabber:x:data form
HWND hFrame = GetDlgItem(hwndDlg, IDC_FRAME);
ShowWindow(GetDlgItem(hwndDlg, IDC_FRAME_TEXT), SW_HIDE);
- if (LPCTSTR ptszInstr = xmlGetText(xmlGetChild(xNode, "instructions")))
+ if (LPCTSTR ptszInstr = XmlGetText(XmlGetChild(xNode, "instructions")))
JabberFormSetInstruction(hwndDlg, ptszInstr);
- else if (LPCTSTR ptszTitle = xmlGetText(xmlGetChild(xNode, "title")))
+ else if (LPCTSTR ptszTitle = XmlGetText(XmlGetChild(xNode, "title")))
JabberFormSetInstruction(hwndDlg, ptszTitle);
else
JabberFormSetInstruction(hwndDlg, TranslateTS(status));
@@ -241,16 +241,16 @@ int CJabberProto::AdHoc_OnJAHMProcessResult(HWND hwndDlg, HXML workNode, JabberA
int toHide[] = { IDC_FRAME_TEXT, IDC_FRAME, IDC_VSCROLL, 0 };
sttShowControls(hwndDlg, FALSE, toHide);
- LPCTSTR noteText = xmlGetText(xmlGetChild(commandNode, "note"));
+ LPCTSTR noteText = XmlGetText(XmlGetChild(commandNode, "note"));
JabberFormSetInstruction(hwndDlg, noteText ? noteText : TranslateTS(status));
}
// check actions
- HXML actionsNode = xmlGetChild(commandNode, "actions");
+ HXML actionsNode = XmlGetChild(commandNode, "actions");
if (actionsNode != NULL) {
- ShowDlgItem(hwndDlg, IDC_PREV, (xmlGetChild(actionsNode, "prev") != NULL) ? SW_SHOW : SW_HIDE);
- ShowDlgItem(hwndDlg, IDC_NEXT, (xmlGetChild(actionsNode, "next") != NULL) ? SW_SHOW : SW_HIDE);
- ShowDlgItem(hwndDlg, IDC_COMPLETE, (xmlGetChild(actionsNode, "complete") != NULL) ? SW_SHOW : SW_HIDE);
+ ShowDlgItem(hwndDlg, IDC_PREV, (XmlGetChild(actionsNode, "prev") != NULL) ? SW_SHOW : SW_HIDE);
+ ShowDlgItem(hwndDlg, IDC_NEXT, (XmlGetChild(actionsNode, "next") != NULL) ? SW_SHOW : SW_HIDE);
+ ShowDlgItem(hwndDlg, IDC_COMPLETE, (XmlGetChild(actionsNode, "complete") != NULL) ? SW_SHOW : SW_HIDE);
ShowDlgItem(hwndDlg, IDC_SUBMIT, SW_HIDE);
int toEnable[] = { IDC_PREV, IDC_NEXT, IDC_COMPLETE, 0 };
@@ -277,10 +277,10 @@ int CJabberProto::AdHoc_OnJAHMProcessResult(HWND hwndDlg, HXML workNode, JabberA
const TCHAR *code=NULL;
const TCHAR *description=NULL;
TCHAR buff[255];
- HXML errorNode = xmlGetChild(workNode , "error");
+ HXML errorNode = XmlGetChild(workNode , "error");
if (errorNode) {
- code = xmlGetAttrValue(errorNode, _T("code"));
- description = xmlGetText(errorNode);
+ code = XmlGetAttrValue(errorNode, _T("code"));
+ description = XmlGetText(errorNode);
}
mir_sntprintf(buff, TranslateT("Error %s %s"), code ? code : _T(""), description ? description : _T(""));
JabberFormSetInstruction(hwndDlg,buff);
@@ -291,29 +291,29 @@ int CJabberProto::AdHoc_OnJAHMProcessResult(HWND hwndDlg, HXML workNode, JabberA
int CJabberProto::AdHoc_SubmitCommandForm(HWND hwndDlg, JabberAdHocData* dat, TCHAR* action)
{
- HXML commandNode = xmlGetChild(dat->AdHocNode, "command");
- HXML xNode = xmlGetChild(commandNode, "x");
+ HXML commandNode = XmlGetChild(dat->AdHocNode, "command");
+ HXML xNode = XmlGetChild(commandNode, "x");
HXML dataNode = JabberFormGetData(GetDlgItem(hwndDlg, IDC_FRAME), xNode);
- LPCTSTR jid2 = xmlGetAttrValue(dat->AdHocNode, _T("from"));
+ LPCTSTR jid2 = XmlGetAttrValue(dat->AdHocNode, _T("from"));
XmlNodeIq iq(AddIQ(&CJabberProto::OnIqResult_CommandExecution, JABBER_IQ_TYPE_SET, jid2, 0, -1, hwndDlg));
HXML command = iq << XCHILDNS(_T("command"), JABBER_FEAT_COMMANDS);
- const TCHAR *sessionId = xmlGetAttrValue(commandNode, _T("sessionid"));
+ const TCHAR *sessionId = XmlGetAttrValue(commandNode, _T("sessionid"));
if (sessionId)
command << XATTR(_T("sessionid"), sessionId);
- const TCHAR *node = xmlGetAttrValue(commandNode, _T("node"));
+ const TCHAR *node = XmlGetAttrValue(commandNode, _T("node"));
if (node)
command << XATTR(_T("node"), node);
if (action)
command << XATTR(_T("action"), action);
- xmlAddChild(command, dataNode);
+ XmlAddChild(command, dataNode);
m_ThreadInfo->send(iq);
- xi.destroyNode(dataNode);
+ xmlDestroyNode(dataNode);
JabberFormSetInstruction(hwndDlg, TranslateT("In progress. Please Wait..."));
@@ -428,7 +428,7 @@ static INT_PTR CALLBACK JabberAdHoc_CommandDlgProc(HWND hwndDlg, UINT msg, WPARA
return dat->proto->AdHoc_SubmitCommandForm(hwndDlg, dat, NULL);
case IDCLOSE:
case IDCANCEL:
- xi.destroyNode(dat->AdHocNode); dat->AdHocNode = NULL;
+ xmlDestroyNode(dat->AdHocNode); dat->AdHocNode = NULL;
DestroyWindow(hwndDlg);
return TRUE;
}
@@ -498,8 +498,8 @@ static INT_PTR CALLBACK JabberAdHoc_CommandDlgProc(HWND hwndDlg, UINT msg, WPARA
dat->proto->m_hwndCommandWindow = NULL;
mir_free(dat->ResponderJID);
- xi.destroyNode(dat->CommandsNode);
- xi.destroyNode(dat->AdHocNode);
+ xmlDestroyNode(dat->CommandsNode);
+ xmlDestroyNode(dat->AdHocNode);
mir_free(dat);
dat = NULL;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, 0);
diff --git a/protocols/JabberG/src/jabber_agent.cpp b/protocols/JabberG/src/jabber_agent.cpp
index fde3e1c0ba..59d2cbf339 100644
--- a/protocols/JabberG/src/jabber_agent.cpp
+++ b/protocols/JabberG/src/jabber_agent.cpp
@@ -116,7 +116,7 @@ public:
virtual void OnDestroy()
{
- xi.destroyNode(m_agentRegIqNode);
+ xmlDestroyNode(m_agentRegIqNode);
JabberFormDestroyUI(GetDlgItem(m_hwnd, IDC_FRAME));
m_proto->m_hwndAgentRegInput = NULL;
EnableWindow(GetParent(m_hwnd), TRUE);
@@ -142,7 +142,7 @@ public:
HXML queryNode, xNode;
if ((m_agentRegIqNode = (HXML)lParam) == NULL) return TRUE;
- if ((queryNode = xmlGetChild(m_agentRegIqNode , "query")) == NULL) return TRUE;
+ if ((queryNode = XmlGetChild(m_agentRegIqNode , "query")) == NULL) return TRUE;
RECT rect;
@@ -153,9 +153,9 @@ public:
GetClientRect(GetDlgItem(m_hwnd, IDC_FRAME), &rect);
m_frameHeight = rect.bottom - rect.top;
- if ((xNode=xmlGetChild(queryNode , "x")) != NULL) {
+ if ((xNode=XmlGetChild(queryNode , "x")) != NULL) {
// use new jabber:x:data form
- if (LPCTSTR ptszInstr = xmlGetText( xmlGetChild(xNode, "instructions")))
+ if (LPCTSTR ptszInstr = XmlGetText( XmlGetChild(xNode, "instructions")))
JabberFormSetInstruction(m_hwnd, ptszInstr);
JabberFormCreateUI(hFrame, xNode, &m_formHeight /*dummy*/);
@@ -164,21 +164,21 @@ public:
// use old registration information form
HJFORMLAYOUT layout_info = JabberFormCreateLayout(hFrame);
for (int i=0; ; i++) {
- HXML n = xmlGetChild(queryNode ,i);
+ HXML n = XmlGetChild(queryNode ,i);
if (n == NULL)
break;
- if (xmlGetName(n)) {
- if (!mir_tstrcmp(xmlGetName(n), _T("instructions"))) {
- JabberFormSetInstruction(m_hwnd, xmlGetText(n));
+ if (XmlGetName(n)) {
+ if (!mir_tstrcmp(XmlGetName(n), _T("instructions"))) {
+ JabberFormSetInstruction(m_hwnd, XmlGetText(n));
}
- else if (!mir_tstrcmp(xmlGetName(n), _T("key")) || !mir_tstrcmp(xmlGetName(n), _T("registered"))) {
+ else if (!mir_tstrcmp(XmlGetName(n), _T("key")) || !mir_tstrcmp(XmlGetName(n), _T("registered"))) {
// do nothing
}
- else if (!mir_tstrcmp(xmlGetName(n), _T("password")))
- JabberFormAppendControl(hFrame, layout_info, JFORM_CTYPE_TEXT_PRIVATE, xmlGetName(n), xmlGetText(n));
+ else if (!mir_tstrcmp(XmlGetName(n), _T("password")))
+ JabberFormAppendControl(hFrame, layout_info, JFORM_CTYPE_TEXT_PRIVATE, XmlGetName(n), XmlGetText(n));
else // everything else is a normal text field
- JabberFormAppendControl(hFrame, layout_info, JFORM_CTYPE_TEXT_SINGLE, xmlGetName(n), xmlGetText(n));
+ JabberFormAppendControl(hFrame, layout_info, JFORM_CTYPE_TEXT_SINGLE, XmlGetName(n), XmlGetText(n));
} }
JabberFormLayoutControls(hFrame, layout_info, &m_formHeight);
mir_free(layout_info);
@@ -229,8 +229,8 @@ public:
const TCHAR *from;
if (m_agentRegIqNode == NULL) return;
- if ((from = xmlGetAttrValue(m_agentRegIqNode, _T("from"))) == NULL) return;
- if ((queryNode = xmlGetChild(m_agentRegIqNode , "query")) == NULL) return;
+ if ((from = XmlGetAttrValue(m_agentRegIqNode, _T("from"))) == NULL) return;
+ if ((queryNode = XmlGetChild(m_agentRegIqNode , "query")) == NULL) return;
HWND hFrame = GetDlgItem(m_hwnd, IDC_FRAME);
TCHAR *str2 = (TCHAR*)alloca(sizeof(TCHAR) * 128);
@@ -239,33 +239,33 @@ public:
XmlNodeIq iq( m_proto->AddIQ(&CJabberProto::OnIqResultSetRegister, JABBER_IQ_TYPE_SET, from));
HXML query = iq << XQUERY(JABBER_FEAT_REGISTER);
- if ((xNode = xmlGetChild(queryNode , "x")) != NULL) {
+ if ((xNode = XmlGetChild(queryNode , "x")) != NULL) {
// use new jabber:x:data form
HXML n = JabberFormGetData(hFrame, xNode);
- xmlAddChild(query, n);
- xi.destroyNode(n);
+ XmlAddChild(query, n);
+ xmlDestroyNode(n);
}
else {
// use old registration information form
for (int i=0; ; i++) {
- HXML n = xmlGetChild(queryNode ,i);
+ HXML n = XmlGetChild(queryNode ,i);
if (!n)
break;
- if (xmlGetName(n)) {
- if (!mir_tstrcmp(xmlGetName(n), _T("key"))) {
+ if (XmlGetName(n)) {
+ if (!mir_tstrcmp(XmlGetName(n), _T("key"))) {
// field that must be passed along with the registration
- if (xmlGetText(n))
- xmlAddChild(query, xmlGetName(n), xmlGetText(n));
+ if (XmlGetText(n))
+ XmlAddChild(query, XmlGetName(n), XmlGetText(n));
else
- xmlAddChild(query, xmlGetName(n));
+ XmlAddChild(query, XmlGetName(n));
}
- else if (!mir_tstrcmp(xmlGetName(n), _T("registered")) || !mir_tstrcmp(xmlGetName(n), _T("instructions"))) {
+ else if (!mir_tstrcmp(XmlGetName(n), _T("registered")) || !mir_tstrcmp(XmlGetName(n), _T("instructions"))) {
// do nothing, we will skip these
}
else {
GetDlgItemText(hFrame, id, str2, 128);
- xmlAddChild(query, xmlGetName(n), str2);
+ XmlAddChild(query, XmlGetName(n), str2);
id++;
} } } }
diff --git a/protocols/JabberG/src/jabber_archive.cpp b/protocols/JabberG/src/jabber_archive.cpp
index f12dbd5c4b..b7d29783ac 100644
--- a/protocols/JabberG/src/jabber_archive.cpp
+++ b/protocols/JabberG/src/jabber_archive.cpp
@@ -52,24 +52,24 @@ void CJabberProto::RetrieveMessageArchive(MCONTACT hContact, JABBER_LIST_ITEM *p
void CJabberProto::OnIqResultGetCollectionList(HXML iqNode, CJabberIqInfo*)
{
- const TCHAR *to = xmlGetAttrValue(iqNode, _T("to"));
- if (to == NULL || mir_tstrcmp( xmlGetAttrValue(iqNode, _T("type")), _T("result")))
+ const TCHAR *to = XmlGetAttrValue(iqNode, _T("to"));
+ if (to == NULL || mir_tstrcmp( XmlGetAttrValue(iqNode, _T("type")), _T("result")))
return;
- HXML list = xmlGetChild(iqNode, "list");
- if (!list || mir_tstrcmp( xmlGetAttrValue(list, _T("xmlns")), JABBER_FEAT_ARCHIVE))
+ HXML list = XmlGetChild(iqNode, "list");
+ if (!list || mir_tstrcmp( XmlGetAttrValue(list, _T("xmlns")), JABBER_FEAT_ARCHIVE))
return;
MCONTACT hContact = NULL;
time_t tmLast = 0;
for (int nodeIdx = 1; ; nodeIdx++) {
- HXML itemNode = xmlGetNthChild(list, _T("chat"), nodeIdx);
+ HXML itemNode = XmlGetNthChild(list, _T("chat"), nodeIdx);
if (!itemNode)
break;
- const TCHAR* start = xmlGetAttrValue(itemNode, _T("start"));
- const TCHAR* with = xmlGetAttrValue(itemNode, _T("with"));
+ const TCHAR* start = XmlGetAttrValue(itemNode, _T("start"));
+ const TCHAR* with = XmlGetAttrValue(itemNode, _T("with"));
if (!start || !with)
continue;
@@ -246,15 +246,15 @@ BOOL IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO& dbei)
void CJabberProto::OnIqResultGetCollection(HXML iqNode, CJabberIqInfo*)
{
- if ( mir_tstrcmp( xmlGetAttrValue(iqNode, _T("type")), _T("result")))
+ if ( mir_tstrcmp( XmlGetAttrValue(iqNode, _T("type")), _T("result")))
return;
- HXML chatNode = xmlGetChild(iqNode, "chat");
- if (!chatNode || mir_tstrcmp( xmlGetAttrValue(chatNode, _T("xmlns")), JABBER_FEAT_ARCHIVE))
+ HXML chatNode = XmlGetChild(iqNode, "chat");
+ if (!chatNode || mir_tstrcmp( XmlGetAttrValue(chatNode, _T("xmlns")), JABBER_FEAT_ARCHIVE))
return;
- const TCHAR* start = xmlGetAttrValue(chatNode, _T("start"));
- const TCHAR* with = xmlGetAttrValue(chatNode, _T("with"));
+ const TCHAR* start = XmlGetAttrValue(chatNode, _T("start"));
+ const TCHAR* with = XmlGetAttrValue(chatNode, _T("with"));
if (!start || !with)
return;
@@ -266,12 +266,12 @@ void CJabberProto::OnIqResultGetCollection(HXML iqNode, CJabberIqInfo*)
_tzset();
for (int nodeIdx = 0; ; nodeIdx++) {
- HXML itemNode = xmlGetChild(chatNode, nodeIdx);
+ HXML itemNode = XmlGetChild(chatNode, nodeIdx);
if (!itemNode)
break;
int from;
- const TCHAR *itemName = xmlGetName(itemNode);
+ const TCHAR *itemName = XmlGetName(itemNode);
if (!mir_tstrcmp(itemName, _T("to")))
from = DBEF_SENT;
else if (!mir_tstrcmp(itemName, _T("from")))
@@ -279,12 +279,12 @@ void CJabberProto::OnIqResultGetCollection(HXML iqNode, CJabberIqInfo*)
else
continue;
- HXML body = xmlGetChild(itemNode, "body");
+ HXML body = XmlGetChild(itemNode, "body");
if (!body)
continue;
- const TCHAR *tszBody = xmlGetText(body);
- const TCHAR *tszSecs = xmlGetAttrValue(itemNode, _T("secs"));
+ const TCHAR *tszBody = XmlGetText(body);
+ const TCHAR *tszSecs = XmlGetAttrValue(itemNode, _T("secs"));
if (!tszBody || !tszSecs)
continue;
diff --git a/protocols/JabberG/src/jabber_byte.cpp b/protocols/JabberG/src/jabber_byte.cpp
index fcde4046de..3ebd23db99 100644
--- a/protocols/JabberG/src/jabber_byte.cpp
+++ b/protocols/JabberG/src/jabber_byte.cpp
@@ -44,7 +44,7 @@ JABBER_BYTE_TRANSFER::~JABBER_BYTE_TRANSFER()
mir_free(iqId);
mir_free(sid);
- xi.destroyNode(iqNode);
+ xmlDestroyNode(iqNode);
// XEP-0065 proxy support
mir_free(szProxyHost);
@@ -58,15 +58,15 @@ void CJabberProto::IqResultProxyDiscovery(HXML iqNode, CJabberIqInfo *pInfo)
JABBER_BYTE_TRANSFER *jbt = (JABBER_BYTE_TRANSFER *)pInfo->GetUserData();
if (pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT) {
- HXML queryNode = xmlGetChild(iqNode , "query");
+ HXML queryNode = XmlGetChild(iqNode , "query");
if (queryNode) {
- const TCHAR *queryXmlns = xmlGetAttrValue(queryNode, _T("xmlns"));
+ const TCHAR *queryXmlns = XmlGetAttrValue(queryNode, _T("xmlns"));
if (queryXmlns && !mir_tstrcmp(queryXmlns, JABBER_FEAT_BYTESTREAMS)) {
- HXML streamHostNode = xmlGetChild(queryNode , "streamhost");
+ HXML streamHostNode = XmlGetChild(queryNode , "streamhost");
if (streamHostNode) {
- const TCHAR *streamJid = xmlGetAttrValue(streamHostNode, _T("jid"));
- const TCHAR *streamHost = xmlGetAttrValue(streamHostNode, _T("host"));
- const TCHAR *streamPort = xmlGetAttrValue(streamHostNode, _T("port"));
+ const TCHAR *streamJid = XmlGetAttrValue(streamHostNode, _T("jid"));
+ const TCHAR *streamHost = XmlGetAttrValue(streamHostNode, _T("host"));
+ const TCHAR *streamPort = XmlGetAttrValue(streamHostNode, _T("port"));
if (streamJid && streamHost && streamPort) {
jbt->szProxyHost = mir_tstrdup(streamHost);
jbt->szProxyJid = mir_tstrdup(streamJid);
@@ -296,13 +296,13 @@ void CJabberProto::ByteInitiateResult(HXML iqNode, CJabberIqInfo *pInfo)
JABBER_BYTE_TRANSFER *jbt = (JABBER_BYTE_TRANSFER *)pInfo->GetUserData();
if (pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT) {
- HXML queryNode = xmlGetChild(iqNode , "query");
+ HXML queryNode = XmlGetChild(iqNode , "query");
if (queryNode) {
- const TCHAR *queryXmlns = xmlGetAttrValue(queryNode, _T("xmlns"));
+ const TCHAR *queryXmlns = XmlGetAttrValue(queryNode, _T("xmlns"));
if (queryXmlns && !mir_tstrcmp(queryXmlns, JABBER_FEAT_BYTESTREAMS)) {
- HXML streamHostNode = xmlGetChild(queryNode , "streamhost-used");
+ HXML streamHostNode = XmlGetChild(queryNode , "streamhost-used");
if (streamHostNode) {
- const TCHAR *streamJid = xmlGetAttrValue(streamHostNode, _T("jid"));
+ const TCHAR *streamJid = XmlGetAttrValue(streamHostNode, _T("jid"));
if (streamJid)
jbt->szStreamhostUsed = mir_tstrdup(streamJid);
} } } }
@@ -412,7 +412,7 @@ void CJabberProto::IqResultStreamActivate(HXML iqNode, CJabberIqInfo*)
if (item == NULL)
return;
- if (!mir_tstrcmp(xmlGetAttrValue(iqNode, _T("type")), _T("result")))
+ if (!mir_tstrcmp(XmlGetAttrValue(iqNode, _T("type")), _T("result")))
item->jbt->bStreamActivated = TRUE;
if (item->jbt->hProxyEvent)
@@ -600,26 +600,26 @@ void __cdecl CJabberProto::ByteReceiveThread(JABBER_BYTE_TRANSFER *jbt)
jbt->state = JBT_INIT;
if (iqNode = jbt->iqNode) {
- from = xmlGetAttrValue(iqNode, _T("from"));
- to = xmlGetAttrValue(iqNode, _T("to"));
- szId = xmlGetAttrValue(iqNode, _T("id"));
+ from = XmlGetAttrValue(iqNode, _T("from"));
+ to = XmlGetAttrValue(iqNode, _T("to"));
+ szId = XmlGetAttrValue(iqNode, _T("id"));
- queryNode = xmlGetChild(iqNode, "query");
+ queryNode = XmlGetChild(iqNode, "query");
if (queryNode)
- sid = xmlGetAttrValue(queryNode, _T("sid"));
+ sid = XmlGetAttrValue(queryNode, _T("sid"));
}
- if (szId && from && to && sid && (n = xmlGetChild(queryNode, "streamhost")) != NULL) {
+ if (szId && from && to && sid && (n = XmlGetChild(queryNode, "streamhost")) != NULL) {
jbt->iqId = mir_tstrdup(szId);
jbt->srcJID = mir_tstrdup(from);
jbt->dstJID = mir_tstrdup(to);
jbt->sid = mir_tstrdup(sid);
if ((buffer = (char*)mir_alloc(JABBER_NETWORK_BUFFER_SIZE))) {
- for (i = 1; (n = xmlGetNthChild(queryNode, _T("streamhost"), i)) != NULL; i++) {
- if ((szHost = xmlGetAttrValue(n, _T("host"))) != NULL &&
- (szPort = xmlGetAttrValue(n, _T("port"))) != NULL &&
- (str = xmlGetAttrValue(n, _T("jid"))) != NULL) {
+ for (i = 1; (n = XmlGetNthChild(queryNode, _T("streamhost"), i)) != NULL; i++) {
+ if ((szHost = XmlGetAttrValue(n, _T("host"))) != NULL &&
+ (szPort = XmlGetAttrValue(n, _T("port"))) != NULL &&
+ (str = XmlGetAttrValue(n, _T("jid"))) != NULL) {
port = (WORD)_ttoi(szPort);
replaceStrT(jbt->streamhostJID, str);
diff --git a/protocols/JabberG/src/jabber_caps.cpp b/protocols/JabberG/src/jabber_caps.cpp
index 6b0581032a..87f9036253 100644
--- a/protocols/JabberG/src/jabber_caps.cpp
+++ b/protocols/JabberG/src/jabber_caps.cpp
@@ -109,7 +109,7 @@ void CJabberProto::OnIqResultCapsDiscoInfoSI(HXML, CJabberIqInfo *pInfo)
if (pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT && query) {
// XEP-0232 support
HXML xform;
- for (int i = 1; (xform = xmlGetNthChild(query, _T("x"), i)) != NULL; i++) {
+ for (int i = 1; (xform = XmlGetNthChild(query, _T("x"), i)) != NULL; i++) {
TCHAR *szFormTypeValue = XPath(xform, _T("field[@var='FORM_TYPE']/value"));
if (szFormTypeValue && !mir_tstrcmp(szFormTypeValue, _T("urn:xmpp:dataforms:softwareinfo"))) {
TCHAR *szTmp = XPath(xform, _T("field[@var='os']/value"));
@@ -142,8 +142,8 @@ void CJabberProto::OnIqResultCapsDiscoInfo(HXML, CJabberIqInfo *pInfo)
if (pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT && query) {
JabberCapsBits jcbCaps = 0;
HXML feature;
- for (int i = 1; (feature = xmlGetNthChild(query, _T("feature"), i)) != NULL; i++) {
- const TCHAR *featureName = xmlGetAttrValue(feature, _T("var"));
+ for (int i = 1; (feature = XmlGetNthChild(query, _T("feature"), i)) != NULL; i++) {
+ const TCHAR *featureName = XmlGetAttrValue(feature, _T("var"));
if (!featureName)
continue;
diff --git a/protocols/JabberG/src/jabber_captcha.cpp b/protocols/JabberG/src/jabber_captcha.cpp
index c923fee4a1..17f37fc7f5 100644
--- a/protocols/JabberG/src/jabber_captcha.cpp
+++ b/protocols/JabberG/src/jabber_captcha.cpp
@@ -112,38 +112,38 @@ INT_PTR CALLBACK JabberCaptchaFormDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
bool CJabberProto::ProcessCaptcha(HXML node, HXML parentNode, ThreadData *info)
{
- HXML x = xmlGetChildByTag(node, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
+ HXML x = XmlGetChildByTag(node, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
if (x == NULL)
return false;
- HXML y = xmlGetChildByTag(x, _T("field"), _T("var"), _T("from"));
+ HXML y = XmlGetChildByTag(x, _T("field"), _T("var"), _T("from"));
if (y == NULL)
return false;
- if ((y = xmlGetChild(y, "value")) == NULL)
+ if ((y = XmlGetChild(y, "value")) == NULL)
return false;
CAPTCHA_FORM_PARAMS param;
- param.fromjid = xmlGetText(y);
+ param.fromjid = XmlGetText(y);
- if ((y = xmlGetChildByTag(x, _T("field"), _T("var"), _T("sid"))) == NULL)
+ if ((y = XmlGetChildByTag(x, _T("field"), _T("var"), _T("sid"))) == NULL)
return false;
- if ((y = xmlGetChild(y, "value")) == NULL)
+ if ((y = XmlGetChild(y, "value")) == NULL)
return false;
- param.sid = xmlGetText(y);
+ param.sid = XmlGetText(y);
- if ((y = xmlGetChildByTag(x, _T("field"), _T("var"), _T("ocr"))) == NULL)
+ if ((y = XmlGetChildByTag(x, _T("field"), _T("var"), _T("ocr"))) == NULL)
return false;
- param.hint = xmlGetAttrValue (y, _T("label"));
+ param.hint = XmlGetAttrValue (y, _T("label"));
- param.from = xmlGetAttrValue(parentNode, _T("from"));
- param.to = xmlGetAttrValue(parentNode, _T("to"));
- param.challenge = xmlGetAttrValue(parentNode, _T("id"));
- HXML o = xmlGetChild(parentNode, "data");
- if (o == NULL || xmlGetText(o) == NULL)
+ param.from = XmlGetAttrValue(parentNode, _T("from"));
+ param.to = XmlGetAttrValue(parentNode, _T("to"));
+ param.challenge = XmlGetAttrValue(parentNode, _T("id"));
+ HXML o = XmlGetChild(parentNode, "data");
+ if (o == NULL || XmlGetText(o) == NULL)
return false;
unsigned bufferLen;
- ptrA buffer((char*)mir_base64_decode( _T2A(xmlGetText(o)), &bufferLen));
+ ptrA buffer((char*)mir_base64_decode( _T2A(XmlGetText(o)), &bufferLen));
if (buffer == NULL)
return false;
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp
index ee686bddb7..1381a7036d 100644
--- a/protocols/JabberG/src/jabber_chat.cpp
+++ b/protocols/JabberG/src/jabber_chat.cpp
@@ -259,7 +259,7 @@ void CJabberProto::GcLogUpdateMemberStatus(JABBER_LIST_ITEM *item, const TCHAR *
{
int statusToSet = 0;
- const TCHAR *szReason = xmlGetText(reason);
+ const TCHAR *szReason = XmlGetText(reason);
if (szReason == NULL) {
if (nStatusCode == 322)
szReason = TranslateT("because room is now members-only");
@@ -347,7 +347,7 @@ void CJabberProto::GcQuit(JABBER_LIST_ITEM *item, int code, HXML reason)
GCDEST gcd = { m_szModuleName, item->jid, GC_EVENT_CONTROL };
GCEVENT gce = { sizeof(gce), &gcd };
gce.ptszUID = item->jid;
- gce.ptszText = xmlGetText(reason);
+ gce.ptszText = XmlGetText(reason);
CallServiceSync(MS_GC_EVENT, (code == 200) ? SESSION_TERMINATE : SESSION_OFFLINE, (LPARAM)&gce);
db_unset(HContactFromJID(item->jid), "CList", "Hidden");
diff --git a/protocols/JabberG/src/jabber_console.cpp b/protocols/JabberG/src/jabber_console.cpp
index 16de723cc1..15a5048d18 100644
--- a/protocols/JabberG/src/jabber_console.cpp
+++ b/protocols/JabberG/src/jabber_console.cpp
@@ -83,7 +83,7 @@ static void sttRtfAppendXml(StringBuf *buf, HXML node, DWORD flags, int indent);
void CJabberProto::OnConsoleProcessXml(HXML node, DWORD flags)
{
if (node && m_pDlgConsole) {
- if (xmlGetName(node)) {
+ if (XmlGetName(node)) {
if (FilterXml(node, flags)) {
StringBuf buf = {0};
sttAppendBufRaw(&buf, RTF_HEADER);
@@ -95,20 +95,20 @@ void CJabberProto::OnConsoleProcessXml(HXML node, DWORD flags)
}
}
else {
- for (int i=0; i < xmlGetChildCount(node); i++)
- OnConsoleProcessXml(xmlGetChild(node, i), flags);
+ for (int i=0; i < XmlGetChildCount(node); i++)
+ OnConsoleProcessXml(XmlGetChild(node, i), flags);
}
}
}
bool CJabberProto::RecursiveCheckFilter(HXML node, DWORD flags)
{
- for (int i = 0; i < xmlGetAttrCount(node); i++)
- if (JabberStrIStr(xmlGetAttr(node, i), m_filterInfo.pattern))
+ for (int i = 0; i < XmlGetAttrCount(node); i++)
+ if (JabberStrIStr(XmlGetAttr(node, i), m_filterInfo.pattern))
return true;
- for (int i = 0; i < xmlGetChildCount(node); i++)
- if (RecursiveCheckFilter(xmlGetChild(node, i), flags))
+ for (int i = 0; i < XmlGetChildCount(node); i++)
+ if (RecursiveCheckFilter(XmlGetChild(node, i), flags))
return true;
return false;
@@ -116,9 +116,9 @@ bool CJabberProto::RecursiveCheckFilter(HXML node, DWORD flags)
bool CJabberProto::FilterXml(HXML node, DWORD flags)
{
- if (!m_filterInfo.msg && !mir_tstrcmp(xmlGetName(node), _T("message"))) return false;
- if (!m_filterInfo.presence && !mir_tstrcmp(xmlGetName(node), _T("presence"))) return false;
- if (!m_filterInfo.iq && !mir_tstrcmp(xmlGetName(node), _T("iq"))) return false;
+ if (!m_filterInfo.msg && !mir_tstrcmp(XmlGetName(node), _T("message"))) return false;
+ if (!m_filterInfo.presence && !mir_tstrcmp(XmlGetName(node), _T("presence"))) return false;
+ if (!m_filterInfo.iq && !mir_tstrcmp(XmlGetName(node), _T("iq"))) return false;
if (m_filterInfo.type == TFilterInfo::T_OFF) return true;
mir_cslock lck(m_filterInfo.csPatternLock);
@@ -126,14 +126,14 @@ bool CJabberProto::FilterXml(HXML node, DWORD flags)
const TCHAR *attrValue;
switch (m_filterInfo.type) {
case TFilterInfo::T_JID:
- attrValue = xmlGetAttrValue(node, (flags & JCPF_OUT) ? _T("to") : _T("from"));
+ attrValue = XmlGetAttrValue(node, (flags & JCPF_OUT) ? _T("to") : _T("from"));
if (attrValue)
return JabberStrIStr(attrValue, m_filterInfo.pattern) != NULL;
break;
case TFilterInfo::T_XMLNS:
- if (xmlGetChildCount(node)) {
- attrValue = xmlGetAttrValue(xmlGetChild(node, 0), _T("xmlns"));
+ if (XmlGetChildCount(node)) {
+ attrValue = XmlGetAttrValue(XmlGetChild(node, 0), _T("xmlns"));
if (attrValue)
return JabberStrIStr(attrValue, m_filterInfo.pattern) != NULL;
}
@@ -202,10 +202,10 @@ static void sttRtfAppendXml(StringBuf *buf, HXML node, DWORD flags, int indent)
if (flags&JCPF_OUT) sttAppendBufRaw(buf, "\\highlight4 ");
sttAppendBufRaw(buf, "<");
sttAppendBufRaw(buf, RTF_BEGINTAGNAME);
- sttAppendBufW(buf, (TCHAR*)xmlGetName(node));
+ sttAppendBufW(buf, (TCHAR*)XmlGetName(node));
sttAppendBufRaw(buf, RTF_ENDTAGNAME);
- for (int i = 0; i < xmlGetAttrCount(node); i++) {
+ for (int i = 0; i < XmlGetAttrCount(node); i++) {
TCHAR *attr = (TCHAR*)xmlGetAttrName(node, i);
sttAppendBufRaw(buf, " ");
sttAppendBufRaw(buf, RTF_BEGINATTRNAME);
@@ -213,39 +213,39 @@ static void sttRtfAppendXml(StringBuf *buf, HXML node, DWORD flags, int indent)
sttAppendBufRaw(buf, RTF_ENDATTRNAME);
sttAppendBufRaw(buf, "=\"");
sttAppendBufRaw(buf, RTF_BEGINATTRVAL);
- sttAppendBufT(buf, (TCHAR*)xmlGetAttr(node, i));
+ sttAppendBufT(buf, (TCHAR*)XmlGetAttr(node, i));
sttAppendBufRaw(buf, "\"");
sttAppendBufRaw(buf, RTF_ENDATTRVAL);
}
- if (xmlGetChild(node) || xmlGetText(node)) {
+ if (XmlGetChild(node) || XmlGetText(node)) {
sttAppendBufRaw(buf, ">");
- if (xmlGetChild(node))
+ if (XmlGetChild(node))
sttAppendBufRaw(buf, RTF_ENDTAG);
}
- if (xmlGetText(node)) {
- if (xmlGetChildCount(node)) {
+ if (XmlGetText(node)) {
+ if (XmlGetChildCount(node)) {
sttAppendBufRaw(buf, RTF_BEGINTEXT);
char indentTextLevel[128];
mir_snprintf(indentTextLevel, _countof(indentTextLevel), RTF_TEXTINDENT_FMT, (int)((indent + 1) * 200));
sttAppendBufRaw(buf, indentTextLevel);
}
- sttAppendBufT(buf, xmlGetText(node));
- if (xmlGetChild(node))
+ sttAppendBufT(buf, XmlGetText(node));
+ if (XmlGetChild(node))
sttAppendBufRaw(buf, RTF_ENDTEXT);
}
- for (int i = 0; i < xmlGetChildCount(node); i++)
- sttRtfAppendXml(buf, xmlGetChild(node, i), flags & ~(JCPF_IN | JCPF_OUT), indent + 1);
+ for (int i = 0; i < XmlGetChildCount(node); i++)
+ sttRtfAppendXml(buf, XmlGetChild(node, i), flags & ~(JCPF_IN | JCPF_OUT), indent + 1);
- if (xmlGetChildCount(node) || xmlGetText(node)) {
+ if (XmlGetChildCount(node) || XmlGetText(node)) {
sttAppendBufRaw(buf, RTF_BEGINTAG);
sttAppendBufRaw(buf, indentLevel);
sttAppendBufRaw(buf, "</");
sttAppendBufRaw(buf, RTF_BEGINTAGNAME);
- sttAppendBufT(buf, xmlGetName(node));
+ sttAppendBufT(buf, XmlGetName(node));
sttAppendBufRaw(buf, RTF_ENDTAGNAME);
sttAppendBufRaw(buf, ">");
}
diff --git a/protocols/JabberG/src/jabber_disco.cpp b/protocols/JabberG/src/jabber_disco.cpp
index 99658d0a49..744d175452 100644
--- a/protocols/JabberG/src/jabber_disco.cpp
+++ b/protocols/JabberG/src/jabber_disco.cpp
@@ -174,17 +174,17 @@ void CJabberProto::OnIqResultServiceDiscoveryInfo(HXML iqNode, CJabberIqInfo *pI
return;
if (pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT) {
- HXML query = xmlGetChild(iqNode , "query");
+ HXML query = XmlGetChild(iqNode , "query");
if (query == NULL)
pNode->SetInfoRequestId(JABBER_DISCO_RESULT_ERROR);
else {
HXML feature;
int i;
- for (i = 1; (feature = xmlGetNthChild(query, _T("feature"), i)) != NULL; i++)
- pNode->AddFeature(xmlGetAttrValue(feature, _T("var")));
+ for (i = 1; (feature = XmlGetNthChild(query, _T("feature"), i)) != NULL; i++)
+ pNode->AddFeature(XmlGetAttrValue(feature, _T("var")));
HXML identity;
- for (i = 1; (identity = xmlGetNthChild(query, _T("identity"), i)) != NULL; i++)
- pNode->AddIdentity(xmlGetAttrValue(identity, _T("category")), xmlGetAttrValue(identity, _T("type")), xmlGetAttrValue(identity, _T("name")));
+ for (i = 1; (identity = XmlGetNthChild(query, _T("identity"), i)) != NULL; i++)
+ pNode->AddIdentity(XmlGetAttrValue(identity, _T("category")), XmlGetAttrValue(identity, _T("type")), XmlGetAttrValue(identity, _T("name")));
pNode->SetInfoRequestId(JABBER_DISCO_RESULT_OK);
pNode->SetInfoRequestErrorText(NULL);
@@ -192,7 +192,7 @@ void CJabberProto::OnIqResultServiceDiscoveryInfo(HXML iqNode, CJabberIqInfo *pI
}
else {
if (pInfo->GetIqType() == JABBER_IQ_TYPE_ERROR) {
- HXML errorNode = xmlGetChild(iqNode , "error");
+ HXML errorNode = XmlGetChild(iqNode , "error");
TCHAR *str = JabberErrorMsg(errorNode);
pNode->SetInfoRequestErrorText(str);
mir_free(str);
@@ -218,13 +218,13 @@ void CJabberProto::OnIqResultServiceDiscoveryItems(HXML iqNode, CJabberIqInfo *p
return;
if (pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT) {
- HXML query = xmlGetChild(iqNode , "query");
+ HXML query = XmlGetChild(iqNode , "query");
if (query == NULL)
pNode->SetItemsRequestId(JABBER_DISCO_RESULT_ERROR);
else {
HXML item;
- for (int i = 1; (item = xmlGetNthChild(query, _T("item"), i)) != NULL; i++)
- pNode->AddChildNode(xmlGetAttrValue(item, _T("jid")), xmlGetAttrValue(item, _T("node")), xmlGetAttrValue(item, _T("name")));
+ for (int i = 1; (item = XmlGetNthChild(query, _T("item"), i)) != NULL; i++)
+ pNode->AddChildNode(XmlGetAttrValue(item, _T("jid")), XmlGetAttrValue(item, _T("node")), XmlGetAttrValue(item, _T("name")));
pNode->SetItemsRequestId(JABBER_DISCO_RESULT_OK);
pNode->SetItemsRequestErrorText(NULL);
@@ -232,7 +232,7 @@ void CJabberProto::OnIqResultServiceDiscoveryItems(HXML iqNode, CJabberIqInfo *p
}
else {
if (pInfo->GetIqType() == JABBER_IQ_TYPE_ERROR) {
- HXML errorNode = xmlGetChild(iqNode , "error");
+ HXML errorNode = XmlGetChild(iqNode , "error");
TCHAR *str = JabberErrorMsg(errorNode);
pNode->SetItemsRequestErrorText(str);
mir_free(str);
@@ -257,12 +257,12 @@ void CJabberProto::OnIqResultServiceDiscoveryRootInfo(HXML iqNode, CJabberIqInfo
mir_cslockfull lck(m_SDManager.cs());
if (pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT) {
- HXML query = xmlGetChild(iqNode , "query");
+ HXML query = XmlGetChild(iqNode , "query");
if (query) {
HXML feature;
- for (int i = 1; (feature = xmlGetNthChild(query, _T("feature"), i)) != NULL; i++) {
- if (!mir_tstrcmp(xmlGetAttrValue(feature, _T("var")), (TCHAR *)pInfo->m_pUserData)) {
- CJabberSDNode *pNode = m_SDManager.AddPrimaryNode(pInfo->GetReceiver(), xmlGetAttrValue(iqNode, _T("node")), NULL);
+ for (int i = 1; (feature = XmlGetNthChild(query, _T("feature"), i)) != NULL; i++) {
+ if (!mir_tstrcmp(XmlGetAttrValue(feature, _T("var")), (TCHAR *)pInfo->m_pUserData)) {
+ CJabberSDNode *pNode = m_SDManager.AddPrimaryNode(pInfo->GetReceiver(), XmlGetAttrValue(iqNode, _T("node")), NULL);
SendBothRequests(pNode, NULL);
break;
} } } }
@@ -279,23 +279,23 @@ void CJabberProto::OnIqResultServiceDiscoveryRootItems(HXML iqNode, CJabberIqInf
XmlNode packet(NULL);
mir_cslockfull lck(m_SDManager.cs());
if (pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT) {
- HXML query = xmlGetChild(iqNode , "query");
+ HXML query = XmlGetChild(iqNode , "query");
if (query) {
HXML item;
- for (int i = 1; (item = xmlGetNthChild(query, _T("item"), i)) != NULL; i++) {
- const TCHAR *szJid = xmlGetAttrValue(item, _T("jid"));
- const TCHAR *szNode = xmlGetAttrValue(item, _T("node"));
+ for (int i = 1; (item = XmlGetNthChild(query, _T("item"), i)) != NULL; i++) {
+ const TCHAR *szJid = XmlGetAttrValue(item, _T("jid"));
+ const TCHAR *szNode = XmlGetAttrValue(item, _T("node"));
CJabberIqInfo *pNewInfo = AddIQ(&CJabberProto::OnIqResultServiceDiscoveryRootInfo, JABBER_IQ_TYPE_GET, szJid);
pNewInfo->m_pUserData = pInfo->m_pUserData;
pNewInfo->SetTimeout(30000);
XmlNodeIq iq(pNewInfo);
iq << XQUERY(JABBER_FEAT_DISCO_INFO) << XATTR(_T("node"), szNode);
- xmlAddChild(packet, iq);
+ XmlAddChild(packet, iq);
} } }
lck.unlock();
- if (xmlGetChild(packet ,0))
+ if (XmlGetChild(packet ,0))
m_ThreadInfo->send(packet);
}
@@ -313,10 +313,10 @@ BOOL CJabberProto::SendInfoRequest(CJabberSDNode *pNode, HXML parent)
XmlNodeIq iq(pInfo);
HXML query = iq << XQUERY(JABBER_FEAT_DISCO_INFO);
if (pNode->GetNode())
- xmlAddAttr(query, _T("node"), pNode->GetNode());
+ XmlAddAttr(query, _T("node"), pNode->GetNode());
if (parent)
- xmlAddChild(parent, iq);
+ XmlAddChild(parent, iq);
else
m_ThreadInfo->send(iq);
}
@@ -343,10 +343,10 @@ BOOL CJabberProto::SendBothRequests(CJabberSDNode *pNode, HXML parent)
XmlNodeIq iq(pInfo);
HXML query = iq << XQUERY(JABBER_FEAT_DISCO_INFO);
if (pNode->GetNode())
- xmlAddAttr(query, _T("node"), pNode->GetNode());
+ XmlAddAttr(query, _T("node"), pNode->GetNode());
if (parent)
- xmlAddChild(parent, iq);
+ XmlAddChild(parent, iq);
else
m_ThreadInfo->send(iq);
}
@@ -360,10 +360,10 @@ BOOL CJabberProto::SendBothRequests(CJabberSDNode *pNode, HXML parent)
XmlNodeIq iq(pInfo);
HXML query = iq << XQUERY(JABBER_FEAT_DISCO_ITEMS);
if (pNode->GetNode())
- xmlAddAttr(query, _T("node"), pNode->GetNode());
+ XmlAddAttr(query, _T("node"), pNode->GetNode());
if (parent)
- xmlAddChild(parent, iq);
+ XmlAddChild(parent, iq);
else
m_ThreadInfo->send(iq);
}
@@ -909,7 +909,7 @@ void CJabberDlgDiscovery::btnRefresh_OnClick(CCtrlButton *)
}
lck.unlock();
- if (xmlGetChild(packet ,0))
+ if (XmlGetChild(packet ,0))
m_proto->m_ThreadInfo->send(packet);
}
@@ -1018,7 +1018,7 @@ INT_PTR CJabberDlgDiscovery::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
m_proto->SendInfoRequest(pNode, packet);
}
}
- if (xmlGetChild(packet, 0))
+ if (XmlGetChild(packet, 0))
m_proto->m_ThreadInfo->send(packet);
KillTimer(m_hwnd, AUTODISCO_TIMER);
@@ -1081,7 +1081,7 @@ INT_PTR CJabberDlgDiscovery::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
TreeList_MakeFakeParent(hItem, FALSE);
}
}
- if (xmlGetChild(packet))
+ if (XmlGetChild(packet))
m_proto->m_ThreadInfo->send(packet);
}
else if (pHeader->code == NM_CUSTOMDRAW) {
@@ -1282,7 +1282,7 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM
TreeList_MakeFakeParent(hItem, FALSE);
}
}
- if (xmlGetChild(packet))
+ if (XmlGetChild(packet))
m_ThreadInfo->send(packet);
}
break;
@@ -1302,14 +1302,14 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM
TreeList_MakeFakeParent(hNode, FALSE);
}
- if (xmlGetChildCount(packet) > 50) {
+ if (XmlGetChildCount(packet) > 50) {
m_ThreadInfo->send(packet);
packet = XmlNode(NULL);
}
}
}
- if (xmlGetChildCount(packet))
+ if (XmlGetChildCount(packet))
m_ThreadInfo->send(packet);
}
break;
diff --git a/protocols/JabberG/src/jabber_form.cpp b/protocols/JabberG/src/jabber_form.cpp
index 511609003a..56aa85ce1c 100644
--- a/protocols/JabberG/src/jabber_form.cpp
+++ b/protocols/JabberG/src/jabber_form.cpp
@@ -440,7 +440,7 @@ void JabberFormCreateUI(HWND hwndStatic, HXML xNode, int *formHeight, BOOL bComp
TCHAR *labelStr, *valueStr;
RECT frameRect;
- if (xNode == NULL || xmlGetName(xNode) == NULL || mir_tstrcmp(xmlGetName(xNode), _T("x")) || hwndStatic == NULL)
+ if (xNode == NULL || XmlGetName(xNode) == NULL || mir_tstrcmp(XmlGetName(xNode), _T("x")) || hwndStatic == NULL)
return;
GetClientRect(hwndStatic, &frameRect);
@@ -456,47 +456,47 @@ void JabberFormCreateUI(HWND hwndStatic, HXML xNode, int *formHeight, BOOL bComp
layout_info.offset = 10;
layout_info.y_pos = bCompact ? 0 : 14;
for (int i = 0;; i++) {
- HXML n = xmlGetChild(xNode, i);
+ HXML n = XmlGetChild(xNode, i);
if (!n)
break;
- if (mir_tstrcmp(xmlGetName(n), _T("field")))
+ if (mir_tstrcmp(XmlGetName(n), _T("field")))
continue;
- varStr = xmlGetAttrValue(n, _T("var"));
- if ((typeName = xmlGetAttrValue(n, _T("type"))) == NULL)
+ varStr = XmlGetAttrValue(n, _T("var"));
+ if ((typeName = XmlGetAttrValue(n, _T("type"))) == NULL)
continue;
- if ((label = xmlGetAttrValue(n, _T("label"))) != NULL)
+ if ((label = XmlGetAttrValue(n, _T("label"))) != NULL)
labelStr = mir_tstrdup(label);
else
labelStr = mir_tstrdup(varStr);
TJabberFormControlType type = JabberFormTypeNameToId(typeName);
- if ((v = xmlGetChild(n, "value")) != NULL) {
- valueText = xmlGetText(v);
+ if ((v = XmlGetChild(n, "value")) != NULL) {
+ valueText = XmlGetText(v);
if (type != JFORM_CTYPE_TEXT_MULTI)
valueStr = mir_tstrdup(valueText);
else {
size_t size = 1;
for (int j = 0;; j++) {
- v = xmlGetChild(n, j);
+ v = XmlGetChild(n, j);
if (!v)
break;
- if (xmlGetName(v) && !mir_tstrcmp(xmlGetName(v), _T("value")) && xmlGetText(v))
- size += mir_tstrlen(xmlGetText(v)) + 2;
+ if (XmlGetName(v) && !mir_tstrcmp(XmlGetName(v), _T("value")) && XmlGetText(v))
+ size += mir_tstrlen(XmlGetText(v)) + 2;
}
valueStr = (TCHAR*)mir_alloc(sizeof(TCHAR)*size);
valueStr[0] = '\0';
for (int j = 0;; j++) {
- v = xmlGetChild(n, j);
+ v = XmlGetChild(n, j);
if (!v)
break;
- if (xmlGetName(v) && !mir_tstrcmp(xmlGetName(v), _T("value")) && xmlGetText(v)) {
+ if (XmlGetName(v) && !mir_tstrcmp(XmlGetName(v), _T("value")) && XmlGetText(v)) {
if (valueStr[0])
mir_tstrcat(valueStr, _T("\r\n"));
- mir_tstrcat(valueStr, xmlGetText(v));
+ mir_tstrcat(valueStr, XmlGetText(v));
}
}
}
@@ -510,44 +510,44 @@ void JabberFormCreateUI(HWND hwndStatic, HXML xNode, int *formHeight, BOOL bComp
if (type == JFORM_CTYPE_LIST_SINGLE) {
for (int j = 0;; j++) {
- HXML o = xmlGetChild(n, j);
+ HXML o = XmlGetChild(n, j);
if (o == NULL)
break;
- if (mir_tstrcmp(xmlGetName(o), _T("option")))
+ if (mir_tstrcmp(XmlGetName(o), _T("option")))
continue;
- if ((v = xmlGetChild(o, "value")) == NULL || xmlGetText(v) == NULL)
+ if ((v = XmlGetChild(o, "value")) == NULL || XmlGetText(v) == NULL)
continue;
- if ((str = xmlGetAttrValue(o, _T("label"))) == NULL)
- str = xmlGetText(v);
+ if ((str = XmlGetAttrValue(o, _T("label"))) == NULL)
+ str = XmlGetText(v);
if (str == NULL)
continue;
- bool selected = !mir_tstrcmp(valueText, xmlGetText(v));
+ bool selected = !mir_tstrcmp(valueText, XmlGetText(v));
JabberFormAddListItem(item, str, selected);
}
}
else if (type == JFORM_CTYPE_LIST_MULTI) {
for (int j = 0;; j++) {
- HXML o = xmlGetChild(n, j);
+ HXML o = XmlGetChild(n, j);
if (o == NULL)
break;
- if (mir_tstrcmp(xmlGetName(o), _T("option")))
+ if (mir_tstrcmp(XmlGetName(o), _T("option")))
continue;
- if ((v = xmlGetChild(o, "value")) == NULL || xmlGetText(v) == NULL)
+ if ((v = XmlGetChild(o, "value")) == NULL || XmlGetText(v) == NULL)
continue;
- if ((str = xmlGetAttrValue(o, _T("label"))) == NULL)
- str = xmlGetText(v);
+ if ((str = XmlGetAttrValue(o, _T("label"))) == NULL)
+ str = XmlGetText(v);
if (str == NULL)
continue;
bool selected = false;
for (int k = 0;; k++) {
- vs = xmlGetChild(n, k);
+ vs = XmlGetChild(n, k);
if (!vs)
break;
- if (!mir_tstrcmp(xmlGetName(vs), _T("value")) && !mir_tstrcmp(xmlGetText(vs), xmlGetText(v))) {
+ if (!mir_tstrcmp(XmlGetName(vs), _T("value")) && !mir_tstrcmp(XmlGetText(vs), XmlGetText(v))) {
selected = true;
break;
}
@@ -579,7 +579,7 @@ HXML JabberFormGetData(HWND hwndStatic, HXML xNode)
const TCHAR *varName, *type, *fieldStr, *labelText, *str2;
TCHAR *p, *q, *str;
- if (xNode == NULL || xmlGetName(xNode) == NULL || mir_tstrcmp(xmlGetName(xNode), _T("x")) || hwndStatic == NULL)
+ if (xNode == NULL || XmlGetName(xNode) == NULL || mir_tstrcmp(XmlGetName(xNode), _T("x")) || hwndStatic == NULL)
return NULL;
hFrame = hwndStatic;
@@ -588,15 +588,15 @@ HXML JabberFormGetData(HWND hwndStatic, HXML xNode)
x << XATTR(_T("xmlns"), JABBER_FEAT_DATA_FORMS) << XATTR(_T("type"), _T("submit"));
for (int i = 0;; i++) {
- n = xmlGetChild(xNode, i);
+ n = XmlGetChild(xNode, i);
if (!n)
break;
fieldStr = NULL;
- if (mir_tstrcmp(xmlGetName(n), _T("field")))
+ if (mir_tstrcmp(XmlGetName(n), _T("field")))
continue;
- if ((varName = xmlGetAttrValue(n, _T("var"))) == NULL || (type = xmlGetAttrValue(n, _T("type"))) == NULL)
+ if ((varName = XmlGetAttrValue(n, _T("var"))) == NULL || (type = XmlGetAttrValue(n, _T("type"))) == NULL)
continue;
hCtrl = GetDlgItem(hFrame, id);
@@ -628,14 +628,14 @@ HXML JabberFormGetData(HWND hwndStatic, HXML xNode)
GetDlgItemText(hFrame, id, str, len + 1);
v = NULL;
for (j = 0;; j++) {
- o = xmlGetChild(n, j);
+ o = XmlGetChild(n, j);
if (!o)
break;
- if (!mir_tstrcmp(xmlGetName(o), _T("option"))) {
- if ((v = xmlGetChild(o, "value")) != NULL && xmlGetText(v)) {
- if ((str2 = xmlGetAttrValue(o, _T("label"))) == NULL)
- str2 = xmlGetText(v);
+ if (!mir_tstrcmp(XmlGetName(o), _T("option"))) {
+ if ((v = XmlGetChild(o, "value")) != NULL && XmlGetText(v)) {
+ if ((str2 = XmlGetAttrValue(o, _T("label"))) == NULL)
+ str2 = XmlGetText(v);
if (!mir_tstrcmp(str2, str))
break;
}
@@ -643,7 +643,7 @@ HXML JabberFormGetData(HWND hwndStatic, HXML xNode)
}
if (o)
- field << XCHILD(_T("value"), xmlGetText(v));
+ field << XCHILD(_T("value"), XmlGetText(v));
mir_free(str);
id++;
@@ -657,17 +657,17 @@ HXML JabberFormGetData(HWND hwndStatic, HXML xNode)
if ((str = (TCHAR*)mir_alloc((len + 1)*sizeof(TCHAR))) != NULL) {
SendMessage(hCtrl, LB_GETTEXT, j, (LPARAM)str);
for (k = 0;; k++) {
- o = xmlGetChild(n, k);
+ o = XmlGetChild(n, k);
if (!o)
break;
- if (xmlGetName(o) && !mir_tstrcmp(xmlGetName(o), _T("option"))) {
- if ((v = xmlGetChild(o, "value")) != NULL && xmlGetText(v)) {
- if ((labelText = xmlGetAttrValue(o, _T("label"))) == NULL)
- labelText = xmlGetText(v);
+ if (XmlGetName(o) && !mir_tstrcmp(XmlGetName(o), _T("option"))) {
+ if ((v = XmlGetChild(o, "value")) != NULL && XmlGetText(v)) {
+ if ((labelText = XmlGetAttrValue(o, _T("label"))) == NULL)
+ labelText = XmlGetText(v);
if (!mir_tstrcmp(labelText, str))
- field << XCHILD(_T("value"), xmlGetText(v));
+ field << XCHILD(_T("value"), XmlGetText(v));
}
}
}
@@ -678,9 +678,9 @@ HXML JabberFormGetData(HWND hwndStatic, HXML xNode)
id++;
}
else if (!mir_tstrcmp(type, _T("fixed")) || !mir_tstrcmp(type, _T("hidden"))) {
- v = xmlGetChild(n, "value");
- if (v != NULL && xmlGetText(v) != NULL)
- field << XCHILD(_T("value"), xmlGetText(v));
+ v = XmlGetChild(n, "value");
+ if (v != NULL && XmlGetText(v) != NULL)
+ field << XCHILD(_T("value"), XmlGetText(v));
}
else { // everything else is considered "text-single" or "text-private"
len = GetWindowTextLength(GetDlgItem(hFrame, id));
@@ -692,7 +692,7 @@ HXML JabberFormGetData(HWND hwndStatic, HXML xNode)
}
}
- return xi.copyNode(x);
+ return xmlCopyNode(x);
}
struct JABBER_FORM_INFO
@@ -724,17 +724,17 @@ static INT_PTR CALLBACK JabberFormDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
HXML n;
LONG frameExStyle;
// Set dialog title
- if (jfi->xNode != NULL && (n = xmlGetChild(jfi->xNode, _T("title"))) != NULL && xmlGetText(n) != NULL)
- SetWindowText(hwndDlg, xmlGetText(n));
+ if (jfi->xNode != NULL && (n = XmlGetChild(jfi->xNode, _T("title"))) != NULL && XmlGetText(n) != NULL)
+ SetWindowText(hwndDlg, XmlGetText(n));
else
SetWindowText(hwndDlg, TranslateTS(jfi->defTitle));
// Set instruction field
- if (jfi->xNode != NULL && (n = xmlGetChild(jfi->xNode, _T("instructions"))) != NULL && xmlGetText(n) != NULL)
- JabberFormSetInstruction(hwndDlg, xmlGetText(n));
+ if (jfi->xNode != NULL && (n = XmlGetChild(jfi->xNode, _T("instructions"))) != NULL && XmlGetText(n) != NULL)
+ JabberFormSetInstruction(hwndDlg, XmlGetText(n));
else {
- if (jfi->xNode != NULL && (n = xmlGetChild(jfi->xNode, _T("title"))) != NULL && xmlGetText(n) != NULL)
- JabberFormSetInstruction(hwndDlg, xmlGetText(n));
+ if (jfi->xNode != NULL && (n = XmlGetChild(jfi->xNode, _T("title"))) != NULL && XmlGetText(n) != NULL)
+ JabberFormSetInstruction(hwndDlg, XmlGetText(n));
else
JabberFormSetInstruction(hwndDlg, TranslateTS(jfi->defTitle));
}
@@ -826,7 +826,7 @@ static INT_PTR CALLBACK JabberFormDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
if (jfi != NULL) {
HXML n = JabberFormGetData(GetDlgItem(hwndDlg, IDC_FRAME), jfi->xNode);
(jfi->ppro->*(jfi->pfnSubmit))(n, jfi->userdata);
- xi.destroyNode(n);
+ xmlDestroyNode(n);
}
// fall through
case IDCANCEL:
@@ -859,7 +859,7 @@ void CJabberProto::FormCreateDialog(HXML xNode, TCHAR* defTitle, JABBER_FORM_SUB
JABBER_FORM_INFO *jfi = new JABBER_FORM_INFO;
memset(jfi, 0, sizeof(JABBER_FORM_INFO));
jfi->ppro = this;
- jfi->xNode = xi.copyNode(xNode);
+ jfi->xNode = xmlCopyNode(xNode);
if (defTitle)
_tcsncpy_s(jfi->defTitle, defTitle, _TRUNCATE);
jfi->pfnSubmit = pfnSubmit;
@@ -872,6 +872,6 @@ void CJabberProto::FormCreateDialog(HXML xNode, TCHAR* defTitle, JABBER_FORM_SUB
JABBER_FORM_INFO::~JABBER_FORM_INFO()
{
- xi.destroyNode(xNode);
+ xmlDestroyNode(xNode);
mir_free(userdata);
}
diff --git a/protocols/JabberG/src/jabber_ft.cpp b/protocols/JabberG/src/jabber_ft.cpp
index fbc4db5b45..41955dc4e5 100644
--- a/protocols/JabberG/src/jabber_ft.cpp
+++ b/protocols/JabberG/src/jabber_ft.cpp
@@ -130,17 +130,17 @@ void CJabberProto::OnFtSiResult(HXML iqNode, CJabberIqInfo *pInfo)
if (!ft) return;
if ((pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT) && pInfo->m_szFrom && pInfo->m_szTo) {
- if ((siNode = xmlGetChild(iqNode , "si")) != NULL) {
+ if ((siNode = XmlGetChild(iqNode , "si")) != NULL) {
// fix for very smart clients, like gajim
BOOL bDirect = m_options.BsDirect;
BOOL bProxy = m_options.BsProxyManual;
- if ((featureNode = xmlGetChild(siNode , "feature")) != NULL) {
- if ((xNode = xmlGetChildByTag(featureNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS)) != NULL) {
- if ((fieldNode = xmlGetChildByTag(xNode, "field", "var", _T("stream-method"))) != NULL) {
- if ((valueNode = xmlGetChild(fieldNode , "value")) != NULL && xmlGetText(valueNode) != NULL) {
- if ((bDirect || bProxy) && !mir_tstrcmp(xmlGetText(valueNode), JABBER_FEAT_BYTESTREAMS)) {
+ if ((featureNode = XmlGetChild(siNode , "feature")) != NULL) {
+ if ((xNode = XmlGetChildByTag(featureNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS)) != NULL) {
+ if ((fieldNode = XmlGetChildByTag(xNode, "field", "var", _T("stream-method"))) != NULL) {
+ if ((valueNode = XmlGetChild(fieldNode , "value")) != NULL && XmlGetText(valueNode) != NULL) {
+ if ((bDirect || bProxy) && !mir_tstrcmp(XmlGetText(valueNode), JABBER_FEAT_BYTESTREAMS)) {
// Start Bytestream session
JABBER_BYTE_TRANSFER *jbt = new JABBER_BYTE_TRANSFER;
memset(jbt, 0, sizeof(JABBER_BYTE_TRANSFER));
@@ -154,7 +154,7 @@ void CJabberProto::OnFtSiResult(HXML iqNode, CJabberIqInfo *pInfo)
ft->jbt = jbt;
ForkThread((MyThreadFunc)&CJabberProto::ByteSendThread, jbt);
}
- else if (!mir_tstrcmp(xmlGetText(valueNode), JABBER_FEAT_IBB)) {
+ else if (!mir_tstrcmp(XmlGetText(valueNode), JABBER_FEAT_IBB)) {
JABBER_IBB_TRANSFER *jibb = (JABBER_IBB_TRANSFER *) mir_alloc(sizeof (JABBER_IBB_TRANSFER));
memset(jibb, 0, sizeof(JABBER_IBB_TRANSFER));
jibb->srcJID = mir_tstrdup(pInfo->m_szTo);
@@ -232,7 +232,7 @@ BOOL CJabberProto::FtIbbSend(int blocksize, filetransfer *ft)
while ((numRead = _read(fd, buffer, blocksize)) > 0) {
int iqId = SerialNext();
XmlNode msg(_T("message"));
- xmlAddAttr(msg, _T("to"), ft->jibb->dstJID);
+ XmlAddAttr(msg, _T("to"), ft->jibb->dstJID);
msg << XATTRID(iqId);
// let others send data too
@@ -300,21 +300,21 @@ void CJabberProto::FtHandleSiRequest(HXML iqNode)
unsigned __int64 filesize;
if (!iqNode ||
- (from = xmlGetAttrValue(iqNode, _T("from"))) == NULL ||
- (str = xmlGetAttrValue(iqNode, _T("type"))) == NULL || mir_tstrcmp(str, _T("set")) ||
- (siNode = xmlGetChildByTag(iqNode, "si", "xmlns", JABBER_FEAT_SI)) == NULL)
+ (from = XmlGetAttrValue(iqNode, _T("from"))) == NULL ||
+ (str = XmlGetAttrValue(iqNode, _T("type"))) == NULL || mir_tstrcmp(str, _T("set")) ||
+ (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", JABBER_FEAT_SI_FT)) != NULL &&
- (filename = xmlGetAttrValue(fileNode, _T("name"))) != NULL &&
- (str = xmlGetAttrValue(fileNode, _T("size"))) != NULL) {
+ szId = XmlGetAttrValue(iqNode, _T("id"));
+ if ((sid = XmlGetAttrValue(siNode, _T("id"))) != 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", JABBER_FEAT_FEATURE_NEG)) != NULL &&
- (xNode = xmlGetChildByTag(featureNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS)) != NULL &&
- (fieldNode = xmlGetChildByTag(xNode, "field", "var", _T("stream-method"))) != 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;
HXML optionNode = NULL;
@@ -322,13 +322,13 @@ void CJabberProto::FtHandleSiRequest(HXML iqNode)
if (!bIbbOnly) {
for (i=0; ; i++) {
- optionNode = xmlGetChild(fieldNode ,i);
+ optionNode = XmlGetChild(fieldNode ,i);
if (!optionNode)
break;
- if (!mir_tstrcmp(xmlGetName(optionNode), _T("option"))) {
- if ((n = xmlGetChild(optionNode , "value")) != NULL && xmlGetText(n)) {
- if (!mir_tstrcmp(xmlGetText(n), JABBER_FEAT_BYTESTREAMS)) {
+ if (!mir_tstrcmp(XmlGetName(optionNode), _T("option"))) {
+ if ((n = XmlGetChild(optionNode , "value")) != NULL && XmlGetText(n)) {
+ if (!mir_tstrcmp(XmlGetText(n), JABBER_FEAT_BYTESTREAMS)) {
ftType = FT_BYTESTREAM;
break;
} } } } }
@@ -336,13 +336,13 @@ void CJabberProto::FtHandleSiRequest(HXML iqNode)
// try IBB only if bytestreams support not found or BsOnlyIBB flag exists
if (bIbbOnly || !optionNode) {
for (i=0; ; i++) {
- optionNode = xmlGetChild(fieldNode ,i);
+ optionNode = XmlGetChild(fieldNode ,i);
if (!optionNode)
break;
- if (!mir_tstrcmp(xmlGetName(optionNode), _T("option"))) {
- if ((n = xmlGetChild(optionNode , "value")) != NULL && xmlGetText(n)) {
- if (!mir_tstrcmp(xmlGetText(n), JABBER_FEAT_IBB)) {
+ if (!mir_tstrcmp(XmlGetName(optionNode), _T("option"))) {
+ if ((n = XmlGetChild(optionNode , "value")) != NULL && XmlGetText(n)) {
+ if (!mir_tstrcmp(XmlGetText(n), JABBER_FEAT_IBB)) {
ftType = FT_IBB;
break;
} } } } }
@@ -366,8 +366,8 @@ void CJabberProto::FtHandleSiRequest(HXML iqNode)
pre.timestamp = time(NULL);
pre.files.t = (TCHAR**)&filename;
pre.lParam = (LPARAM)ft;
- if ((n = xmlGetChild(fileNode , "desc")) != NULL)
- pre.descr.t = (TCHAR*)xmlGetText(n);
+ if ((n = XmlGetChild(fileNode , "desc")) != NULL)
+ pre.descr.t = (TCHAR*)XmlGetText(n);
ProtoChainRecvFile(ft->std.hContact, &pre);
return;
@@ -431,11 +431,11 @@ BOOL CJabberProto::FtHandleBytestreamRequest(HXML iqNode, CJabberIqInfo *pInfo)
const TCHAR *sid;
JABBER_LIST_ITEM *item;
- if ((sid = xmlGetAttrValue(queryNode, _T("sid"))) != NULL && (item = ListGetItemPtr(LIST_FTRECV, sid)) != NULL) {
+ if ((sid = XmlGetAttrValue(queryNode, _T("sid"))) != NULL && (item = ListGetItemPtr(LIST_FTRECV, sid)) != NULL) {
// Start Bytestream session
JABBER_BYTE_TRANSFER *jbt = new JABBER_BYTE_TRANSFER;
memset(jbt, 0, sizeof(JABBER_BYTE_TRANSFER));
- jbt->iqNode = xi.copyNode(iqNode);
+ jbt->iqNode = xmlCopyNode(iqNode);
jbt->pfnRecv = &CJabberProto::FtReceive;
jbt->pfnFinal = &CJabberProto::FtReceiveFinal;
jbt->ft = item->ft;
@@ -453,15 +453,15 @@ BOOL CJabberProto::FtHandleIbbRequest(HXML iqNode, BOOL bOpen)
{
if (iqNode == NULL) return FALSE;
- const TCHAR *id = xmlGetAttrValue(iqNode, _T("id"));
- const TCHAR *from = xmlGetAttrValue(iqNode, _T("from"));
- const TCHAR *to = xmlGetAttrValue(iqNode, _T("to"));
+ const TCHAR *id = XmlGetAttrValue(iqNode, _T("id"));
+ const TCHAR *from = XmlGetAttrValue(iqNode, _T("from"));
+ const TCHAR *to = XmlGetAttrValue(iqNode, _T("to"));
if (!id || !from || !to) return FALSE;
- HXML ibbNode = xmlGetChildByTag(iqNode, bOpen ? "open" : "close", "xmlns", 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"));
+ const TCHAR *sid = XmlGetAttrValue(ibbNode, _T("sid"));
if (!sid) return FALSE;
// already closed?
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp
index fb1e164ece..6b38a3ee49 100644
--- a/protocols/JabberG/src/jabber_groupchat.cpp
+++ b/protocols/JabberG/src/jabber_groupchat.cpp
@@ -296,7 +296,7 @@ void CJabberProto::OnIqResultDiscovery(HXML iqNode, CJabberIqInfo *pInfo)
SendMessage(hwndList, CB_RESETCONTENT, 0, 0);
if (pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT) {
- HXML query = xmlGetChild(iqNode, "query");
+ HXML query = XmlGetChild(iqNode, "query");
if (query == NULL) {
sttRoomListAppend(hwndList, RoomInfo::ROOM_FAIL,
TranslateT("Jabber Error"),
@@ -306,8 +306,8 @@ void CJabberProto::OnIqResultDiscovery(HXML iqNode, CJabberIqInfo *pInfo)
else {
bool found = false;
HXML item;
- for (int i = 1; item = xmlGetNthChild(query, _T("item"), i); i++) {
- const TCHAR *jid = xmlGetAttrValue(item, _T("jid"));
+ for (int i = 1; item = XmlGetNthChild(query, _T("item"), i); i++) {
+ const TCHAR *jid = XmlGetAttrValue(item, _T("jid"));
TCHAR *name = NEWTSTR_ALLOCA(jid);
if (name) {
if (TCHAR *p = _tcschr(name, _T('@')))
@@ -317,7 +317,7 @@ void CJabberProto::OnIqResultDiscovery(HXML iqNode, CJabberIqInfo *pInfo)
sttRoomListAppend(hwndList,
ListGetItemPtr(LIST_BOOKMARK, jid) ? RoomInfo::ROOM_BOOKMARK : RoomInfo::ROOM_DEFAULT,
- xmlGetAttrValue(item, _T("name")),
+ XmlGetAttrValue(item, _T("name")),
jid, name);
found = true;
@@ -332,7 +332,7 @@ void CJabberProto::OnIqResultDiscovery(HXML iqNode, CJabberIqInfo *pInfo)
}
}
else if (pInfo->GetIqType() == JABBER_IQ_TYPE_ERROR) {
- HXML errorNode = xmlGetChild(iqNode, "error");
+ HXML errorNode = XmlGetChild(iqNode, "error");
TCHAR *str = JabberErrorMsg(errorNode);
sttRoomListAppend(hwndList, RoomInfo::ROOM_FAIL,
TranslateT("Jabber Error"),
@@ -770,11 +770,11 @@ static VOID CALLBACK JabberGroupchatChangeNickname(void* arg)
static int sttGetStatusCode(HXML node)
{
- HXML statusNode = xmlGetChild(node, "status");
+ HXML statusNode = XmlGetChild(node, "status");
if (statusNode == NULL)
return -1;
- const TCHAR *statusCode = xmlGetAttrValue(statusNode, _T("code"));
+ const TCHAR *statusCode = XmlGetAttrValue(statusNode, _T("code"));
if (statusCode == NULL)
return -1;
@@ -783,8 +783,8 @@ static int sttGetStatusCode(HXML node)
void CJabberProto::RenameParticipantNick(JABBER_LIST_ITEM *item, const TCHAR *oldNick, HXML itemNode)
{
- const TCHAR *jid = xmlGetAttrValue(itemNode, _T("jid"));
- const TCHAR *newNick = xmlGetAttrValue(itemNode, _T("nick"));
+ const TCHAR *jid = XmlGetAttrValue(itemNode, _T("jid"));
+ const TCHAR *newNick = XmlGetAttrValue(itemNode, _T("nick"));
if (newNick == NULL)
return;
@@ -822,8 +822,8 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
{
const TCHAR *from;
- if (!node || !xmlGetName(node) || mir_tstrcmp(xmlGetName(node), _T("presence"))) return;
- if ((from = xmlGetAttrValue(node, _T("from"))) == NULL) return;
+ if (!node || !XmlGetName(node) || mir_tstrcmp(XmlGetName(node), _T("presence"))) return;
+ if ((from = XmlGetAttrValue(node, _T("from"))) == NULL) return;
const TCHAR *resource = _tcschr(from, '/');
if (resource == NULL || *++resource == '\0')
@@ -835,18 +835,18 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
pResourceStatus r(item->findResource(resource));
- HXML nNode = xmlGetChildByTag(node, "nick", "xmlns", JABBER_FEAT_NICK);
- const TCHAR *cnick = xmlGetText(nNode);
+ HXML nNode = XmlGetChildByTag(node, "nick", "xmlns", JABBER_FEAT_NICK);
+ const TCHAR *cnick = XmlGetText(nNode);
const TCHAR *nick = cnick ? cnick : (r && r->m_tszNick ? r->m_tszNick : resource);
// process custom nick change
if (cnick && r && r->m_tszNick && mir_tstrcmp(cnick, r->m_tszNick))
r->m_tszNick = mir_tstrdup(cnick);
- HXML xNode = xmlGetChildByTag(node, "x", "xmlns", JABBER_FEAT_MUC_USER);
- HXML itemNode = xmlGetChild(xNode, "item");
+ HXML xNode = XmlGetChildByTag(node, "x", "xmlns", JABBER_FEAT_MUC_USER);
+ HXML itemNode = XmlGetChild(xNode, "item");
- const TCHAR *type = xmlGetAttrValue(node, _T("type"));
+ const TCHAR *type = XmlGetAttrValue(node, _T("type"));
// entering room or a usual room presence
if (type == NULL || !mir_tstrcmp(type, _T("available"))) {
@@ -858,7 +858,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
// Update status of room participant
int status = ID_STATUS_ONLINE;
- LPCTSTR ptszShow = xmlGetText(xmlGetChild(node, "show"));
+ LPCTSTR ptszShow = XmlGetText(XmlGetChild(node, "show"));
if (ptszShow) {
if (!mir_tstrcmp(ptszShow, _T("away"))) status = ID_STATUS_AWAY;
else if (!mir_tstrcmp(ptszShow, _T("xa"))) status = ID_STATUS_NA;
@@ -866,10 +866,10 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
else if (!mir_tstrcmp(ptszShow, _T("chat"))) status = ID_STATUS_FREECHAT;
}
- LPCTSTR str = xmlGetText(xmlGetChild(node, "status"));
+ LPCTSTR str = XmlGetText(XmlGetChild(node, "status"));
char priority = 0;
- if (LPCTSTR ptszPriority = xmlGetText(xmlGetChild(node, "priority")))
+ if (LPCTSTR ptszPriority = XmlGetText(XmlGetChild(node, "priority")))
priority = (char)_ttoi(ptszPriority);
bool bStatusChanged = false, bRoomCreated = false, bAffiliationChanged = false, bRoleChanged = false;
@@ -887,14 +887,14 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
JABBER_GC_AFFILIATION affiliation = r->m_affiliation;
JABBER_GC_ROLE role = r->m_role;
- if ((str = xmlGetAttrValue(itemNode, _T("affiliation"))) != NULL) {
+ if ((str = XmlGetAttrValue(itemNode, _T("affiliation"))) != NULL) {
if (!mir_tstrcmp(str, _T("owner"))) affiliation = AFFILIATION_OWNER;
else if (!mir_tstrcmp(str, _T("admin"))) affiliation = AFFILIATION_ADMIN;
else if (!mir_tstrcmp(str, _T("member"))) affiliation = AFFILIATION_MEMBER;
else if (!mir_tstrcmp(str, _T("none"))) affiliation = AFFILIATION_NONE;
else if (!mir_tstrcmp(str, _T("outcast"))) affiliation = AFFILIATION_OUTCAST;
}
- if ((str = xmlGetAttrValue(itemNode, _T("role"))) != NULL) {
+ if ((str = XmlGetAttrValue(itemNode, _T("role"))) != NULL) {
if (!mir_tstrcmp(str, _T("moderator"))) role = ROLE_MODERATOR;
else if (!mir_tstrcmp(str, _T("participant"))) role = ROLE_PARTICIPANT;
else if (!mir_tstrcmp(str, _T("visitor"))) role = ROLE_VISITOR;
@@ -917,7 +917,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
bRoleChanged = true;
}
- if (str = xmlGetAttrValue(itemNode, _T("jid")))
+ if (str = XmlGetAttrValue(itemNode, _T("jid")))
r->m_tszRealJid = mir_tstrdup(str);
}
}
@@ -942,8 +942,8 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
// Check <created/>
if (bRoomCreated) {
- HXML n = xmlGetChild(node, "created");
- if (n != NULL && (str = xmlGetAttrValue(n, _T("xmlns"))) != NULL && !mir_tstrcmp(str, JABBER_FEAT_MUC_OWNER))
+ HXML n = XmlGetChild(node, "created");
+ if (n != NULL && (str = XmlGetAttrValue(n, _T("xmlns"))) != NULL && !mir_tstrcmp(str, JABBER_FEAT_MUC_OWNER))
// A new room just created by me
// Request room config
m_ThreadInfo->send(
@@ -956,8 +956,8 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
else if (!mir_tstrcmp(type, _T("unavailable"))) {
const TCHAR *str = 0;
if (xNode != NULL && item->nick != NULL) {
- HXML reasonNode = xmlGetChild(itemNode, "reason");
- str = xmlGetAttrValue(itemNode, _T("jid"));
+ HXML reasonNode = XmlGetChild(itemNode, "reason");
+ str = XmlGetAttrValue(itemNode, _T("jid"));
int iStatus = sttGetStatusCode(xNode);
if (iStatus == 301 && r != NULL)
@@ -991,7 +991,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
}
}
- HXML statusNode = xmlGetChild(node, "status");
+ HXML statusNode = XmlGetChild(node, "status");
GcLogUpdateMemberStatus(item, resource, nick, str, GC_EVENT_PART, statusNode);
ListRemoveResource(LIST_CHATROOM, from);
@@ -1003,7 +1003,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
// processing room errors
else if (!mir_tstrcmp(type, _T("error"))) {
int errorCode = 0;
- HXML errorNode = xmlGetChild(node, "error");
+ HXML errorNode = XmlGetChild(node, "error");
ptrT str(JabberErrorMsg(errorNode, &errorCode));
if (errorCode == JABBER_ERROR_CONFLICT) {
@@ -1035,11 +1035,11 @@ void CJabberProto::GroupchatProcessMessage(HXML node)
JABBER_LIST_ITEM *item;
CMString imgLink;
- if (!xmlGetName(node) || mir_tstrcmp(xmlGetName(node), _T("message"))) return;
- if ((from = xmlGetAttrValue(node, _T("from"))) == NULL) return;
+ if (!XmlGetName(node) || mir_tstrcmp(XmlGetName(node), _T("message"))) return;
+ if ((from = XmlGetAttrValue(node, _T("from"))) == NULL) return;
if ((item = ListGetItemPtr(LIST_CHATROOM, from)) == NULL) return;
- if ((type = xmlGetAttrValue(node, _T("type"))) == NULL) return;
+ if ((type = XmlGetAttrValue(node, _T("type"))) == NULL) return;
if (!mir_tstrcmp(type, _T("error")))
return;
@@ -1051,15 +1051,15 @@ void CJabberProto::GroupchatProcessMessage(HXML node)
if (resource != NULL && *++resource == '\0')
resource = NULL;
- if ((n = xmlGetChild(node, "subject")) != NULL) {
- msgText = xmlGetText(n);
+ if ((n = XmlGetChild(node, "subject")) != NULL) {
+ msgText = XmlGetText(n);
if (msgText == NULL || msgText[0] == '\0')
return;
gcd.iType = GC_EVENT_TOPIC;
- if (resource == NULL && (m = xmlGetChild(node, "body")) != NULL) {
- const TCHAR *tmpnick = xmlGetText(m);
+ if (resource == NULL && (m = XmlGetChild(node, "body")) != NULL) {
+ const TCHAR *tmpnick = XmlGetText(m);
if (tmpnick == NULL || *tmpnick == 0)
return;
@@ -1076,11 +1076,11 @@ void CJabberProto::GroupchatProcessMessage(HXML node)
else {
imgLink = ExtractImage(node);
- if ((n = xmlGetChildByTag(node, "body", "xml:lang", m_tszSelectedLang)) == NULL)
- if ((n = xmlGetChild(node, "body")) == NULL)
+ if ((n = XmlGetChildByTag(node, "body", "xml:lang", m_tszSelectedLang)) == NULL)
+ if ((n = XmlGetChild(node, "body")) == NULL)
return;
- msgText = xmlGetText(n);
+ msgText = XmlGetText(n);
if (msgText == NULL)
return;
@@ -1097,8 +1097,8 @@ void CJabberProto::GroupchatProcessMessage(HXML node)
time_t msgTime = 0;
if (!JabberReadXep203delay(node, msgTime)) {
- HXML xDelay = xmlGetChildByTag(node, "x", "xmlns", _T("jabber:x:delay"));
- if (xDelay && (p = xmlGetAttrValue(xDelay, _T("stamp"))) != NULL)
+ HXML xDelay = XmlGetChildByTag(node, "x", "xmlns", _T("jabber:x:delay"));
+ if (xDelay && (p = XmlGetAttrValue(xDelay, _T("stamp"))) != NULL)
msgTime = JabberIsoToUnixTime(p);
}
diff --git a/protocols/JabberG/src/jabber_ibb.cpp b/protocols/JabberG/src/jabber_ibb.cpp
index 61094fb023..8177cd4942 100644
--- a/protocols/JabberG/src/jabber_ibb.cpp
+++ b/protocols/JabberG/src/jabber_ibb.cpp
@@ -52,10 +52,10 @@ BOOL CJabberProto::OnFtHandleIbbIq(HXML iqNode, CJabberIqInfo *pInfo)
FtHandleIbbRequest(iqNode, FALSE);
else if (!mir_tstrcmp(pInfo->GetChildNodeName(), _T("data"))) {
BOOL bOk = FALSE;
- const TCHAR *sid = xmlGetAttrValue(pInfo->GetChildNode(), _T("sid"));
- const TCHAR *seq = xmlGetAttrValue(pInfo->GetChildNode(), _T("seq"));
- if (sid && seq && xmlGetText(pInfo->GetChildNode()))
- bOk = OnIbbRecvdData(xmlGetText(pInfo->GetChildNode()), sid, seq);
+ const TCHAR *sid = XmlGetAttrValue(pInfo->GetChildNode(), _T("sid"));
+ const TCHAR *seq = XmlGetAttrValue(pInfo->GetChildNode(), _T("seq"));
+ if (sid && seq && XmlGetText(pInfo->GetChildNode()))
+ bOk = OnIbbRecvdData(XmlGetText(pInfo->GetChildNode()), sid, seq);
if (bOk)
m_ThreadInfo->send( XmlNodeIq(_T("result"), pInfo));
diff --git a/protocols/JabberG/src/jabber_iq.cpp b/protocols/JabberG/src/jabber_iq.cpp
index 5669757ee9..34d35a7fc4 100644
--- a/protocols/JabberG/src/jabber_iq.cpp
+++ b/protocols/JabberG/src/jabber_iq.cpp
@@ -240,7 +240,7 @@ bool CJabberIqManager::HandleIq(int nIqId, HXML pNode)
if (nIqId == -1 || pNode == NULL)
return false;
- const TCHAR *szType = xmlGetAttrValue(pNode, _T("type"));
+ const TCHAR *szType = XmlGetAttrValue(pNode, _T("type"));
if (!szType)
return false;
@@ -260,24 +260,24 @@ bool CJabberIqManager::HandleIq(int nIqId, HXML pNode)
pInfo->m_nIqType = nIqType;
if (nIqType == JABBER_IQ_TYPE_RESULT) {
if (pInfo->m_dwParamsToParse & JABBER_IQ_PARSE_CHILD_TAG_NODE)
- pInfo->m_pChildNode = xmlGetChild(pNode , 0);
+ pInfo->m_pChildNode = XmlGetChild(pNode , 0);
if (pInfo->m_pChildNode && (pInfo->m_dwParamsToParse & JABBER_IQ_PARSE_CHILD_TAG_NAME))
- pInfo->m_szChildTagName = (TCHAR*)xmlGetName(pInfo->m_pChildNode);
+ pInfo->m_szChildTagName = (TCHAR*)XmlGetName(pInfo->m_pChildNode);
if (pInfo->m_pChildNode && (pInfo->m_dwParamsToParse & JABBER_IQ_PARSE_CHILD_TAG_XMLNS))
- pInfo->m_szChildTagXmlns = (TCHAR*)xmlGetAttrValue(pNode, _T("xmlns"));
+ pInfo->m_szChildTagXmlns = (TCHAR*)XmlGetAttrValue(pNode, _T("xmlns"));
}
if (pInfo->m_dwParamsToParse & JABBER_IQ_PARSE_TO)
- pInfo->m_szTo = (TCHAR*)xmlGetAttrValue(pNode, _T("to"));
+ pInfo->m_szTo = (TCHAR*)XmlGetAttrValue(pNode, _T("to"));
if (pInfo->m_dwParamsToParse & JABBER_IQ_PARSE_FROM)
- pInfo->m_szFrom = (TCHAR*)xmlGetAttrValue(pNode, _T("from"));
+ pInfo->m_szFrom = (TCHAR*)XmlGetAttrValue(pNode, _T("from"));
if (pInfo->m_szFrom && (pInfo->m_dwParamsToParse & JABBER_IQ_PARSE_HCONTACT))
pInfo->m_hContact = ppro->HContactFromJID(pInfo->m_szFrom, 3);
if (pInfo->m_dwParamsToParse & JABBER_IQ_PARSE_ID_STR)
- pInfo->m_szId = (TCHAR*)xmlGetAttrValue(pNode, _T("id"));
+ pInfo->m_szId = (TCHAR*)XmlGetAttrValue(pNode, _T("id"));
(ppro->*(pInfo->m_pHandler))(pNode, pInfo);
delete pInfo;
@@ -291,7 +291,7 @@ bool CJabberIqManager::HandleIqPermanent(HXML pNode)
for (int i = 0; i < m_arHandlers.getCount(); i++) {
CJabberIqPermanentInfo &pInfo = m_arHandlers[i];
// have to get all data here, in the loop, because there's always possibility that previous handler modified it
- const TCHAR *szType = xmlGetAttrValue(pNode, _T("type"));
+ const TCHAR *szType = XmlGetAttrValue(pNode, _T("type"));
if (!szType)
return FALSE;
@@ -307,12 +307,12 @@ bool CJabberIqManager::HandleIqPermanent(HXML pNode)
if (!(pInfo.m_nIqTypes & iqInfo.m_nIqType))
continue;
- HXML pFirstChild = xmlGetChild(pNode , 0);
- if (!pFirstChild || !xmlGetName(pFirstChild))
+ HXML pFirstChild = XmlGetChild(pNode , 0);
+ if (!pFirstChild || !XmlGetName(pFirstChild))
return FALSE;
- const TCHAR *szTagName = xmlGetName(pFirstChild);
- const TCHAR *szXmlns = xmlGetAttrValue(pFirstChild, _T("xmlns"));
+ const TCHAR *szTagName = XmlGetName(pFirstChild);
+ const TCHAR *szXmlns = XmlGetAttrValue(pFirstChild, _T("xmlns"));
if ((!pInfo.m_szXmlns || (szXmlns && !mir_tstrcmp(pInfo.m_szXmlns, szXmlns))) &&
(!pInfo.m_szTag || !mir_tstrcmp(pInfo.m_szTag, szTagName)))
@@ -321,14 +321,14 @@ bool CJabberIqManager::HandleIqPermanent(HXML pNode)
iqInfo.m_pChildNode = pFirstChild;
iqInfo.m_szChildTagName = (TCHAR*)szTagName;
iqInfo.m_szChildTagXmlns = (TCHAR*)szXmlns;
- iqInfo.m_szId = (TCHAR*)xmlGetAttrValue(pNode, _T("id"));
+ iqInfo.m_szId = (TCHAR*)XmlGetAttrValue(pNode, _T("id"));
iqInfo.m_pUserData = pInfo.m_pUserData;
if (pInfo.m_dwParamsToParse & JABBER_IQ_PARSE_TO)
- iqInfo.m_szTo = (TCHAR*)xmlGetAttrValue(pNode, _T("to"));
+ iqInfo.m_szTo = (TCHAR*)XmlGetAttrValue(pNode, _T("to"));
if (pInfo.m_dwParamsToParse & JABBER_IQ_PARSE_FROM)
- iqInfo.m_szFrom = (TCHAR*)xmlGetAttrValue(pNode, _T("from"));
+ iqInfo.m_szFrom = (TCHAR*)XmlGetAttrValue(pNode, _T("from"));
if ((pInfo.m_dwParamsToParse & JABBER_IQ_PARSE_HCONTACT) && (iqInfo.m_szFrom))
iqInfo.m_hContact = ppro->HContactFromJID(iqInfo.m_szFrom, 3);
diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp
index 909f05f939..5afce7aaa9 100644
--- a/protocols/JabberG/src/jabber_iq_handlers.cpp
+++ b/protocols/JabberG/src/jabber_iq_handlers.cpp
@@ -476,7 +476,7 @@ BOOL CJabberProto::OnIqRequestAvatar(HXML, CJabberIqInfo *pInfo)
BOOL CJabberProto::OnSiRequest(HXML node, CJabberIqInfo *pInfo)
{
- const TCHAR *szProfile = xmlGetAttrValue(pInfo->GetChildNode(), _T("profile"));
+ const TCHAR *szProfile = XmlGetAttrValue(pInfo->GetChildNode(), _T("profile"));
if (szProfile && !mir_tstrcmp(szProfile, JABBER_FEAT_SI_FT))
FtHandleSiRequest(node);
@@ -528,29 +528,29 @@ BOOL CJabberProto::OnRosterPushRequest(HXML, CJabberIqInfo *pInfo)
MCONTACT hContact = NULL;
const TCHAR *jid, *str;
- debugLogA("<iq/> Got roster push, query has %d children", xmlGetChildCount(queryNode));
+ debugLogA("<iq/> Got roster push, query has %d children", XmlGetChildCount(queryNode));
for (int i = 0;; i++) {
- HXML itemNode = xmlGetChild(queryNode, i);
+ HXML itemNode = XmlGetChild(queryNode, i);
if (!itemNode)
break;
- if (mir_tstrcmp(xmlGetName(itemNode), _T("item")) != 0)
+ if (mir_tstrcmp(XmlGetName(itemNode), _T("item")) != 0)
continue;
- if ((jid = xmlGetAttrValue(itemNode, _T("jid"))) == NULL)
+ if ((jid = XmlGetAttrValue(itemNode, _T("jid"))) == NULL)
continue;
- if ((str = xmlGetAttrValue(itemNode, _T("subscription"))) == NULL)
+ if ((str = XmlGetAttrValue(itemNode, _T("subscription"))) == NULL)
continue;
// we will not add new account when subscription=remove
if (!mir_tstrcmp(str, _T("to")) || !mir_tstrcmp(str, _T("both")) || !mir_tstrcmp(str, _T("from")) || !mir_tstrcmp(str, _T("none"))) {
- const TCHAR *name = xmlGetAttrValue(itemNode, _T("name"));
+ const TCHAR *name = XmlGetAttrValue(itemNode, _T("name"));
ptrT nick((name != NULL) ? mir_tstrdup(name) : JabberNickFromJID(jid));
if (nick != NULL) {
if ((item = ListAdd(LIST_ROSTER, jid)) != NULL) {
replaceStrT(item->nick, nick);
- HXML groupNode = xmlGetChild(itemNode, "group");
- replaceStrT(item->group, xmlGetText(groupNode));
+ HXML groupNode = XmlGetChild(itemNode, "group");
+ replaceStrT(item->group, XmlGetText(groupNode));
if ((hContact = HContactFromJID(jid, 0)) == NULL) {
// Received roster has a new JID.
@@ -614,14 +614,14 @@ BOOL CJabberProto::OnIqRequestOOB(HXML, CJabberIqInfo *pInfo)
if (!pInfo->GetFrom() || !pInfo->GetHContact())
return TRUE;
- HXML n = xmlGetChild(pInfo->GetChildNode(), "url");
- if (!n || !xmlGetText(n))
+ HXML n = XmlGetChild(pInfo->GetChildNode(), "url");
+ if (!n || !XmlGetText(n))
return TRUE;
if (m_options.BsOnlyIBB) {
// reject
XmlNodeIq iq(_T("error"), pInfo);
- HXML e = xmlAddChild(iq, _T("error"), _T("File transfer refused")); xmlAddAttr(e, _T("code"), 406);
+ HXML e = XmlAddChild(iq, _T("error"), _T("File transfer refused")); XmlAddAttr(e, _T("code"), 406);
m_ThreadInfo->send(iq);
return TRUE;
}
@@ -636,7 +636,7 @@ BOOL CJabberProto::OnIqRequestOOB(HXML, CJabberIqInfo *pInfo)
ft->httpPath = NULL;
// Parse the URL
- TCHAR *str = (TCHAR*)xmlGetText(n); // URL of the file to get
+ TCHAR *str = (TCHAR*)XmlGetText(n); // URL of the file to get
if (!_tcsnicmp(str, _T("http://"), 7)) {
TCHAR *p = str + 7, *q;
if ((q = _tcschr(p, '/')) != NULL) {
@@ -660,8 +660,8 @@ BOOL CJabberProto::OnIqRequestOOB(HXML, CJabberIqInfo *pInfo)
TCHAR *desc = NULL;
debugLogA("Host=%s Port=%d Path=%s", ft->httpHostName, ft->httpPort, ft->httpPath);
- if ((n = xmlGetChild(pInfo->GetChildNode(), "desc")) != NULL)
- desc = (TCHAR*)xmlGetText(n);
+ if ((n = XmlGetChild(pInfo->GetChildNode(), "desc")) != NULL)
+ desc = (TCHAR*)XmlGetText(n);
TCHAR *str2;
debugLog(_T("description = %s"), desc);
@@ -685,7 +685,7 @@ BOOL CJabberProto::OnIqRequestOOB(HXML, CJabberIqInfo *pInfo)
else {
// reject
XmlNodeIq iq(_T("error"), pInfo);
- HXML e = xmlAddChild(iq, _T("error"), _T("File transfer refused")); xmlAddAttr(e, _T("code"), 406);
+ HXML e = XmlAddChild(iq, _T("error"), _T("File transfer refused")); XmlAddAttr(e, _T("code"), 406);
m_ThreadInfo->send(iq);
delete ft;
}
@@ -697,7 +697,7 @@ BOOL CJabberProto::OnHandleDiscoInfoRequest(HXML iqNode, CJabberIqInfo *pInfo)
if (!pInfo->GetChildNode())
return TRUE;
- const TCHAR *szNode = xmlGetAttrValue(pInfo->GetChildNode(), _T("node"));
+ const TCHAR *szNode = XmlGetAttrValue(pInfo->GetChildNode(), _T("node"));
// caps hack
if (m_clientCapsManager.HandleInfoRequest(iqNode, pInfo, szNode))
return TRUE;
@@ -720,7 +720,7 @@ BOOL CJabberProto::OnHandleDiscoItemsRequest(HXML iqNode, CJabberIqInfo *pInfo)
return TRUE;
// ad-hoc commands check:
- const TCHAR *szNode = xmlGetAttrValue(pInfo->GetChildNode(), _T("node"));
+ const TCHAR *szNode = XmlGetAttrValue(pInfo->GetChildNode(), _T("node"));
if (szNode && m_adhocManager.HandleItemsRequest(iqNode, pInfo, szNode))
return TRUE;
@@ -728,7 +728,7 @@ BOOL CJabberProto::OnHandleDiscoItemsRequest(HXML iqNode, CJabberIqInfo *pInfo)
XmlNodeIq iq(_T("result"), pInfo);
HXML resultQuery = iq << XQUERY(JABBER_FEAT_DISCO_ITEMS);
if (szNode)
- xmlAddAttr(resultQuery, _T("node"), szNode);
+ XmlAddAttr(resultQuery, _T("node"), szNode);
if (!szNode && m_options.EnableRemoteControl)
resultQuery << XCHILD(_T("item")) << XATTR(_T("jid"), m_ThreadInfo->fullJID)
@@ -763,13 +763,13 @@ BOOL CJabberProto::OnIqHttpAuth(HXML node, CJabberIqInfo *pInfo)
if (!node || !pInfo->GetChildNode() || !pInfo->GetFrom() || !pInfo->GetIdStr())
return TRUE;
- HXML pConfirm = xmlGetChild(node, "confirm");
+ HXML pConfirm = XmlGetChild(node, "confirm");
if (!pConfirm)
return TRUE;
- const TCHAR *szId = xmlGetAttrValue(pConfirm, _T("id"));
- const TCHAR *szMethod = xmlGetAttrValue(pConfirm, _T("method"));
- const TCHAR *szUrl = xmlGetAttrValue(pConfirm, _T("url"));
+ const TCHAR *szId = XmlGetAttrValue(pConfirm, _T("id"));
+ const TCHAR *szMethod = XmlGetAttrValue(pConfirm, _T("method"));
+ const TCHAR *szUrl = XmlGetAttrValue(pConfirm, _T("url"));
if (!szId || !szMethod || !szUrl)
return TRUE;
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp
index 3e1b65b3f0..9326a4264b 100644
--- a/protocols/JabberG/src/jabber_iqid.cpp
+++ b/protocols/JabberG/src/jabber_iqid.cpp
@@ -34,20 +34,20 @@ void CJabberProto::OnIqResultServerDiscoInfo(HXML iqNode, CJabberIqInfo*)
if (iqNode == NULL)
return;
- const TCHAR *type = xmlGetAttrValue(iqNode, _T("type"));
+ const TCHAR *type = XmlGetAttrValue(iqNode, _T("type"));
if ( mir_tstrcmp(type, _T("result")))
return;
- HXML query = xmlGetChildByTag(iqNode, "query", "xmlns", JABBER_FEAT_DISCO_INFO);
+ HXML query = XmlGetChildByTag(iqNode, "query", "xmlns", JABBER_FEAT_DISCO_INFO);
if (query == NULL)
return;
HXML identity;
- for (int i = 1; (identity = xmlGetNthChild(query, _T("identity"), i)) != NULL; i++) {
+ for (int i = 1; (identity = XmlGetNthChild(query, _T("identity"), i)) != NULL; i++) {
JABBER_DISCO_FIELD tmp = {
- xmlGetAttrValue(identity, _T("category")),
- xmlGetAttrValue(identity, _T("type")),
- xmlGetAttrValue(identity, _T("name")) };
+ XmlGetAttrValue(identity, _T("category")),
+ XmlGetAttrValue(identity, _T("type")),
+ XmlGetAttrValue(identity, _T("name")) };
if (!mir_tstrcmp(tmp.category, _T("pubsub")) && !mir_tstrcmp(tmp.type, _T("pep"))) {
m_bPepSupported = true;
@@ -62,8 +62,8 @@ void CJabberProto::OnIqResultServerDiscoInfo(HXML iqNode, CJabberIqInfo*)
if (m_ThreadInfo) {
HXML feature;
- for (int i = 1; (feature = xmlGetNthChild(query, _T("feature"), i)) != NULL; i++) {
- const TCHAR *featureName = xmlGetAttrValue(feature, _T("var"));
+ for (int i = 1; (feature = XmlGetNthChild(query, _T("feature"), i)) != NULL; i++) {
+ const TCHAR *featureName = XmlGetAttrValue(feature, _T("var"));
if (!featureName)
continue;
@@ -208,21 +208,21 @@ void CJabberProto::OnIqResultGetAuth(HXML iqNode, CJabberIqInfo*)
HXML queryNode;
const TCHAR *type;
- if ((type = xmlGetAttrValue(iqNode, _T("type"))) == NULL) return;
- if ((queryNode = xmlGetChild(iqNode, "query")) == NULL) return;
+ if ((type = XmlGetAttrValue(iqNode, _T("type"))) == NULL) return;
+ if ((queryNode = XmlGetChild(iqNode, "query")) == NULL) return;
if (!mir_tstrcmp(type, _T("result"))) {
XmlNodeIq iq(AddIQ(&CJabberProto::OnIqResultSetAuth, JABBER_IQ_TYPE_SET));
HXML query = iq << XQUERY(_T("jabber:iq:auth"));
query << XCHILD(_T("username"), m_ThreadInfo->conn.username);
- if (xmlGetChild(queryNode, "digest") != NULL && m_ThreadInfo->szStreamId) {
+ if (XmlGetChild(queryNode, "digest") != NULL && m_ThreadInfo->szStreamId) {
JabberShaStrBuf buf;
T2Utf str(m_ThreadInfo->conn.password);
char text[200];
mir_snprintf(text, _countof(text), "%s%s", m_ThreadInfo->szStreamId, str);
query << XCHILD(_T("digest"), _A2T(JabberSha1(text, buf)));
}
- else if (xmlGetChild(queryNode, "password") != NULL)
+ else if (XmlGetChild(queryNode, "password") != NULL)
query << XCHILD(_T("password"), m_ThreadInfo->conn.password);
else {
debugLogA("No known authentication mechanism accepted by the server.");
@@ -230,7 +230,7 @@ void CJabberProto::OnIqResultGetAuth(HXML iqNode, CJabberIqInfo*)
return;
}
- if (xmlGetChild(queryNode , "resource") != NULL)
+ if (XmlGetChild(queryNode , "resource") != NULL)
query << XCHILD(_T("resource"), m_ThreadInfo->resource);
m_ThreadInfo->send(iq);
@@ -252,7 +252,7 @@ void CJabberProto::OnIqResultSetAuth(HXML iqNode, CJabberIqInfo*)
// RECVED: authentication result
// ACTION: if successfully logged in, continue by requesting roster list and set my initial status
debugLogA("<iq/> iqIdSetAuth");
- if ((type = xmlGetAttrValue(iqNode, _T("type"))) == NULL) return;
+ if ((type = XmlGetAttrValue(iqNode, _T("type"))) == NULL) return;
if (!mir_tstrcmp(type, _T("result"))) {
ptrT tszNick(getTStringA("Nick"));
@@ -341,13 +341,13 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo)
return;
}
- HXML queryNode = xmlGetChild(iqNode , "query");
+ HXML queryNode = XmlGetChild(iqNode , "query");
if (queryNode == NULL) {
mir_free(szGroupDelimeter);
return;
}
- if (mir_tstrcmp(xmlGetAttrValue(queryNode, _T("xmlns")), JABBER_FEAT_IQ_ROSTER)) {
+ if (mir_tstrcmp(XmlGetAttrValue(queryNode, _T("xmlns")), JABBER_FEAT_IQ_ROSTER)) {
mir_free(szGroupDelimeter);
return;
}
@@ -363,14 +363,14 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo)
for (int i=0; ; i++) {
BOOL bIsTransport=FALSE;
- HXML itemNode = xmlGetChild(queryNode ,i);
+ HXML itemNode = XmlGetChild(queryNode ,i);
if (!itemNode)
break;
- if (mir_tstrcmp(xmlGetName(itemNode), _T("item")))
+ if (mir_tstrcmp(XmlGetName(itemNode), _T("item")))
continue;
- const TCHAR *str = xmlGetAttrValue(itemNode, _T("subscription"));
+ const TCHAR *str = XmlGetAttrValue(itemNode, _T("subscription"));
JABBER_SUBSCRIPTION sub;
if (str == NULL) sub = SUB_NONE;
@@ -379,13 +379,13 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo)
else if (!mir_tstrcmp(str, _T("from"))) sub = SUB_FROM;
else sub = SUB_NONE;
- const TCHAR *jid = xmlGetAttrValue(itemNode, _T("jid"));
+ const TCHAR *jid = XmlGetAttrValue(itemNode, _T("jid"));
if (jid == NULL)
continue;
if (_tcschr(jid, '@') == NULL)
bIsTransport = TRUE;
- const TCHAR *name = xmlGetAttrValue(itemNode, _T("name"));
+ const TCHAR *name = XmlGetAttrValue(itemNode, _T("name"));
TCHAR *nick = (name != NULL) ? mir_tstrdup(name) : JabberNickFromJID(jid);
if (nick == NULL)
continue;
@@ -395,8 +395,8 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo)
mir_free(item->nick); item->nick = nick;
- HXML groupNode = xmlGetChild(itemNode , "group");
- replaceStrT(item->group, xmlGetText(groupNode));
+ HXML groupNode = XmlGetChild(itemNode , "group");
+ replaceStrT(item->group, XmlGetText(groupNode));
// check group delimiters:
if (item->group && szGroupDelimeter) {
@@ -472,7 +472,7 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo)
setByte(hContact, "IsTransport", FALSE);
}
- const TCHAR *imagepath = xmlGetAttrValue(itemNode, _T("vz:img"));
+ const TCHAR *imagepath = XmlGetAttrValue(itemNode, _T("vz:img"));
if (imagepath)
httpavatars->insert(new JABBER_HTTP_AVATARS(imagepath, hContact));
}
@@ -524,16 +524,16 @@ void CJabberProto::OnIqResultGetRegister(HXML iqNode, CJabberIqInfo*)
HXML queryNode;
const TCHAR *type;
- if ((type = xmlGetAttrValue(iqNode, _T("type"))) == NULL) return;
- if ((queryNode = xmlGetChild(iqNode , "query")) == NULL) return;
+ if ((type = XmlGetAttrValue(iqNode, _T("type"))) == NULL) return;
+ if ((queryNode = XmlGetChild(iqNode , "query")) == NULL) return;
if (!mir_tstrcmp(type, _T("result"))) {
if (m_hwndAgentRegInput)
- SendMessage(m_hwndAgentRegInput, WM_JABBER_REGINPUT_ACTIVATE, 1 /*success*/, (LPARAM)xi.copyNode(iqNode));
+ SendMessage(m_hwndAgentRegInput, WM_JABBER_REGINPUT_ACTIVATE, 1 /*success*/, (LPARAM)xmlCopyNode(iqNode));
}
else if (!mir_tstrcmp(type, _T("error"))) {
if (m_hwndAgentRegInput) {
- HXML errorNode = xmlGetChild(iqNode , "error");
+ HXML errorNode = XmlGetChild(iqNode , "error");
TCHAR *str = JabberErrorMsg(errorNode);
SendMessage(m_hwndAgentRegInput, WM_JABBER_REGINPUT_ACTIVATE, 0 /*error*/, (LPARAM)str);
mir_free(str);
@@ -546,8 +546,8 @@ void CJabberProto::OnIqResultSetRegister(HXML iqNode, CJabberIqInfo*)
debugLogA("<iq/> iqIdSetRegister");
const TCHAR *type, *from;
- if ((type = xmlGetAttrValue(iqNode, _T("type"))) == NULL) return;
- if ((from = xmlGetAttrValue(iqNode, _T("from"))) == NULL) return;
+ if ((type = XmlGetAttrValue(iqNode, _T("type"))) == NULL) return;
+ if ((from = XmlGetAttrValue(iqNode, _T("from"))) == NULL) return;
if (!mir_tstrcmp(type, _T("result"))) {
MCONTACT hContact = HContactFromJID(from);
@@ -559,7 +559,7 @@ void CJabberProto::OnIqResultSetRegister(HXML iqNode, CJabberIqInfo*)
}
else if (!mir_tstrcmp(type, _T("error"))) {
if (m_hwndRegProgress) {
- HXML errorNode = xmlGetChild(iqNode , "error");
+ HXML errorNode = XmlGetChild(iqNode , "error");
TCHAR *str = JabberErrorMsg(errorNode);
SendMessage(m_hwndRegProgress, WM_JABBER_REGDLG_UPDATE, 100, (LPARAM)str);
mir_free(str);
@@ -574,8 +574,8 @@ void CJabberProto::OnIqResultGetVcardPhoto(HXML n, MCONTACT hContact, bool &hasP
if (hasPhoto)
return;
- HXML o = xmlGetChild(n, "BINVAL");
- LPCTSTR ptszBinval = xmlGetText(o);
+ HXML o = XmlGetChild(n, "BINVAL");
+ LPCTSTR ptszBinval = XmlGetText(o);
if (o == NULL || ptszBinval == NULL)
return;
@@ -636,11 +636,11 @@ void CJabberProto::OnIqResultGetVcardPhoto(HXML n, MCONTACT hContact, bool &hasP
static TCHAR* sttGetText(HXML node, char* tag)
{
- HXML n = xmlGetChild(node , tag);
+ HXML n = XmlGetChild(node , tag);
if (n == NULL)
return NULL;
- return (TCHAR*)xmlGetText(n);
+ return (TCHAR*)XmlGetText(n);
}
void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
@@ -652,14 +652,14 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
DBVARIANT dbv;
debugLogA("<iq/> iqIdGetVcard");
- if ((type = xmlGetAttrValue(iqNode, _T("type"))) == NULL) return;
- if ((jid = xmlGetAttrValue(iqNode, _T("from"))) == NULL) return;
+ if ((type = XmlGetAttrValue(iqNode, _T("type"))) == NULL) return;
+ if ((jid = XmlGetAttrValue(iqNode, _T("from"))) == NULL) return;
int id = JabberGetPacketID(iqNode);
if (id == m_nJabberSearchID) {
m_nJabberSearchID = -1;
- if ((vCardNode = xmlGetChild(iqNode , "vCard")) != NULL) {
+ if ((vCardNode = XmlGetChild(iqNode , "vCard")) != NULL) {
if (!mir_tstrcmp(type, _T("result"))) {
PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
@@ -708,45 +708,45 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
hasOrgname = false, hasOrgunit = false, hasRole = false, hasTitle = false, hasDesc = false, hasPhoto = false;
int nEmail = 0, nPhone = 0, nYear, nMonth, nDay;
- if ((vCardNode = xmlGetChild(iqNode , "vCard")) != NULL) {
+ if ((vCardNode = XmlGetChild(iqNode , "vCard")) != NULL) {
for (int i=0; ; i++) {
- n = xmlGetChild(vCardNode ,i);
+ n = XmlGetChild(vCardNode ,i);
if (!n)
break;
- if (xmlGetName(n) == NULL) continue;
- if (!mir_tstrcmp(xmlGetName(n), _T("FN"))) {
- if (xmlGetText(n) != NULL) {
+ if (XmlGetName(n) == NULL) continue;
+ if (!mir_tstrcmp(XmlGetName(n), _T("FN"))) {
+ if (XmlGetText(n) != NULL) {
hasFn = true;
- setTString(hContact, "FullName", xmlGetText(n));
+ setTString(hContact, "FullName", XmlGetText(n));
}
}
- else if (!mir_tstrcmp(xmlGetName(n), _T("NICKNAME"))) {
- if (xmlGetText(n) != NULL) {
+ else if (!mir_tstrcmp(XmlGetName(n), _T("NICKNAME"))) {
+ if (XmlGetText(n) != NULL) {
hasNick = true;
- setTString(hContact, "Nick", xmlGetText(n));
+ setTString(hContact, "Nick", XmlGetText(n));
}
}
- else if (!mir_tstrcmp(xmlGetName(n), _T("N"))) {
+ else if (!mir_tstrcmp(XmlGetName(n), _T("N"))) {
// First/Last name
if (!hasGiven && !hasFamily && !hasMiddle) {
- if ((m=xmlGetChild(n, "GIVEN")) != NULL && xmlGetText(m) != NULL) {
+ if ((m=XmlGetChild(n, "GIVEN")) != NULL && XmlGetText(m) != NULL) {
hasGiven = true;
- setTString(hContact, "FirstName", xmlGetText(m));
+ setTString(hContact, "FirstName", XmlGetText(m));
}
- if ((m=xmlGetChild(n, "FAMILY")) != NULL && xmlGetText(m) != NULL) {
+ if ((m=XmlGetChild(n, "FAMILY")) != NULL && XmlGetText(m) != NULL) {
hasFamily = true;
- setTString(hContact, "LastName", xmlGetText(m));
+ setTString(hContact, "LastName", XmlGetText(m));
}
- if ((m=xmlGetChild(n, "MIDDLE")) != NULL && xmlGetText(m) != NULL) {
+ if ((m=XmlGetChild(n, "MIDDLE")) != NULL && XmlGetText(m) != NULL) {
hasMiddle = true;
- setTString(hContact, "MiddleName", xmlGetText(m));
+ setTString(hContact, "MiddleName", XmlGetText(m));
} }
}
- else if (!mir_tstrcmp(xmlGetName(n), _T("EMAIL"))) {
+ else if (!mir_tstrcmp(XmlGetName(n), _T("EMAIL"))) {
// E-mail address(es)
- if ((m=xmlGetChild(n, "USERID")) == NULL) // Some bad client put e-mail directly in <EMAIL/> instead of <USERID/>
+ if ((m=XmlGetChild(n, "USERID")) == NULL) // Some bad client put e-mail directly in <EMAIL/> instead of <USERID/>
m = n;
- if (xmlGetText(m) != NULL) {
+ if (XmlGetText(m) != NULL) {
char text[100];
if (hContact != NULL) {
if (nEmail == 0)
@@ -755,25 +755,25 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
mir_snprintf(text, _countof(text), "e-mail%d", nEmail - 1);
}
else mir_snprintf(text, _countof(text), "e-mail%d", nEmail);
- setTString(hContact, text, xmlGetText(m));
+ setTString(hContact, text, XmlGetText(m));
if (hContact == NULL) {
mir_snprintf(text, _countof(text), "e-mailFlag%d", nEmail);
int nFlag = 0;
- if (xmlGetChild(n, "HOME") != NULL) nFlag |= JABBER_VCEMAIL_HOME;
- if (xmlGetChild(n, "WORK") != NULL) nFlag |= JABBER_VCEMAIL_WORK;
- if (xmlGetChild(n, "INTERNET") != NULL) nFlag |= JABBER_VCEMAIL_INTERNET;
- if (xmlGetChild(n, "X400") != NULL) nFlag |= JABBER_VCEMAIL_X400;
+ if (XmlGetChild(n, "HOME") != NULL) nFlag |= JABBER_VCEMAIL_HOME;
+ if (XmlGetChild(n, "WORK") != NULL) nFlag |= JABBER_VCEMAIL_WORK;
+ if (XmlGetChild(n, "INTERNET") != NULL) nFlag |= JABBER_VCEMAIL_INTERNET;
+ if (XmlGetChild(n, "X400") != NULL) nFlag |= JABBER_VCEMAIL_X400;
setWord(text, nFlag);
}
nEmail++;
}
}
- else if (!mir_tstrcmp(xmlGetName(n), _T("BDAY"))) {
+ else if (!mir_tstrcmp(XmlGetName(n), _T("BDAY"))) {
// Birthday
- if (!hasBday && xmlGetText(n) != NULL) {
+ if (!hasBday && XmlGetText(n) != NULL) {
if (hContact != NULL) {
- if (_stscanf(xmlGetText(n), _T("%d-%d-%d"), &nYear, &nMonth, &nDay) == 3) {
+ if (_stscanf(XmlGetText(n), _T("%d-%d-%d"), &nYear, &nMonth, &nDay) == 3) {
hasBday = true;
setWord(hContact, "BirthYear", (WORD)nYear);
setByte(hContact, "BirthMonth", (BYTE) nMonth);
@@ -790,202 +790,202 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
}
else {
hasBday = true;
- setTString("BirthDate", xmlGetText(n));
+ setTString("BirthDate", XmlGetText(n));
} }
}
- else if (!mir_tstrcmp(xmlGetName(n), _T("GENDER"))) {
+ else if (!mir_tstrcmp(XmlGetName(n), _T("GENDER"))) {
// Gender
- if (!hasGender && xmlGetText(n) != NULL) {
+ if (!hasGender && XmlGetText(n) != NULL) {
if (hContact != NULL) {
- if (xmlGetText(n)[0] && strchr("mMfF", xmlGetText(n)[0]) != NULL) {
+ if (XmlGetText(n)[0] && strchr("mMfF", XmlGetText(n)[0]) != NULL) {
hasGender = true;
- setByte(hContact, "Gender", (BYTE) toupper(xmlGetText(n)[0]));
+ setByte(hContact, "Gender", (BYTE) toupper(XmlGetText(n)[0]));
}
}
else {
hasGender = true;
- setTString("GenderString", xmlGetText(n));
+ setTString("GenderString", XmlGetText(n));
} }
}
- else if (!mir_tstrcmp(xmlGetName(n), _T("ADR"))) {
- if (!hasHome && xmlGetChild(n, "HOME") != NULL) {
+ else if (!mir_tstrcmp(XmlGetName(n), _T("ADR"))) {
+ if (!hasHome && XmlGetChild(n, "HOME") != NULL) {
// Home address
hasHome = true;
- if ((m=xmlGetChild(n, "STREET")) != NULL && xmlGetText(m) != NULL) {
+ if ((m=XmlGetChild(n, "STREET")) != NULL && XmlGetText(m) != NULL) {
hasHomeStreet = true;
if (hContact != NULL) {
- if ((o=xmlGetChild(n, "EXTADR")) != NULL && xmlGetText(o) != NULL)
- mir_sntprintf(text, _T("%s\r\n%s"), xmlGetText(m), xmlGetText(o));
- else if ((o=xmlGetChild(n, "EXTADD")) != NULL && xmlGetText(o) != NULL)
- mir_sntprintf(text, _T("%s\r\n%s"), xmlGetText(m), xmlGetText(o));
+ if ((o=XmlGetChild(n, "EXTADR")) != NULL && XmlGetText(o) != NULL)
+ mir_sntprintf(text, _T("%s\r\n%s"), XmlGetText(m), XmlGetText(o));
+ else if ((o=XmlGetChild(n, "EXTADD")) != NULL && XmlGetText(o) != NULL)
+ mir_sntprintf(text, _T("%s\r\n%s"), XmlGetText(m), XmlGetText(o));
else
- _tcsncpy_s(text, xmlGetText(m), _TRUNCATE);
+ _tcsncpy_s(text, XmlGetText(m), _TRUNCATE);
text[_countof(text)-1] = '\0';
setTString(hContact, "Street", text);
}
else {
- setTString(hContact, "Street", xmlGetText(m));
- if ((m=xmlGetChild(n, "EXTADR")) == NULL)
- m = xmlGetChild(n, "EXTADD");
- if (m != NULL && xmlGetText(m) != NULL) {
+ setTString(hContact, "Street", XmlGetText(m));
+ if ((m=XmlGetChild(n, "EXTADR")) == NULL)
+ m = XmlGetChild(n, "EXTADD");
+ if (m != NULL && XmlGetText(m) != NULL) {
hasHomeStreet2 = true;
- setTString(hContact, "Street2", xmlGetText(m));
+ setTString(hContact, "Street2", XmlGetText(m));
} } }
- if ((m=xmlGetChild(n, "LOCALITY")) != NULL && xmlGetText(m) != NULL) {
+ if ((m=XmlGetChild(n, "LOCALITY")) != NULL && XmlGetText(m) != NULL) {
hasHomeLocality = true;
- setTString(hContact, "City", xmlGetText(m));
+ setTString(hContact, "City", XmlGetText(m));
}
- if ((m=xmlGetChild(n, "REGION")) != NULL && xmlGetText(m) != NULL) {
+ if ((m=XmlGetChild(n, "REGION")) != NULL && XmlGetText(m) != NULL) {
hasHomeRegion = true;
- setTString(hContact, "State", xmlGetText(m));
+ setTString(hContact, "State", XmlGetText(m));
}
- if ((m=xmlGetChild(n, "PCODE")) != NULL && xmlGetText(m) != NULL) {
+ if ((m=XmlGetChild(n, "PCODE")) != NULL && XmlGetText(m) != NULL) {
hasHomePcode = true;
- setTString(hContact, "ZIP", xmlGetText(m));
+ setTString(hContact, "ZIP", XmlGetText(m));
}
- if ((m=xmlGetChild(n, "CTRY")) == NULL || xmlGetText(m) == NULL) // Some bad client use <COUNTRY/> instead of <CTRY/>
- m = xmlGetChild(n, "COUNTRY");
- if (m != NULL && xmlGetText(m) != NULL) {
+ if ((m=XmlGetChild(n, "CTRY")) == NULL || XmlGetText(m) == NULL) // Some bad client use <COUNTRY/> instead of <CTRY/>
+ m = XmlGetChild(n, "COUNTRY");
+ if (m != NULL && XmlGetText(m) != NULL) {
hasHomeCtry = true;
- setTString(hContact, "Country", xmlGetText(m));
+ setTString(hContact, "Country", XmlGetText(m));
} }
- if (!hasWork && xmlGetChild(n, "WORK") != NULL) {
+ if (!hasWork && XmlGetChild(n, "WORK") != NULL) {
// Work address
hasWork = true;
- if ((m=xmlGetChild(n, "STREET")) != NULL && xmlGetText(m) != NULL) {
+ if ((m=XmlGetChild(n, "STREET")) != NULL && XmlGetText(m) != NULL) {
hasWorkStreet = true;
if (hContact != NULL) {
- if ((o=xmlGetChild(n, "EXTADR")) != NULL && xmlGetText(o) != NULL)
- mir_sntprintf(text, _T("%s\r\n%s"), xmlGetText(m), xmlGetText(o));
- else if ((o=xmlGetChild(n, "EXTADD")) != NULL && xmlGetText(o) != NULL)
- mir_sntprintf(text, _T("%s\r\n%s"), xmlGetText(m), xmlGetText(o));
+ if ((o=XmlGetChild(n, "EXTADR")) != NULL && XmlGetText(o) != NULL)
+ mir_sntprintf(text, _T("%s\r\n%s"), XmlGetText(m), XmlGetText(o));
+ else if ((o=XmlGetChild(n, "EXTADD")) != NULL && XmlGetText(o) != NULL)
+ mir_sntprintf(text, _T("%s\r\n%s"), XmlGetText(m), XmlGetText(o));
else
- _tcsncpy_s(text, xmlGetText(m), _TRUNCATE);
+ _tcsncpy_s(text, XmlGetText(m), _TRUNCATE);
text[_countof(text)-1] = '\0';
setTString(hContact, "CompanyStreet", text);
}
else {
- setTString(hContact, "CompanyStreet", xmlGetText(m));
- if ((m=xmlGetChild(n, "EXTADR")) == NULL)
- m = xmlGetChild(n, "EXTADD");
- if (m != NULL && xmlGetText(m) != NULL) {
+ setTString(hContact, "CompanyStreet", XmlGetText(m));
+ if ((m=XmlGetChild(n, "EXTADR")) == NULL)
+ m = XmlGetChild(n, "EXTADD");
+ if (m != NULL && XmlGetText(m) != NULL) {
hasWorkStreet2 = true;
- setTString(hContact, "CompanyStreet2", xmlGetText(m));
+ setTString(hContact, "CompanyStreet2", XmlGetText(m));
} } }
- if ((m=xmlGetChild(n, "LOCALITY")) != NULL && xmlGetText(m) != NULL) {
+ if ((m=XmlGetChild(n, "LOCALITY")) != NULL && XmlGetText(m) != NULL) {
hasWorkLocality = true;
- setTString(hContact, "CompanyCity", xmlGetText(m));
+ setTString(hContact, "CompanyCity", XmlGetText(m));
}
- if ((m=xmlGetChild(n, "REGION")) != NULL && xmlGetText(m) != NULL) {
+ if ((m=XmlGetChild(n, "REGION")) != NULL && XmlGetText(m) != NULL) {
hasWorkRegion = true;
- setTString(hContact, "CompanyState", xmlGetText(m));
+ setTString(hContact, "CompanyState", XmlGetText(m));
}
- if ((m=xmlGetChild(n, "PCODE")) != NULL && xmlGetText(m) != NULL) {
+ if ((m=XmlGetChild(n, "PCODE")) != NULL && XmlGetText(m) != NULL) {
hasWorkPcode = true;
- setTString(hContact, "CompanyZIP", xmlGetText(m));
+ setTString(hContact, "CompanyZIP", XmlGetText(m));
}
- if ((m=xmlGetChild(n, "CTRY")) == NULL || xmlGetText(m) == NULL) // Some bad client use <COUNTRY/> instead of <CTRY/>
- m = xmlGetChild(n, "COUNTRY");
- if (m != NULL && xmlGetText(m) != NULL) {
+ if ((m=XmlGetChild(n, "CTRY")) == NULL || XmlGetText(m) == NULL) // Some bad client use <COUNTRY/> instead of <CTRY/>
+ m = XmlGetChild(n, "COUNTRY");
+ if (m != NULL && XmlGetText(m) != NULL) {
hasWorkCtry = true;
- setTString(hContact, "CompanyCountry", xmlGetText(m));
+ setTString(hContact, "CompanyCountry", XmlGetText(m));
} }
}
- else if (!mir_tstrcmp(xmlGetName(n), _T("TEL"))) {
+ else if (!mir_tstrcmp(XmlGetName(n), _T("TEL"))) {
// Telephone/Fax/Cellular
- if ((m=xmlGetChild(n, "NUMBER")) != NULL && xmlGetText(m) != NULL) {
+ if ((m=XmlGetChild(n, "NUMBER")) != NULL && XmlGetText(m) != NULL) {
if (hContact != NULL) {
- if (!hasFax && xmlGetChild(n, "FAX") != NULL) {
+ if (!hasFax && XmlGetChild(n, "FAX") != NULL) {
hasFax = true;
- setTString(hContact, "Fax", xmlGetText(m));
+ setTString(hContact, "Fax", XmlGetText(m));
}
- else if (!hasCell && xmlGetChild(n, "CELL") != NULL) {
+ else if (!hasCell && XmlGetChild(n, "CELL") != NULL) {
hasCell = true;
- setTString(hContact, "Cellular", xmlGetText(m));
+ setTString(hContact, "Cellular", XmlGetText(m));
}
else if (!hasPhone &&
- (xmlGetChild(n, "HOME") != NULL || xmlGetChild(n, "WORK") != NULL || xmlGetChild(n, "VOICE") != NULL ||
- (xmlGetChild(n, "FAX") == NULL &&
- xmlGetChild(n, "PAGER") == NULL &&
- xmlGetChild(n, "MSG") == NULL &&
- xmlGetChild(n, "CELL") == NULL &&
- xmlGetChild(n, "VIDEO") == NULL &&
- xmlGetChild(n, "BBS") == NULL &&
- xmlGetChild(n, "MODEM") == NULL &&
- xmlGetChild(n, "ISDN") == NULL &&
- xmlGetChild(n, "PCS") == NULL)))
+ (XmlGetChild(n, "HOME") != NULL || XmlGetChild(n, "WORK") != NULL || XmlGetChild(n, "VOICE") != NULL ||
+ (XmlGetChild(n, "FAX") == NULL &&
+ XmlGetChild(n, "PAGER") == NULL &&
+ XmlGetChild(n, "MSG") == NULL &&
+ XmlGetChild(n, "CELL") == NULL &&
+ XmlGetChild(n, "VIDEO") == NULL &&
+ XmlGetChild(n, "BBS") == NULL &&
+ XmlGetChild(n, "MODEM") == NULL &&
+ XmlGetChild(n, "ISDN") == NULL &&
+ XmlGetChild(n, "PCS") == NULL)))
{
hasPhone = true;
- setTString(hContact, "Phone", xmlGetText(m));
+ setTString(hContact, "Phone", XmlGetText(m));
}
}
else {
char text[100];
mir_snprintf(text, _countof(text), "Phone%d", nPhone);
- setTString(text, xmlGetText(m));
+ setTString(text, XmlGetText(m));
mir_snprintf(text, _countof(text), "PhoneFlag%d", nPhone);
int nFlag = 0;
- if (xmlGetChild(n, "HOME") != NULL) nFlag |= JABBER_VCTEL_HOME;
- if (xmlGetChild(n, "WORK") != NULL) nFlag |= JABBER_VCTEL_WORK;
- if (xmlGetChild(n, "VOICE") != NULL) nFlag |= JABBER_VCTEL_VOICE;
- if (xmlGetChild(n, "FAX") != NULL) nFlag |= JABBER_VCTEL_FAX;
- if (xmlGetChild(n, "PAGER") != NULL) nFlag |= JABBER_VCTEL_PAGER;
- if (xmlGetChild(n, "MSG") != NULL) nFlag |= JABBER_VCTEL_MSG;
- if (xmlGetChild(n, "CELL") != NULL) nFlag |= JABBER_VCTEL_CELL;
- if (xmlGetChild(n, "VIDEO") != NULL) nFlag |= JABBER_VCTEL_VIDEO;
- if (xmlGetChild(n, "BBS") != NULL) nFlag |= JABBER_VCTEL_BBS;
- if (xmlGetChild(n, "MODEM") != NULL) nFlag |= JABBER_VCTEL_MODEM;
- if (xmlGetChild(n, "ISDN") != NULL) nFlag |= JABBER_VCTEL_ISDN;
- if (xmlGetChild(n, "PCS") != NULL) nFlag |= JABBER_VCTEL_PCS;
+ if (XmlGetChild(n, "HOME") != NULL) nFlag |= JABBER_VCTEL_HOME;
+ if (XmlGetChild(n, "WORK") != NULL) nFlag |= JABBER_VCTEL_WORK;
+ if (XmlGetChild(n, "VOICE") != NULL) nFlag |= JABBER_VCTEL_VOICE;
+ if (XmlGetChild(n, "FAX") != NULL) nFlag |= JABBER_VCTEL_FAX;
+ if (XmlGetChild(n, "PAGER") != NULL) nFlag |= JABBER_VCTEL_PAGER;
+ if (XmlGetChild(n, "MSG") != NULL) nFlag |= JABBER_VCTEL_MSG;
+ if (XmlGetChild(n, "CELL") != NULL) nFlag |= JABBER_VCTEL_CELL;
+ if (XmlGetChild(n, "VIDEO") != NULL) nFlag |= JABBER_VCTEL_VIDEO;
+ if (XmlGetChild(n, "BBS") != NULL) nFlag |= JABBER_VCTEL_BBS;
+ if (XmlGetChild(n, "MODEM") != NULL) nFlag |= JABBER_VCTEL_MODEM;
+ if (XmlGetChild(n, "ISDN") != NULL) nFlag |= JABBER_VCTEL_ISDN;
+ if (XmlGetChild(n, "PCS") != NULL) nFlag |= JABBER_VCTEL_PCS;
setWord(text, nFlag);
nPhone++;
}
}
}
- else if (!mir_tstrcmp(xmlGetName(n), _T("URL"))) {
+ else if (!mir_tstrcmp(XmlGetName(n), _T("URL"))) {
// Homepage
- if (!hasUrl && xmlGetText(n) != NULL) {
+ if (!hasUrl && XmlGetText(n) != NULL) {
hasUrl = true;
- setTString(hContact, "Homepage", xmlGetText(n));
+ setTString(hContact, "Homepage", XmlGetText(n));
}
}
- else if (!mir_tstrcmp(xmlGetName(n), _T("ORG"))) {
+ else if (!mir_tstrcmp(XmlGetName(n), _T("ORG"))) {
if (!hasOrgname && !hasOrgunit) {
- if ((m = xmlGetChild(n, "ORGNAME")) != NULL && xmlGetText(m) != NULL) {
+ if ((m = XmlGetChild(n, "ORGNAME")) != NULL && XmlGetText(m) != NULL) {
hasOrgname = true;
- setTString(hContact, "Company", xmlGetText(m));
+ setTString(hContact, "Company", XmlGetText(m));
}
- if ((m = xmlGetChild(n, "ORGUNIT")) != NULL && xmlGetText(m) != NULL) { // The real vCard can have multiple <ORGUNIT/> but we will only display the first one
+ if ((m = XmlGetChild(n, "ORGUNIT")) != NULL && XmlGetText(m) != NULL) { // The real vCard can have multiple <ORGUNIT/> but we will only display the first one
hasOrgunit = true;
- setTString(hContact, "CompanyDepartment", xmlGetText(m));
+ setTString(hContact, "CompanyDepartment", XmlGetText(m));
}
}
}
- else if (!mir_tstrcmp(xmlGetName(n), _T("ROLE"))) {
- if (!hasRole && xmlGetText(n) != NULL) {
+ else if (!mir_tstrcmp(XmlGetName(n), _T("ROLE"))) {
+ if (!hasRole && XmlGetText(n) != NULL) {
hasRole = true;
- setTString(hContact, "Role", xmlGetText(n));
+ setTString(hContact, "Role", XmlGetText(n));
}
}
- else if (!mir_tstrcmp(xmlGetName(n), _T("TITLE"))) {
- if (!hasTitle && xmlGetText(n) != NULL) {
+ else if (!mir_tstrcmp(XmlGetName(n), _T("TITLE"))) {
+ if (!hasTitle && XmlGetText(n) != NULL) {
hasTitle = true;
- setTString(hContact, "CompanyPosition", xmlGetText(n));
+ setTString(hContact, "CompanyPosition", XmlGetText(n));
}
}
- else if (!mir_tstrcmp(xmlGetName(n), _T("DESC"))) {
- if (!hasDesc && xmlGetText(n) != NULL) {
+ else if (!mir_tstrcmp(XmlGetName(n), _T("DESC"))) {
+ if (!hasDesc && XmlGetText(n) != NULL) {
hasDesc = true;
- CMString tszMemo(xmlGetText(n));
+ CMString tszMemo(XmlGetText(n));
tszMemo.Replace(_T("\n"), _T("\r\n"));
setTString(hContact, "About", tszMemo);
}
}
- else if (!mir_tstrcmp(xmlGetName(n), _T("PHOTO")))
+ else if (!mir_tstrcmp(XmlGetName(n), _T("PHOTO")))
OnIqResultGetVcardPhoto(n, hContact, hasPhoto);
} }
@@ -1118,7 +1118,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*)
void CJabberProto::OnIqResultSetVcard(HXML iqNode, CJabberIqInfo*)
{
debugLogA("<iq/> iqIdSetVcard");
- if (xmlGetAttrValue(iqNode, _T("type")))
+ if (XmlGetAttrValue(iqNode, _T("type")))
WindowList_Broadcast(m_hWindowList, WM_JABBER_REFRESH_VCARD, 0, 0);
}
@@ -1129,38 +1129,38 @@ void CJabberProto::OnIqResultSetSearch(HXML iqNode, CJabberIqInfo*)
int id;
debugLogA("<iq/> iqIdGetSearch");
- if ((type = xmlGetAttrValue(iqNode, _T("type"))) == NULL) return;
+ if ((type = XmlGetAttrValue(iqNode, _T("type"))) == NULL) return;
if ((id = JabberGetPacketID(iqNode)) == -1) return;
if (!mir_tstrcmp(type, _T("result"))) {
- if ((queryNode = xmlGetChild(iqNode, "query")) == NULL)
+ if ((queryNode = XmlGetChild(iqNode, "query")) == NULL)
return;
PROTOSEARCHRESULT psr = { 0 };
psr.cbSize = sizeof(psr);
for (int i = 0;; i++) {
- HXML itemNode = xmlGetChild(queryNode, i);
+ HXML itemNode = XmlGetChild(queryNode, i);
if (!itemNode)
break;
- if (!mir_tstrcmp(xmlGetName(itemNode), _T("item"))) {
- if ((jid = xmlGetAttrValue(itemNode, _T("jid"))) != NULL) {
+ if (!mir_tstrcmp(XmlGetName(itemNode), _T("item"))) {
+ if ((jid = XmlGetAttrValue(itemNode, _T("jid"))) != NULL) {
psr.id.t = (TCHAR*)jid;
debugLog(_T("Result jid = %s"), jid);
- if ((n = xmlGetChild(itemNode, "nick")) != NULL && xmlGetText(n) != NULL)
- psr.nick.t = (TCHAR*)xmlGetText(n);
+ if ((n = XmlGetChild(itemNode, "nick")) != NULL && XmlGetText(n) != NULL)
+ psr.nick.t = (TCHAR*)XmlGetText(n);
else
psr.nick.t = _T("");
- if ((n = xmlGetChild(itemNode, "first")) != NULL && xmlGetText(n) != NULL)
- psr.firstName.t = (TCHAR*)xmlGetText(n);
+ if ((n = XmlGetChild(itemNode, "first")) != NULL && XmlGetText(n) != NULL)
+ psr.firstName.t = (TCHAR*)XmlGetText(n);
else
psr.firstName.t = _T("");
- if ((n = xmlGetChild(itemNode, "last")) != NULL && xmlGetText(n) != NULL)
- psr.lastName.t = (TCHAR*)xmlGetText(n);
+ if ((n = XmlGetChild(itemNode, "last")) != NULL && XmlGetText(n) != NULL)
+ psr.lastName.t = (TCHAR*)XmlGetText(n);
else
psr.lastName.t = _T("");
- if ((n = xmlGetChild(itemNode, "email")) != NULL && xmlGetText(n) != NULL)
- psr.email.t = (TCHAR*)xmlGetText(n);
+ if ((n = XmlGetChild(itemNode, "email")) != NULL && XmlGetText(n) != NULL)
+ psr.email.t = (TCHAR*)XmlGetText(n);
else
psr.email.t = _T("");
psr.flags = PSR_TCHAR;
@@ -1180,7 +1180,7 @@ void CJabberProto::OnIqResultExtSearch(HXML iqNode, CJabberIqInfo*)
HXML queryNode;
debugLogA("<iq/> iqIdGetExtSearch");
- const TCHAR *type = xmlGetAttrValue(iqNode, _T("type"));
+ const TCHAR *type = XmlGetAttrValue(iqNode, _T("type"));
if (type == NULL)
return;
@@ -1189,13 +1189,13 @@ void CJabberProto::OnIqResultExtSearch(HXML iqNode, CJabberIqInfo*)
return;
if (!mir_tstrcmp(type, _T("result"))) {
- if ((queryNode=xmlGetChild(iqNode , "query")) == NULL) return;
- if ((queryNode=xmlGetChild(queryNode , "x")) == NULL) return;
+ if ((queryNode=XmlGetChild(iqNode , "query")) == NULL) return;
+ if ((queryNode=XmlGetChild(queryNode , "x")) == NULL) return;
for (int i=0; ; i++) {
- HXML itemNode = xmlGetChild(queryNode ,i);
+ HXML itemNode = XmlGetChild(queryNode ,i);
if (!itemNode)
break;
- if (mir_tstrcmp(xmlGetName(itemNode), _T("item")))
+ if (mir_tstrcmp(XmlGetName(itemNode), _T("item")))
continue;
PROTOSEARCHRESULT psr = { 0 };
@@ -1203,35 +1203,35 @@ void CJabberProto::OnIqResultExtSearch(HXML iqNode, CJabberIqInfo*)
psr.flags = PSR_TCHAR;
for (int j=0; ; j++) {
- HXML fieldNode = xmlGetChild(itemNode ,j);
+ HXML fieldNode = XmlGetChild(itemNode ,j);
if (!fieldNode)
break;
- if (mir_tstrcmp(xmlGetName(fieldNode), _T("field")))
+ if (mir_tstrcmp(XmlGetName(fieldNode), _T("field")))
continue;
- const TCHAR *fieldName = xmlGetAttrValue(fieldNode, _T("var"));
+ const TCHAR *fieldName = XmlGetAttrValue(fieldNode, _T("var"));
if (fieldName == NULL)
continue;
- HXML n = xmlGetChild(fieldNode , "value");
+ HXML n = XmlGetChild(fieldNode , "value");
if (n == NULL)
continue;
if (!mir_tstrcmp(fieldName, _T("jid"))) {
- psr.id.t = (TCHAR*)xmlGetText(n);
+ psr.id.t = (TCHAR*)XmlGetText(n);
debugLog(_T("Result jid = %s"), psr.id.t);
}
else if (!mir_tstrcmp(fieldName, _T("nickname")))
- psr.nick.t = (xmlGetText(n) != NULL) ? (TCHAR*)xmlGetText(n) : _T("");
+ psr.nick.t = (XmlGetText(n) != NULL) ? (TCHAR*)XmlGetText(n) : _T("");
else if (!mir_tstrcmp(fieldName, _T("fn")))
- psr.firstName.t = (xmlGetText(n) != NULL) ? (TCHAR*)xmlGetText(n) : _T("");
+ psr.firstName.t = (XmlGetText(n) != NULL) ? (TCHAR*)XmlGetText(n) : _T("");
else if (!mir_tstrcmp(fieldName, _T("given")))
- psr.firstName.t = (xmlGetText(n) != NULL) ? (TCHAR*)xmlGetText(n) : _T("");
+ psr.firstName.t = (XmlGetText(n) != NULL) ? (TCHAR*)XmlGetText(n) : _T("");
else if (!mir_tstrcmp(fieldName, _T("family")))
- psr.lastName.t = (xmlGetText(n) != NULL) ? (TCHAR*)xmlGetText(n) : _T("");
+ psr.lastName.t = (XmlGetText(n) != NULL) ? (TCHAR*)XmlGetText(n) : _T("");
else if (!mir_tstrcmp(fieldName, _T("email")))
- psr.email.t = (xmlGetText(n) != NULL) ? (TCHAR*)xmlGetText(n) : _T("");
+ psr.email.t = (XmlGetText(n) != NULL) ? (TCHAR*)XmlGetText(n) : _T("");
}
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)id, (LPARAM)&psr);
@@ -1247,7 +1247,7 @@ void CJabberProto::OnIqResultSetPassword(HXML iqNode, CJabberIqInfo*)
{
debugLogA("<iq/> iqIdSetPassword");
- const TCHAR *type = xmlGetAttrValue(iqNode, _T("type"));
+ const TCHAR *type = XmlGetAttrValue(iqNode, _T("type"));
if (type == NULL)
return;
@@ -1263,7 +1263,7 @@ void CJabberProto::OnIqResultGetVCardAvatar(HXML iqNode, CJabberIqInfo*)
{
debugLogA("<iq/> OnIqResultGetVCardAvatar");
- const TCHAR *from = xmlGetAttrValue(iqNode, _T("from"));
+ const TCHAR *from = XmlGetAttrValue(iqNode, _T("from"));
if (from == NULL)
return;
@@ -1272,15 +1272,15 @@ void CJabberProto::OnIqResultGetVCardAvatar(HXML iqNode, CJabberIqInfo*)
return;
const TCHAR *type;
- if ((type = xmlGetAttrValue(iqNode, _T("type"))) == NULL) return;
+ if ((type = XmlGetAttrValue(iqNode, _T("type"))) == NULL) return;
if (mir_tstrcmp(type, _T("result"))) return;
- HXML vCard = xmlGetChild(iqNode , "vCard");
+ HXML vCard = XmlGetChild(iqNode , "vCard");
if (vCard == NULL) return;
- vCard = xmlGetChild(vCard , "PHOTO");
+ vCard = XmlGetChild(vCard , "PHOTO");
if (vCard == NULL) return;
- if (xmlGetChildCount(vCard) == 0) {
+ if (XmlGetChildCount(vCard) == 0) {
delSetting(hContact, "AvatarHash");
if ( ptrT( getTStringA(hContact, "AvatarSaved")) != NULL) {
delSetting(hContact, "AvatarSaved");
@@ -1289,8 +1289,8 @@ void CJabberProto::OnIqResultGetVCardAvatar(HXML iqNode, CJabberIqInfo*)
return;
}
- const TCHAR *mimeType = xmlGetText( xmlGetChild(vCard , "TYPE"));
- HXML n = xmlGetChild(vCard , "BINVAL");
+ const TCHAR *mimeType = XmlGetText( XmlGetChild(vCard , "TYPE"));
+ HXML n = XmlGetChild(vCard , "BINVAL");
if (n == NULL)
return;
@@ -1304,7 +1304,7 @@ void CJabberProto::OnIqResultGetClientAvatar(HXML iqNode, CJabberIqInfo*)
debugLogA("<iq/> iqIdResultGetClientAvatar");
- const TCHAR *from = xmlGetAttrValue(iqNode, _T("from"));
+ const TCHAR *from = XmlGetAttrValue(iqNode, _T("from"));
if (from == NULL)
return;
MCONTACT hContact = HContactFromJID(from);
@@ -1312,17 +1312,17 @@ void CJabberProto::OnIqResultGetClientAvatar(HXML iqNode, CJabberIqInfo*)
return;
HXML n = NULL;
- if ((type = xmlGetAttrValue(iqNode, _T("type"))) != NULL && !mir_tstrcmp(type, _T("result"))) {
- HXML queryNode = xmlGetChild(iqNode , "query");
+ if ((type = XmlGetAttrValue(iqNode, _T("type"))) != NULL && !mir_tstrcmp(type, _T("result"))) {
+ HXML queryNode = XmlGetChild(iqNode , "query");
if (queryNode != NULL) {
- const TCHAR *xmlns = xmlGetAttrValue(queryNode, _T("xmlns"));
+ const TCHAR *xmlns = XmlGetAttrValue(queryNode, _T("xmlns"));
if (!mir_tstrcmp(xmlns, JABBER_FEAT_AVATAR))
- n = xmlGetChild(queryNode , "data");
+ n = XmlGetChild(queryNode , "data");
}
}
if (n != NULL) {
- OnIqResultGotAvatar(hContact, n, xmlGetAttrValue(n, _T("mimetype")));
+ OnIqResultGotAvatar(hContact, n, XmlGetAttrValue(n, _T("mimetype")));
return;
}
@@ -1342,7 +1342,7 @@ void CJabberProto::OnIqResultGetServerAvatar(HXML iqNode, CJabberIqInfo*)
{
debugLogA("<iq/> iqIdResultGetServerAvatar");
- const TCHAR *from = xmlGetAttrValue(iqNode, _T("from"));
+ const TCHAR *from = XmlGetAttrValue(iqNode, _T("from"));
if (from == NULL)
return;
@@ -1351,18 +1351,18 @@ void CJabberProto::OnIqResultGetServerAvatar(HXML iqNode, CJabberIqInfo*)
return;
HXML n = NULL;
- const TCHAR *type = xmlGetAttrValue(iqNode, _T("type"));
+ const TCHAR *type = XmlGetAttrValue(iqNode, _T("type"));
if (!mir_tstrcmp(type, _T("result"))) {
- HXML queryNode = xmlGetChild(iqNode , "query");
+ HXML queryNode = XmlGetChild(iqNode , "query");
if (queryNode != NULL) {
- const TCHAR *xmlns = xmlGetAttrValue(queryNode, _T("xmlns"));
+ const TCHAR *xmlns = XmlGetAttrValue(queryNode, _T("xmlns"));
if (!mir_tstrcmp(xmlns, JABBER_FEAT_SERVER_AVATAR))
- n = xmlGetChild(queryNode, "data");
+ n = XmlGetChild(queryNode, "data");
}
}
if (n != NULL) {
- OnIqResultGotAvatar(hContact, n, xmlGetAttrValue(n, _T("mimetype")));
+ OnIqResultGotAvatar(hContact, n, XmlGetAttrValue(n, _T("mimetype")));
return;
}
@@ -1382,7 +1382,7 @@ void CJabberProto::OnIqResultGetServerAvatar(HXML iqNode, CJabberIqInfo*)
void CJabberProto::OnIqResultGotAvatar(MCONTACT hContact, HXML n, const TCHAR *mimeType)
{
unsigned resultLen;
- ptrA body((char*)mir_base64_decode( _T2A(xmlGetText(n)), &resultLen));
+ ptrA body((char*)mir_base64_decode( _T2A(XmlGetText(n)), &resultLen));
if (body == NULL)
return;
@@ -1443,7 +1443,7 @@ void CJabberProto::OnIqResultDiscoBookmarks(HXML iqNode, CJabberIqInfo*)
// RECVED: list of bookmarks
// ACTION: refresh bookmarks dialog
debugLogA("<iq/> iqIdGetBookmarks");
- const TCHAR *type = xmlGetAttrValue(iqNode, _T("type"));
+ const TCHAR *type = XmlGetAttrValue(iqNode, _T("type"));
if (type == NULL)
return;
@@ -1458,24 +1458,24 @@ void CJabberProto::OnIqResultDiscoBookmarks(HXML iqNode, CJabberIqInfo*)
ListRemoveList(LIST_BOOKMARK);
HXML itemNode;
- for (int i = 0; itemNode = xmlGetChild(storageNode, i); i++) {
- if (LPCTSTR name = xmlGetName(itemNode)) {
- if (!mir_tstrcmp(name, _T("conference")) && (jid = xmlGetAttrValue(itemNode, _T("jid")))) {
+ for (int i = 0; itemNode = XmlGetChild(storageNode, i); i++) {
+ if (LPCTSTR name = XmlGetName(itemNode)) {
+ if (!mir_tstrcmp(name, _T("conference")) && (jid = XmlGetAttrValue(itemNode, _T("jid")))) {
JABBER_LIST_ITEM *item = ListAdd(LIST_BOOKMARK, jid);
- item->name = mir_tstrdup(xmlGetAttrValue(itemNode, _T("name")));
+ item->name = mir_tstrdup(XmlGetAttrValue(itemNode, _T("name")));
item->type = mir_tstrdup(_T("conference"));
item->bUseResource = TRUE;
item->nick = mir_tstrdup(XPathT(itemNode, "nick"));
item->password = mir_tstrdup(XPathT(itemNode, "password"));
- const TCHAR *autoJ = xmlGetAttrValue(itemNode, _T("autojoin"));
+ const TCHAR *autoJ = XmlGetAttrValue(itemNode, _T("autojoin"));
if (autoJ != NULL)
item->bAutoJoin = (!mir_tstrcmp(autoJ, _T("true")) || !mir_tstrcmp(autoJ, _T("1"))) ? true : false;
}
- else if (!mir_tstrcmp(name, _T("url")) && (jid = xmlGetAttrValue(itemNode, _T("url")))) {
+ else if (!mir_tstrcmp(name, _T("url")) && (jid = XmlGetAttrValue(itemNode, _T("url")))) {
JABBER_LIST_ITEM *item = ListAdd(LIST_BOOKMARK, jid);
item->bUseResource = TRUE;
- item->name = mir_tstrdup(xmlGetAttrValue(itemNode, _T("name")));
+ item->name = mir_tstrdup(XmlGetAttrValue(itemNode, _T("name")));
item->type = mir_tstrdup(_T("url"));
}
}
@@ -1533,7 +1533,7 @@ void CJabberProto::OnIqResultSetBookmarks(HXML iqNode, CJabberIqInfo*)
debugLogA("<iq/> iqIdSetBookmarks");
- const TCHAR *type = xmlGetAttrValue(iqNode, _T("type"));
+ const TCHAR *type = XmlGetAttrValue(iqNode, _T("type"));
if (type == NULL)
return;
@@ -1541,7 +1541,7 @@ void CJabberProto::OnIqResultSetBookmarks(HXML iqNode, CJabberIqInfo*)
UI_SAFE_NOTIFY(m_pDlgBookmarks, WM_JABBER_REFRESH);
}
else if (!mir_tstrcmp(type, _T("error"))) {
- HXML errorNode = xmlGetChild(iqNode, "error");
+ HXML errorNode = XmlGetChild(iqNode, "error");
TCHAR *str = JabberErrorMsg(errorNode);
MessageBox(NULL, str, TranslateT("Jabber Bookmarks Error"), MB_OK | MB_SETFOREGROUND);
mir_free(str);
diff --git a/protocols/JabberG/src/jabber_iqid_muc.cpp b/protocols/JabberG/src/jabber_iqid_muc.cpp
index b66a55cf5b..cd982c3515 100644
--- a/protocols/JabberG/src/jabber_iqid_muc.cpp
+++ b/protocols/JabberG/src/jabber_iqid_muc.cpp
@@ -32,7 +32,7 @@ void CJabberProto::SetMucConfig(HXML node, void *from)
if (m_ThreadInfo && from) {
XmlNodeIq iq(_T("set"), SerialNext(), (TCHAR*)from);
HXML query = iq << XQUERY(JABBER_FEAT_MUC_OWNER);
- xmlAddChild(query, node);
+ XmlAddChild(query, node);
m_ThreadInfo->send(iq);
}
}
@@ -42,21 +42,21 @@ void CJabberProto::SetMucConfig(HXML node, void *from)
void CJabberProto::OnIqResultGetMuc(HXML iqNode, CJabberIqInfo*)
{
debugLogA("<iq/> iqIdGetMuc");
- LPCTSTR type = xmlGetAttrValue(iqNode, _T("type"));
+ LPCTSTR type = XmlGetAttrValue(iqNode, _T("type"));
if (type == NULL)
return;
- LPCTSTR from = xmlGetAttrValue(iqNode, _T("from"));
+ LPCTSTR from = XmlGetAttrValue(iqNode, _T("from"));
if (from == NULL)
return;
if (!mir_tstrcmp(type, _T("result"))) {
- HXML queryNode = xmlGetChild(iqNode , _T("query"));
+ HXML queryNode = XmlGetChild(iqNode , _T("query"));
if (queryNode != NULL) {
- LPCTSTR str = xmlGetAttrValue(queryNode, _T("xmlns"));
+ LPCTSTR str = XmlGetAttrValue(queryNode, _T("xmlns"));
if (!mir_tstrcmp(str, JABBER_FEAT_MUC_OWNER)) {
- HXML xNode = xmlGetChild(queryNode , _T("x"));
+ HXML xNode = XmlGetChild(queryNode , _T("x"));
if (xNode != NULL) {
- str = xmlGetAttrValue(xNode, _T("xmlns"));
+ str = XmlGetAttrValue(xNode, _T("xmlns"));
if (!mir_tstrcmp(str, JABBER_FEAT_DATA_FORMS))
//LaunchForm(xNode);
FormCreateDialog(xNode, _T("Jabber Conference Room Configuration"), &CJabberProto::SetMucConfig, mir_tstrdup(from));
@@ -99,30 +99,30 @@ static void sttFillJidList(HWND hwndDlg)
TCHAR tszItemText[ JABBER_MAX_JID_LEN + 256 ];
HXML iqNode = jidListInfo->iqNode;
if (iqNode != NULL) {
- LPCTSTR from = xmlGetAttrValue(iqNode, _T("from"));
+ LPCTSTR from = XmlGetAttrValue(iqNode, _T("from"));
if (from != NULL) {
- HXML queryNode = xmlGetChild(iqNode , _T("query"));
+ HXML queryNode = XmlGetChild(iqNode , _T("query"));
if (queryNode != NULL) {
lvi.mask = LVIF_TEXT | LVIF_PARAM;
lvi.iSubItem = 0;
lvi.iItem = 0;
for (int i=0; ; i++) {
- HXML itemNode = xmlGetChild(queryNode ,i);
+ HXML itemNode = XmlGetChild(queryNode ,i);
if (!itemNode)
break;
- LPCTSTR jid = xmlGetAttrValue(itemNode, _T("jid"));
+ LPCTSTR jid = XmlGetAttrValue(itemNode, _T("jid"));
if (jid != NULL) {
lvi.pszText = (TCHAR*)jid;
if (jidListInfo->type == MUC_BANLIST) {
- LPCTSTR reason = xmlGetText(xmlGetChild(itemNode , _T("reason")));
+ LPCTSTR reason = XmlGetText(XmlGetChild(itemNode , _T("reason")));
if (reason != NULL) {
mir_sntprintf(tszItemText, _countof(tszItemText), _T("%s (%s)") , jid, reason);
lvi.pszText = tszItemText;
}
}
else if (jidListInfo->type == MUC_VOICELIST || jidListInfo->type == MUC_MODERATORLIST) {
- LPCTSTR nick = xmlGetAttrValue(itemNode, _T("nick"));
+ LPCTSTR nick = XmlGetAttrValue(itemNode, _T("nick"));
if (nick != NULL) {
mir_sntprintf(tszItemText, _countof(tszItemText), _T("%s (%s)") , nick, jid);
lvi.pszText = tszItemText;
@@ -252,10 +252,10 @@ static INT_PTR CALLBACK JabberMucJidListDlgProc(HWND hwndDlg, UINT msg, WPARAM w
if ((dat=(JABBER_MUC_JIDLIST_INFO *) lParam) != NULL) {
HXML iqNode = dat->iqNode;
if (iqNode != NULL) {
- LPCTSTR from = xmlGetAttrValue(iqNode, _T("from"));
+ LPCTSTR from = XmlGetAttrValue(iqNode, _T("from"));
if (from != NULL) {
dat->roomJid = mir_tstrdup(from);
- HXML queryNode = xmlGetChild(iqNode , _T("query"));
+ HXML queryNode = XmlGetChild(iqNode , _T("query"));
if (queryNode != NULL) {
TCHAR *localFrom = mir_tstrdup(from);
mir_sntprintf(title, _countof(title), TranslateT("%s, %d items (%s)"),
@@ -265,7 +265,7 @@ static INT_PTR CALLBACK JabberMucJidListDlgProc(HWND hwndDlg, UINT msg, WPARAM w
(dat->type == MUC_BANLIST) ? TranslateT("Ban List") :
(dat->type == MUC_ADMINLIST) ? TranslateT("Admin List") :
(dat->type == MUC_OWNERLIST) ? TranslateT("Owner List") :
- TranslateT("JID List"), xmlGetChildCount(queryNode), localFrom);
+ TranslateT("JID List"), XmlGetChildCount(queryNode), localFrom);
mir_free(localFrom);
}
}
@@ -449,11 +449,11 @@ static void CALLBACK JabberMucJidListCreateDialogApcProc(void* param)
if (iqNode == NULL)
return;
- LPCTSTR from = xmlGetAttrValue(iqNode, _T("from"));
+ LPCTSTR from = XmlGetAttrValue(iqNode, _T("from"));
if (from == NULL)
return;
- HXML queryNode = xmlGetChild(iqNode , _T("query"));
+ HXML queryNode = XmlGetChild(iqNode , _T("query"));
if (queryNode == NULL)
return;
@@ -492,7 +492,7 @@ static void CALLBACK JabberMucJidListCreateDialogApcProc(void* param)
void CJabberProto::OnIqResultMucGetJidList(HXML iqNode, JABBER_MUC_JIDLIST_TYPE listType)
{
- LPCTSTR type = xmlGetAttrValue(iqNode, _T("type"));
+ LPCTSTR type = XmlGetAttrValue(iqNode, _T("type"));
if (type == NULL)
return;
@@ -502,7 +502,7 @@ void CJabberProto::OnIqResultMucGetJidList(HXML iqNode, JABBER_MUC_JIDLIST_TYPE
jidListInfo->type = listType;
jidListInfo->ppro = this;
jidListInfo->roomJid = NULL; // Set in the dialog procedure
- if ((jidListInfo->iqNode = xi.copyNode(iqNode)) != NULL)
+ if ((jidListInfo->iqNode = xmlCopyNode(iqNode)) != NULL)
CallFunctionAsync(JabberMucJidListCreateDialogApcProc, jidListInfo);
else
mir_free(jidListInfo);
@@ -550,7 +550,7 @@ void CJabberProto::OnIqResultMucGetOwnerList(HXML iqNode, CJabberIqInfo *)
JABBER_MUC_JIDLIST_INFO::~JABBER_MUC_JIDLIST_INFO()
{
- xi.destroyNode(iqNode);
+ xmlDestroyNode(iqNode);
mir_free(roomJid);
}
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp
index 727f31b3a4..bc8841eeee 100644
--- a/protocols/JabberG/src/jabber_menu.cpp
+++ b/protocols/JabberG/src/jabber_menu.cpp
@@ -556,9 +556,9 @@ INT_PTR __cdecl CJabberProto::OnMenuTransportLogin(WPARAM hContact, LPARAM)
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, ptrT(getTStringA(hContact, "jid")));
if (item != NULL) {
- XmlNode p(_T("presence")); xmlAddAttr(p, _T("to"), item->jid);
+ XmlNode p(_T("presence")); XmlAddAttr(p, _T("to"), item->jid);
if (item->getTemp()->m_iStatus == ID_STATUS_ONLINE)
- xmlAddAttr(p, _T("type"), _T("unavailable"));
+ XmlAddAttr(p, _T("type"), _T("unavailable"));
m_ThreadInfo->send(p);
}
return 0;
diff --git a/protocols/JabberG/src/jabber_message_handlers.cpp b/protocols/JabberG/src/jabber_message_handlers.cpp
index 77e900c76e..df87b2aade 100644
--- a/protocols/JabberG/src/jabber_message_handlers.cpp
+++ b/protocols/JabberG/src/jabber_message_handlers.cpp
@@ -42,9 +42,9 @@ BOOL CJabberProto::OnMessageError(HXML node, ThreadData*, CJabberMessageInfo* pI
}
else {
TCHAR buf[512];
- HXML bodyNode = xmlGetChild(node, "body");
+ HXML bodyNode = XmlGetChild(node, "body");
if (bodyNode)
- mir_sntprintf(buf, _T("%s:\n%s\n%s"), pInfo->GetFrom(), xmlGetText(bodyNode), szErrText);
+ mir_sntprintf(buf, _T("%s:\n%s\n%s"), pInfo->GetFrom(), XmlGetText(bodyNode), szErrText);
else
mir_sntprintf(buf, _T("%s:\n%s"), pInfo->GetFrom(), szErrText);
@@ -58,10 +58,10 @@ BOOL CJabberProto::OnMessageError(HXML node, ThreadData*, CJabberMessageInfo* pI
BOOL CJabberProto::OnMessageIbb(HXML, ThreadData*, CJabberMessageInfo* pInfo)
{
BOOL bOk = FALSE;
- const TCHAR *sid = xmlGetAttrValue(pInfo->GetChildNode(), _T("sid"));
- const TCHAR *seq = xmlGetAttrValue(pInfo->GetChildNode(), _T("seq"));
- if (sid && seq && xmlGetText(pInfo->GetChildNode()))
- bOk = OnIbbRecvdData(xmlGetText(pInfo->GetChildNode()), sid, seq);
+ const TCHAR *sid = XmlGetAttrValue(pInfo->GetChildNode(), _T("sid"));
+ const TCHAR *seq = XmlGetAttrValue(pInfo->GetChildNode(), _T("seq"));
+ if (sid && seq && XmlGetText(pInfo->GetChildNode()))
+ bOk = OnIbbRecvdData(XmlGetText(pInfo->GetChildNode()), sid, seq);
return TRUE;
}
@@ -82,7 +82,7 @@ BOOL CJabberProto::OnMessageGroupchat(HXML node, ThreadData*, CJabberMessageInfo
else {
// TCHAR *conference = NEWTSTR_ALLOCA(from);
// if (TCHAR *s = _tcschr(conference, _T('/'))) *s = 0;
-// XmlNode p("presence"); xmlAddAttr(p, "to", conference); xmlAddAttr(p, "type", "unavailable");
+// XmlNode p("presence"); XmlAddAttr(p, "to", conference); XmlAddAttr(p, "type", "unavailable");
// info->send(p);
}
return TRUE;
diff --git a/protocols/JabberG/src/jabber_message_manager.cpp b/protocols/JabberG/src/jabber_message_manager.cpp
index 4709b1dea1..cffaaaef41 100644
--- a/protocols/JabberG/src/jabber_message_manager.cpp
+++ b/protocols/JabberG/src/jabber_message_manager.cpp
@@ -57,7 +57,7 @@ bool CJabberMessageManager::HandleMessagePermanent(HXML node, ThreadData *pThrea
// have to get all data here, in the loop, because there's always possibility that previous handler modified it
CJabberMessageInfo messageInfo;
- LPCTSTR szType = xmlGetAttrValue(node, _T("type"));
+ LPCTSTR szType = XmlGetAttrValue(node, _T("type"));
if (szType) {
if (!mir_tstrcmpi(szType, _T("normal")))
messageInfo.m_nMessageType = JABBER_MESSAGE_TYPE_NORMAL;
@@ -75,12 +75,12 @@ bool CJabberMessageManager::HandleMessagePermanent(HXML node, ThreadData *pThrea
else messageInfo.m_nMessageType = JABBER_MESSAGE_TYPE_NORMAL;
if (pInfo.m_nMessageTypes & messageInfo.m_nMessageType) {
- for (int i = xmlGetChildCount(node) - 1; i >= 0; i--) {
+ for (int i = XmlGetChildCount(node) - 1; i >= 0; i--) {
// enumerate all children and see whether this node suits handler criteria
- HXML child = xmlGetChild(node, i);
+ HXML child = XmlGetChild(node, i);
- LPCTSTR szTagName = xmlGetName(child);
- LPCTSTR szXmlns = xmlGetAttrValue(child, _T("xmlns"));
+ LPCTSTR szTagName = XmlGetName(child);
+ LPCTSTR szXmlns = XmlGetAttrValue(child, _T("xmlns"));
if ((!pInfo.m_szXmlns || (szXmlns && !mir_tstrcmp(pInfo.m_szXmlns, szXmlns))) && (!pInfo.m_szTag || !mir_tstrcmp(pInfo.m_szTag, szTagName))) {
// node suits handler criteria, call the handler
@@ -88,13 +88,13 @@ bool CJabberMessageManager::HandleMessagePermanent(HXML node, ThreadData *pThrea
messageInfo.m_szChildTagName = szTagName;
messageInfo.m_szChildTagXmlns = szXmlns;
messageInfo.m_pUserData = pInfo.m_pUserData;
- messageInfo.m_szFrom = xmlGetAttrValue(node, _T("from")); // is necessary for ppro->debugLogA() below, that's why we must parse it even if JABBER_MESSAGE_PARSE_FROM flag is not set
+ messageInfo.m_szFrom = XmlGetAttrValue(node, _T("from")); // is necessary for ppro->debugLogA() below, that's why we must parse it even if JABBER_MESSAGE_PARSE_FROM flag is not set
if (pInfo.m_dwParamsToParse & JABBER_MESSAGE_PARSE_ID_STR)
- messageInfo.m_szId = xmlGetAttrValue(node, _T("id"));
+ messageInfo.m_szId = XmlGetAttrValue(node, _T("id"));
if (pInfo.m_dwParamsToParse & JABBER_IQ_PARSE_TO)
- messageInfo.m_szTo = xmlGetAttrValue(node, _T("to"));
+ messageInfo.m_szTo = XmlGetAttrValue(node, _T("to"));
if (pInfo.m_dwParamsToParse & JABBER_MESSAGE_PARSE_HCONTACT)
messageInfo.m_hContact = ppro->HContactFromJID(messageInfo.m_szFrom, 3);
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp
index e0961c2a9f..bf376b217d 100644
--- a/protocols/JabberG/src/jabber_misc.cpp
+++ b/protocols/JabberG/src/jabber_misc.cpp
@@ -506,10 +506,10 @@ CMString CJabberProto::ExtractImage(HXML node)
LPCTSTR src;
CMString link;
- if ((nHtml = xmlGetChild(node, "html")) != NULL &&
- (nBody = xmlGetChild(nHtml, "body")) != NULL &&
- (nImg = xmlGetChild(nBody, "img")) != NULL &&
- (src = xmlGetAttrValue(nImg, _T("src"))) != NULL) {
+ if ((nHtml = XmlGetChild(node, "html")) != NULL &&
+ (nBody = XmlGetChild(nHtml, "body")) != NULL &&
+ (nImg = XmlGetChild(nBody, "img")) != NULL &&
+ (src = XmlGetAttrValue(nImg, _T("src"))) != NULL) {
CMString strSrc(src);
if (strSrc.Left(11).Compare(L"data:image/") == 0) {
diff --git a/protocols/JabberG/src/jabber_notes.cpp b/protocols/JabberG/src/jabber_notes.cpp
index a6800722c8..5b35fe871b 100644
--- a/protocols/JabberG/src/jabber_notes.cpp
+++ b/protocols/JabberG/src/jabber_notes.cpp
@@ -137,10 +137,10 @@ void CNoteList::LoadXml(HXML hXml)
destroy();
m_bIsModified = false;
- int count = xmlGetChildCount(hXml);
+ int count = XmlGetChildCount(hXml);
for (int i=0; i < count; i++)
{
- CNoteItem *pNote = new CNoteItem(xi.getChild(hXml, i));
+ CNoteItem *pNote = new CNoteItem(xmlGetChild(hXml, i));
if (pNote->IsNotEmpty())
insert(pNote);
else
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp
index f521cdcbfe..88a03769e6 100644
--- a/protocols/JabberG/src/jabber_opt.cpp
+++ b/protocols/JabberG/src/jabber_opt.cpp
@@ -706,12 +706,12 @@ private:
m_cbServer.ResetContent();
if (node) {
for (int i=0; ; i++) {
- HXML n = xmlGetChild(node, i);
+ HXML n = XmlGetChild(node, i);
if (!n)
break;
- if (!mir_tstrcmp(xmlGetName(n), _T("item")))
- if (const TCHAR *jid = xmlGetAttrValue(n, _T("jid")))
+ if (!mir_tstrcmp(XmlGetName(n), _T("item")))
+ if (const TCHAR *jid = XmlGetAttrValue(n, _T("jid")))
if (m_cbServer.FindString(jid, -1, true) == CB_ERR)
m_cbServer.AddString(jid);
}
@@ -743,7 +743,7 @@ private:
TCHAR *buf = mir_a2t(result->pData);
XmlNode node(buf, NULL, NULL);
if (node) {
- HXML queryNode = xmlGetChild(node, _T("query"));
+ HXML queryNode = XmlGetChild(node, _T("query"));
SendMessage(hwnd, WM_JABBER_REFRESH, 0, (LPARAM)queryNode);
bIsError = false;
}
@@ -995,21 +995,21 @@ void CJabberProto::_RosterHandleGetRequest(HXML node, CJabberIqInfo*)
HWND hList = GetDlgItem(rrud.hwndDlg, IDC_ROSTER);
if (rrud.bRRAction == RRA_FILLLIST) {
_RosterListClear(rrud.hwndDlg);
- HXML query = xmlGetChild(node , "query");
+ HXML query = XmlGetChild(node , "query");
if (query == NULL) return;
int i = 1;
while (TRUE) {
- HXML item = xmlGetNthChild(query, _T("item"), i++);
+ HXML item = XmlGetNthChild(query, _T("item"), i++);
if (item == NULL)
break;
- const TCHAR *jid = xmlGetAttrValue(item, _T("jid"));
+ const TCHAR *jid = XmlGetAttrValue(item, _T("jid"));
if (jid == NULL)
continue;
- const TCHAR *name = xmlGetAttrValue(item, _T("name"));
- const TCHAR *subscription = xmlGetAttrValue(item, _T("subscription"));
- const TCHAR *group = xmlGetText( xmlGetChild(item, "group"));
+ const TCHAR *name = XmlGetAttrValue(item, _T("name"));
+ const TCHAR *subscription = XmlGetAttrValue(item, _T("subscription"));
+ const TCHAR *group = XmlGetText( XmlGetChild(item, "group"));
_RosterInsertListItem(hList, jid, name, group, subscription, TRUE);
}
@@ -1043,7 +1043,7 @@ void CJabberProto::_RosterHandleGetRequest(HXML node, CJabberIqInfo*)
if (rrud.bRRAction == RRA_SYNCROSTER) {
SetDlgItemText(rrud.hwndDlg, IDC_UPLOAD, TranslateT("Uploading..."));
- HXML queryRoster = xmlGetChild(node , "query");
+ HXML queryRoster = XmlGetChild(node , "query");
if (!queryRoster)
return;
@@ -1062,7 +1062,7 @@ void CJabberProto::_RosterHandleGetRequest(HXML node, CJabberIqInfo*)
ListView_GetItemText(hList, index, 1, name, _countof(name));
ListView_GetItemText(hList, index, 2, group, _countof(group));
ListView_GetItemText(hList, index, 3, subscr, _countof(subscr));
- HXML itemRoster = xmlGetChildByTag(queryRoster, "item", "jid", jid);
+ HXML itemRoster = XmlGetChildByTag(queryRoster, "item", "jid", jid);
BOOL bRemove = !ListView_GetCheckState(hList,index);
if (itemRoster && bRemove) {
//delete item
@@ -1072,16 +1072,16 @@ void CJabberProto::_RosterHandleGetRequest(HXML node, CJabberIqInfo*)
else if (!bRemove) {
BOOL bPushed = itemRoster ? TRUE : FALSE;
if (!bPushed) {
- const TCHAR *rosterName = xmlGetAttrValue(itemRoster, _T("name"));
+ const TCHAR *rosterName = XmlGetAttrValue(itemRoster, _T("name"));
if ((rosterName != NULL || name[0]!=0) && mir_tstrcmpi(rosterName,name))
bPushed=TRUE;
if (!bPushed) {
- rosterName = xmlGetAttrValue(itemRoster, _T("subscription"));
+ rosterName = XmlGetAttrValue(itemRoster, _T("subscription"));
if ((rosterName != NULL || subscr[0]!=0) && mir_tstrcmpi(rosterName,subscr))
bPushed=TRUE;
}
if (!bPushed) {
- const TCHAR *rosterGroup = xmlGetText( xmlGetChild(itemRoster, "group"));
+ const TCHAR *rosterGroup = XmlGetText( XmlGetChild(itemRoster, "group"));
if ((rosterGroup != NULL || group[0]!=0) && mir_tstrcmpi(rosterGroup,group))
bPushed=TRUE;
}
@@ -1231,9 +1231,9 @@ void CJabberProto::_RosterExportToFile(HWND hwndDlg)
char header[] = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<?mso-application progid=\"Excel.Sheet\"?>\n";
fwrite(header, 1, sizeof(header) - 1 /* for zero terminator */, fp);
- TCHAR *xtmp = xi.toString(root, NULL);
+ TCHAR *xtmp = xmlToString(root, NULL);
fputs(T2Utf(xtmp), fp);
- xi.freeMem(xtmp);
+ xmlFree(xtmp);
fclose(fp);
}
@@ -1275,17 +1275,17 @@ void CJabberProto::_RosterImportFromFile(HWND hwndDlg)
int nBytesProcessed = 0;
XmlNode node(newBuf, &nBytesProcessed, NULL);
if (node) {
- HXML Workbook = xmlGetChild(node, _T("Workbook"));
+ HXML Workbook = XmlGetChild(node, _T("Workbook"));
if (Workbook) {
- HXML Worksheet = xmlGetChild(Workbook , "Worksheet");
+ HXML Worksheet = XmlGetChild(Workbook , "Worksheet");
if (Worksheet) {
- HXML Table = xmlGetChild(Worksheet , "Table");
+ HXML Table = XmlGetChild(Worksheet , "Table");
if (Table) {
int index=1;
HWND hList=GetDlgItem(hwndDlg, IDC_ROSTER);
while (TRUE)
{
- HXML Row = xmlGetNthChild(Table, _T("Row"), index++);
+ HXML Row = XmlGetNthChild(Table, _T("Row"), index++);
if (!Row)
break;
@@ -1294,36 +1294,36 @@ void CJabberProto::_RosterImportFromFile(HWND hwndDlg)
const TCHAR *name=NULL;
const TCHAR *group=NULL;
const TCHAR *subscr=NULL;
- HXML Cell = xmlGetNthChild(Row, _T("Cell"), 1);
- HXML Data = (Cell) ? xmlGetChild(Cell , "Data") : XmlNode();
+ HXML Cell = XmlGetNthChild(Row, _T("Cell"), 1);
+ HXML Data = (Cell) ? XmlGetChild(Cell , "Data") : XmlNode();
if (Data)
{
- if (!mir_tstrcmpi(xmlGetText(Data),_T("+"))) bAdd=TRUE;
- else if (mir_tstrcmpi(xmlGetText(Data),_T("-"))) continue;
+ if (!mir_tstrcmpi(XmlGetText(Data),_T("+"))) bAdd=TRUE;
+ else if (mir_tstrcmpi(XmlGetText(Data),_T("-"))) continue;
- Cell = xmlGetNthChild(Row, _T("Cell"),2);
- if (Cell) Data=xmlGetChild(Cell , "Data");
+ Cell = XmlGetNthChild(Row, _T("Cell"),2);
+ if (Cell) Data=XmlGetChild(Cell , "Data");
else Data = NULL;
if (Data)
{
- jid=xmlGetText(Data);
+ jid=XmlGetText(Data);
if (!jid || mir_tstrlen(jid)==0) continue;
}
- Cell=xmlGetNthChild(Row,_T("Cell"),3);
- if (Cell) Data=xmlGetChild(Cell , "Data");
+ Cell=XmlGetNthChild(Row,_T("Cell"),3);
+ if (Cell) Data=XmlGetChild(Cell , "Data");
else Data = NULL;
- if (Data) name=xmlGetText(Data);
+ if (Data) name=XmlGetText(Data);
- Cell=xmlGetNthChild(Row,_T("Cell"),4);
- if (Cell) Data=xmlGetChild(Cell , "Data");
+ Cell=XmlGetNthChild(Row,_T("Cell"),4);
+ if (Cell) Data=XmlGetChild(Cell , "Data");
else Data = NULL;
- if (Data) group=xmlGetText(Data);
+ if (Data) group=XmlGetText(Data);
- Cell=xmlGetNthChild(Row,_T("Cell"),5);
- if (Cell) Data=xmlGetChild(Cell , "Data");
+ Cell=XmlGetNthChild(Row,_T("Cell"),5);
+ if (Cell) Data=XmlGetChild(Cell , "Data");
else Data = NULL;
- if (Data) subscr=xmlGetText(Data);
+ if (Data) subscr=XmlGetText(Data);
}
_RosterInsertListItem(hList,jid,name,group,subscr,bAdd);
} } } } }
@@ -2059,12 +2059,12 @@ void CJabberDlgAccMgrUI::RefreshServers(HXML node)
m_cbServer.ResetContent();
if (node) {
for (int i = 0;; i++) {
- HXML n = xmlGetChild(node, i);
+ HXML n = XmlGetChild(node, i);
if (!n)
break;
- if (!mir_tstrcmp(xmlGetName(n), _T("item")))
- if (const TCHAR *jid = xmlGetAttrValue(n, _T("jid")))
+ if (!mir_tstrcmp(XmlGetName(n), _T("item")))
+ if (const TCHAR *jid = XmlGetAttrValue(n, _T("jid")))
if (m_cbServer.FindString(jid, -1, true) == CB_ERR)
m_cbServer.AddString(jid);
}
@@ -2094,7 +2094,7 @@ void CJabberDlgAccMgrUI::QueryServerListThread(void *arg)
TCHAR *ptszText = mir_a2t(result->pData);
XmlNode node(ptszText, NULL, NULL);
if (node) {
- HXML queryNode = xmlGetChild(node, _T("query"));
+ HXML queryNode = XmlGetChild(node, _T("query"));
if (queryNode && IsWindow(hwnd)) {
SendMessage(hwnd, WM_JABBER_REFRESH, 0, (LPARAM)queryNode);
bIsError = false;
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp
index 2a8a556305..e7863ca056 100644
--- a/protocols/JabberG/src/jabber_privacy.cpp
+++ b/protocols/JabberG/src/jabber_privacy.cpp
@@ -73,20 +73,20 @@ void CJabberProto::OnIqResultPrivacyList(HXML iqNode, CJabberIqInfo*)
if (iqNode == NULL)
return;
- const TCHAR *type = xmlGetAttrValue(iqNode, _T("type"));
+ const TCHAR *type = XmlGetAttrValue(iqNode, _T("type"));
if (type == NULL)
return;
if ( mir_tstrcmp(type, _T("result")))
return;
- HXML query = xmlGetChild(iqNode , "query");
+ HXML query = XmlGetChild(iqNode , "query");
if (query == NULL)
return;
- HXML list = xmlGetChild(query, "list");
+ HXML list = XmlGetChild(query, "list");
if (list == NULL)
return;
- TCHAR *szListName = (TCHAR*)xmlGetAttrValue(list, _T("name"));
+ TCHAR *szListName = (TCHAR*)XmlGetAttrValue(list, _T("name"));
if (!szListName)
return;
@@ -100,8 +100,8 @@ void CJabberProto::OnIqResultPrivacyList(HXML iqNode, CJabberIqInfo*)
}
HXML item;
- for (int i = 1; (item = xmlGetNthChild(list, _T("item"), i)) != NULL; i++) {
- const TCHAR *itemType = xmlGetAttrValue(item, _T("type"));
+ for (int i = 1; (item = XmlGetNthChild(list, _T("item"), i)) != NULL; i++) {
+ const TCHAR *itemType = XmlGetAttrValue(item, _T("type"));
PrivacyListRuleType nItemType = Else;
if (itemType) {
if (!mir_tstrcmpi(itemType, _T("jid")))
@@ -112,26 +112,26 @@ void CJabberProto::OnIqResultPrivacyList(HXML iqNode, CJabberIqInfo*)
nItemType = Subscription;
}
- const TCHAR *itemValue = xmlGetAttrValue(item, _T("value"));
+ const TCHAR *itemValue = XmlGetAttrValue(item, _T("value"));
- const TCHAR *itemAction = xmlGetAttrValue(item, _T("action"));
+ const TCHAR *itemAction = XmlGetAttrValue(item, _T("action"));
BOOL bAllow = TRUE;
if (itemAction && !mir_tstrcmpi(itemAction, _T("deny")))
bAllow = FALSE;
- const TCHAR *itemOrder = xmlGetAttrValue(item, _T("order"));
+ const TCHAR *itemOrder = XmlGetAttrValue(item, _T("order"));
DWORD dwOrder = 0;
if (itemOrder)
dwOrder = _ttoi(itemOrder);
DWORD dwPackets = 0;
- if (xmlGetChild(item , "message"))
+ if (XmlGetChild(item , "message"))
dwPackets |= JABBER_PL_RULE_TYPE_MESSAGE;
- if (xmlGetChild(item , "presence-in"))
+ if (XmlGetChild(item , "presence-in"))
dwPackets |= JABBER_PL_RULE_TYPE_PRESENCE_IN;
- if (xmlGetChild(item , "presence-out"))
+ if (XmlGetChild(item , "presence-out"))
dwPackets |= JABBER_PL_RULE_TYPE_PRESENCE_OUT;
- if (xmlGetChild(item , "iq"))
+ if (XmlGetChild(item , "iq"))
dwPackets |= JABBER_PL_RULE_TYPE_IQ;
pList->AddRule(nItemType, itemValue, bAllow, dwOrder, dwPackets);
}
@@ -179,7 +179,7 @@ void CJabberProto::OnIqResultPrivacyListActive(HXML iqNode, CJabberIqInfo *pInfo
if (iqNode == NULL)
return;
- const TCHAR *type = xmlGetAttrValue(iqNode, _T("type"));
+ const TCHAR *type = XmlGetAttrValue(iqNode, _T("type"));
if (type == NULL)
return;
@@ -214,7 +214,7 @@ void CJabberProto::OnIqResultPrivacyListDefault(HXML iqNode, CJabberIqInfo *pInf
if (iqNode == NULL)
return;
- const TCHAR *type = xmlGetAttrValue(iqNode, _T("type"));
+ const TCHAR *type = XmlGetAttrValue(iqNode, _T("type"));
if (type == NULL)
return;
@@ -247,7 +247,7 @@ void CJabberProto::OnIqResultPrivacyLists(HXML iqNode, CJabberIqInfo *pInfo)
if (pInfo->m_nIqType != JABBER_IQ_TYPE_RESULT)
return;
- HXML query = xmlGetChild(iqNode, "query");
+ HXML query = XmlGetChild(iqNode, "query");
if (query == NULL)
return;
@@ -258,11 +258,11 @@ void CJabberProto::OnIqResultPrivacyLists(HXML iqNode, CJabberIqInfo *pInfo)
m_privacyListManager.RemoveAllLists();
for (int i = 1; ; i++) {
- HXML list = xmlGetNthChild(query, _T("list"), i);
+ HXML list = XmlGetNthChild(query, _T("list"), i);
if (list == NULL)
break;
- const TCHAR *listName = xmlGetAttrValue(list, _T("name"));
+ const TCHAR *listName = XmlGetAttrValue(list, _T("name"));
if (listName) {
m_privacyListManager.AddList((TCHAR*)listName);
@@ -275,15 +275,15 @@ void CJabberProto::OnIqResultPrivacyLists(HXML iqNode, CJabberIqInfo *pInfo)
}
const TCHAR *szName = NULL;
- HXML node = xmlGetChild(query , "active");
+ HXML node = XmlGetChild(query , "active");
if (node)
- szName = xmlGetAttrValue(node, _T("name"));
+ szName = XmlGetAttrValue(node, _T("name"));
m_privacyListManager.SetActiveListName(szName);
szName = NULL;
- node = xmlGetChild(query , "default");
+ node = XmlGetChild(query , "default");
if (node)
- szName = xmlGetAttrValue(node, _T("name"));
+ szName = XmlGetAttrValue(node, _T("name"));
m_privacyListManager.SetDefaultListName(szName);
}
UI_SAFE_NOTIFY(m_pDlgPrivacyLists, WM_JABBER_REFRESH);
@@ -1687,7 +1687,7 @@ void CJabberDlgPrivacyLists::btnSetDefault_OnClick(CCtrlButton *)
HXML query = iq << XQUERY(JABBER_FEAT_PRIVACY_LISTS);
HXML defaultTag = query << XCHILD(_T("default"));
if (pList)
- xmlAddAttr(defaultTag, _T("name"), pList->GetListName());
+ XmlAddAttr(defaultTag, _T("name"), pList->GetListName());
lck.unlock();
SetStatusText(TranslateT(JABBER_PL_BUSY_MSG));
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index 3ea5af5ddf..b314175b67 100644
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -981,7 +981,7 @@ int __cdecl CJabberProto::SendMsg(MCONTACT hContact, int, const char* pszSrc)
else
msgType = _T("chat");
- XmlNode m(_T("message")); xmlAddAttr(m, _T("type"), msgType);
+ XmlNode m(_T("message")); XmlAddAttr(m, _T("type"), msgType);
if (!isEncrypted)
m << XCHILD(_T("body"), msg);
else {
@@ -1013,17 +1013,17 @@ int __cdecl CJabberProto::SendMsg(MCONTACT hContact, int, const char* pszSrc)
!m_options.MsgAck || !getByte(hContact, "MsgAck", TRUE))
{
if (!mir_tstrcmp(msgType, _T("groupchat")))
- xmlAddAttr(m, _T("to"), szClientJid);
+ XmlAddAttr(m, _T("to"), szClientJid);
else {
id = SerialNext();
- xmlAddAttr(m, _T("to"), szClientJid); xmlAddAttrID(m, id);
+ XmlAddAttr(m, _T("to"), szClientJid); XmlAddAttrID(m, id);
}
m_ThreadInfo->send(m);
ForkThread(&CJabberProto::SendMessageAckThread, new TFakeAckParams(hContact, 0, id));
}
else {
- xmlAddAttr(m, _T("to"), szClientJid); xmlAddAttrID(m, id);
+ XmlAddAttr(m, _T("to"), szClientJid); XmlAddAttrID(m, id);
// message receipts XEP priority
if (jcb & JABBER_CAPS_MESSAGE_RECEIPTS)
@@ -1250,7 +1250,7 @@ int __cdecl CJabberProto::UserIsTyping(MCONTACT hContact, int type)
if (jcb & JABBER_RESOURCE_CAPS_ERROR)
jcb = JABBER_RESOURCE_CAPS_NONE;
- XmlNode m(_T("message")); xmlAddAttr(m, _T("to"), szClientJid);
+ XmlNode m(_T("message")); XmlAddAttr(m, _T("to"), szClientJid);
if (jcb & JABBER_CAPS_CHATSTATES) {
m << XATTR(_T("type"), _T("chat")) << XATTRID(SerialNext());
diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp
index 6e11c3c324..eb347895b9 100644
--- a/protocols/JabberG/src/jabber_rc.cpp
+++ b/protocols/JabberG/src/jabber_rc.cpp
@@ -58,7 +58,7 @@ BOOL CJabberProto::HandleAdhocCommandRequest(HXML iqNode, CJabberIqInfo *pInfo)
return TRUE;
}
- const TCHAR *szNode = xmlGetAttrValue(pInfo->GetChildNode(), _T("node"));
+ const TCHAR *szNode = XmlGetAttrValue(pInfo->GetChildNode(), _T("node"));
if (!szNode)
return TRUE;
@@ -154,7 +154,7 @@ BOOL CJabberAdhocManager::HandleCommandRequest(HXML iqNode, CJabberIqInfo *pInfo
return FALSE;
}
- const TCHAR *szSessionId = xmlGetAttrValue(commandNode, _T("sessionid"));
+ const TCHAR *szSessionId = XmlGetAttrValue(commandNode, _T("sessionid"));
CJabberAdhocSession* pSession = NULL;
if (szSessionId) {
@@ -333,15 +333,15 @@ int CJabberProto::AdhocSetStatusHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhoc
if (pSession->GetStage() == 1) {
// result form here
HXML commandNode = pInfo->GetChildNode();
- HXML xNode = xmlGetChildByTag(commandNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
+ HXML xNode = XmlGetChildByTag(commandNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
if (!xNode)
return JABBER_ADHOC_HANDLER_STATUS_CANCEL;
- HXML fieldNode = xmlGetChildByTag(xNode, "field", "var", _T("status")), valueNode;
+ HXML fieldNode = XmlGetChildByTag(xNode, "field", "var", _T("status")), valueNode;
if (!fieldNode)
return JABBER_ADHOC_HANDLER_STATUS_CANCEL;
- LPCTSTR ptszValue = xmlGetText( xmlGetChild(fieldNode , "value"));
+ LPCTSTR ptszValue = XmlGetText( XmlGetChild(fieldNode , "value"));
if (ptszValue == NULL)
return JABBER_ADHOC_HANDLER_STATUS_CANCEL;
@@ -358,18 +358,18 @@ int CJabberProto::AdhocSetStatusHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhoc
int priority = -9999;
- fieldNode = xmlGetChildByTag(xNode, "field", "var", _T("status-priority"));
- if (fieldNode && (valueNode = xmlGetChild(fieldNode , "value")))
- if (ptszValue = xmlGetText(valueNode))
+ fieldNode = XmlGetChildByTag(xNode, "field", "var", _T("status-priority"));
+ if (fieldNode && (valueNode = XmlGetChild(fieldNode , "value")))
+ if (ptszValue = XmlGetText(valueNode))
priority = _ttoi(ptszValue);
if (priority >= -128 && priority <= 127)
setWord("Priority", (WORD)priority);
const TCHAR *szStatusMessage = NULL;
- fieldNode = xmlGetChildByTag(xNode, "field", "var", _T("status-message"));
- if (fieldNode && (valueNode = xmlGetChild(fieldNode , "value")))
- szStatusMessage = xmlGetText(valueNode);
+ fieldNode = XmlGetChildByTag(xNode, "field", "var", _T("status-message"));
+ if (fieldNode && (valueNode = XmlGetChild(fieldNode , "value")))
+ szStatusMessage = XmlGetText(valueNode);
// skip f...ng away dialog
int nNoDlg = db_get_b(NULL, "SRAway", StatusModeToDbSetting(status, "NoDlg"), 0);
@@ -377,9 +377,9 @@ int CJabberProto::AdhocSetStatusHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhoc
db_set_ts(NULL, "SRAway", StatusModeToDbSetting(status, "Msg"), szStatusMessage ? szStatusMessage : _T(""));
- fieldNode = xmlGetChildByTag(xNode, "field", "var", _T("status-global"));
- if (fieldNode && (valueNode = xmlGetChild(fieldNode , "value"))) {
- if ((ptszValue = xmlGetText(valueNode)) != NULL && _ttoi(ptszValue))
+ fieldNode = XmlGetChildByTag(xNode, "field", "var", _T("status-global"));
+ if (fieldNode && (valueNode = XmlGetChild(fieldNode , "value"))) {
+ if ((ptszValue = XmlGetText(valueNode)) != NULL && _ttoi(ptszValue))
CallService(MS_CLIST_SETSTATUSMODE, status, NULL);
else
CallProtoService(m_szModuleName, PS_SETSTATUS, status, NULL);
@@ -434,26 +434,26 @@ int CJabberProto::AdhocOptionsHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe
if (pSession->GetStage() == 1) {
// result form here
HXML commandNode = pInfo->GetChildNode();
- HXML xNode = xmlGetChildByTag(commandNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
+ HXML xNode = XmlGetChildByTag(commandNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
if (!xNode)
return JABBER_ADHOC_HANDLER_STATUS_CANCEL;
// Automatically Accept File Transfers
- HXML fieldNode = xmlGetChildByTag(xNode, "field", "var", _T("auto-files")), valueNode;
- if (fieldNode && (valueNode = xmlGetChild(fieldNode , "value")))
- if (xmlGetText(valueNode))
- db_set_b(NULL, "SRFile", "AutoAccept", (BYTE)_ttoi(xmlGetText(valueNode)));
+ HXML fieldNode = XmlGetChildByTag(xNode, "field", "var", _T("auto-files")), valueNode;
+ if (fieldNode && (valueNode = XmlGetChild(fieldNode , "value")))
+ if (XmlGetText(valueNode))
+ db_set_b(NULL, "SRFile", "AutoAccept", (BYTE)_ttoi(XmlGetText(valueNode)));
// Use sounds
- fieldNode = xmlGetChildByTag(xNode, "field", "var", _T("sounds"));
- if (fieldNode && (valueNode = xmlGetChild(fieldNode , "value")))
- if (xmlGetText(valueNode))
- db_set_b(NULL, "Skin", "UseSound", (BYTE)_ttoi(xmlGetText(valueNode)));
+ fieldNode = XmlGetChildByTag(xNode, "field", "var", _T("sounds"));
+ if (fieldNode && (valueNode = XmlGetChild(fieldNode , "value")))
+ if (XmlGetText(valueNode))
+ db_set_b(NULL, "Skin", "UseSound", (BYTE)_ttoi(XmlGetText(valueNode)));
// Disable remote controlling
- fieldNode = xmlGetChildByTag(xNode, "field", "var", _T("enable-rc"));
- if (fieldNode && (valueNode = xmlGetChild(fieldNode , "value")))
- if (xmlGetText(valueNode) && _ttoi(xmlGetText(valueNode)))
+ fieldNode = XmlGetChildByTag(xNode, "field", "var", _T("enable-rc"));
+ if (fieldNode && (valueNode = XmlGetChild(fieldNode , "value")))
+ if (XmlGetText(valueNode) && _ttoi(XmlGetText(valueNode)))
m_options.EnableRemoteControl = 0;
return JABBER_ADHOC_HANDLER_STATUS_COMPLETED;
@@ -535,16 +535,16 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe
if (pSession->GetStage() == 1) {
// result form here
HXML commandNode = pInfo->GetChildNode();
- HXML xNode = xmlGetChildByTag(commandNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
+ HXML xNode = XmlGetChildByTag(commandNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
if (!xNode)
return JABBER_ADHOC_HANDLER_STATUS_CANCEL;
BOOL bRemoveCListEvents = TRUE;
// remove clist events
- HXML fieldNode = xmlGetChildByTag(xNode,"field", "var", _T("remove-clist-events")), valueNode;
- if (fieldNode && (valueNode = xmlGetChild(fieldNode , "value")))
- if (xmlGetText(valueNode) && !_ttoi(xmlGetText(valueNode)))
+ HXML fieldNode = XmlGetChildByTag(xNode,"field", "var", _T("remove-clist-events")), valueNode;
+ if (fieldNode && (valueNode = XmlGetChild(fieldNode , "value")))
+ if (XmlGetText(valueNode) && !_ttoi(XmlGetText(valueNode)))
bRemoveCListEvents = FALSE;
m_options.RcMarkMessagesAsRead = bRemoveCListEvents ? 1 : 0;
@@ -674,16 +674,16 @@ int CJabberProto::AdhocQuitMirandaHandler(HXML, CJabberIqInfo *pInfo, CJabberAdh
if (pSession->GetStage() == 1) {
// result form here
HXML commandNode = pInfo->GetChildNode();
- HXML xNode = xmlGetChildByTag(commandNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
+ HXML xNode = XmlGetChildByTag(commandNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
if (!xNode)
return JABBER_ADHOC_HANDLER_STATUS_CANCEL;
HXML fieldNode, valueNode;
// I Agree checkbox
- fieldNode = xmlGetChildByTag(xNode,"field", "var", _T("allow-shutdown"));
- if (fieldNode && (valueNode = xmlGetChild(fieldNode , "value")))
- if (xmlGetText(valueNode) && _ttoi(xmlGetText(valueNode)))
+ fieldNode = XmlGetChildByTag(xNode,"field", "var", _T("allow-shutdown"));
+ if (fieldNode && (valueNode = XmlGetChild(fieldNode , "value")))
+ if (XmlGetText(valueNode) && _ttoi(XmlGetText(valueNode)))
CallFunctionAsync(JabberQuitMirandaIMThread, 0);
return JABBER_ADHOC_HANDLER_STATUS_COMPLETED;
@@ -754,17 +754,17 @@ int CJabberProto::AdhocLeaveGroupchatsHandler(HXML, CJabberIqInfo *pInfo, CJabbe
if (pSession->GetStage() == 1) {
// result form here
HXML commandNode = pInfo->GetChildNode();
- HXML xNode = xmlGetChildByTag(commandNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
+ HXML xNode = XmlGetChildByTag(commandNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
if (!xNode)
return JABBER_ADHOC_HANDLER_STATUS_CANCEL;
// Groupchat list here:
- HXML fieldNode = xmlGetChildByTag(xNode,"field", "var", _T("groupchats"));
+ HXML fieldNode = XmlGetChildByTag(xNode,"field", "var", _T("groupchats"));
if (fieldNode) {
- for (i=0; i < xmlGetChildCount(fieldNode); i++) {
- HXML valueNode = xmlGetChild(fieldNode, i);
- if (valueNode && xmlGetName(valueNode) && xmlGetText(valueNode) && !mir_tstrcmp(xmlGetName(valueNode), _T("value"))) {
- JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_CHATROOM, xmlGetText(valueNode));
+ for (i=0; i < XmlGetChildCount(fieldNode); i++) {
+ HXML valueNode = XmlGetChild(fieldNode, i);
+ if (valueNode && XmlGetName(valueNode) && XmlGetText(valueNode) && !mir_tstrcmp(XmlGetName(valueNode), _T("value"))) {
+ JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_CHATROOM, XmlGetText(valueNode));
if (item)
GcQuit(item, 0, NULL);
}
diff --git a/protocols/JabberG/src/jabber_search.cpp b/protocols/JabberG/src/jabber_search.cpp
index 87fcc15b21..d05e00da66 100644
--- a/protocols/JabberG/src/jabber_search.cpp
+++ b/protocols/JabberG/src/jabber_search.cpp
@@ -137,38 +137,38 @@ void CJabberProto::OnIqResultGetSearchFields(HXML iqNode, CJabberIqInfo*)
if (!searchHandleDlg)
return;
- LPCTSTR type = xmlGetAttrValue(iqNode, _T("type"));
+ LPCTSTR type = XmlGetAttrValue(iqNode, _T("type"));
if (type == NULL)
return;
if (!mir_tstrcmp(type, _T("result"))) {
- HXML queryNode = xmlGetNthChild(iqNode, _T("query"), 1);
- HXML xNode = xmlGetChildByTag(queryNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
+ HXML queryNode = XmlGetNthChild(iqNode, _T("query"), 1);
+ HXML xNode = XmlGetChildByTag(queryNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
ShowWindow(searchHandleDlg, SW_HIDE);
if (xNode) {
//1. Form
- PostMessage(searchHandleDlg, WM_USER + 11, (WPARAM)xi.copyNode(xNode), 0);
- HXML xcNode = xmlGetNthChild(xNode, _T("instructions"), 1);
+ PostMessage(searchHandleDlg, WM_USER + 11, (WPARAM)xmlCopyNode(xNode), 0);
+ HXML xcNode = XmlGetNthChild(xNode, _T("instructions"), 1);
if (xcNode)
- SetDlgItemText(searchHandleDlg, IDC_INSTRUCTIONS, xmlGetText(xcNode));
+ SetDlgItemText(searchHandleDlg, IDC_INSTRUCTIONS, XmlGetText(xcNode));
}
else {
int Order = 0;
for (int i = 0;; i++) {
- HXML chNode = xmlGetChild(queryNode, i);
+ HXML chNode = XmlGetChild(queryNode, i);
if (!chNode)
break;
- if (!mir_tstrcmpi(xmlGetName(chNode), _T("instructions")) && xmlGetText(chNode))
- SetDlgItemText(searchHandleDlg, IDC_INSTRUCTIONS, TranslateTS(xmlGetText(chNode)));
- else if (xmlGetName(chNode)) {
+ if (!mir_tstrcmpi(XmlGetName(chNode), _T("instructions")) && XmlGetText(chNode))
+ SetDlgItemText(searchHandleDlg, IDC_INSTRUCTIONS, TranslateTS(XmlGetText(chNode)));
+ else if (XmlGetName(chNode)) {
Data *MyData = (Data*)malloc(sizeof(Data));
memset(MyData, 0, sizeof(Data));
- MyData->Label = mir_tstrdup(xmlGetName(chNode));
- MyData->Var = mir_tstrdup(xmlGetName(chNode));
- MyData->defValue = mir_tstrdup(xmlGetText(chNode));
+ MyData->Label = mir_tstrdup(XmlGetName(chNode));
+ MyData->Var = mir_tstrdup(XmlGetName(chNode));
+ MyData->defValue = mir_tstrdup(XmlGetText(chNode));
MyData->Order = Order;
if (MyData->defValue) MyData->bReadOnly = TRUE;
PostMessage(searchHandleDlg, WM_USER + 10, FALSE, (LPARAM)MyData);
@@ -177,7 +177,7 @@ void CJabberProto::OnIqResultGetSearchFields(HXML iqNode, CJabberIqInfo*)
}
}
- const TCHAR *szFrom = xmlGetAttrValue(iqNode, _T("from"));
+ const TCHAR *szFrom = XmlGetAttrValue(iqNode, _T("from"));
if (szFrom)
SearchAddToRecent(szFrom, searchHandleDlg);
PostMessage(searchHandleDlg, WM_USER + 10, 0, 0);
@@ -187,10 +187,10 @@ void CJabberProto::OnIqResultGetSearchFields(HXML iqNode, CJabberIqInfo*)
const TCHAR *code = NULL;
const TCHAR *description = NULL;
TCHAR buff[255];
- HXML errorNode = xmlGetChild(iqNode, "error");
+ HXML errorNode = XmlGetChild(iqNode, "error");
if (errorNode) {
- code = xmlGetAttrValue(errorNode, _T("code"));
- description = xmlGetText(errorNode);
+ code = XmlGetAttrValue(errorNode, _T("code"));
+ description = XmlGetText(errorNode);
}
mir_sntprintf(buff, TranslateT("Error %s %s\r\nPlease select other server"), code ? code : _T(""), description ? description : _T(""));
SetDlgItemText(searchHandleDlg, IDC_INSTRUCTIONS, buff);
@@ -307,23 +307,23 @@ void CJabberProto::OnIqResultAdvancedSearch(HXML iqNode, CJabberIqInfo*)
U_TCHAR_MAP mColumnsNames(10);
LIST<void> SearchResults(2);
- if (((id = JabberGetPacketID(iqNode)) == -1) || ((type = xmlGetAttrValue(iqNode, _T("type"))) == NULL)) {
+ if (((id = JabberGetPacketID(iqNode)) == -1) || ((type = XmlGetAttrValue(iqNode, _T("type"))) == NULL)) {
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
return;
}
if (!mir_tstrcmp(type, _T("result"))) {
- HXML queryNode = xmlGetNthChild(iqNode, _T("query"), 1);
- HXML xNode = xmlGetChildByTag(queryNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
+ HXML queryNode = XmlGetNthChild(iqNode, _T("query"), 1);
+ HXML xNode = XmlGetChildByTag(queryNode, "x", "xmlns", JABBER_FEAT_DATA_FORMS);
if (xNode) {
//1. Form search results info
- HXML reportNode = xmlGetNthChild(xNode, _T("reported"), 1);
+ HXML reportNode = XmlGetNthChild(xNode, _T("reported"), 1);
if (reportNode) {
int i = 1;
- while (HXML fieldNode = xmlGetNthChild(reportNode, _T("field"), i++)) {
- TCHAR *var = (TCHAR*)xmlGetAttrValue(fieldNode, _T("var"));
+ while (HXML fieldNode = XmlGetNthChild(reportNode, _T("field"), i++)) {
+ TCHAR *var = (TCHAR*)XmlGetAttrValue(fieldNode, _T("var"));
if (var) {
- TCHAR *Label = (TCHAR*)xmlGetAttrValue(fieldNode, _T("label"));
+ TCHAR *Label = (TCHAR*)XmlGetAttrValue(fieldNode, _T("label"));
mColumnsNames.insert(var, (Label != NULL) ? Label : var);
}
}
@@ -331,12 +331,12 @@ void CJabberProto::OnIqResultAdvancedSearch(HXML iqNode, CJabberIqInfo*)
int i = 1;
HXML itemNode;
- while (itemNode = xmlGetNthChild(xNode, _T("item"), i++)) {
+ while (itemNode = XmlGetNthChild(xNode, _T("item"), i++)) {
U_TCHAR_MAP *pUserColumn = new U_TCHAR_MAP(10);
int j = 1;
- while (HXML fieldNode = xmlGetNthChild(itemNode, _T("field"), j++)) {
- if (TCHAR* var = (TCHAR*)xmlGetAttrValue(fieldNode, _T("var"))) {
- if (TCHAR* Text = (TCHAR*)xmlGetText(xmlGetChild(fieldNode, _T("value")))) {
+ while (HXML fieldNode = XmlGetNthChild(itemNode, _T("field"), j++)) {
+ if (TCHAR* var = (TCHAR*)XmlGetAttrValue(fieldNode, _T("var"))) {
+ if (TCHAR* Text = (TCHAR*)XmlGetText(XmlGetChild(fieldNode, _T("value")))) {
if (!mColumnsNames[var])
mColumnsNames.insert(var, var);
pUserColumn->insert(var, Text);
@@ -350,23 +350,23 @@ void CJabberProto::OnIqResultAdvancedSearch(HXML iqNode, CJabberIqInfo*)
else {
//2. Field list search results info
int i = 1;
- while (HXML itemNode = xmlGetNthChild(queryNode, _T("item"), i++)) {
+ while (HXML itemNode = XmlGetNthChild(queryNode, _T("item"), i++)) {
U_TCHAR_MAP *pUserColumn = new U_TCHAR_MAP(10);
- TCHAR *jid = (TCHAR*)xmlGetAttrValue(itemNode, _T("jid"));
+ TCHAR *jid = (TCHAR*)XmlGetAttrValue(itemNode, _T("jid"));
TCHAR *keyReturned;
mColumnsNames.insertCopyKey(_T("jid"), _T("jid"), &keyReturned, CopyKey, DestroyKey);
mColumnsNames.insert(_T("jid"), keyReturned);
pUserColumn->insertCopyKey(_T("jid"), jid, NULL, CopyKey, DestroyKey);
for (int j = 0;; j++) {
- HXML child = xmlGetChild(itemNode, j);
+ HXML child = XmlGetChild(itemNode, j);
if (!child)
break;
- const TCHAR *szColumnName = xmlGetName(child);
+ const TCHAR *szColumnName = XmlGetName(child);
if (szColumnName) {
- LPCTSTR ptszChild = xmlGetText(child);
+ LPCTSTR ptszChild = XmlGetText(child);
if (ptszChild && *ptszChild) {
mColumnsNames.insertCopyKey((TCHAR*)szColumnName, _T(""), &keyReturned, CopyKey, DestroyKey);
mColumnsNames.insert((TCHAR*)szColumnName, keyReturned);
@@ -383,10 +383,10 @@ void CJabberProto::OnIqResultAdvancedSearch(HXML iqNode, CJabberIqInfo*)
const TCHAR *code = NULL;
const TCHAR *description = NULL;
TCHAR buff[255];
- HXML errorNode = xmlGetChild(iqNode, "error");
+ HXML errorNode = XmlGetChild(iqNode, "error");
if (errorNode) {
- code = xmlGetAttrValue(errorNode, _T("code"));
- description = xmlGetText(errorNode);
+ code = XmlGetAttrValue(errorNode, _T("code"));
+ description = XmlGetText(errorNode);
}
mir_sntprintf(buff, TranslateT("Error %s %s\r\nTry to specify more detailed"), code ? code : _T(""), description ? description : _T(""));
@@ -432,7 +432,7 @@ static void JabberSearchFreeData(HWND hwndDlg, JabberSearchData * dat)
else EnumChildWindows(GetDlgItem(hwndDlg, IDC_FRAME), DeleteChildWindowsProc, 0);
if (dat->xNode)
- xi.destroyNode(dat->xNode);
+ xmlDestroyNode(dat->xNode);
SendDlgItemMessage(hwndDlg, IDC_FRAME, WM_SETFONT, (WPARAM)SendMessage(hwndDlg, WM_GETFONT, 0, 0), 0);
dat->nJSInfCount = 0;
@@ -758,15 +758,15 @@ HWND __cdecl CJabberProto::SearchAdvanced(HWND hwndDlg)
if (dat->fSearchRequestIsXForm) {
fRequestNotEmpty = TRUE;
HXML n = JabberFormGetData(GetDlgItem(hwndDlg, IDC_FRAME), dat->xNode);
- xmlAddChild(query, n);
- xi.destroyNode(n);
+ XmlAddChild(query, n);
+ xmlDestroyNode(n);
}
else { //and Simple fields: XEP-0055 Example 3
for (int i = 0; i < dat->nJSInfCount; i++) {
TCHAR szFieldValue[100];
GetWindowText(dat->pJSInf[i].hwndValueItem, szFieldValue, _countof(szFieldValue));
if (szFieldValue[0] != 0) {
- xmlAddChild(query, dat->pJSInf[i].szFieldName, szFieldValue);
+ XmlAddChild(query, dat->pJSInf[i].szFieldName, szFieldValue);
fRequestNotEmpty = TRUE;
}
}
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index f22f0299ed..e02a190684 100644
--- a/protocols/JabberG/src/jabber_thread.cpp
+++ b/protocols/JabberG/src/jabber_thread.cpp
@@ -193,18 +193,18 @@ void CJabberProto::xmlStreamInitializeNow(ThreadData *info)
m_szXmlStreamToBeInitialized = NULL;
}
- HXML n = xi.createNode(_T("xml"), NULL, 1) << XATTR(_T("version"), _T("1.0")) << XATTR(_T("encoding"), _T("UTF-8"));
+ HXML n = xmlCreateNode(_T("xml"), NULL, 1) << XATTR(_T("version"), _T("1.0")) << XATTR(_T("encoding"), _T("UTF-8"));
HXML stream = n << XCHILDNS(_T("stream:stream"), _T("jabber:client")) << XATTR(_T("to"), _A2T(info->conn.server))
<< XATTR(_T("xmlns:stream"), _T("http://etherx.jabber.org/streams"));
if (m_tszSelectedLang)
- xmlAddAttr(stream, _T("xml:lang"), m_tszSelectedLang);
+ XmlAddAttr(stream, _T("xml:lang"), m_tszSelectedLang);
if (!m_options.Disable3920auth)
- xmlAddAttr(stream, _T("version"), _T("1.0"));
+ XmlAddAttr(stream, _T("version"), _T("1.0"));
- LPTSTR xmlQuery = xi.toString(n, NULL);
+ LPTSTR xmlQuery = xmlToString(n, NULL);
T2Utf buf(xmlQuery);
int bufLen = (int)mir_strlen(buf);
if (bufLen > 2) {
@@ -213,8 +213,8 @@ void CJabberProto::xmlStreamInitializeNow(ThreadData *info)
}
info->send(buf, bufLen);
- xi.freeMem(xmlQuery);
- xi.destroyNode(n);
+ xmlFree(xmlQuery);
+ xmlDestroyNode(n);
}
void CJabberProto::ServerThread(JABBER_CONN_DATA *param)
@@ -461,9 +461,9 @@ recvRest:
debugLogA("bytesParsed = %d", bytesParsed);
if (root) tag = NULL;
- if (xmlGetName(root) == NULL) {
+ if (XmlGetName(root) == NULL) {
for (int i = 0;; i++) {
- HXML n = xmlGetChild(root, i);
+ HXML n = XmlGetChild(root, i);
if (!n)
break;
OnProcessProtocol(n, &info);
@@ -566,17 +566,17 @@ void CJabberProto::PerformIqAuth(ThreadData *info)
void CJabberProto::OnProcessStreamOpening(HXML node, ThreadData *info)
{
- if (mir_tstrcmp(xmlGetName(node), _T("stream:stream")))
+ if (mir_tstrcmp(XmlGetName(node), _T("stream:stream")))
return;
if (!info->bIsReg) {
- const TCHAR *sid = xmlGetAttrValue(node, _T("id"));
+ const TCHAR *sid = XmlGetAttrValue(node, _T("id"));
if (sid != NULL)
info->szStreamId = mir_t2a(sid);
}
// old server - disable SASL then
- if (xmlGetAttrValue(node, _T("version")) == NULL)
+ if (XmlGetAttrValue(node, _T("version")) == NULL)
info->proto->m_options.Disable3920auth = TRUE;
if (info->proto->m_options.Disable3920auth)
@@ -675,33 +675,33 @@ void CJabberProto::OnProcessFeatures(HXML node, ThreadData *info)
bool areMechanismsDefined = false;
for (int i = 0;; i++) {
- HXML n = xmlGetChild(node, i);
+ HXML n = XmlGetChild(node, i);
if (!n)
break;
- if (!mir_tstrcmp(xmlGetName(n), _T("starttls"))) {
+ if (!mir_tstrcmp(XmlGetName(n), _T("starttls"))) {
if (!info->conn.useSSL && m_options.UseTLS) {
debugLogA("Requesting TLS");
- info->send(XmlNode(xmlGetName(n)) << XATTR(_T("xmlns"), _T("urn:ietf:params:xml:ns:xmpp-tls")));
+ info->send(XmlNode(XmlGetName(n)) << XATTR(_T("xmlns"), _T("urn:ietf:params:xml:ns:xmpp-tls")));
return;
} }
- if (!mir_tstrcmp(xmlGetName(n), _T("compression")) && m_options.EnableZlib == TRUE) {
+ if (!mir_tstrcmp(XmlGetName(n), _T("compression")) && m_options.EnableZlib == TRUE) {
debugLogA("Server compression available");
for (int k = 0;; k++) {
- HXML c = xmlGetChild(n, k);
+ HXML c = XmlGetChild(n, k);
if (!c)
break;
- if (!mir_tstrcmp(xmlGetName(c), _T("method"))) {
- if (!mir_tstrcmp(xmlGetText(c), _T("zlib")) && info->zlibInit() == TRUE) {
+ if (!mir_tstrcmp(XmlGetName(c), _T("method"))) {
+ if (!mir_tstrcmp(XmlGetText(c), _T("zlib")) && info->zlibInit() == TRUE) {
debugLogA("Requesting Zlib compression");
info->send(XmlNode(_T("compress")) << XATTR(_T("xmlns"), _T("http://jabber.org/protocol/compress"))
<< XCHILD(_T("method"), _T("zlib")));
return;
} } } }
- if (!mir_tstrcmp(xmlGetName(n), _T("mechanisms"))) {
+ if (!mir_tstrcmp(XmlGetName(n), _T("mechanisms"))) {
m_AuthMechs.isPlainAvailable = false;
m_AuthMechs.isPlainOldAvailable = false;
m_AuthMechs.isMd5Available = false;
@@ -714,12 +714,12 @@ void CJabberProto::OnProcessFeatures(HXML node, ThreadData *info)
areMechanismsDefined = true;
//JabberLog("%d mechanisms\n",n->numChild);
for (int k = 0;; k++) {
- HXML c = xmlGetChild(n, k);
+ HXML c = XmlGetChild(n, k);
if (!c)
break;
- if (!mir_tstrcmp(xmlGetName(c), _T("mechanism"))) {
- LPCTSTR ptszMechanism = xmlGetText(c);
+ if (!mir_tstrcmp(XmlGetName(c), _T("mechanism"))) {
+ LPCTSTR ptszMechanism = XmlGetText(c);
if (!mir_tstrcmp(ptszMechanism, _T("PLAIN"))) m_AuthMechs.isPlainOldAvailable = m_AuthMechs.isPlainAvailable = true;
else if (!mir_tstrcmp(ptszMechanism, _T("DIGEST-MD5"))) m_AuthMechs.isMd5Available = true;
else if (!mir_tstrcmp(ptszMechanism, _T("SCRAM-SHA-1"))) m_AuthMechs.isScramAvailable = true;
@@ -727,17 +727,17 @@ void CJabberProto::OnProcessFeatures(HXML node, ThreadData *info)
else if (!mir_tstrcmp(ptszMechanism, _T("GSS-SPNEGO"))) m_AuthMechs.isSpnegoAvailable = true;
else if (!mir_tstrcmp(ptszMechanism, _T("GSSAPI"))) m_AuthMechs.isKerberosAvailable = true;
}
- else if (!mir_tstrcmp(xmlGetName(c), _T("hostname"))) {
- const TCHAR *mech = xmlGetAttrValue(c, _T("mechanism"));
+ else if (!mir_tstrcmp(XmlGetName(c), _T("hostname"))) {
+ const TCHAR *mech = XmlGetAttrValue(c, _T("mechanism"));
if (mech && mir_tstrcmpi(mech, _T("GSSAPI")) == 0) {
- m_AuthMechs.m_gssapiHostName = mir_tstrdup(xmlGetText(c));
+ m_AuthMechs.m_gssapiHostName = mir_tstrdup(XmlGetText(c));
}
}
}
}
- else if (!mir_tstrcmp(xmlGetName(n), _T("register"))) isRegisterAvailable = true;
- else if (!mir_tstrcmp(xmlGetName(n), _T("auth"))) m_AuthMechs.isAuthAvailable = true;
- else if (!mir_tstrcmp(xmlGetName(n), _T("session"))) m_AuthMechs.isSessionAvailable = true;
+ else if (!mir_tstrcmp(XmlGetName(n), _T("register"))) isRegisterAvailable = true;
+ else if (!mir_tstrcmp(XmlGetName(n), _T("auth"))) m_AuthMechs.isAuthAvailable = true;
+ else if (!mir_tstrcmp(XmlGetName(n), _T("session"))) m_AuthMechs.isSessionAvailable = true;
}
if (areMechanismsDefined) {
@@ -769,7 +769,7 @@ void CJabberProto::OnProcessFailure(HXML node, ThreadData *info)
{
const TCHAR *type;
//failure xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\"
- if ((type = xmlGetAttrValue(node, _T("xmlns"))) == NULL) return;
+ if ((type = XmlGetAttrValue(node, _T("xmlns"))) == NULL) return;
if (!mir_tstrcmp(type, _T("urn:ietf:params:xml:ns:xmpp-sasl"))) {
PerformAuthentication(info);
}
@@ -783,18 +783,18 @@ void CJabberProto::OnProcessError(HXML node, ThreadData *info)
bool skipMsg = false;
//failure xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\"
- if (!xmlGetChild(node, 0))
+ if (!XmlGetChild(node, 0))
return;
buff = (TCHAR *)mir_alloc(1024 * sizeof(TCHAR));
pos = 0;
for (i = 0;; i++) {
- HXML n = xmlGetChild(node, i);
+ HXML n = XmlGetChild(node, i);
if (!n)
break;
- const TCHAR *name = xmlGetName(n);
- const TCHAR *desc = xmlGetText(n);
+ const TCHAR *name = XmlGetName(n);
+ const TCHAR *desc = XmlGetText(n);
if (desc)
pos += mir_sntprintf(buff + pos, 1024 - pos, _T("%s: %s\r\n"), name, desc);
else
@@ -817,11 +817,11 @@ void CJabberProto::OnProcessSuccess(HXML node, ThreadData *info)
// int iqId;
// RECVED: <success ...
// ACTION: if successfully logged in, continue by requesting roster list and set my initial status
- if ((type = xmlGetAttrValue(node, _T("xmlns"))) == NULL)
+ if ((type = XmlGetAttrValue(node, _T("xmlns"))) == NULL)
return;
if (!mir_tstrcmp(type, _T("urn:ietf:params:xml:ns:xmpp-sasl"))) {
- if (!info->auth->validateLogin(xmlGetText(node))) {
+ if (!info->auth->validateLogin(XmlGetText(node))) {
info->send("</stream:stream>");
return;
}
@@ -843,10 +843,10 @@ void CJabberProto::OnProcessChallenge(HXML node, ThreadData *info)
return;
}
- if (mir_tstrcmp(xmlGetAttrValue(node, _T("xmlns")), _T("urn:ietf:params:xml:ns:xmpp-sasl")))
+ if (mir_tstrcmp(XmlGetAttrValue(node, _T("xmlns")), _T("urn:ietf:params:xml:ns:xmpp-sasl")))
return;
- char* challenge = info->auth->getChallenge(xmlGetText(node));
+ char* challenge = info->auth->getChallenge(XmlGetText(node));
info->send(XmlNode(_T("response"), _A2T(challenge)) << XATTR(_T("xmlns"), _T("urn:ietf:params:xml:ns:xmpp-sasl")));
mir_free(challenge);
}
@@ -855,34 +855,34 @@ void CJabberProto::OnProcessProtocol(HXML node, ThreadData *info)
{
OnConsoleProcessXml(node, JCPF_IN);
- if (!mir_tstrcmp(xmlGetName(node), _T("proceed")))
+ if (!mir_tstrcmp(XmlGetName(node), _T("proceed")))
OnProcessProceed(node, info);
- else if (!mir_tstrcmp(xmlGetName(node), _T("compressed")))
+ else if (!mir_tstrcmp(XmlGetName(node), _T("compressed")))
OnProcessCompressed(node, info);
- else if (!mir_tstrcmp(xmlGetName(node), _T("stream:features")))
+ else if (!mir_tstrcmp(XmlGetName(node), _T("stream:features")))
OnProcessFeatures(node, info);
- else if (!mir_tstrcmp(xmlGetName(node), _T("stream:stream")))
+ else if (!mir_tstrcmp(XmlGetName(node), _T("stream:stream")))
OnProcessStreamOpening(node, info);
- else if (!mir_tstrcmp(xmlGetName(node), _T("success")))
+ else if (!mir_tstrcmp(XmlGetName(node), _T("success")))
OnProcessSuccess(node, info);
- else if (!mir_tstrcmp(xmlGetName(node), _T("failure")))
+ else if (!mir_tstrcmp(XmlGetName(node), _T("failure")))
OnProcessFailure(node, info);
- else if (!mir_tstrcmp(xmlGetName(node), _T("stream:error")))
+ else if (!mir_tstrcmp(XmlGetName(node), _T("stream:error")))
OnProcessError(node, info);
- else if (!mir_tstrcmp(xmlGetName(node), _T("challenge")))
+ else if (!mir_tstrcmp(XmlGetName(node), _T("challenge")))
OnProcessChallenge(node, info);
else if (!info->bIsReg) {
- if (!mir_tstrcmp(xmlGetName(node), _T("message")))
+ if (!mir_tstrcmp(XmlGetName(node), _T("message")))
OnProcessMessage(node, info);
- else if (!mir_tstrcmp(xmlGetName(node), _T("presence")))
+ else if (!mir_tstrcmp(XmlGetName(node), _T("presence")))
OnProcessPresence(node, info);
- else if (!mir_tstrcmp(xmlGetName(node), _T("iq")))
+ else if (!mir_tstrcmp(XmlGetName(node), _T("iq")))
OnProcessIq(node);
else
debugLogA("Invalid top-level tag (only <message/> <presence/> and <iq/> allowed)");
}
else {
- if (!mir_tstrcmp(xmlGetName(node), _T("iq")))
+ if (!mir_tstrcmp(XmlGetName(node), _T("iq")))
OnProcessRegIq(node, info);
else
debugLogA("Invalid top-level tag (only <iq/> allowed)");
@@ -892,7 +892,7 @@ void CJabberProto::OnProcessProtocol(HXML node, ThreadData *info)
void CJabberProto::OnProcessProceed(HXML node, ThreadData *info)
{
const TCHAR *type;
- if ((type = xmlGetAttrValue(node, _T("xmlns"))) != NULL && !mir_tstrcmp(type, _T("error")))
+ if ((type = XmlGetAttrValue(node, _T("xmlns"))) != NULL && !mir_tstrcmp(type, _T("error")))
return;
if (!mir_tstrcmp(type, _T("urn:ietf:params:xml:ns:xmpp-tls"))) {
@@ -919,7 +919,7 @@ void CJabberProto::OnProcessCompressed(HXML node, ThreadData *info)
{
debugLogA("Compression confirmed");
- const TCHAR *type = xmlGetAttrValue(node, _T("xmlns"));
+ const TCHAR *type = XmlGetAttrValue(node, _T("xmlns"));
if (type != NULL && !mir_tstrcmp(type, _T("error")))
return;
if (mir_tstrcmp(type, _T("http://jabber.org/protocol/compress")))
@@ -935,11 +935,11 @@ void CJabberProto::OnProcessCompressed(HXML node, ThreadData *info)
void CJabberProto::OnProcessPubsubEvent(HXML node)
{
- const TCHAR *from = xmlGetAttrValue(node, _T("from"));
+ const TCHAR *from = XmlGetAttrValue(node, _T("from"));
if (!from)
return;
- HXML eventNode = xmlGetChildByTag(node, "event", "xmlns", JABBER_FEAT_PUBSUB_EVENT);
+ HXML eventNode = XmlGetChildByTag(node, "event", "xmlns", JABBER_FEAT_PUBSUB_EVENT);
if (!eventNode)
return;
@@ -950,9 +950,9 @@ void CJabberProto::OnProcessPubsubEvent(HXML node)
return;
HXML itemsNode;
- if (m_options.EnableUserTune && (itemsNode = xmlGetChildByTag(eventNode, "items", "node", JABBER_FEAT_USER_TUNE))) {
+ if (m_options.EnableUserTune && (itemsNode = XmlGetChildByTag(eventNode, "items", "node", JABBER_FEAT_USER_TUNE))) {
// node retract?
- if (xmlGetChild(itemsNode, "retract")) {
+ if (XmlGetChild(itemsNode, "retract")) {
SetContactTune(hContact, NULL, NULL, NULL, NULL, NULL);
return;
}
@@ -1024,18 +1024,18 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
{
HXML xNode, n;
- if (!xmlGetName(node) || mir_tstrcmp(xmlGetName(node), _T("message")))
+ if (!XmlGetName(node) || mir_tstrcmp(XmlGetName(node), _T("message")))
return;
- LPCTSTR from, type = xmlGetAttrValue(node, _T("type"));
- if ((from = xmlGetAttrValue(node, _T("from"))) == NULL)
+ LPCTSTR from, type = XmlGetAttrValue(node, _T("type"));
+ if ((from = XmlGetAttrValue(node, _T("from"))) == NULL)
return;
- LPCTSTR idStr = xmlGetAttrValue(node, _T("id"));
+ LPCTSTR idStr = XmlGetAttrValue(node, _T("id"));
pResourceStatus pFromResource(ResourceInfoFromJID(from));
// Message receipts delivery request. Reply here, before a call to HandleMessagePermanent() to make sure message receipts are handled for external plugins too.
- if ((!type || mir_tstrcmpi(type, _T("error"))) && xmlGetChildByTag(node, "request", "xmlns", JABBER_FEAT_MESSAGE_RECEIPTS)) {
+ if ((!type || mir_tstrcmpi(type, _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"), JABBER_FEAT_MESSAGE_RECEIPTS) << XATTR(_T("id"), idStr));
@@ -1050,20 +1050,20 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
MCONTACT hContact = HContactFromJID(from);
JABBER_LIST_ITEM *chatItem = ListGetItemPtr(LIST_CHATROOM, from);
if (chatItem) {
- HXML xCaptcha = xmlGetChild(node, "captcha");
+ HXML xCaptcha = XmlGetChild(node, "captcha");
if (xCaptcha)
if (ProcessCaptcha(xCaptcha, node, info))
return;
}
const TCHAR *szMessage = NULL;
- HXML bodyNode = xmlGetChildByTag(node, "body", "xml:lang", m_tszSelectedLang);
+ HXML bodyNode = XmlGetChildByTag(node, "body", "xml:lang", m_tszSelectedLang);
if (bodyNode == NULL)
- bodyNode = xmlGetChild(node, "body");
+ bodyNode = XmlGetChild(node, "body");
if (bodyNode != NULL)
- szMessage = xmlGetText(bodyNode);
+ szMessage = XmlGetText(bodyNode);
- LPCTSTR ptszSubject = xmlGetText(xmlGetChild(node, "subject"));
+ LPCTSTR ptszSubject = XmlGetText(XmlGetChild(node, "subject"));
if (ptszSubject && *ptszSubject) {
size_t cbLen = (szMessage ? mir_tstrlen(szMessage) : 0) + mir_tstrlen(ptszSubject) + 128;
TCHAR *szTmp = (TCHAR *)alloca(sizeof(TCHAR) * cbLen);
@@ -1078,10 +1078,10 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
szMessage = szTmp;
}
- if (szMessage && (n = xmlGetChildByTag(node, "addresses", "xmlns", JABBER_FEAT_EXT_ADDRESSING))) {
- HXML addressNode = xmlGetChildByTag(n, "address", "type", _T("ofrom"));
+ 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"));
+ const TCHAR *szJid = XmlGetAttrValue(addressNode, _T("jid"));
if (szJid) {
size_t cbLen = mir_tstrlen(szMessage) + 1000;
TCHAR *p = (TCHAR*)alloca(sizeof(TCHAR) * cbLen);
@@ -1108,26 +1108,26 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
bool isDelivered = false;
// check chatstates availability
- if (pFromResource && xmlGetChildByTag(node, "active", "xmlns", JABBER_FEAT_CHATSTATES))
+ if (pFromResource && XmlGetChildByTag(node, "active", "xmlns", JABBER_FEAT_CHATSTATES))
pFromResource->m_jcbManualDiscoveredCaps |= JABBER_CAPS_CHATSTATES;
// chatstates composing event
- if (hContact && xmlGetChildByTag(node, "composing", "xmlns", JABBER_FEAT_CHATSTATES))
+ if (hContact && XmlGetChildByTag(node, "composing", "xmlns", JABBER_FEAT_CHATSTATES))
CallService(MS_PROTO_CONTACTISTYPING, hContact, 60);
// chatstates paused event
- if (hContact && xmlGetChildByTag(node, "paused", "xmlns", JABBER_FEAT_CHATSTATES))
+ if (hContact && XmlGetChildByTag(node, "paused", "xmlns", JABBER_FEAT_CHATSTATES))
CallService(MS_PROTO_CONTACTISTYPING, hContact, PROTOTYPE_CONTACTTYPING_OFF);
// chatstates inactive event
- if (hContact && xmlGetChildByTag(node, "inactive", "xmlns", JABBER_FEAT_CHATSTATES)) {
+ if (hContact && XmlGetChildByTag(node, "inactive", "xmlns", JABBER_FEAT_CHATSTATES)) {
CallService(MS_PROTO_CONTACTISTYPING, hContact, PROTOTYPE_CONTACTTYPING_OFF);
if (pFromResource)
pFromResource->m_bMessageSessionActive = false;
}
// message receipts delivery notification
- if (n = xmlGetChildByTag(node, "received", "xmlns", JABBER_FEAT_MESSAGE_RECEIPTS)) {
+ if (n = XmlGetChildByTag(node, "received", "xmlns", JABBER_FEAT_MESSAGE_RECEIPTS)) {
int nPacketId = JabberGetPacketID(n);
if (nPacketId == -1)
nPacketId = JabberGetPacketID(node);
@@ -1138,7 +1138,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
JabberReadXep203delay(node, msgTime);
// XEP-0224 support (Attention/Nudge)
- if (xmlGetChildByTag(node, "attention", "xmlns", JABBER_FEAT_ATTENTION)) {
+ if (XmlGetChildByTag(node, "attention", "xmlns", JABBER_FEAT_ATTENTION)) {
if (!hContact)
hContact = CreateTemporaryContact(from, chatItem);
if (hContact)
@@ -1146,7 +1146,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
}
// chatstates gone event
- if (hContact && xmlGetChildByTag(node, "gone", "xmlns", 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;
@@ -1158,10 +1158,10 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
db_event_add(hContact, &dbei);
}
- 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"));
+ 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"));
if (!szId || !szMethod || !szUrl)
return;
@@ -1172,7 +1172,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
memset(pParams, 0, sizeof(CJabberHttpAuthParams));
pParams->m_nType = CJabberHttpAuthParams::MSG;
pParams->m_szFrom = mir_tstrdup(from);
- LPCTSTR ptszThread = xmlGetText(xmlGetChild(node, "thread"));
+ LPCTSTR ptszThread = XmlGetText(XmlGetChild(node, "thread"));
if (ptszThread && *ptszThread)
pParams->m_szThreadId = mir_tstrdup(ptszThread);
pParams->m_szId = mir_tstrdup(szId);
@@ -1184,20 +1184,20 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
}
// parsing extensions
- for (int i = 0; (xNode = xmlGetChild(node, i)) != NULL; i++) {
- if ((xNode = xmlGetNthChild(node, _T("x"), i + 1)) == NULL)
+ for (int i = 0; (xNode = XmlGetChild(node, i)) != NULL; i++) {
+ if ((xNode = XmlGetNthChild(node, _T("x"), i + 1)) == NULL)
continue;
- const TCHAR *ptszXmlns = xmlGetAttrValue(xNode, _T("xmlns"));
+ const TCHAR *ptszXmlns = XmlGetAttrValue(xNode, _T("xmlns"));
if (ptszXmlns == NULL)
continue;
if (!mir_tstrcmp(ptszXmlns, JABBER_FEAT_MIRANDA_NOTES)) {
- if (OnIncomingNote(from, xmlGetChild(xNode, "note")))
+ if (OnIncomingNote(from, XmlGetChild(xNode, "note")))
return;
}
else if (!mir_tstrcmp(ptszXmlns, _T("jabber:x:encrypted"))) {
- LPCTSTR ptszText = xmlGetText(xNode);
+ LPCTSTR ptszText = XmlGetText(xNode);
if (ptszText == NULL)
return;
@@ -1209,7 +1209,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
szMessage = tempstring;
}
else if (!mir_tstrcmp(ptszXmlns, JABBER_FEAT_DELAY) && msgTime == 0) {
- const TCHAR *ptszTimeStamp = xmlGetAttrValue(xNode, _T("stamp"));
+ const TCHAR *ptszTimeStamp = XmlGetAttrValue(xNode, _T("stamp"));
if (ptszTimeStamp != NULL)
msgTime = JabberIsoToUnixTime(ptszTimeStamp);
}
@@ -1224,28 +1224,28 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
// pFromResource->m_jcbManualDiscoveredCaps |= (JABBER_CAPS_MESSAGE_EVENTS | JABBER_CAPS_MESSAGE_EVENTS_NO_DELIVERY);
if (bodyNode == NULL) {
- HXML idNode = xmlGetChild(xNode, "id");
- if (xmlGetChild(xNode, "delivered") != NULL || xmlGetChild(xNode, "offline") != NULL) {
+ HXML idNode = XmlGetChild(xNode, "id");
+ if (XmlGetChild(xNode, "delivered") != NULL || XmlGetChild(xNode, "offline") != NULL) {
int id = -1;
- if (idNode != NULL && xmlGetText(idNode) != NULL)
- if (!_tcsncmp(xmlGetText(idNode), _T(JABBER_IQID), mir_strlen(JABBER_IQID)))
- id = _ttoi((xmlGetText(idNode)) + mir_strlen(JABBER_IQID));
+ if (idNode != NULL && XmlGetText(idNode) != NULL)
+ if (!_tcsncmp(XmlGetText(idNode), _T(JABBER_IQID), mir_strlen(JABBER_IQID)))
+ id = _ttoi((XmlGetText(idNode)) + mir_strlen(JABBER_IQID));
if (id != -1)
ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)id, 0);
}
- if (hContact && xmlGetChild(xNode, "composing") != NULL)
+ if (hContact && XmlGetChild(xNode, "composing") != NULL)
CallService(MS_PROTO_CONTACTISTYPING, hContact, 60);
// Maybe a cancel to the previous composing
- HXML child = xmlGetChild(xNode, 0);
+ HXML child = XmlGetChild(xNode, 0);
if (hContact && (!child || (child && idNode != NULL)))
CallService(MS_PROTO_CONTACTISTYPING, hContact, PROTOTYPE_CONTACTTYPING_OFF);
}
else {
// Check whether any event is requested
- if (!isDelivered && (n = xmlGetChild(xNode, "delivered")) != NULL) {
+ if (!isDelivered && (n = XmlGetChild(xNode, "delivered")) != NULL) {
isDelivered = true;
XmlNode m(_T("message")); m << XATTR(_T("to"), from);
@@ -1254,7 +1254,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
x << XCHILD(_T("id"), idStr);
info->send(m);
}
- if (item != NULL && xmlGetChild(xNode, "composing") != NULL) {
+ if (item != NULL && XmlGetChild(xNode, "composing") != NULL) {
if (item->messageEventIdStr)
mir_free(item->messageEventIdStr);
item->messageEventIdStr = (idStr == NULL) ? NULL : mir_tstrdup(idStr);
@@ -1262,7 +1262,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
}
}
else if (!mir_tstrcmp(ptszXmlns, JABBER_FEAT_OOB2)) {
- LPCTSTR ptszUrl = xmlGetText(xmlGetChild(xNode, "url"));
+ LPCTSTR ptszUrl = XmlGetText(XmlGetChild(xNode, "url"));
if (ptszUrl != NULL && *ptszUrl) {
size_t cbLen = (szMessage ? mir_tstrlen(szMessage) : 0) + mir_tstrlen(ptszUrl) + 32;
TCHAR *szTmp = (TCHAR *)alloca(sizeof(TCHAR)* cbLen);
@@ -1275,30 +1275,30 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
}
}
else if (!mir_tstrcmp(ptszXmlns, JABBER_FEAT_MUC_USER)) {
- HXML inviteNode = xmlGetChild(xNode, _T("invite"));
+ HXML inviteNode = XmlGetChild(xNode, _T("invite"));
if (inviteNode != NULL) {
- inviteFromJid = xmlGetAttrValue(inviteNode, _T("from"));
- inviteReason = xmlGetText(xmlGetChild(inviteNode, _T("reason")));
+ inviteFromJid = XmlGetAttrValue(inviteNode, _T("from"));
+ inviteReason = XmlGetText(XmlGetChild(inviteNode, _T("reason")));
}
inviteRoomJid = from;
if (inviteReason == NULL)
inviteReason = szMessage;
isChatRoomInvitation = true;
- invitePassword = xmlGetText(xmlGetChild(xNode, "password"));
+ invitePassword = XmlGetText(XmlGetChild(xNode, "password"));
}
else if (!mir_tstrcmp(ptszXmlns, JABBER_FEAT_ROSTER_EXCHANGE) &&
item != NULL && (item->subscription == SUB_BOTH || item->subscription == SUB_TO)) {
TCHAR chkJID[JABBER_MAX_JID_LEN] = _T("@");
JabberStripJid(from, chkJID + 1, _countof(chkJID) - 1);
for (int i = 1;; i++) {
- HXML iNode = xmlGetNthChild(xNode, _T("item"), i);
+ HXML iNode = XmlGetNthChild(xNode, _T("item"), i);
if (iNode == NULL)
break;
- const TCHAR *action = xmlGetAttrValue(iNode, _T("action"));
- const TCHAR *jid = xmlGetAttrValue(iNode, _T("jid"));
- const TCHAR *nick = xmlGetAttrValue(iNode, _T("name"));
- const TCHAR *group = xmlGetText(xmlGetChild(iNode, _T("group")));
+ const TCHAR *action = XmlGetAttrValue(iNode, _T("action"));
+ const TCHAR *jid = XmlGetAttrValue(iNode, _T("jid"));
+ const TCHAR *nick = XmlGetAttrValue(iNode, _T("name"));
+ const TCHAR *group = XmlGetText(XmlGetChild(iNode, _T("group")));
if (action && jid && _tcsstr(jid, chkJID)) {
if (!mir_tstrcmp(action, _T("add"))) {
MCONTACT hContact = DBCreateContact(jid, nick, FALSE, FALSE);
@@ -1314,10 +1314,10 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
}
}
else if (!isChatRoomInvitation && !mir_tstrcmp(ptszXmlns, JABBER_FEAT_DIRECT_MUC_INVITE)) {
- inviteRoomJid = xmlGetAttrValue(xNode, _T("jid"));
+ inviteRoomJid = XmlGetAttrValue(xNode, _T("jid"));
inviteFromJid = from;
if (inviteReason == NULL)
- inviteReason = xmlGetText(xNode);
+ inviteReason = XmlGetText(xNode);
if (!inviteReason)
inviteReason = szMessage;
isChatRoomInvitation = true;
@@ -1329,12 +1329,12 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
if (m_options.IgnoreMUCInvites) {
// FIXME: temporary disabled due to MUC inconsistence on server side
/*
- XmlNode m("message"); xmlAddAttr(m, "to", from);
- XmlNode xNode = xmlAddChild(m, "x");
- xmlAddAttr(xNode, "xmlns", JABBER_FEAT_MUC_USER);
- XmlNode declineNode = xmlAddChild(xNode, "decline");
- xmlAddAttr(declineNode, "from", inviteRoomJid);
- XmlNode reasonNode = xmlAddChild(declineNode, "reason", "The user has chosen to not accept chat invites");
+ XmlNode m("message"); XmlAddAttr(m, "to", from);
+ XmlNode xNode = XmlAddChild(m, "x");
+ XmlAddAttr(xNode, "xmlns", JABBER_FEAT_MUC_USER);
+ XmlNode declineNode = XmlAddChild(xNode, "decline");
+ XmlAddAttr(declineNode, "from", inviteRoomJid);
+ XmlNode reasonNode = XmlAddChild(declineNode, "reason", "The user has chosen to not accept chat invites");
info->send(m);
*/
}
@@ -1385,7 +1385,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
// XEP-0115: Entity Capabilities
void CJabberProto::OnProcessPresenceCapabilites(HXML node)
{
- const TCHAR *from = xmlGetAttrValue(node, _T("from"));
+ const TCHAR *from = XmlGetAttrValue(node, _T("from"));
if (from == NULL)
return;
@@ -1397,12 +1397,12 @@ void CJabberProto::OnProcessPresenceCapabilites(HXML node)
// check XEP-0115 support, and old style:
HXML n;
- if ((n = xmlGetChildByTag(node, "c", "xmlns", JABBER_FEAT_ENTITY_CAPS)) != NULL ||
- (n = xmlGetChild(node, "c")) != NULL)
+ if ((n = XmlGetChildByTag(node, "c", "xmlns", JABBER_FEAT_ENTITY_CAPS)) != NULL ||
+ (n = XmlGetChild(node, "c")) != NULL)
{
- const TCHAR *szNode = xmlGetAttrValue(n, _T("node"));
- const TCHAR *szVer = xmlGetAttrValue(n, _T("ver"));
- const TCHAR *szExt = xmlGetAttrValue(n, _T("ext"));
+ const TCHAR *szNode = XmlGetAttrValue(n, _T("node"));
+ const TCHAR *szVer = XmlGetAttrValue(n, _T("ver"));
+ const TCHAR *szExt = XmlGetAttrValue(n, _T("ext"));
if (szNode && szVer) {
r->m_tszCapsNode = mir_tstrdup(szNode);
r->m_tszCapsVer = mir_tstrdup(szVer);
@@ -1479,10 +1479,10 @@ void CJabberProto::UpdateJidDbSettings(const TCHAR *jid)
void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
{
- if (!node || !xmlGetName(node) || mir_tstrcmp(xmlGetName(node), _T("presence")))
+ if (!node || !XmlGetName(node) || mir_tstrcmp(XmlGetName(node), _T("presence")))
return;
- LPCTSTR from = xmlGetAttrValue(node, _T("from"));
+ LPCTSTR from = XmlGetAttrValue(node, _T("from"));
if (from == NULL) return;
if (m_presenceManager.HandlePresencePermanent(node, info))
@@ -1503,7 +1503,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
if (!mir_tstrcmpi(szBareFrom, szBareOurJid))
bSelfPresence = TRUE;
- LPCTSTR type = xmlGetAttrValue(node, _T("type"));
+ LPCTSTR type = XmlGetAttrValue(node, _T("type"));
if (type == NULL || !mir_tstrcmp(type, _T("available"))) {
ptrT nick(JabberNickFromJID(from));
if (nick == NULL)
@@ -1522,8 +1522,8 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
}
DBCheckIsTransportedContact(from, hContact);
int status = ID_STATUS_ONLINE;
- if (HXML showNode = xmlGetChild(node, "show")) {
- if (LPCTSTR show = xmlGetText(showNode)) {
+ if (HXML showNode = XmlGetChild(node, "show")) {
+ if (LPCTSTR show = XmlGetText(showNode)) {
if (!mir_tstrcmp(show, _T("away"))) status = ID_STATUS_AWAY;
else if (!mir_tstrcmp(show, _T("xa"))) status = ID_STATUS_NA;
else if (!mir_tstrcmp(show, _T("dnd"))) status = ID_STATUS_DND;
@@ -1532,10 +1532,10 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
}
char priority = 0;
- if (LPCTSTR ptszPriority = xmlGetText(xmlGetChild(node, "priority")))
+ if (LPCTSTR ptszPriority = XmlGetText(XmlGetChild(node, "priority")))
priority = (char)_ttoi(ptszPriority);
- ListAddResource(LIST_ROSTER, from, status, xmlGetText(xmlGetChild(node, "status")), priority);
+ ListAddResource(LIST_ROSTER, from, status, XmlGetText(XmlGetChild(node, "status")), priority);
// XEP-0115: Entity Capabilities
OnProcessPresenceCapabilites(node);
@@ -1552,9 +1552,9 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
bool bHasAvatar = false, bRemovedAvatar = false;
debugLogA("Avatar enabled");
- for (int i = 1; (xNode = xmlGetNthChild(node, _T("x"), i)) != NULL; i++) {
- if (!mir_tstrcmp(xmlGetAttrValue(xNode, _T("xmlns")), _T("jabber:x:avatar"))) {
- LPCTSTR ptszHash = xmlGetText(xmlGetChild(xNode, "hash"));
+ for (int i = 1; (xNode = XmlGetNthChild(node, _T("x"), i)) != NULL; i++) {
+ if (!mir_tstrcmp(XmlGetAttrValue(xNode, _T("xmlns")), _T("jabber:x:avatar"))) {
+ LPCTSTR ptszHash = XmlGetText(XmlGetChild(xNode, "hash"));
if (ptszHash != NULL) {
delSetting(hContact, "AvatarXVcard");
debugLogA("AvatarXVcard deleted");
@@ -1571,10 +1571,10 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
}
if (!bHasAvatar) { //no jabber:x:avatar. try vcard-temp:x:update
debugLogA("Not hasXAvatar");
- for (int i = 1; (xNode = xmlGetNthChild(node, _T("x"), i)) != NULL; i++) {
- if (!mir_tstrcmp(xmlGetAttrValue(xNode, _T("xmlns")), _T("vcard-temp:x:update"))) {
- if ((xNode = xmlGetChild(xNode, "photo")) != NULL) {
- LPCTSTR txt = xmlGetText(xNode);
+ for (int i = 1; (xNode = XmlGetNthChild(node, _T("x"), i)) != NULL; i++) {
+ if (!mir_tstrcmp(XmlGetAttrValue(xNode, _T("xmlns")), _T("vcard-temp:x:update"))) {
+ if ((xNode = XmlGetChild(xNode, "photo")) != NULL) {
+ LPCTSTR txt = XmlGetText(xNode);
if (txt != NULL && txt[0] != 0) {
setByte(hContact, "AvatarXVcard", 1);
debugLogA("AvatarXVcard set");
@@ -1617,7 +1617,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
// set status only if no more available resources
if (!item->arResources.getCount()) {
item->getTemp()->m_iStatus = ID_STATUS_OFFLINE;
- item->getTemp()->m_tszStatusMessage = mir_tstrdup(xmlGetText(xmlGetChild(node, "status")));
+ item->getTemp()->m_tszStatusMessage = mir_tstrdup(XmlGetText(XmlGetChild(node, "status")));
}
}
else debugLog(_T("SKIP Receive presence offline from %s (who is not in my roster)"), from);
@@ -1636,9 +1636,9 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData *info)
AddDbPresenceEvent(hContact, JABBER_DB_EVENT_PRESENCE_SUBSCRIBE);
ptrT tszNick(JabberNickFromJID(from));
- HXML xNick = xmlGetChildByTag(node, "nick", "xmlns", JABBER_FEAT_NICK);
+ HXML xNick = XmlGetChildByTag(node, "nick", "xmlns", JABBER_FEAT_NICK);
if (xNick != NULL) {
- LPCTSTR xszNick = xmlGetText(xNick);
+ LPCTSTR xszNick = XmlGetText(xNick);
if (xszNick != NULL && *xszNick) {
debugLog(_T("Grabbed nick from presence: %s"), xszNick);
tszNick = mir_tstrdup(xszNick);
@@ -1714,12 +1714,12 @@ void CJabberProto::OnIqResultVersion(HXML /*node*/, CJabberIqInfo *pInfo)
if (pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT && queryNode) {
HXML n;
- if ((n = xmlGetChild(queryNode, "name")) != NULL && xmlGetText(n))
- r->m_tszSoftware = mir_tstrdup(xmlGetText(n));
- if ((n = xmlGetChild(queryNode, "version")) != NULL && xmlGetText(n))
- r->m_tszSoftwareVersion = mir_tstrdup(xmlGetText(n));
- if ((n = xmlGetChild(queryNode, "os")) != NULL && xmlGetText(n))
- r->m_tszOs = mir_tstrdup(xmlGetText(n));
+ if ((n = XmlGetChild(queryNode, "name")) != NULL && XmlGetText(n))
+ r->m_tszSoftware = mir_tstrdup(XmlGetText(n));
+ if ((n = XmlGetChild(queryNode, "version")) != NULL && XmlGetText(n))
+ r->m_tszSoftwareVersion = mir_tstrdup(XmlGetText(n));
+ if ((n = XmlGetChild(queryNode, "os")) != NULL && XmlGetText(n))
+ r->m_tszOs = mir_tstrdup(XmlGetText(n));
}
GetResourceCapabilites(pInfo->GetFrom(), TRUE);
@@ -1732,14 +1732,14 @@ void CJabberProto::OnIqResultVersion(HXML /*node*/, CJabberIqInfo *pInfo)
BOOL CJabberProto::OnProcessJingle(HXML node)
{
LPCTSTR type;
- HXML child = xmlGetChildByTag(node, _T("jingle"), _T("xmlns"), JABBER_FEAT_JINGLE);
+ HXML child = XmlGetChildByTag(node, _T("jingle"), _T("xmlns"), JABBER_FEAT_JINGLE);
if (child) {
- if ((type = xmlGetAttrValue(node, _T("type"))) == NULL) return FALSE;
+ if ((type = XmlGetAttrValue(node, _T("type"))) == NULL) return FALSE;
if ((!mir_tstrcmp(type, _T("get")) || !mir_tstrcmp(type, _T("set")))) {
- LPCTSTR szAction = xmlGetAttrValue(child, _T("action"));
- LPCTSTR idStr = xmlGetAttrValue(node, _T("id"));
- LPCTSTR from = xmlGetAttrValue(node, _T("from"));
+ LPCTSTR szAction = XmlGetAttrValue(child, _T("action"));
+ LPCTSTR idStr = XmlGetAttrValue(node, _T("id"));
+ LPCTSTR from = XmlGetAttrValue(node, _T("from"));
if (szAction && !mir_tstrcmp(szAction, _T("session-initiate"))) {
// if this is a Jingle 'session-initiate' and noone processed it yet, reply with "unsupported-applications"
m_ThreadInfo->send(XmlNodeIq(_T("result"), idStr, from));
@@ -1748,10 +1748,10 @@ BOOL CJabberProto::OnProcessJingle(HXML node)
HXML jingleNode = iq << XCHILDNS(_T("jingle"), JABBER_FEAT_JINGLE);
jingleNode << XATTR(_T("action"), _T("session-terminate"));
- LPCTSTR szInitiator = xmlGetAttrValue(child, _T("initiator"));
+ LPCTSTR szInitiator = XmlGetAttrValue(child, _T("initiator"));
if (szInitiator)
jingleNode << XATTR(_T("initiator"), szInitiator);
- LPCTSTR szSid = xmlGetAttrValue(child, _T("sid"));
+ LPCTSTR szSid = XmlGetAttrValue(child, _T("sid"));
if (szSid)
jingleNode << XATTR(_T("sid"), szSid);
@@ -1780,13 +1780,13 @@ void CJabberProto::OnProcessIq(HXML node)
HXML queryNode;
const TCHAR *type, *xmlns;
- if (!xmlGetName(node) || mir_tstrcmp(xmlGetName(node), _T("iq"))) return;
- if ((type = xmlGetAttrValue(node, _T("type"))) == NULL) return;
+ if (!XmlGetName(node) || mir_tstrcmp(XmlGetName(node), _T("iq"))) return;
+ if ((type = XmlGetAttrValue(node, _T("type"))) == NULL) return;
int id = JabberGetPacketID(node);
- queryNode = xmlGetChild(node, "query");
- xmlns = xmlGetAttrValue(queryNode, _T("xmlns"));
+ queryNode = XmlGetChild(node, "query");
+ xmlns = XmlGetAttrValue(queryNode, _T("xmlns"));
// new match by id
if (m_iqManager.HandleIq(id, node))
@@ -1819,11 +1819,11 @@ void CJabberProto::OnProcessIq(HXML node)
}
}
else if ((!mir_tstrcmp(type, _T("get")) || !mir_tstrcmp(type, _T("set")))) {
- XmlNodeIq iq(_T("error"), id, xmlGetAttrValue(node, _T("from")));
+ XmlNodeIq iq(_T("error"), id, XmlGetAttrValue(node, _T("from")));
- HXML pFirstChild = xmlGetChild(node, 0);
+ HXML pFirstChild = XmlGetChild(node, 0);
if (pFirstChild)
- xmlAddChild(iq, pFirstChild);
+ XmlAddChild(iq, pFirstChild);
iq << XCHILD(_T("error")) << XATTR(_T("type"), _T("cancel"))
<< XCHILDNS(_T("service-unavailable"), _T("urn:ietf:params:xml:ns:xmpp-stanzas"));
@@ -1835,8 +1835,8 @@ void CJabberProto::OnProcessRegIq(HXML node, ThreadData *info)
{
const TCHAR *type;
- if (!xmlGetName(node) || mir_tstrcmp(xmlGetName(node), _T("iq"))) return;
- if ((type = xmlGetAttrValue(node, _T("type"))) == NULL) return;
+ if (!XmlGetName(node) || mir_tstrcmp(XmlGetName(node), _T("iq"))) return;
+ if ((type = XmlGetAttrValue(node, _T("type"))) == NULL) return;
int id = JabberGetPacketID(node);
@@ -1864,7 +1864,7 @@ void CJabberProto::OnProcessRegIq(HXML node, ThreadData *info)
}
else if (!mir_tstrcmp(type, _T("error"))) {
- TCHAR *str = JabberErrorMsg(xmlGetChild(node, "error"));
+ TCHAR *str = JabberErrorMsg(XmlGetChild(node, "error"));
SendMessage(info->conn.reg_hwndDlg, WM_JABBER_REGDLG_UPDATE, 100, (LPARAM)str);
mir_free(str);
info->reg_done = TRUE;
@@ -1963,7 +1963,7 @@ int ThreadData::send(HXML node)
if (this == NULL)
return 0;
- while (HXML parent = xi.getParent(node))
+ while (HXML parent = xmlGetParent(node))
node = parent;
if (proto->m_sendManager.HandleSendPermanent(node, this))
@@ -1971,7 +1971,7 @@ int ThreadData::send(HXML node)
proto->OnConsoleProcessXml(node, JCPF_OUT);
- TCHAR *str = xi.toString(node, NULL);
+ TCHAR *str = xmlToString(node, NULL);
// strip forbidden control characters from outgoing XML stream
TCHAR *q = str;
@@ -1990,6 +1990,6 @@ int ThreadData::send(HXML node)
T2Utf utfStr(str);
int result = send(utfStr, (int)mir_strlen(utfStr));
- xi.freeMem(str);
+ xmlFree(str);
return result;
}
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp
index a709bc492c..77534292f5 100644
--- a/protocols/JabberG/src/jabber_util.cpp
+++ b/protocols/JabberG/src/jabber_util.cpp
@@ -298,20 +298,20 @@ TCHAR* __stdcall JabberErrorMsg(HXML errorNode, int* pErrorCode)
}
int errorCode = -1;
- const TCHAR *str = xmlGetAttrValue(errorNode, _T("code"));
+ const TCHAR *str = XmlGetAttrValue(errorNode, _T("code"));
if (str != NULL)
errorCode = _ttoi(str);
- str = xmlGetText(errorNode);
+ str = XmlGetText(errorNode);
if (str == NULL)
- str = xmlGetText(xmlGetChild(errorNode, _T("text")));
+ str = XmlGetText(XmlGetChild(errorNode, _T("text")));
if (str == NULL) {
for (int i = 0;; i++) {
- HXML c = xmlGetChild(errorNode, i);
+ HXML c = XmlGetChild(errorNode, i);
if (c == NULL) break;
- const TCHAR *attr = xmlGetAttrValue(c, _T("xmlns"));
+ const TCHAR *attr = XmlGetAttrValue(c, _T("xmlns"));
if (attr && !mir_tstrcmp(attr, _T("urn:ietf:params:xml:ns:xmpp-stanzas"))) {
- str = xmlGetName(c);
+ str = XmlGetName(c);
break;
}
}
@@ -416,7 +416,7 @@ void CJabberProto::SendPresenceTo(int status, const TCHAR* to, HXML extra, const
p << XATTR(_T("to"), to);
if (extra)
- xmlAddChild(p, extra);
+ XmlAddChild(p, extra);
// XEP-0115:Entity Capabilities
HXML c = p << XCHILDNS(_T("c"), JABBER_FEAT_ENTITY_CAPS) << XATTR(_T("node"), JABBER_CAPS_MIRANDA_NODE)
@@ -465,7 +465,7 @@ void CJabberProto::SendPresenceTo(int status, const TCHAR* to, HXML extra, const
szExtCaps.AppendChar(' ');
szExtCaps += arrExtCaps[i];
}
- xmlAddAttr(c, _T("ext"), szExtCaps);
+ XmlAddAttr(c, _T("ext"), szExtCaps);
}
if (m_options.EnableAvatars) {
@@ -540,7 +540,7 @@ void CJabberProto::SendPresence(int status, bool bSendToAll)
int __stdcall JabberGetPacketID(HXML n)
{
- const TCHAR *str = xmlGetAttrValue(n, _T("id"));
+ const TCHAR *str = XmlGetAttrValue(n, _T("id"));
if (str)
if (!_tcsncmp(str, _T(JABBER_IQID), _countof(JABBER_IQID) - 1))
return _ttoi(str + _countof(JABBER_IQID) - 1);
@@ -616,7 +616,7 @@ TCHAR* __stdcall JabberStripJid(const TCHAR *jid, TCHAR *dest, size_t destLen)
LPCTSTR __stdcall JabberGetPictureType(HXML node, const char *picBuf)
{
- if (LPCTSTR ptszType = xmlGetText(xmlGetChild(node, "TYPE")))
+ if (LPCTSTR ptszType = XmlGetText(XmlGetChild(node, "TYPE")))
if (!mir_tstrcmp(ptszType, _T("image/jpeg")) ||
!mir_tstrcmp(ptszType, _T("image/png")) ||
!mir_tstrcmp(ptszType, _T("image/gif")) ||
@@ -872,11 +872,11 @@ BOOL CJabberProto::EnterString(CMString &result, LPCTSTR caption, int type, char
bool JabberReadXep203delay(HXML node, time_t &msgTime)
{
- HXML n = xmlGetChildByTag(node, "delay", "xmlns", _T("urn:xmpp:delay"));
+ HXML n = XmlGetChildByTag(node, "delay", "xmlns", _T("urn:xmpp:delay"));
if (n == NULL)
return false;
- const TCHAR *ptszTimeStamp = xmlGetAttrValue(n, _T("stamp"));
+ const TCHAR *ptszTimeStamp = XmlGetAttrValue(n, _T("stamp"));
if (ptszTimeStamp == NULL)
return false;
diff --git a/protocols/JabberG/src/jabber_xml.cpp b/protocols/JabberG/src/jabber_xml.cpp
index 0d75e02496..dc528dadfd 100644
--- a/protocols/JabberG/src/jabber_xml.cpp
+++ b/protocols/JabberG/src/jabber_xml.cpp
@@ -55,7 +55,7 @@ XmlNodeIq::XmlNodeIq(const TCHAR *type, HXML node, LPCTSTR to) :
if (type != NULL) *this << XATTR(_T("type"), type );
if (to != NULL) *this << XATTR(_T("to"), to );
if (node != NULL) {
- const TCHAR *iqId = xmlGetAttrValue(*this, _T("id"));
+ const TCHAR *iqId = XmlGetAttrValue(*this, _T("id"));
if (iqId != NULL) *this << XATTR(_T("id"), iqId);
}
}
@@ -85,31 +85,31 @@ XmlNodeIq::XmlNodeIq(const TCHAR *type, CJabberIqInfo *pInfo) :
XmlNode::XmlNode(LPCTSTR pszName)
{
- m_hXml = xi.createNode(T2UTF(pszName), NULL, 0);
+ m_hXml = xmlCreateNode(T2UTF(pszName), NULL, 0);
}
XmlNode::XmlNode(LPCTSTR pszName, LPCTSTR ptszText)
{
- m_hXml = xi.createNode(T2UTF(pszName), ptszText, 0);
+ m_hXml = xmlCreateNode(T2UTF(pszName), ptszText, 0);
}
XmlNode::XmlNode(const XmlNode& n)
{
- m_hXml = xi.copyNode(n);
+ m_hXml = xmlCopyNode(n);
}
XmlNode& XmlNode::operator =(const XmlNode& n)
{
if (m_hXml)
- xi.destroyNode(m_hXml);
- m_hXml = xi.copyNode(n);
+ xmlDestroyNode(m_hXml);
+ m_hXml = xmlCopyNode(n);
return *this;
}
XmlNode::~XmlNode()
{
if (m_hXml) {
- xi.destroyNode(m_hXml);
+ xmlDestroyNode(m_hXml);
m_hXml = NULL;
} }
@@ -117,132 +117,132 @@ XmlNode::~XmlNode()
HXML __fastcall operator<<(HXML node, const XCHILDNS& child)
{
- HXML res = xmlAddChild(node, child.name);
- xmlAddAttr(res, _T("xmlns"), child.ns);
+ HXML res = XmlAddChild(node, child.name);
+ XmlAddAttr(res, _T("xmlns"), child.ns);
return res;
}
HXML __fastcall operator<<(HXML node, const XQUERY& child)
{
- HXML n = xmlAddChild(node, _T("query"));
+ HXML n = XmlAddChild(node, _T("query"));
if (n)
- xmlAddAttr(n, _T("xmlns"), child.ns);
+ XmlAddAttr(n, _T("xmlns"), child.ns);
return n;
}
/////////////////////////////////////////////////////////////////////////////////////////
-void __fastcall xmlAddAttr(HXML hXml, LPCTSTR name, LPCTSTR value)
+void __fastcall XmlAddAttr(HXML hXml, LPCTSTR name, LPCTSTR value)
{
if (value)
- xi.addAttr(hXml, name, T2UTF(value));
+ xmlAddAttr(hXml, name, T2UTF(value));
}
-void __fastcall xmlAddAttr(HXML hXml, LPCTSTR pszName, int value)
+void __fastcall XmlAddAttr(HXML hXml, LPCTSTR pszName, int value)
{
- xi.addAttrInt(hXml, T2UTF(pszName), value);
+ xmlAddAttrInt(hXml, T2UTF(pszName), value);
}
-void __fastcall xmlAddAttr(HXML hXml, LPCTSTR pszName, unsigned __int64 value)
+void __fastcall XmlAddAttr(HXML hXml, LPCTSTR pszName, unsigned __int64 value)
{
TCHAR buf[60];
_ui64tot(value, buf, 10);
- xi.addAttr(hXml, T2UTF(pszName), T2UTF(buf));
+ xmlAddAttr(hXml, T2UTF(pszName), T2UTF(buf));
}
-void __fastcall xmlAddAttrID(HXML hXml, int id)
+void __fastcall XmlAddAttrID(HXML hXml, int id)
{
TCHAR text[100];
mir_sntprintf(text, _T(JABBER_IQID) _T("%d"), id);
- xmlAddAttr(hXml, _T("id"), text);
+ XmlAddAttr(hXml, _T("id"), text);
}
/////////////////////////////////////////////////////////////////////////////////////////
-LPCTSTR __fastcall xmlGetAttr(HXML hXml, int n)
+LPCTSTR __fastcall XmlGetAttr(HXML hXml, int n)
{
- return xi.getAttr(hXml, n);
+ return xmlGetAttr(hXml, n);
}
-int __fastcall xmlGetAttrCount(HXML hXml)
+int __fastcall XmlGetAttrCount(HXML hXml)
{
- return xi.getAttrCount(hXml);
+ return xmlGetAttrCount(hXml);
}
-LPCTSTR __fastcall xmlGetAttrName(HXML hXml, int n)
+LPCTSTR __fastcall XmlGetAttrName(HXML hXml, int n)
{
- return xi.getAttrName(hXml, n);
+ return xmlGetAttrName(hXml, n);
}
/////////////////////////////////////////////////////////////////////////////////////////
-void __fastcall xmlAddChild(HXML hXml, HXML n)
+void __fastcall XmlAddChild(HXML hXml, HXML n)
{
- xi.addChild2(n, hXml);
+ xmlAddChild2(n, hXml);
}
-HXML __fastcall xmlAddChild(HXML hXml, LPCTSTR name)
+HXML __fastcall XmlAddChild(HXML hXml, LPCTSTR name)
{
- return xi.addChild(hXml, T2UTF(name), NULL);
+ return xmlAddChild(hXml, T2UTF(name), NULL);
}
-HXML __fastcall xmlAddChild(HXML hXml, LPCTSTR name, LPCTSTR value)
+HXML __fastcall XmlAddChild(HXML hXml, LPCTSTR name, LPCTSTR value)
{
- return xi.addChild(hXml, T2UTF(name), T2UTF(value));
+ return xmlAddChild(hXml, T2UTF(name), T2UTF(value));
}
-HXML __fastcall xmlAddChild(HXML hXml, LPCTSTR name, int value)
+HXML __fastcall XmlAddChild(HXML hXml, LPCTSTR name, int value)
{
TCHAR buf[40];
_itot(value, buf, 10);
- return xi.addChild(hXml, T2UTF(name), buf);
+ return xmlAddChild(hXml, T2UTF(name), buf);
}
/////////////////////////////////////////////////////////////////////////////////////////
-LPCTSTR __fastcall xmlGetAttrValue(HXML hXml, LPCTSTR key)
+LPCTSTR __fastcall XmlGetAttrValue(HXML hXml, LPCTSTR key)
{
- return xi.getAttrValue(hXml, key);
+ return xmlGetAttrValue(hXml, key);
}
-HXML __fastcall xmlGetChild(HXML hXml, int n)
+HXML __fastcall XmlGetChild(HXML hXml, int n)
{
- return xi.getChild(hXml, n);
+ return xmlGetChild(hXml, n);
}
-HXML __fastcall xmlGetChild(HXML hXml, LPCTSTR key)
+HXML __fastcall XmlGetChild(HXML hXml, LPCTSTR key)
{
- return xi.getNthChild(hXml, key, 0);
+ return xmlGetNthChild(hXml, key, 0);
}
-HXML __fastcall xmlGetChild(HXML hXml, LPCSTR key)
+HXML __fastcall XmlGetChild(HXML hXml, LPCSTR key)
{
LPTSTR wszKey = mir_a2t(key);
- HXML result = xi.getNthChild(hXml, wszKey, 0);
+ HXML result = xmlGetNthChild(hXml, wszKey, 0);
mir_free(wszKey);
return result;
}
-HXML __fastcall xmlGetChildByTag(HXML hXml, LPCTSTR key, LPCTSTR attrName, LPCTSTR attrValue)
+HXML __fastcall XmlGetChildByTag(HXML hXml, LPCTSTR key, LPCTSTR attrName, LPCTSTR attrValue)
{
- return xi.getChildByAttrValue(hXml, key, attrName, attrValue);
+ return xmlGetChildByAttrValue(hXml, key, attrName, attrValue);
}
-HXML __fastcall xmlGetChildByTag(HXML hXml, LPCSTR key, LPCSTR attrName, LPCTSTR attrValue)
+HXML __fastcall XmlGetChildByTag(HXML hXml, LPCSTR key, LPCSTR attrName, LPCTSTR attrValue)
{
LPTSTR wszKey = mir_a2t(key), wszName = mir_a2t(attrName);
- HXML result = xi.getChildByAttrValue(hXml, wszKey, wszName, attrValue);
+ HXML result = xmlGetChildByAttrValue(hXml, wszKey, wszName, attrValue);
mir_free(wszKey), mir_free(wszName);
return result;
}
-int __fastcall xmlGetChildCount(HXML hXml)
+int __fastcall XmlGetChildCount(HXML hXml)
{
- return xi.getChildCount(hXml);
+ return xmlGetChildCount(hXml);
}
-HXML __fastcall xmlGetNthChild(HXML hXml, LPCTSTR tag, int nth)
+HXML __fastcall XmlGetNthChild(HXML hXml, LPCTSTR tag, int nth)
{
int i, num;
@@ -251,10 +251,10 @@ HXML __fastcall xmlGetNthChild(HXML hXml, LPCTSTR tag, int nth)
num = 1;
for (i=0; ; i++) {
- HXML n = xi.getChild(hXml, i);
+ HXML n = xmlGetChild(hXml, i);
if (!n)
break;
- if (!mir_tstrcmp(tag, xmlGetName(n))) {
+ if (!mir_tstrcmp(tag, XmlGetName(n))) {
if (num == nth)
return n;
@@ -264,14 +264,14 @@ HXML __fastcall xmlGetNthChild(HXML hXml, LPCTSTR tag, int nth)
return NULL;
}
-LPCTSTR __fastcall xmlGetName(HXML xml)
+LPCTSTR __fastcall XmlGetName(HXML xml)
{
- return xi.getName(xml);
+ return xmlGetName(xml);
}
-LPCTSTR __fastcall xmlGetText(HXML xml)
+LPCTSTR __fastcall XmlGetText(HXML xml)
{
- return (xml) ? xi.getText(xml) : NULL;
+ return (xml) ? xmlGetText(xml) : NULL;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -288,16 +288,16 @@ void XPath::ProcessPath(LookupInfo &info, bool bCreate)
mir_tstrncpy(attrName, info.attrName.p, info.attrName.length + 1);
TCHAR *attrValue = (TCHAR *)alloca(sizeof(TCHAR)* (info.attrValue.length + 1));
mir_tstrncpy(attrValue, info.attrValue.p, info.attrValue.length + 1);
- HXML hXml = xmlGetChildByTag(m_hXml, nodeName, attrName, attrValue);
+ HXML hXml = XmlGetChildByTag(m_hXml, nodeName, attrName, attrValue);
m_hXml = (hXml || !bCreate) ? hXml : (m_hXml << XCHILD(nodeName) << XATTR(attrName, attrValue));
}
else if (info.nodeIndex) {
int idx = _ttoi(info.nodeIndex.p);
- m_hXml = mir_tstrcmp(nodeName, _T("*")) ? xmlGetNthChild(m_hXml, nodeName, idx) : xmlGetChild(m_hXml, idx - 1);
+ m_hXml = mir_tstrcmp(nodeName, _T("*")) ? XmlGetNthChild(m_hXml, nodeName, idx) : XmlGetChild(m_hXml, idx - 1);
}
else {
- HXML hXml = xmlGetChild(m_hXml, nodeName);
+ HXML hXml = XmlGetChild(m_hXml, nodeName);
m_hXml = (hXml || !bCreate) ? hXml : (m_hXml << XCHILD(nodeName));
}
diff --git a/protocols/JabberG/src/jabber_xml.h b/protocols/JabberG/src/jabber_xml.h
index 452820b99c..0a935a3b46 100644
--- a/protocols/JabberG/src/jabber_xml.h
+++ b/protocols/JabberG/src/jabber_xml.h
@@ -28,32 +28,32 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_xml.h>
-void __fastcall xmlAddChild(HXML, HXML);
-HXML __fastcall xmlAddChild(HXML, LPCTSTR pszName);
-HXML __fastcall xmlAddChild(HXML, LPCTSTR pszName, LPCTSTR ptszValue);
-HXML __fastcall xmlAddChild(HXML, LPCTSTR pszName, int iValue);
-
-LPCTSTR __fastcall xmlGetAttrValue(HXML, LPCTSTR key);
-HXML __fastcall xmlGetChild(HXML, int n = 0);
-HXML __fastcall xmlGetChild(HXML, LPCSTR key);
-HXML __fastcall xmlGetChild(HXML, LPCTSTR key);
-int __fastcall xmlGetChildCount(HXML);
-HXML __fastcall xmlGetChildByTag(HXML, LPCTSTR key, LPCTSTR attrName, LPCTSTR attrValue);
-HXML __fastcall xmlGetChildByTag(HXML, LPCSTR key, LPCSTR attrName, LPCTSTR attrValue);
-HXML __fastcall xmlGetNthChild(HXML, LPCTSTR key, int n = 0);
-
-LPCTSTR __fastcall xmlGetName(HXML);
-LPCTSTR __fastcall xmlGetText(HXML);
-
-void __fastcall xmlAddAttr(HXML, LPCTSTR pszName, LPCTSTR ptszValue);
-void __fastcall xmlAddAttr(HXML, LPCTSTR pszName, int value);
-void __fastcall xmlAddAttr(HXML hXml, LPCTSTR pszName, unsigned __int64 value);
-void __fastcall xmlAddAttrID(HXML, int id);
-
-int __fastcall xmlGetAttrCount(HXML);
-LPCTSTR __fastcall xmlGetAttr(HXML, int n);
-LPCTSTR __fastcall xmlGetAttrName(HXML, int n);
-LPCTSTR __fastcall xmlGetAttrValue(HXML, LPCTSTR key);
+void __fastcall XmlAddChild(HXML, HXML);
+HXML __fastcall XmlAddChild(HXML, LPCTSTR pszName);
+HXML __fastcall XmlAddChild(HXML, LPCTSTR pszName, LPCTSTR ptszValue);
+HXML __fastcall XmlAddChild(HXML, LPCTSTR pszName, int iValue);
+
+LPCTSTR __fastcall XmlGetAttrValue(HXML, LPCTSTR key);
+HXML __fastcall XmlGetChild(HXML, int n = 0);
+HXML __fastcall XmlGetChild(HXML, LPCSTR key);
+HXML __fastcall XmlGetChild(HXML, LPCTSTR key);
+int __fastcall XmlGetChildCount(HXML);
+HXML __fastcall XmlGetChildByTag(HXML, LPCTSTR key, LPCTSTR attrName, LPCTSTR attrValue);
+HXML __fastcall XmlGetChildByTag(HXML, LPCSTR key, LPCSTR attrName, LPCTSTR attrValue);
+HXML __fastcall XmlGetNthChild(HXML, LPCTSTR key, int n = 0);
+
+LPCTSTR __fastcall XmlGetName(HXML);
+LPCTSTR __fastcall XmlGetText(HXML);
+
+void __fastcall XmlAddAttr(HXML, LPCTSTR pszName, LPCTSTR ptszValue);
+void __fastcall XmlAddAttr(HXML, LPCTSTR pszName, int value);
+void __fastcall XmlAddAttr(HXML hXml, LPCTSTR pszName, unsigned __int64 value);
+void __fastcall XmlAddAttrID(HXML, int id);
+
+int __fastcall XmlGetAttrCount(HXML);
+LPCTSTR __fastcall XmlGetAttr(HXML, int n);
+LPCTSTR __fastcall XmlGetAttrName(HXML, int n);
+LPCTSTR __fastcall XmlGetAttrValue(HXML, LPCTSTR key);
struct XmlNode
{
@@ -61,7 +61,7 @@ struct XmlNode
__forceinline XmlNode(LPCTSTR pszString, int* numBytes, LPCTSTR ptszTag)
{
- m_hXml = xi.parseString(pszString, numBytes, ptszTag);
+ m_hXml = xmlParseString(pszString, numBytes, ptszTag);
}
XmlNode(const XmlNode& n);
@@ -107,7 +107,7 @@ struct XATTR
};
HXML __forceinline operator<<(HXML node, const XATTR& attr)
-{ xmlAddAttr(node, attr.name, attr.value);
+{ XmlAddAttr(node, attr.name, attr.value);
return node;
}
@@ -125,7 +125,7 @@ struct XATTRI
};
HXML __forceinline operator<<(HXML node, const XATTRI& attr)
-{ xmlAddAttr(node, attr.name, attr.value);
+{ XmlAddAttr(node, attr.name, attr.value);
return node;
}
@@ -143,7 +143,7 @@ struct XATTRI64
};
HXML __forceinline operator<<(HXML node, const XATTRI64& attr)
-{ xmlAddAttr(node, attr.name, attr.value);
+{ XmlAddAttr(node, attr.name, attr.value);
return node;
}
@@ -159,7 +159,7 @@ struct XATTRID
};
HXML __forceinline operator<<(HXML node, const XATTRID& attr)
-{ xmlAddAttrID(node, attr.id);
+{ XmlAddAttrID(node, attr.id);
return node;
}
@@ -176,7 +176,7 @@ struct XCHILD
};
HXML __forceinline operator<<(HXML node, const XCHILD& child)
-{ return xmlAddChild(node, child.name, child.value);
+{ return XmlAddChild(node, child.name, child.value);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -237,7 +237,7 @@ public:
switch (Lookup())
{
case T_NODE: return m_hXml;
- case T_NODESET: return xmlGetNthChild(m_hXml, m_szParam, 1);
+ case T_NODESET: return XmlGetNthChild(m_hXml, m_szParam, 1);
}
return NULL;
}
@@ -245,9 +245,9 @@ public:
{
switch (Lookup())
{
- case T_ATTRIBUTE: return (TCHAR *)xmlGetAttrValue(m_hXml, m_szParam);
- case T_NODE: return (TCHAR *)xmlGetText(m_hXml);
- case T_NODESET: return (TCHAR *)xmlGetText(xmlGetNthChild(m_hXml, m_szParam, 1));
+ case T_ATTRIBUTE: return (TCHAR *)XmlGetAttrValue(m_hXml, m_szParam);
+ case T_NODE: return (TCHAR *)XmlGetText(m_hXml);
+ case T_NODESET: return (TCHAR *)XmlGetText(XmlGetNthChild(m_hXml, m_szParam, 1));
}
return NULL;
}
@@ -266,7 +266,7 @@ public:
}
HXML operator[] (int idx)
{
- return (Lookup() == T_NODESET) ? xmlGetNthChild(m_hXml, m_szParam, idx) : NULL;
+ return (Lookup() == T_NODESET) ? XmlGetNthChild(m_hXml, m_szParam, idx) : NULL;
}
// Write data
@@ -274,7 +274,7 @@ public:
{
switch (Lookup(true))
{
- case T_ATTRIBUTE: xmlAddAttr(m_hXml, m_szParam, value); break;
+ case T_ATTRIBUTE: XmlAddAttr(m_hXml, m_szParam, value); break;
case T_NODE: break; // TODO: set node text
}
}
diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp
index 947d047537..53959c0c83 100644
--- a/protocols/JabberG/src/jabber_xstatus.cpp
+++ b/protocols/JabberG/src/jabber_xstatus.cpp
@@ -626,7 +626,7 @@ void CPepMood::ProcessItems(const TCHAR *from, HXML itemsNode)
}
else hSelfContact = m_proto->HContactFromJID(from);
- if (xmlGetChild(itemsNode, _T("retract"))) {
+ if (XmlGetChild(itemsNode, _T("retract"))) {
if (hSelfContact)
SetMood(hSelfContact, NULL, NULL);
SetMood(hContact, NULL, NULL);
@@ -637,11 +637,11 @@ void CPepMood::ProcessItems(const TCHAR *from, HXML itemsNode)
if (!moodNode) return;
LPCTSTR moodType = NULL, moodText = NULL;
- for (int i=0; n = xmlGetChild(moodNode, i); i++) {
- if (!mir_tstrcmp(xmlGetName(n), _T("text")))
- moodText = xmlGetText(n);
+ for (int i=0; n = XmlGetChild(moodNode, i); i++) {
+ if (!mir_tstrcmp(XmlGetName(n), _T("text")))
+ moodText = XmlGetText(n);
else
- moodType = xmlGetName(n);
+ moodType = XmlGetName(n);
}
TCHAR *fixedText = JabberStrFixLines(moodText);
@@ -1006,7 +1006,7 @@ void CPepActivity::ProcessItems(const TCHAR *from, HXML itemsNode)
}
else hSelfContact = m_proto->HContactFromJID(from);
- if (xmlGetChild(itemsNode, "retract")) {
+ if (XmlGetChild(itemsNode, "retract")) {
if (hSelfContact)
SetActivity(hSelfContact, NULL, NULL, NULL);
SetActivity(hContact, NULL, NULL, NULL);
@@ -1021,12 +1021,12 @@ void CPepActivity::ProcessItems(const TCHAR *from, HXML itemsNode)
LPCTSTR szFirstNode = NULL, szSecondNode = NULL;
HXML n;
- for (int i=0; n = xmlGetChild(actNode, i); i++) {
- if (mir_tstrcmp(xmlGetName(n), _T("text"))) {
- szFirstNode = xmlGetName(n);
- HXML secondNode = xmlGetChild(n, 0);
- if (szFirstNode && secondNode && xmlGetName(secondNode))
- szSecondNode = xmlGetName(secondNode);
+ for (int i=0; n = XmlGetChild(actNode, i); i++) {
+ if (mir_tstrcmp(XmlGetName(n), _T("text"))) {
+ szFirstNode = XmlGetName(n);
+ HXML secondNode = XmlGetChild(n, 0);
+ if (szFirstNode && secondNode && XmlGetName(secondNode))
+ szSecondNode = XmlGetName(secondNode);
break;
}
}
diff --git a/protocols/JabberG/src/jabber_xstatus.h b/protocols/JabberG/src/jabber_xstatus.h
index 1fd27d5c2b..daa12ac4ec 100644
--- a/protocols/JabberG/src/jabber_xstatus.h
+++ b/protocols/JabberG/src/jabber_xstatus.h
@@ -69,7 +69,7 @@ public:
for (int i=0; i < getCount(); i++)
{
CPepService &pepSvc = (*this)[i];
- HXML itemsNode = xmlGetChildByTag(eventNode, _T("items"), _T("node"), pepSvc.GetNode());
+ HXML itemsNode = XmlGetChildByTag(eventNode, _T("items"), _T("node"), pepSvc.GetNode());
if (itemsNode)
pepSvc.ProcessItems(from, itemsNode);
}
diff --git a/protocols/SkypeWeb/src/main.cpp b/protocols/SkypeWeb/src/main.cpp
index 0d09d03e32..c944b64fb5 100644
--- a/protocols/SkypeWeb/src/main.cpp
+++ b/protocols/SkypeWeb/src/main.cpp
@@ -18,7 +18,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
int hLangpack;
-XML_API xi;
HINSTANCE g_hInstance;
CLIST_INTERFACE *pcli;
char g_szMirVer[100];
@@ -55,7 +54,6 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC
extern "C" int __declspec(dllexport) Load(void)
{
mir_getLP(&pluginInfo);
- mir_getXI(&xi);
mir_getCLI();
CallService(MS_SYSTEM_GETVERSIONTEXT, sizeof(g_szMirVer), LPARAM(g_szMirVer));
diff --git a/protocols/SkypeWeb/src/skype_chatrooms.cpp b/protocols/SkypeWeb/src/skype_chatrooms.cpp
index 51b70c307a..eef1c9179f 100644
--- a/protocols/SkypeWeb/src/skype_chatrooms.cpp
+++ b/protocols/SkypeWeb/src/skype_chatrooms.cpp
@@ -293,37 +293,37 @@ void CSkypeProto::OnChatEvent(const JSONNode &node)
ptrA xinitiator, xtarget, initiator;
//content = <addmember><eventtime>1429186229164</eventtime><initiator>8:initiator</initiator><target>8:user</target></addmember>
- HXML xml = xi.parseString(ptrT(mir_a2t(content.c_str())), 0, _T("addmember"));
+ HXML xml = xmlParseString(ptrT(mir_a2t(content.c_str())), 0, _T("addmember"));
if (xml == NULL)
return;
- for (int i = 0; i < xi.getChildCount(xml); i++)
+ for (int i = 0; i < xmlGetChildCount(xml); i++)
{
- HXML xmlNode = xi.getNthChild(xml, L"target", i);
+ HXML xmlNode = xmlGetNthChild(xml, L"target", i);
if (xmlNode == NULL)
break;
- xtarget = mir_t2a(xi.getText(xmlNode));
+ xtarget = mir_t2a(xmlGetText(xmlNode));
CMStringA target = ParseUrl(xtarget, "8:");
AddChatContact(_A2T(chatname), target, target, L"User");
}
- xi.destroyNode(xml);
+ xmlDestroyNode(xml);
}
else if (!mir_strcmpi(messageType.c_str(), "ThreadActivity/DeleteMember"))
{
ptrA xinitiator, xtarget;
//content = <addmember><eventtime>1429186229164</eventtime><initiator>8:initiator</initiator><target>8:user</target></addmember>
- HXML xml = xi.parseString(ptrT(mir_a2t(content.c_str())), 0, _T("deletemember"));
+ HXML xml = xmlParseString(ptrT(mir_a2t(content.c_str())), 0, _T("deletemember"));
if (xml != NULL) {
- HXML xmlNode = xi.getChildByPath(xml, _T("initiator"), 0);
- xinitiator = node != NULL ? mir_t2a(xi.getText(xmlNode)) : NULL;
+ HXML xmlNode = xmlGetChildByPath(xml, _T("initiator"), 0);
+ xinitiator = node != NULL ? mir_t2a(xmlGetText(xmlNode)) : NULL;
- xmlNode = xi.getChildByPath(xml, _T("target"), 0);
- xtarget = xmlNode != NULL ? mir_t2a(xi.getText(xmlNode)) : NULL;
+ xmlNode = xmlGetChildByPath(xml, _T("target"), 0);
+ xtarget = xmlNode != NULL ? mir_t2a(xmlGetText(xmlNode)) : NULL;
- xi.destroyNode(xml);
+ xmlDestroyNode(xml);
}
if (xtarget == NULL)
return;
@@ -337,15 +337,15 @@ void CSkypeProto::OnChatEvent(const JSONNode &node)
{
//content=<topicupdate><eventtime>1429532702130</eventtime><initiator>8:user</initiator><value>test topic</value></topicupdate>
ptrA xinitiator, value;
- HXML xml = xi.parseString(ptrT(mir_a2t(content.c_str())), 0, _T("topicupdate"));
+ HXML xml = xmlParseString(ptrT(mir_a2t(content.c_str())), 0, _T("topicupdate"));
if (xml != NULL) {
- HXML xmlNode = xi.getChildByPath(xml, _T("initiator"), 0);
- xinitiator = xmlNode != NULL ? mir_t2a(xi.getText(xmlNode)) : NULL;
+ HXML xmlNode = xmlGetChildByPath(xml, _T("initiator"), 0);
+ xinitiator = xmlNode != NULL ? mir_t2a(xmlGetText(xmlNode)) : NULL;
- xmlNode = xi.getChildByPath(xml, _T("value"), 0);
- value = xmlNode != NULL ? mir_t2a(xi.getText(xmlNode)) : NULL;
+ xmlNode = xmlGetChildByPath(xml, _T("value"), 0);
+ value = xmlNode != NULL ? mir_t2a(xmlGetText(xmlNode)) : NULL;
- xi.destroyNode(xml);
+ xmlDestroyNode(xml);
}
CMStringA initiator = ParseUrl(xinitiator, "8:");
@@ -356,20 +356,20 @@ void CSkypeProto::OnChatEvent(const JSONNode &node)
{
//content=<roleupdate><eventtime>1429551258363</eventtime><initiator>8:user</initiator><target><id>8:user1</id><role>admin</role></target></roleupdate>
ptrA xinitiator, xId, xRole;
- HXML xml = xi.parseString(ptrT(mir_a2t(content.c_str())), 0, _T("roleupdate"));
+ HXML xml = xmlParseString(ptrT(mir_a2t(content.c_str())), 0, _T("roleupdate"));
if (xml != NULL) {
- HXML xmlNode = xi.getChildByPath(xml, _T("initiator"), 0);
- xinitiator = xmlNode != NULL ? mir_t2a(xi.getText(xmlNode)) : NULL;
+ HXML xmlNode = xmlGetChildByPath(xml, _T("initiator"), 0);
+ xinitiator = xmlNode != NULL ? mir_t2a(xmlGetText(xmlNode)) : NULL;
- xmlNode = xi.getChildByPath(xml, _T("target"), 0);
+ xmlNode = xmlGetChildByPath(xml, _T("target"), 0);
if (xmlNode != NULL)
{
- HXML xmlId = xi.getChildByPath(xmlNode, _T("id"), 0);
- HXML xmlRole = xi.getChildByPath(xmlNode, _T("role"), 0);
- xId = xmlId != NULL ? mir_t2a(xi.getText(xmlId)) : NULL;
- xRole = xmlRole != NULL ? mir_t2a(xi.getText(xmlRole)) : NULL;
+ HXML xmlId = xmlGetChildByPath(xmlNode, _T("id"), 0);
+ HXML xmlRole = xmlGetChildByPath(xmlNode, _T("role"), 0);
+ xId = xmlId != NULL ? mir_t2a(xmlGetText(xmlId)) : NULL;
+ xRole = xmlRole != NULL ? mir_t2a(xmlGetText(xmlRole)) : NULL;
}
- xi.destroyNode(xml);
+ xmlDestroyNode(xml);
CMStringA initiator = ParseUrl(xinitiator, "8:");
CMStringA id = ParseUrl(xId, "8:");
diff --git a/protocols/SkypeWeb/src/skype_history_sync.cpp b/protocols/SkypeWeb/src/skype_history_sync.cpp
index c21ee4573a..ef57c93e8a 100644
--- a/protocols/SkypeWeb/src/skype_history_sync.cpp
+++ b/protocols/SkypeWeb/src/skype_history_sync.cpp
@@ -107,19 +107,19 @@ void CSkypeProto::OnGetServerHistory(const NETLIBHTTPREQUEST *response)
//content=<partlist type="started" alt=""><part identity="username"><name>user name</name></part></partlist>
int iType = 3, iDuration = 0;
CMStringA skypename(ContactUrlToName(from.c_str()));
- HXML xml = xi.parseString(ptrT(mir_a2t(content.c_str())), 0, _T("partlist"));
+ HXML xml = xmlParseString(ptrT(mir_a2t(content.c_str())), 0, _T("partlist"));
if (xml != NULL)
{
- ptrA type(mir_t2a(xi.getAttrValue(xml, _T("type"))));
+ ptrA type(mir_t2a(xmlGetAttrValue(xml, _T("type"))));
if (!mir_strcmpi(type, "ended")) iType = 0;
else if (!mir_strcmpi(type, "started")) iType = 1;
- HXML xmlNode = xi.getChildByPath(xml, _T("part"), 0);
- HXML duration = xmlNode == NULL ? NULL : xi.getChildByPath(xmlNode, _T("duration"), 0);
- iDuration = duration != NULL ? atoi(mir_t2a(xi.getText(duration))) : NULL;
+ HXML xmlNode = xmlGetChildByPath(xml, _T("part"), 0);
+ HXML duration = xmlNode == NULL ? NULL : xmlGetChildByPath(xmlNode, _T("duration"), 0);
+ iDuration = duration != NULL ? atoi(mir_t2a(xmlGetText(duration))) : NULL;
- xi.destroyNode(xml);
+ xmlDestroyNode(xml);
}
CMStringA text = "";
if (iType == 1)
@@ -147,17 +147,17 @@ void CSkypeProto::OnGetServerHistory(const NETLIBHTTPREQUEST *response)
else if (!mir_strcmpi(messageType.c_str(), "RichText/Files"))
{
//content=<files alt="отправил (-а) файл &quot;run.bat&quot;"><file size="97" index="0" tid="4197760077">run.bat</file></files>
- HXML xml = xi.parseString(ptrT(mir_a2t(content.c_str())), 0, _T("files"));
+ HXML xml = xmlParseString(ptrT(mir_a2t(content.c_str())), 0, _T("files"));
if (xml != NULL)
{
- for (int i = 0; i < xi.getChildCount(xml); i++)
+ for (int i = 0; i < xmlGetChildCount(xml); i++)
{
int fileSize; CMStringA msg = "";
- HXML xmlNode = xi.getNthChild(xml, L"file", i);
+ HXML xmlNode = xmlGetNthChild(xml, L"file", i);
if (xmlNode == NULL)
break;
- fileSize = atoi(_T2A(xi.getAttrValue(xmlNode, L"size")));
- ptrA fileName(mir_t2a(xi.getText(xmlNode)));
+ fileSize = atoi(_T2A(xmlGetAttrValue(xmlNode, L"size")));
+ ptrA fileName(mir_t2a(xmlGetText(xmlNode)));
if (fileName == NULL || fileSize == NULL)
continue;
@@ -170,10 +170,10 @@ void CSkypeProto::OnGetServerHistory(const NETLIBHTTPREQUEST *response)
else if (!mir_strcmpi(messageType.c_str(), "RichText/UriObject"))
{
//content=<URIObject type="Picture.1" uri="https://api.asm.skype.com/v1//objects/0-weu-d1-262f0a1ee256d03b8e4b8360d9208834" url_thumbnail="https://api.asm.skype.com/v1//objects/0-weu-d1-262f0a1ee256d03b8e4b8360d9208834/views/imgt1"><Title></Title><Description></Description>Для просмотра этого общего фото перейдите по ссылке: https://api.asm.skype.com/s/i?0-weu-d1-262f0a1ee256d03b8e4b8360d9208834<meta type="photo" originalName="ysd7ZE4BqOg.jpg"/><OriginalName v="ysd7ZE4BqOg.jpg"/></URIObject>
- HXML xml = xi.parseString(ptrT(mir_a2t(content.c_str())), 0, _T("URIObject"));
+ HXML xml = xmlParseString(ptrT(mir_a2t(content.c_str())), 0, _T("URIObject"));
if (xml != NULL)
{
- CMStringA object(ParseUrl(_T2A(xi.getAttrValue(xml, L"uri")), "/objects/"));
+ CMStringA object(ParseUrl(_T2A(xmlGetAttrValue(xml, L"uri")), "/objects/"));
CMStringA data(FORMAT, "%s: https://api.asm.skype.com/s/i?%s", Translate("Image"), object.c_str());
AddMessageToDb(hContact, timestamp, flags, clientMsgId.c_str(), data.GetBuffer());
diff --git a/protocols/SkypeWeb/src/skype_messages.cpp b/protocols/SkypeWeb/src/skype_messages.cpp
index cdd86adf49..87ed6a37fe 100644
--- a/protocols/SkypeWeb/src/skype_messages.cpp
+++ b/protocols/SkypeWeb/src/skype_messages.cpp
@@ -199,20 +199,20 @@ void CSkypeProto::OnPrivateMessageEvent(const JSONNode &node)
//<part identity="echo123"><name>Echo / Sound Test Service</name><duration>6</duration></part></partlist>
//content=<partlist type="started" alt=""><part identity="username"><name>user name</name></part></partlist>
int iType = 3, iDuration = 0;
- HXML xml = xi.parseString(ptrT(mir_a2t(content.c_str())), 0, _T("partlist"));
+ HXML xml = xmlParseString(ptrT(mir_a2t(content.c_str())), 0, _T("partlist"));
if (xml != NULL)
{
- ptrA type(mir_t2a(xi.getAttrValue(xml, _T("type"))));
+ ptrA type(mir_t2a(xmlGetAttrValue(xml, _T("type"))));
if (!mir_strcmpi(type, "ended")) iType = 0;
else if (!mir_strcmpi(type, "started")) iType = 1;
- HXML xmlNode = xi.getChildByPath(xml, _T("part"), 0);
- HXML duration = xmlNode == NULL ? NULL : xi.getChildByPath(xmlNode, _T("duration"), 0);
- iDuration = duration != NULL ? atoi(mir_t2a(xi.getText(duration))) : NULL;
+ HXML xmlNode = xmlGetChildByPath(xml, _T("part"), 0);
+ HXML duration = xmlNode == NULL ? NULL : xmlGetChildByPath(xmlNode, _T("duration"), 0);
+ iDuration = duration != NULL ? atoi(mir_t2a(xmlGetText(duration))) : NULL;
- xi.destroyNode(xml);
+ xmlDestroyNode(xml);
}
CMStringA text = "";
if (iType == 1)
@@ -244,17 +244,17 @@ void CSkypeProto::OnPrivateMessageEvent(const JSONNode &node)
else if (!mir_strcmpi(messageType.c_str(), "RichText/Files"))
{
//content=<files alt="отправил (-а) файл &quot;run.bat&quot;"><file size="97" index="0" tid="4197760077">run.bat</file></files>
- HXML xml = xi.parseString(ptrT(mir_a2t(content.c_str())), 0, _T("files"));
+ HXML xml = xmlParseString(ptrT(mir_a2t(content.c_str())), 0, _T("files"));
if (xml != NULL)
{
- for (int i = 0; i < xi.getChildCount(xml); i++)
+ for (int i = 0; i < xmlGetChildCount(xml); i++)
{
int fileSize;
- HXML xmlNode = xi.getNthChild(xml, _T("file"), i);
+ HXML xmlNode = xmlGetNthChild(xml, _T("file"), i);
if (xmlNode == NULL)
break;
- fileSize = atoi(_T2A(xi.getAttrValue(xmlNode, _T("size"))));
- ptrA fileName(mir_utf8encodeT(xi.getText(xmlNode)));
+ fileSize = atoi(_T2A(xmlGetAttrValue(xmlNode, _T("size"))));
+ ptrA fileName(mir_utf8encodeT(xmlGetText(xmlNode)));
if (fileName == NULL || fileSize == NULL)
continue;
@@ -267,10 +267,10 @@ void CSkypeProto::OnPrivateMessageEvent(const JSONNode &node)
else if (!mir_strcmpi(messageType.c_str(), "RichText/UriObject"))
{
//content=<URIObject type="Picture.1" uri="https://api.asm.skype.com/v1//objects/0-weu-d1-262f0a1ee256d03b8e4b8360d9208834" url_thumbnail="https://api.asm.skype.com/v1//objects/0-weu-d1-262f0a1ee256d03b8e4b8360d9208834/views/imgt1"><Title></Title><Description></Description>Для просмотра этого общего фото перейдите по ссылке: https://api.asm.skype.com/s/i?0-weu-d1-262f0a1ee256d03b8e4b8360d9208834<meta type="photo" originalName="ysd7ZE4BqOg.jpg"/><OriginalName v="ysd7ZE4BqOg.jpg"/></URIObject>
- HXML xml = xi.parseString(ptrT(mir_a2t(content.c_str())), 0, _T("URIObject"));
+ HXML xml = xmlParseString(ptrT(mir_a2t(content.c_str())), 0, _T("URIObject"));
if (xml != NULL)
{
- CMStringA object(ParseUrl(_T2A(xi.getAttrValue(xml, L"uri")), "/objects/"));
+ CMStringA object(ParseUrl(_T2A(xmlGetAttrValue(xml, L"uri")), "/objects/"));
CMStringA data(FORMAT, "%s: https://api.asm.skype.com/s/i?%s", Translate("Image"), object.c_str());
AddMessageToDb(hContact, timestamp, DBEF_UTF, clientMsgId.c_str(), data.GetBuffer());
}