From 29d1abccac205189d4ef1d5692493774b7af4bea Mon Sep 17 00:00:00 2001 From: fiaxh Date: Sun, 6 Feb 2022 23:48:58 +0100 Subject: Support direct jingle call invites with call invite messages --- libdino/src/service/call_peer_state.vala | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'libdino/src/service/call_peer_state.vala') diff --git a/libdino/src/service/call_peer_state.vala b/libdino/src/service/call_peer_state.vala index 902a0792..52b3e6ef 100644 --- a/libdino/src/service/call_peer_state.vala +++ b/libdino/src/service/call_peer_state.vala @@ -12,6 +12,7 @@ public class Dino.PeerState : Object { public signal void encryption_updated(Xep.Jingle.ContentEncryption? audio_encryption, Xep.Jingle.ContentEncryption? video_encryption, bool same); public StreamInteractor stream_interactor; + CallState call_state; public Calls calls; public Call call; public Jid jid; @@ -30,7 +31,6 @@ public class Dino.PeerState : Object { public HashMap? audio_encryptions = null; public bool first_peer = false; - public bool accepted_jmi = false; public bool waiting_for_inbound_muji_connection = false; public Xep.Muji.GroupCall? group_call { get; set; } @@ -38,9 +38,10 @@ public class Dino.PeerState : Object { public bool we_should_send_audio { get; set; default=false; } public bool we_should_send_video { get; set; default=false; } - public PeerState(Jid jid, Call call, StreamInteractor stream_interactor) { + public PeerState(Jid jid, Call call, CallState call_state, StreamInteractor stream_interactor) { this.jid = jid; this.call = call; + this.call_state = call_state; this.stream_interactor = stream_interactor; this.calls = stream_interactor.get_module(Calls.IDENTITY); @@ -82,9 +83,6 @@ public class Dino.PeerState : Object { if (do_jmi) { XmppStream? stream = stream_interactor.get_stream(call.account); - calls.current_jmi_request_call[call.account] = calls.call_states[call]; - calls.current_jmi_request_peer[call.account] = this; - var descriptions = new ArrayList(); descriptions.add(new StanzaNode.build("description", Xep.JingleRtp.NS_URI).add_self_xmlns().put_attribute("media", "audio")); if (we_should_send_video) { @@ -92,6 +90,7 @@ 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_invite_id = stream.get_module(Xmpp.Xep.CallInvites.Module.IDENTITY).send_jingle_propose(stream, jid, sid, we_should_send_video); } else if (jid_for_direct != null) { yield call_resource(jid_for_direct); } @@ -117,11 +116,6 @@ public class Dino.PeerState : Object { XmppStream stream = stream_interactor.get_stream(call.account); if (stream == null) return; - accepted_jmi = true; - - calls.current_jmi_request_call[call.account] = calls.call_states[call]; - calls.current_jmi_request_peer[call.account] = this; - stream.get_module(Xep.JingleMessageInitiation.Module.IDENTITY).send_session_accept_to_self(stream, sid); stream.get_module(Xep.JingleMessageInitiation.Module.IDENTITY).send_session_proceed_to_peer(stream, jid, sid); } -- cgit v1.2.3-54-g00ecf