# HG changeset patch # User Nathan Walp # Date 1178754289 0 # Node ID b4720d213f316348f3552a33277a24d999f7a25a # Parent f8d0c9bbb9ae36e1f6f229547df5a48052dcac01# Parent 87e6707b512f552c14c99b03343a61d6b458e290 merge of 'c0fb147adcf6f18b147249c26e510fed206697ea' and 'ed3f09c2af33db942ef45b9acc2a75f126aadcfa' diff -r 87e6707b512f -r b4720d213f31 libpurple/protocols/jabber/buddy.c --- 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); } diff -r 87e6707b512f -r b4720d213f31 libpurple/protocols/jabber/libxmpp.c