# HG changeset patch # User Marcus Lundblad # Date 1253911148 0 # Node ID 2bb3936d2f1eeff39c07ecd79d3adc23d42ccce5 # Parent f858b53dfbf0720cf88cfb60113abc17de39d3a0 Don't include relay-info in the stream params if the prpl has already set it (like Google) since this will allow it use a non-standard relay... diff -r f858b53dfbf0 -r 2bb3936d2f1e libpurple/media.c --- a/libpurple/media.c Thu Sep 24 20:22:24 2009 +0000 +++ b/libpurple/media.c Fri Sep 25 20:39:08 2009 +0000 @@ -2719,9 +2719,22 @@ const gchar *stun_ip = purple_network_get_stun_ip(); const gchar *turn_ip = purple_network_get_turn_ip(); - if (stun_ip || turn_ip) { + /* check if the prpl has already specified a relay-info + we need to do this to allow them to override when using non-standard + TURN modes, like Google f.ex. */ + gboolean got_turn_from_prpl = FALSE; + int i; + + for (i = 0 ; i < num_params ; i++) { + if (purple_strequal(params[i].name, "relay-info")) { + got_turn_from_prpl = TRUE; + break; + } + } + + if (stun_ip || (turn_ip && !got_turn_from_prpl)) { guint new_num_params = - (stun_ip && is_nice) && turn_ip ? + (stun_ip && is_nice && turn_ip && !got_turn_from_prpl) ? num_params + 2 : num_params + 1; guint next_param_index = num_params; GParameter *param = g_new0(GParameter, new_num_params); @@ -2737,7 +2750,7 @@ next_param_index++; } - if (turn_ip && is_nice) { + if (turn_ip && !got_turn_from_prpl && is_nice) { GValueArray *relay_info = g_value_array_new(0); GValue value; gint turn_port =