changeset 29208:f66dec812ba9

Move new stream emission back to media.c
author maiku@pidgin.im
date Wed, 28 Oct 2009 18:36:18 +0000
parents bcee1aab1c01
children d510b0324721
files libpurple/media/backend-fs2.c libpurple/media/media.c
diffstat 2 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/media/backend-fs2.c	Wed Oct 28 18:24:10 2009 +0000
+++ b/libpurple/media/backend-fs2.c	Wed Oct 28 18:36:18 2009 +0000
@@ -1468,9 +1468,6 @@
 
 	g_hash_table_insert(priv->participants, g_strdup(name), participant);
 
-	g_signal_emit_by_name(priv->media, "state-changed",
-			PURPLE_MEDIA_STATE_NEW, NULL, name);
-
 	return TRUE;
 }
 
--- a/libpurple/media/media.c	Wed Oct 28 18:24:10 2009 +0000
+++ b/libpurple/media/media.c	Wed Oct 28 18:36:18 2009 +0000
@@ -1033,6 +1033,15 @@
 				session->id, NULL);
 	}
 
+	if (!g_list_find_custom(media->priv->participants,
+			who, (GCompareFunc)strcmp)) {
+		media->priv->participants = g_list_prepend(
+				media->priv->participants, g_strdup(who));
+
+		g_signal_emit_by_name(media, "state-changed",
+				PURPLE_MEDIA_STATE_NEW, NULL, who);
+	}
+
 	if (purple_media_get_stream(media, sess_id, who) == NULL) {
 		stream = purple_media_insert_stream(session, who, initiator);