summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Markmann <tfar@soc.pidgin.im>2008-08-03 22:21:49 +0000
committerTobias Markmann <tfar@soc.pidgin.im>2008-08-03 22:21:49 +0000
commit2b336d6db0ab067fdb74be096e270984bc79c81d (patch)
tree60be6190ffc99b605237580901f585cbf3901831
parentccfdc3961a05e755b77610612ddfaa40dd867475 (diff)
downloadpidgin-2b336d6db0ab067fdb74be096e270984bc79c81d.tar.gz
* small bugfix in jabber_ipc_add_feature()
-rw-r--r--libpurple/protocols/jabber/jabber.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/libpurple/protocols/jabber/jabber.c b/libpurple/protocols/jabber/jabber.c
index 91f94e1053..2b72863798 100644
--- a/libpurple/protocols/jabber/jabber.c
+++ b/libpurple/protocols/jabber/jabber.c
@@ -528,7 +528,7 @@ txt_resolved_cb(PurpleTxtResponse *resp, int results, gpointer data)
JabberStream *js = gc->proto_data;
int n;
- if (results > 0) {
+ if (results == 0) {
gchar *tmp;
tmp = g_strdup_printf(_("Could not find alternative XMPP connection methods after failing to connect directly.\n"));
purple_connection_error_reason (gc,
@@ -537,7 +537,15 @@ txt_resolved_cb(PurpleTxtResponse *resp, int results, gpointer data)
}
for (n = 0; n < results; n++) {
- purple_debug_info("dnssrv","TXT RDATA: %s\n", resp[n].content);
+ gchar **token;
+ token = g_strsplit(resp[n].content, "=", 2);
+ if (!strcmp(token[0], "_xmpp-client-xbosh")) {
+ purple_debug_info("jabber","Found alternative connection method using %s at %s.\n", token[0], token[1]);
+ js->bosh.url = g_strdup(token[1]);
+ g_strfreev(token);
+ break;
+ }
+ g_strfreev(token);
}
}
@@ -2484,7 +2492,7 @@ jabber_ipc_contact_has_feature(gchar *fulljid, gchar *feature)
if (!caps_info) return FALSE;
capabilities = g_hash_table_lookup(capstable, caps_info);
- if (g_list_find(capabilities->features, feature) == NULL) return FALSE ;
+ if (g_list_find_custom(capabilities->features, feature, strcmp) == NULL) return FALSE ;
return TRUE;
}