Mercurial > pidgin
comparison libpurple/media.c @ 28532:867438a30bdd
Allow the initiator to start connection checks before the remote side accepts.
Clients are allowed send candidates before acceptance. Empathy doesn't accept
until the connection checks are successful. Fixes Pidgin <-> Empathy calls.
author | maiku@pidgin.im |
---|---|
date | Wed, 11 Nov 2009 02:38:28 +0000 |
parents | 2c4a3703324b |
children | f1437342cc0e f93ac891ff01 0b5520bf1fe3 |
comparison
equal
deleted
inserted
replaced
28531:aa8fa6335c9c | 28532:867438a30bdd |
---|---|
2279 g_object_set(G_OBJECT(stream->stream), "direction", | 2279 g_object_set(G_OBJECT(stream->stream), "direction", |
2280 purple_media_to_fs_stream_direction( | 2280 purple_media_to_fs_stream_direction( |
2281 stream->session->type), NULL); | 2281 stream->session->type), NULL); |
2282 stream->accepted = TRUE; | 2282 stream->accepted = TRUE; |
2283 | 2283 |
2284 if (stream->remote_candidates != NULL) { | 2284 if (stream->remote_candidates != NULL && |
2285 stream->initiator == FALSE) { | |
2285 GError *err = NULL; | 2286 GError *err = NULL; |
2286 fs_stream_set_remote_candidates(stream->stream, | 2287 fs_stream_set_remote_candidates(stream->stream, |
2287 stream->remote_candidates, &err); | 2288 stream->remote_candidates, &err); |
2288 | 2289 |
2289 if (err) { | 2290 if (err) { |
2814 return FALSE; | 2815 return FALSE; |
2815 } | 2816 } |
2816 } | 2817 } |
2817 | 2818 |
2818 fsstream = fs_session_new_stream(session->session, | 2819 fsstream = fs_session_new_stream(session->session, |
2819 participant, type_direction & | 2820 participant, initiator == TRUE ? |
2820 FS_DIRECTION_RECV, transmitter, | 2821 type_direction : (type_direction & |
2822 FS_DIRECTION_RECV), transmitter, | |
2821 new_num_params, param, &err); | 2823 new_num_params, param, &err); |
2822 g_free(param); | 2824 g_free(param); |
2823 } else { | 2825 } else { |
2824 fsstream = fs_session_new_stream(session->session, | 2826 fsstream = fs_session_new_stream(session->session, |
2825 participant, type_direction & | 2827 participant, initiator == TRUE ? |
2826 FS_DIRECTION_RECV, transmitter, | 2828 type_direction : (type_direction & |
2829 FS_DIRECTION_RECV), transmitter, | |
2827 num_params, params, &err); | 2830 num_params, params, &err); |
2828 } | 2831 } |
2829 | 2832 |
2830 if (fsstream == NULL) { | 2833 if (fsstream == NULL) { |
2831 purple_debug_error("media", | 2834 purple_debug_error("media", |
2950 } | 2953 } |
2951 | 2954 |
2952 stream->remote_candidates = g_list_concat(stream->remote_candidates, | 2955 stream->remote_candidates = g_list_concat(stream->remote_candidates, |
2953 purple_media_candidate_list_to_fs(remote_candidates)); | 2956 purple_media_candidate_list_to_fs(remote_candidates)); |
2954 | 2957 |
2955 if (stream->accepted == TRUE) { | 2958 if (stream->initiator == TRUE || stream->accepted == TRUE) { |
2956 fs_stream_set_remote_candidates(stream->stream, | 2959 fs_stream_set_remote_candidates(stream->stream, |
2957 stream->remote_candidates, &err); | 2960 stream->remote_candidates, &err); |
2958 | 2961 |
2959 if (err) { | 2962 if (err) { |
2960 purple_debug_error("media", "Error adding remote" | 2963 purple_debug_error("media", "Error adding remote" |