aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/service/call_peer_state.vala
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2022-02-12 14:07:19 +0100
committerfiaxh <git@lightrise.org>2022-02-12 14:22:29 +0100
commitbe751a5dda6e4b4612276d278f59f9f96ed0298c (patch)
tree3f0aeca430893c4ebf1fe51ab1102537a5681ca2 /libdino/src/service/call_peer_state.vala
parent6532c2b160c66540091d667c4af116ec4d71ff43 (diff)
downloaddino-be751a5dda6e4b4612276d278f59f9f96ed0298c.tar.gz
dino-be751a5dda6e4b4612276d278f59f9f96ed0298c.zip
Various call fixes
- If peer invited us claiming audio-only and then wants to have a video content, do a content-modify and accept audio-only - Check contents for video (and modify) and whether call is truly accepted in PeerState.accept() directly - If a message contains both JMI and CIM, only use JMI - Fix outgoing CIM (disabled) - Use opacity instead of visiblity for file_menu, small fixes - Add back owner/admin/member queries when joining MUC (regression from 33104a7)
Diffstat (limited to 'libdino/src/service/call_peer_state.vala')
-rw-r--r--libdino/src/service/call_peer_state.vala24
1 files changed, 23 insertions, 1 deletions
diff --git a/libdino/src/service/call_peer_state.vala b/libdino/src/service/call_peer_state.vala
index cf39eec4..c97aa48d 100644
--- a/libdino/src/service/call_peer_state.vala
+++ b/libdino/src/service/call_peer_state.vala
@@ -90,7 +90,10 @@ public class Dino.PeerState : Object {
}
stream.get_module(Xmpp.Xep.JingleMessageInitiation.Module.IDENTITY).send_session_propose_to_peer(stream, jid, sid, descriptions);
-// call_state.cim_call_id = stream.get_module(Xmpp.Xep.CallInvites.Module.IDENTITY).send_jingle_propose(stream, jid, sid, we_should_send_video);
+
+// Uncomment this use CIM instead of JMI
+// call_state.cim_call_id = sid;
+// stream.get_module(Xmpp.Xep.CallInvites.Module.IDENTITY).send_jingle_propose(stream, call_state.cim_call_id, jid, sid, we_should_send_video);
} else if (jid_for_direct != null) {
yield call_resource(jid_for_direct);
}
@@ -111,8 +114,27 @@ public class Dino.PeerState : Object {
}
public void accept() {
+ if (!call_state.accepted) {
+ critical("Tried to accept peer in unaccepted call?! Something's fishy. Abort.");
+ return;
+ }
+
if (session != null) {
foreach (Xep.Jingle.Content content in session.contents) {
+ Xep.JingleRtp.Parameters? rtp_content_parameter = content.content_params as Xep.JingleRtp.Parameters;
+ if (rtp_content_parameter != null && rtp_content_parameter.media == "video") {
+ // We didn't accept video but our peer wants to negotiate that content
+ if (!we_should_send_video && 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();
+ continue;
+ }
+ }
+ }
content.accept();
}
} else {