# HG changeset patch # User Paul Aurich # Date 1244080301 0 # Node ID 53294b47a4a60bda5a3052c21c4e34425ab9014d # Parent 6bd7b3e0623338eac73a78f9c625eebd124ebf02 Fix an issue with the server responding with jid/node items as first-level children and add a TODO. That bug was revealed by ejabberd returning the ad-hoc commands (with no way to identify them as such) as children of the domain. diff -r 6bd7b3e06233 -r 53294b47a4a6 pidgin/plugins/disco/xmppdisco.c --- a/pidgin/plugins/disco/xmppdisco.c Thu Jun 04 01:18:45 2009 +0000 +++ b/pidgin/plugins/disco/xmppdisco.c Thu Jun 04 01:51:41 2009 +0000 @@ -17,6 +17,23 @@ * */ +/* TODO list (a little bit of a brain dump): + * Support more actions than "register" and "add" based on context. + - Subscribe to pubsub nodes (just...because?) + - Execute ad-hoc commands + - Change 'Register' to 'Unregister' if we're registered? + - Administer MUCs + * See if we can better handle the ad-hoc commands that ejabberd returns + when disco'ing a server as an administrator: +from disco#items: + +disco#info: + + + + * For services that are a JID w/o a node, handle fetching ad-hoc commands? +*/ + #include "internal.h" #include "pidgin.h" @@ -423,6 +440,8 @@ for (item = xmlnode_get_child(query, "item"); item; item = xmlnode_get_next_twin(item)) { const char *jid = xmlnode_get_attrib(item, "jid"); + const char *name = xmlnode_get_attrib(item, "name"); + const char *node = xmlnode_get_attrib(item, "node"); struct item_data *item_data; if (!jid) @@ -430,10 +449,12 @@ item_data = g_new0(struct item_data, 1); item_data->list = list; + item_data->name = g_strdup(name); + item_data->node = g_strdup(node); ++list->fetch_count; pidgin_disco_list_ref(list); - xmpp_disco_info_do(pc, item_data, jid, NULL, got_info_cb); + xmpp_disco_info_do(pc, item_data, jid, node, got_info_cb); } }