diff options
author | Marcus Lundblad <malu@pidgin.im> | 2010-09-04 15:47:59 +0000 |
---|---|---|
committer | Marcus Lundblad <malu@pidgin.im> | 2010-09-04 15:47:59 +0000 |
commit | 0d1e8924dc8f41ebf23063e93b171f26f40dcd44 (patch) | |
tree | 139690716c16edfa4d985a78c30e24951554a807 | |
parent | ab217cec58035d4a4385bd9c6a1262d513a3ec3a (diff) | |
download | pidgin-0d1e8924dc8f41ebf23063e93b171f26f40dcd44.tar.gz |
jabber: set priority on remote candidates for Google-style vv
-rw-r--r-- | libpurple/protocols/jabber/google/google_session.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libpurple/protocols/jabber/google/google_session.c b/libpurple/protocols/jabber/google/google_session.c index 34dde77444..b91a275f7f 100644 --- a/libpurple/protocols/jabber/google/google_session.c +++ b/libpurple/protocols/jabber/google/google_session.c @@ -543,13 +543,15 @@ google_session_handle_candidates(JabberStream *js, GoogleSession *session, xmln 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 @@ google_session_handle_candidates(JabberStream *js, GoogleSession *session, xmln 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 |