changeset 26931:e7819fa37224

Only try to fetch adhoc commands from buddies once. Pushed updates (which we support now) are far superior.
author Paul Aurich <paul@darkrain42.org>
date Fri, 08 May 2009 02:58:33 +0000
parents 7d924c723d7e
children 04af21d4be27
files libpurple/protocols/jabber/buddy.h libpurple/protocols/jabber/presence.c
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/buddy.h	Fri May 08 02:50:17 2009 +0000
+++ b/libpurple/protocols/jabber/buddy.h	Fri May 08 02:58:33 2009 +0000
@@ -86,6 +86,7 @@
 		GList *exts;
 	} caps;
 	GList *commands;
+	gboolean commands_fetched;
 } JabberBuddyResource;
 
 void jabber_buddy_free(JabberBuddy *jb);
--- a/libpurple/protocols/jabber/presence.c	Fri May 08 02:50:17 2009 +0000
+++ b/libpurple/protocols/jabber/presence.c	Fri May 08 02:58:33 2009 +0000
@@ -429,13 +429,15 @@
 	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);