pidgin: 8c750517: Only try to fetch adhoc commands from bu...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Thu May 7 23:00:27 EDT 2009


-----------------------------------------------------------------
Revision: 8c750517ab44a01e47f71cbe26137c71a5a0ec62
Ancestor: eab222a9387545fa33ff564e86c0847652447eb8
Author: darkrain42 at pidgin.im
Date: 2009-05-08T02:58:33
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/8c750517ab44a01e47f71cbe26137c71a5a0ec62

Modified files:
        libpurple/protocols/jabber/buddy.h
        libpurple/protocols/jabber/presence.c

ChangeLog: 

Only try to fetch adhoc commands from buddies once. Pushed updates (which we support now) are far superior.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/buddy.h	dd87b0d002b95e43adf2abf9b24ec82727ff25ba
+++ libpurple/protocols/jabber/buddy.h	fbee7a1866a43ffd1c2b0dea0625610e5d33773e
@@ -86,6 +86,7 @@ typedef struct _JabberBuddyResource {
 		GList *exts;
 	} caps;
 	GList *commands;
+	gboolean commands_fetched;
 } JabberBuddyResource;
 
 void jabber_buddy_free(JabberBuddy *jb);
============================================================
--- libpurple/protocols/jabber/presence.c	7516399ba4c60baff74d1874665633453195fbfc
+++ libpurple/protocols/jabber/presence.c	1ef4842a4a58e332423a1a871cb95772d5d53174
@@ -429,13 +429,15 @@ jabber_presence_set_capabilities(JabberC
 	jbr->caps.info = info;
 	jbr->caps.exts = exts;
 
-	if (jabber_resource_has_capability(jbr, "http://jabber.org/protocol/commands")) {
+	if (!jbr->commands_fetched && jabber_resource_has_capability(jbr, "http://jabber.org/protocol/commands")) {
 		JabberIq *iq = jabber_iq_new_query(userdata->js, JABBER_IQ_GET, "http://jabber.org/protocol/disco#items");
 		xmlnode *query = xmlnode_get_child_with_namespace(iq->node, "query", "http://jabber.org/protocol/disco#items");
 		xmlnode_set_attrib(iq->node, "to", userdata->from);
 		xmlnode_set_attrib(query, "node", "http://jabber.org/protocol/commands");
 		jabber_iq_set_callback(iq, jabber_adhoc_disco_result_cb, NULL);
 		jabber_iq_send(iq);
+
+		jbr->commands_fetched = TRUE;
 	}
 
 	g_free(userdata->from);


More information about the Commits mailing list