Improve Remote Controlling Clients
The XEP recommends adding the node to the IQ response.
Some clients seem not to understand the answer when it is omitted.
Problem reported by Rhaamo and js (thanks to js for spotting the
node issue!).
--- a/mcabber/src/jab_iq.c Fri Apr 11 21:59:06 2008 +0200
+++ b/mcabber/src/jab_iq.c Sat Apr 12 13:35:03 2008 +0200
@@ -1069,12 +1069,18 @@
xmlnode myquery;
jid requester_jid;
const struct adhoc_command *command;
+ const char *node;
bool from_self;
+
x = jutil_iqnew(JPACKET__RESULT, NS_DISCO_ITEMS);
xmlnode_put_attrib(x, "id", id);
xmlnode_put_attrib(x, "to", xmlnode_get_attrib(xmldata, "from"));
myquery = xmlnode_get_tag(x, "query");
+ node = xmlnode_get_attrib(xmlnode_get_tag(xmldata, "query"), "node");
+ if (node)
+ xmlnode_put_attrib(myquery, "node", node);
+
requester_jid = jid_new(conn->p, xmlnode_get_attrib(xmldata, "from"));
from_self = !jid_cmpx(conn->user, requester_jid, JID_USER | JID_SERVER);
@@ -1341,7 +1347,7 @@
xmlnode xmldata)
{
xmlnode x;
- char *node;
+ const char *node;
x = xmlnode_get_tag(xmldata, "query");
node = xmlnode_get_attrib(x, "node");
if (node) {