diff libpurple/protocols/jabber/google/jingleinfo.c @ 30530:2e26b90a28dd

Now it compiles again...
author Marcus Lundblad <ml@update.uu.se>
date Wed, 01 Sep 2010 21:23:55 +0000
parents 34f586bffe4e
children a8cc50c2279f
line wrap: on
line diff
--- a/libpurple/protocols/jabber/google/jingleinfo.c	Wed Sep 01 20:33:45 2010 +0000
+++ b/libpurple/protocols/jabber/google/jingleinfo.c	Wed Sep 01 21:23:55 2010 +0000
@@ -76,6 +76,7 @@
                                  JabberIqType type, xmlnode *query)
 {
 	const xmlnode *stun = xmlnode_get_child(query, "stun");
+	const xmlnode *relay = xmlnode_get_child(query, "relay");
 	gchar *my_bare_jid;
 
 	/*
@@ -119,8 +120,23 @@
 			}
 		}
 	}
-	/* should perhaps handle relays later on, or maybe wait until
-	 Google supports a common standard... */
+
+	if (relay) {
+		xmlnode *token = xmlnode_get_child(relay, "token");
+		xmlnode *server = xmlnode_get_child(relay, "server");
+		
+		if (token) {
+			gchar *relay_token = xmlnode_get_data(token);
+
+			/* we let js own the string returned from xmlnode_get_data */
+			js->google_relay_token = relay_token;
+		}
+
+		if (server) {
+			js->google_relay_host = 
+				g_strdup(xmlnode_get_attrib(server, "host"));
+		}
+	}
 }
 
 static void