pidgin: 94fef144: Allow the initiator to start connection ...

maiku at pidgin.im maiku at pidgin.im
Tue Nov 10 21:40:27 EST 2009


-----------------------------------------------------------------
Revision: 94fef144531267b3eb00d02de32ce8a705df592c
Ancestor: c744dcf4d1215326fbb92b5178b3825a7bb35f19
Author: maiku at pidgin.im
Date: 2009-11-11T02:38:28
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/94fef144531267b3eb00d02de32ce8a705df592c

Modified files:
        libpurple/media.c

ChangeLog: 

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.

-------------- next part --------------
============================================================
--- libpurple/media.c	3bdd23bf80c6d8ab374dc4b34f70283a49dd479e
+++ libpurple/media.c	0b99988ea2d569de8965dcaeb554ea1eb6d8a542
@@ -2281,7 +2281,8 @@ purple_media_stream_info(PurpleMedia *me
 					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 @@ purple_media_add_stream(PurpleMedia *med
 			}
 
 			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 @@ purple_media_add_remote_candidates(Purpl
 	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);
 


More information about the Commits mailing list