React only to the first stream info signal release-2.x.y

Tue, 02 Jul 2019 16:13:40 +0200

author
Fabrice Bellet <fabrice@bellet.info>
date
Tue, 02 Jul 2019 16:13:40 +0200
branch
release-2.x.y
changeset 39725
29aec83e0e44
parent 39724
72a35ff95941
child 39726
e136207df0ee

React only to the first stream info signal

libpurple/protocols/jabber/jingle/rtp.c file | annotate | diff | comparison | revisions
--- a/libpurple/protocols/jabber/jingle/rtp.c	Tue Jul 02 14:04:49 2019 +0200
+++ b/libpurple/protocols/jabber/jingle/rtp.c	Tue Jul 02 16:13:40 2019 +0200
@@ -486,8 +486,15 @@
 				session);
 
 		g_object_unref(session);
-	} else if (type == PURPLE_MEDIA_INFO_ACCEPT &&
+	/* The same signal is emited *four* times in case of acceptance
+	 * by purple_media_stream_info() (stream acceptance, session
+	 * acceptance, participant acceptance, and conference acceptance).
+	 * We only react to the first one, where sid and name are given
+	 * non-null values.
+	 */
+	} else if (type == PURPLE_MEDIA_INFO_ACCEPT && sid && name &&
 			jingle_session_is_initiator(session) == FALSE) {
+
 		jingle_rtp_ready(session);
 	}
 }

mercurial