jabber: set priority on remote candidates for Google-style vv

Sat, 04 Sep 2010 15:47:59 +0000

author
Marcus Lundblad <malu@pidgin.im>
date
Sat, 04 Sep 2010 15:47:59 +0000
changeset 30756
4f357819d93b
parent 30755
10446db8b003
child 30757
ca36f52b5f77
child 30773
530a74a5b97e

jabber: set priority on remote candidates for Google-style vv

libpurple/protocols/jabber/google/google_session.c file | annotate | diff | comparison | revisions
--- a/libpurple/protocols/jabber/google/google_session.c	Fri Sep 03 20:08:14 2010 +0000
+++ b/libpurple/protocols/jabber/google/google_session.c	Sat Sep 04 15:47:59 2010 +0000
@@ -543,13 +543,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"))
@@ -573,7 +575,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))
 				video_list = g_list_append(video_list, info);
 			else

mercurial