# HG changeset patch # User Marcus Lundblad # Date 1265237283 0 # Node ID 3de19f8f5c923a7c854441ef3d9d86dfe19ee644 # Parent 452043d200f09f54de5b5015d43b5d30c6d8bdec# Parent 0629b6814963fe27b6282b4f2e57af7dd2141486 merge of '57bf84117d335fd0bba1edff4c5b3b21e29f6bbc' and '681fb86466372d3d72fbfb554c0b766c81d763e6' diff -r 452043d200f0 -r 3de19f8f5c92 ChangeLog --- a/ChangeLog Wed Feb 03 22:19:11 2010 +0000 +++ b/ChangeLog Wed Feb 03 22:48:03 2010 +0000 @@ -5,6 +5,8 @@ * Fix 'make check' on OS X. (David Fang) * Fix a quirk in purple_markup_html_to_xhtml that caused some messages to be improperly converted to XHTML. + * Set "controlling-mode" correctly when initializing a media session. + Fixes receiving voice calls from Psi. General: * Correctly disable all missing dependencies when using the diff -r 452043d200f0 -r 3de19f8f5c92 libpurple/media.c --- a/libpurple/media.c Wed Feb 03 22:19:11 2010 +0000 +++ b/libpurple/media.c Wed Feb 03 22:48:03 2010 +0000 @@ -2754,15 +2754,21 @@ FsStream *fsstream = NULL; const gchar *stun_ip = purple_network_get_stun_ip(); const gchar *turn_ip = purple_network_get_turn_ip(); - - if (stun_ip || turn_ip) { - guint new_num_params = + guint new_num_params = + !stun_ip && !turn_ip ? num_params + 1 : (stun_ip && is_nice) && turn_ip ? - num_params + 2 : num_params + 1; - guint next_param_index = num_params; - GParameter *param = g_new0(GParameter, new_num_params); - memcpy(param, params, sizeof(GParameter) * num_params); - + num_params + 3 : num_params + 2; + guint next_param_index = num_params; + GParameter *param = g_new0(GParameter, new_num_params); + memcpy(param, params, sizeof(GParameter) * num_params); + + /* set controlling mode according to direction */ + param[next_param_index].name = "controlling-mode"; + g_value_init(¶m[next_param_index].value, G_TYPE_BOOLEAN); + g_value_set_boolean(¶m[next_param_index].value, initiator); + next_param_index++; + + if (stun_ip || turn_ip) { if (stun_ip) { purple_debug_info("media", "setting property stun-ip on new stream: %s\n", stun_ip); @@ -2813,20 +2819,14 @@ return FALSE; } } - - fsstream = fs_session_new_stream(session->session, + } + + fsstream = fs_session_new_stream(session->session, participant, initiator == TRUE ? type_direction : (type_direction & FS_DIRECTION_RECV), transmitter, new_num_params, param, &err); - g_free(param); - } else { - fsstream = fs_session_new_stream(session->session, - participant, initiator == TRUE ? - type_direction : (type_direction & - FS_DIRECTION_RECV), transmitter, - num_params, params, &err); - } + g_free(param); if (fsstream == NULL) { purple_debug_error("media",