im.pidgin.pidgin: 375ee8dbfbcb119caf0510839f43bc2b0a2d8ff1

am at adiumx.com am at adiumx.com
Thu Nov 8 21:05:41 EST 2007


-----------------------------------------------------------------
Revision: 375ee8dbfbcb119caf0510839f43bc2b0a2d8ff1
Ancestor: 7d51d92656a386ecd5d02f6b22db9f7153ca157b
Author: am at adiumx.com
Date: 2007-11-09T02:00:15
Branch: im.pidgin.pidgin

Modified files:
        libpurple/protocols/jabber/adhoccommands.c

ChangeLog: 

Fixed cancelling ad-hoc commands

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/adhoccommands.c	1f8c9a282612f146d5e43e994629da3817e88f48
+++ libpurple/protocols/jabber/adhoccommands.c	ae6d583f8fa7edb6bd28727ee96d3fa6f36b07ee
@@ -109,10 +109,16 @@ static void do_adhoc_action_cb(JabberStr
 	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;
 		g_free(handle);


More information about the Commits mailing list