From 09dc38f169745cb7697fdb969b9d4eb5e021e07a Mon Sep 17 00:00:00 2001 From: fiaxh Date: Fri, 9 Apr 2021 18:50:29 +0200 Subject: Accept additional jingle contents with senders=both (but modify to senders=peer) --- libdino/src/service/calls.vala | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/libdino/src/service/calls.vala b/libdino/src/service/calls.vala index b457c764..ccae3e05 100644 --- a/libdino/src/service/calls.vala +++ b/libdino/src/service/calls.vala @@ -355,11 +355,22 @@ namespace Dino { private void on_incoming_content_add(XmppStream stream, Call call, Xep.Jingle.Session session, Xep.Jingle.Content content) { Xep.JingleRtp.Parameters? rtp_content_parameter = content.content_params as Xep.JingleRtp.Parameters; - if (rtp_content_parameter == null || session.senders_include_us(content.senders)) { + if (rtp_content_parameter == null) { content.reject(); return; } + // Our peer shouldn't tell us to start sending, that's for us to initiate + if (session.senders_include_us(content.senders)) { + if (session.senders_include_counterpart(content.senders)) { + // If our peer wants to send, let them + content.modify(session.we_initiated ? Xep.Jingle.Senders.RESPONDER : Xep.Jingle.Senders.INITIATOR); + } else { + // If only we're supposed to send, reject + content.reject(); + } + } + connect_content_signals(call, content, rtp_content_parameter); content.accept(); } -- cgit v1.2.3-70-g09d2