changeset 16994:b4720d213f31

merge of 'c0fb147adcf6f18b147249c26e510fed206697ea' and 'ed3f09c2af33db942ef45b9acc2a75f126aadcfa'
author Nathan Walp <nwalp@pidgin.im>
date Wed, 09 May 2007 23:44:49 +0000
parents f8d0c9bbb9ae (diff) 87e6707b512f (current diff)
children 8d94cf688009 af4181dde6fa
files
diffstat 1 files changed, 30 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/buddy.c	Wed May 09 22:04:39 2007 +0000
+++ b/libpurple/protocols/jabber/buddy.c	Wed May 09 23:44:49 2007 +0000
@@ -1118,6 +1118,24 @@
 	return FALSE;
 }
 
+static gboolean _client_is_blacklisted(JabberBuddyResource *jbr, const char *ns)
+{
+	/* can't be blacklisted if we don't know what you're running yet */
+	if(!jbr->client.name)
+		return FALSE;
+
+	if(!strcmp(ns, "jabber:iq:last")) {
+		if(!strcmp(jbr->client.name, "Trillian")) {
+			if(!strcmp(jbr->client.version, "3.1.0.121")) {
+				/* verified by nwalp 2007/05/09 */
+				return TRUE;
+			}
+		}
+	}
+
+	return FALSE;
+}
+
 static void jabber_buddy_get_info_for_jid(JabberStream *js, const char *jid)
 {
 	JabberIq *iq;
@@ -1175,11 +1193,18 @@
 			jabber_iq_send(iq);
 		}
 
-		iq = jabber_iq_new_query(js, JABBER_IQ_GET, "jabber:iq:last");
-		xmlnode_set_attrib(iq->node, "to", full_jid);
-		jabber_iq_set_callback(iq, jabber_last_parse, jbi);
-		jbi->ids = g_slist_prepend(jbi->ids, g_strdup(iq->id));
-		jabber_iq_send(iq);
+		/* this is to fix the feeling of irritation I get when trying
+		 * to get info on a friend running Trillian, which doesn't
+		 * respont (with an error or otherwise) to jabber:iq:last
+		 * requests.  There are a number of Trillian users in my
+		 * office. */
+		if(!_client_is_blacklisted(jbr, "jabber:iq:last")) {
+			iq = jabber_iq_new_query(js, JABBER_IQ_GET, "jabber:iq:last");
+			xmlnode_set_attrib(iq->node, "to", full_jid);
+			jabber_iq_set_callback(iq, jabber_last_parse, jbi);
+			jbi->ids = g_slist_prepend(jbi->ids, g_strdup(iq->id));
+			jabber_iq_send(iq);
+		}
 
 		g_free(full_jid);
 	}