changeset 21180:134e057e947b

merge of '375ee8dbfbcb119caf0510839f43bc2b0a2d8ff1' and '54be730b876d8dcb239390730afc8620f96bc429'
author Andreas Monitzer <pidgin@monitzer.com>
date Fri, 09 Nov 2007 02:02:13 +0000
parents d1da36099088 (diff) e4c986ae75b1 (current diff)
children 581af8ea9ba1
files
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/adhoccommands.c	Fri Nov 09 01:41:27 2007 +0000
+++ b/libpurple/protocols/jabber/adhoccommands.c	Fri Nov 09 02:02:13 2007 +0000
@@ -109,9 +109,15 @@
 	xmlnode_set_namespace(command,"http://jabber.org/protocol/commands");
 	xmlnode_set_attrib(command,"sessionid",actionInfo->sessionid);
 	xmlnode_set_attrib(command,"node",actionInfo->node);
-	if(actionhandle)
-		xmlnode_set_attrib(command,"action",actionhandle);
-	xmlnode_insert_child(command,result);
+	
+	/* cancel is handled differently on ad-hoc commands than regular forms */
+	if(!strcmp(xmlnode_get_namespace(result),"jabber:x:data") && !strcmp(xmlnode_get_attrib(result, "type"),"cancel")) {
+		xmlnode_set_attrib(command,"action","cancel");
+	} else {
+		if(actionhandle)
+			xmlnode_set_attrib(command,"action",actionhandle);
+		xmlnode_insert_child(command,result);
+	}
 	
 	for(action = actionInfo->actionslist; action; action = g_list_next(action)) {
 		char *handle = action->data;