changeset 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 aa8fa6335c9c
children 52eef06b1829 f93ac891ff01
files libpurple/media.c
diffstat 1 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/media.c	Wed Nov 11 02:06:19 2009 +0000
+++ b/libpurple/media.c	Wed Nov 11 02:38:28 2009 +0000
@@ -2281,7 +2281,8 @@
 					stream->session->type), NULL);
 			stream->accepted = TRUE;
 
-			if (stream->remote_candidates != NULL) {
+			if (stream->remote_candidates != NULL &&
+					stream->initiator == FALSE) {
 				GError *err = NULL;
 				fs_stream_set_remote_candidates(stream->stream,
 						stream->remote_candidates, &err);
@@ -2816,14 +2817,16 @@
 			}
 
 			fsstream = fs_session_new_stream(session->session,
-					participant, type_direction &
-					FS_DIRECTION_RECV, transmitter,
+					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, type_direction &
-					FS_DIRECTION_RECV, transmitter,
+					participant, initiator == TRUE ?
+					type_direction : (type_direction &
+					FS_DIRECTION_RECV), transmitter,
 					num_params, params, &err);
 		}
 
@@ -2952,7 +2955,7 @@
 	stream->remote_candidates = g_list_concat(stream->remote_candidates,
 			purple_media_candidate_list_to_fs(remote_candidates));
 
-	if (stream->accepted == TRUE) {
+	if (stream->initiator == TRUE || stream->accepted == TRUE) {
 		fs_stream_set_remote_candidates(stream->stream,
 				stream->remote_candidates, &err);