aboutsummaryrefslogtreecommitdiff
path: root/libdino
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2021-04-09 18:50:29 +0200
committerfiaxh <git@lightrise.org>2021-04-09 22:23:56 +0200
commit09dc38f169745cb7697fdb969b9d4eb5e021e07a (patch)
tree84926d54c50cd594bf91a5118729192c9ad7af90 /libdino
parentfbc10c2023a4c2b874f87940f0a71bc0d8d7b57d (diff)
downloaddino-09dc38f169745cb7697fdb969b9d4eb5e021e07a.tar.gz
dino-09dc38f169745cb7697fdb969b9d4eb5e021e07a.zip
Accept additional jingle contents with senders=both (but modify to senders=peer)
Diffstat (limited to 'libdino')
-rw-r--r--libdino/src/service/calls.vala13
1 files changed, 12 insertions, 1 deletions
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();
}