comparison 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
comparison
equal deleted inserted replaced
16989:d637851abeb8 16990:f8d0c9bbb9ae
1116 jabber_buddy_info_show_if_ready(jbi); 1116 jabber_buddy_info_show_if_ready(jbi);
1117 1117
1118 return FALSE; 1118 return FALSE;
1119 } 1119 }
1120 1120
1121 static gboolean _client_is_blacklisted(JabberBuddyResource *jbr, const char *ns)
1122 {
1123 /* can't be blacklisted if we don't know what you're running yet */
1124 if(!jbr->client.name)
1125 return FALSE;
1126
1127 if(!strcmp(ns, "jabber:iq:last")) {
1128 if(!strcmp(jbr->client.name, "Trillian")) {
1129 if(!strcmp(jbr->client.version, "3.1.0.121")) {
1130 /* verified by nwalp 2007/05/09 */
1131 return TRUE;
1132 }
1133 }
1134 }
1135
1136 return FALSE;
1137 }
1138
1121 static void jabber_buddy_get_info_for_jid(JabberStream *js, const char *jid) 1139 static void jabber_buddy_get_info_for_jid(JabberStream *js, const char *jid)
1122 { 1140 {
1123 JabberIq *iq; 1141 JabberIq *iq;
1124 xmlnode *vcard; 1142 xmlnode *vcard;
1125 GList *resources; 1143 GList *resources;
1173 jabber_iq_set_callback(iq, jabber_version_parse, jbi); 1191 jabber_iq_set_callback(iq, jabber_version_parse, jbi);
1174 jbi->ids = g_slist_prepend(jbi->ids, g_strdup(iq->id)); 1192 jbi->ids = g_slist_prepend(jbi->ids, g_strdup(iq->id));
1175 jabber_iq_send(iq); 1193 jabber_iq_send(iq);
1176 } 1194 }
1177 1195
1178 iq = jabber_iq_new_query(js, JABBER_IQ_GET, "jabber:iq:last"); 1196 /* this is to fix the feeling of irritation I get when trying
1179 xmlnode_set_attrib(iq->node, "to", full_jid); 1197 * to get info on a friend running Trillian, which doesn't
1180 jabber_iq_set_callback(iq, jabber_last_parse, jbi); 1198 * respont (with an error or otherwise) to jabber:iq:last
1181 jbi->ids = g_slist_prepend(jbi->ids, g_strdup(iq->id)); 1199 * requests. There are a number of Trillian users in my
1182 jabber_iq_send(iq); 1200 * office. */
1201 if(!_client_is_blacklisted(jbr, "jabber:iq:last")) {
1202 iq = jabber_iq_new_query(js, JABBER_IQ_GET, "jabber:iq:last");
1203 xmlnode_set_attrib(iq->node, "to", full_jid);
1204 jabber_iq_set_callback(iq, jabber_last_parse, jbi);
1205 jbi->ids = g_slist_prepend(jbi->ids, g_strdup(iq->id));
1206 jabber_iq_send(iq);
1207 }
1183 1208
1184 g_free(full_jid); 1209 g_free(full_jid);
1185 } 1210 }
1186 1211
1187 js->pending_buddy_info_requests = g_slist_prepend(js->pending_buddy_info_requests, jbi); 1212 js->pending_buddy_info_requests = g_slist_prepend(js->pending_buddy_info_requests, jbi);