summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_adhoc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/JabberG/src/jabber_adhoc.cpp')
-rw-r--r--protocols/JabberG/src/jabber_adhoc.cpp86
1 files changed, 43 insertions, 43 deletions
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);