pidgin: 99982a9d: Fix an issue with the server responding ...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Wed Jun 3 21:55:26 EDT 2009


-----------------------------------------------------------------
Revision: 99982a9d5c9da8620d3b612c7a4625c32684834a
Ancestor: 6f45c572115a887648567a632193add720a030da
Author: darkrain42 at pidgin.im
Date: 2009-06-04T01:51:41
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/99982a9d5c9da8620d3b612c7a4625c32684834a

Modified files:
        pidgin/plugins/disco/xmppdisco.c

ChangeLog: 

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.

-------------- next part --------------
============================================================
--- pidgin/plugins/disco/xmppdisco.c	6f03902f898aa3ecc542abce91322ed98e471f28
+++ pidgin/plugins/disco/xmppdisco.c	af179b91f665a2d8f7eb5ee3a95c5e74ea721fbe
@@ -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:
+	<item jid='darkrain42.org' node='announce' name='Announcements'/>
+disco#info:
+	<iq from='darkrain42.org' type='result'>
+		<query xmlns='http://jabber.org/protocol/disco#info' node='announce'/>
+	</iq>
+	* 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 @@ server_items_cb(PurpleConnection *pc, co
 		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 @@ server_items_cb(PurpleConnection *pc, co
 
 			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);
 		}
 	}
 


More information about the Commits mailing list