changeset 29603:d510b0324721

Handle individual streams in the Fs2 backend's stream-info callback for accept signals.
author maiku@pidgin.im
date Wed, 28 Oct 2009 19:01:33 +0000
parents f66dec812ba9
children 2b2b930281a0
files libpurple/media/backend-fs2.c
diffstat 1 files changed, 17 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/media/backend-fs2.c	Wed Oct 28 18:36:18 2009 +0000
+++ b/libpurple/media/backend-fs2.c	Wed Oct 28 19:01:33 2009 +0000
@@ -1079,32 +1079,28 @@
 		gchar *sid, gchar *name, gboolean local,
 		PurpleMediaBackendFs2 *self)
 {
-	if (type == PURPLE_MEDIA_INFO_ACCEPT) {
-		GList *streams = _get_streams(self, sid, name);
-		
-		for (; streams; streams =
-				g_list_delete_link(streams, streams)) {
-			PurpleMediaBackendFs2Stream *stream = streams->data;
-			GError *err = NULL;
+	if (type == PURPLE_MEDIA_INFO_ACCEPT && sid != NULL && name != NULL) {
+		PurpleMediaBackendFs2Stream *stream =
+				_get_stream(self, sid, name);
+		GError *err = NULL;
 
-			g_object_set(G_OBJECT(stream->stream), "direction",
-					_session_type_to_fs_stream_direction(
-					stream->session->type), NULL);
+		g_object_set(G_OBJECT(stream->stream), "direction",
+				_session_type_to_fs_stream_direction(
+				stream->session->type), NULL);
 
-			if (stream->remote_candidates == NULL)
-				continue;
+		if (stream->remote_candidates == NULL)
+			return;
 
-			fs_stream_set_remote_candidates(stream->stream,
-					stream->remote_candidates, &err);
+		fs_stream_set_remote_candidates(stream->stream,
+				stream->remote_candidates, &err);
 
-			if (err == NULL)
-				continue;
+		if (err == NULL)
+			return;
 
-			purple_debug_error("backend-fs2", "Error adding "
-					"remote candidates: %s\n",
-					err->message);
-			g_error_free(err);
-		}
+		purple_debug_error("backend-fs2", "Error adding "
+				"remote candidates: %s\n",
+				err->message);
+		g_error_free(err);
 	} else if (local == TRUE && (type == PURPLE_MEDIA_INFO_MUTE ||
 			type == PURPLE_MEDIA_INFO_UNMUTE)) {
 		PurpleMediaBackendFs2Private *priv =