diff libpurple/protocols/jabber/google/google_session.c @ 30965:e126e263be18

propagate from branch 'im.pidgin.pidgin' (head 1fe5329935f43a65155a01681228bdab48f3b48b) to branch 'im.pidgin.cpw.malu.xmpp.google_relay' (head 1a4d83bf629ef1561c5587cdd4487d9db012979b)
author Marcus Lundblad <ml@update.uu.se>
date Sat, 04 Sep 2010 15:48:23 +0000
parents c423dd4fb003 e97788414900
children 75045bed7704
line wrap: on
line diff
--- a/libpurple/protocols/jabber/google/google_session.c	Thu Sep 02 21:00:25 2010 +0000
+++ b/libpurple/protocols/jabber/google/google_session.c	Sat Sep 04 15:48:23 2010 +0000
@@ -745,13 +745,15 @@
 		const gchar *protocol = xmlnode_get_attrib(cand, "protocol");
 		const gchar *address = xmlnode_get_attrib(cand, "address");
 		const gchar *port = xmlnode_get_attrib(cand, "port");
+		const gchar *priority = xmlnode_get_attrib(cand, "priority");
 		guint component_id;
 
 		if (cname && type && address && port) {
 			PurpleMediaCandidateType candidate_type;
-
+			guint prio = priority ? atof(priority) * 1000 : 0;
+			
 			g_snprintf(n, sizeof(n), "S%d", name++);
-
+			
 			if (g_str_equal(type, "local"))
 				candidate_type = PURPLE_MEDIA_CANDIDATE_TYPE_HOST;
 			else if (g_str_equal(type, "stun"))
@@ -775,7 +777,8 @@
 					address,
 					atoi(port));
 			g_object_set(info, "username", xmlnode_get_attrib(cand, "username"),
-					"password", xmlnode_get_attrib(cand, "password"), NULL);
+					"password", xmlnode_get_attrib(cand, "password"),
+			        "priority", prio, NULL);
 			if (!strncmp(cname, "video_", 6)) {
 				if (session_data->added_streams) {
 					video_list = g_list_append(video_list, info);