diff libpurple/media/backend-fs2.c @ 29239:9da83d5f48c3

Allow connection checks before acceptance. Fixes Empathy<->Pidgin.
author maiku@pidgin.im
date Wed, 11 Nov 2009 05:31:38 +0000
parents 85a7a93cd19a
children bd7159aeabc0
line wrap: on
line diff
--- a/libpurple/media/backend-fs2.c	Wed Nov 11 03:07:21 2009 +0000
+++ b/libpurple/media/backend-fs2.c	Wed Nov 11 05:31:38 2009 +0000
@@ -1088,7 +1088,8 @@
 				session_type_to_fs_stream_direction(
 				stream->session->type), NULL);
 
-		if (stream->remote_candidates == NULL)
+		if (stream->remote_candidates == NULL ||
+				purple_media_is_initiator(media, sid, name))
 			return;
 
 		fs_stream_set_remote_candidates(stream->stream,
@@ -1650,7 +1651,8 @@
 	}
 
 	fsstream = fs_session_new_stream(session->session, participant,
-			type_direction & FS_DIRECTION_RECV, transmitter,
+			initiator == TRUE ? type_direction :
+			(type_direction & FS_DIRECTION_RECV), transmitter,
 			_num_params, _params, &err);
 	g_free(_params);
 
@@ -1762,7 +1764,9 @@
 	stream->remote_candidates = g_list_concat(stream->remote_candidates,
 			candidate_list_to_fs(remote_candidates));
 
-	if (purple_media_accepted(priv->media, sess_id, participant)) {
+	if (purple_media_is_initiator(priv->media, sess_id, participant) ||
+			purple_media_accepted(
+			priv->media, sess_id, participant)) {
 		fs_stream_set_remote_candidates(stream->stream,
 				stream->remote_candidates, &err);