changeset 7730:01eb54bb41dc

[gaim-migrate @ 8375] jabber updates committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Thu, 04 Dec 2003 03:19:59 +0000
parents 2ffb337be055
children 36727d6e1d5a
files src/protocols/jabber/auth.c
diffstat 1 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/jabber/auth.c	Wed Dec 03 17:29:48 2003 +0000
+++ b/src/protocols/jabber/auth.c	Thu Dec 04 03:19:59 2003 +0000
@@ -111,14 +111,18 @@
 {
 	const char *type = xmlnode_get_attrib(packet, "type");
 
-	if(type && !strcmp(type, "error")) {
+	if(type && !strcmp(type, "result")) {
+		jabber_stream_set_state(js, JABBER_STREAM_CONNECTED);
+	} else {
 		xmlnode *error = xmlnode_get_child(packet, "error");
-		const char *err_code;
-		char *err_text;
+		const char *err_code = NULL;
+		char *err_text = NULL;
 		char *buf;
 
-		err_code = xmlnode_get_attrib(error, "code");
-		err_text = xmlnode_get_data(error);
+		if(error) {
+			err_code = xmlnode_get_attrib(error, "code");
+			err_text = xmlnode_get_data(error);
+		}
 
 		if(!err_code)
 			err_code = "";
@@ -135,7 +139,6 @@
 		g_free(err_text);
 		g_free(buf);
 	}
-	jabber_stream_set_state(js, JABBER_STREAM_CONNECTED);
 }
 
 static void auth_old_cb(JabberStream *js, xmlnode *packet, gpointer data)