# HG changeset patch # User John Bailey # Date 1194595580 0 # Node ID 581af8ea9ba1eec5b0093faa823f52a2ccf92c90 # Parent 134e057e947b50a9b6e26e3766863bb5404500c3# Parent 50a93945811be02e6de9d34a3bcfe4468e271d25 merge of '3df0bc5b9537dc64833bb97fe2a03920e6f0c304' and '7eccb0cdce9d646aacc309eaadcf48c6809fb7ce' diff -r 50a93945811b -r 581af8ea9ba1 libpurple/protocols/jabber/adhoccommands.c --- a/libpurple/protocols/jabber/adhoccommands.c Fri Nov 09 04:07:37 2007 +0000 +++ b/libpurple/protocols/jabber/adhoccommands.c Fri Nov 09 08:06:20 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;