Accept additional jingle contents with senders=both (but modify to senders=peer)

This commit is contained in:
fiaxh 2021-04-09 18:50:29 +02:00
parent fbc10c2023
commit 09dc38f169

View file

@ -355,11 +355,22 @@ namespace Dino {
private void on_incoming_content_add(XmppStream stream, Call call, Xep.Jingle.Session session, Xep.Jingle.Content content) { 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; 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(); content.reject();
return; 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); connect_content_signals(call, content, rtp_content_parameter);
content.accept(); content.accept();
} }