libpurple/protocols/jabber/adhoccommands.c

branch
soc.2007.xmpp
changeset 18797
0cff7a4d0449
parent 18754
d0a3169c8f29
child 19898
218e4bb04853
equal deleted inserted replaced
18796:d992fc9f9f35 18797:0cff7a4d0449
126 126
127 static void jabber_adhoc_parse(JabberStream *js, xmlnode *packet, gpointer data) { 127 static void jabber_adhoc_parse(JabberStream *js, xmlnode *packet, gpointer data) {
128 xmlnode *command = xmlnode_get_child_with_namespace(packet, "command", "http://jabber.org/protocol/commands"); 128 xmlnode *command = xmlnode_get_child_with_namespace(packet, "command", "http://jabber.org/protocol/commands");
129 const char *status = xmlnode_get_attrib(command,"status"); 129 const char *status = xmlnode_get_attrib(command,"status");
130 xmlnode *xdata = xmlnode_get_child_with_namespace(command,"x","jabber:x:data"); 130 xmlnode *xdata = xmlnode_get_child_with_namespace(command,"x","jabber:x:data");
131 const char *type = xmlnode_get_attrib(packet,"type");
132
133 if(type && !strcmp(type,"error")) {
134 char *msg = jabber_parse_error(js, packet);
135 if(!msg)
136 msg = g_strdup(_("Unknown Error"));
137
138 purple_notify_error(NULL, _("Ad-Hoc Command Failed"),
139 _("Ad-Hoc Command Failed"), msg);
140 g_free(msg);
141 return;
142 }
143 if(!type || strcmp(type,"result"))
144 return;
131 145
132 if(!status) 146 if(!status)
133 return; 147 return;
134 148
135 if(!strcmp(status,"completed")) { 149 if(!strcmp(status,"completed")) {

mercurial