changeset 25597:9f8951284a2e

* small bugfix in jabber_ipc_add_feature()
author Tobias Markmann <tfar@soc.pidgin.im>
date Sun, 03 Aug 2008 22:21:49 +0000
parents 7768cad83127
children b238da95f39a
files libpurple/protocols/jabber/jabber.c
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jabber.c	Sun Aug 03 13:48:59 2008 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Sun Aug 03 22:21:49 2008 +0000
@@ -528,7 +528,7 @@
 	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 @@
 	}
 	
 	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 @@
 	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;
 }