diff libpurple/protocols/jabber/buddy.c @ 16990:f8d0c9bbb9ae

gross hack that will save me time in 30 second chunks
author Nathan Walp <nwalp@pidgin.im>
date Wed, 09 May 2007 23:07:56 +0000
parents 88444e60ea95
children 830c0cc9b9d4
line wrap: on
line diff
--- a/libpurple/protocols/jabber/buddy.c	Wed May 09 21:15:05 2007 +0000
+++ b/libpurple/protocols/jabber/buddy.c	Wed May 09 23:07:56 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);
 	}