changeset 8398:66db94ff619c

[gaim-migrate @ 9127] handle web page registration hints committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Fri, 05 Mar 2004 16:24:05 +0000
parents b63debdf5a92
children 681b1661ee8b
files src/protocols/jabber/jabber.c
diffstat 1 files changed, 16 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/jabber/jabber.c	Fri Mar 05 16:14:22 2004 +0000
+++ b/src/protocols/jabber/jabber.c	Fri Mar 05 16:24:05 2004 +0000
@@ -605,19 +605,26 @@
 			return;
 		}
 
-		for(x = xmlnode_get_child(packet, "x"); x; x = xmlnode_get_next_twin(x)) {
-			const char *xmlns;
-			if(!(xmlns = xmlnode_get_attrib(x, "xmlns")))
-				continue;
+		if((x = xmlnode_get_child_with_namespace(packet, "x",
+						"jabber:x:data"))) {
+			jabber_x_data_request(js, x, jabber_register_x_data_cb, NULL);
+			return;
+		} else if((x = xmlnode_get_child_with_namespace(packet, "x",
+						"jabber:x:oob"))) {
+			xmlnode *url;
 
-			if(!strcmp(xmlns, "jabber:x:data")) {
-				jabber_x_data_request(js, x, jabber_register_x_data_cb, NULL);
-				return;
+			if((url = xmlnode_get_child(x, "url"))) {
+				char *href;
+				if((href = xmlnode_get_data(url))) {
+					gaim_notify_uri(NULL, href);
+					g_free(href);
+					js->gc->wants_to_die = TRUE;
+					jabber_connection_schedule_close(js);
+					return;
+				}
 			}
 		}
 
-		/* XXX: if no jabber:x:data, but jabber:x:oob is there, use that */
-
 		/* as a last resort, use the old jabber:iq:register syntax */
 
 		fields = gaim_request_fields_new();