# HG changeset patch # User Nathan Walp # Date 1178752076 0 # Node ID f8d0c9bbb9ae36e1f6f229547df5a48052dcac01 # Parent d637851abeb8e32562d0afd079cf87ded5c7d09c gross hack that will save me time in 30 second chunks diff -r d637851abeb8 -r f8d0c9bbb9ae libpurple/protocols/jabber/buddy.c --- 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); }