From 26d10d1dcb95f11b65611473c9840e13683cb5ec Mon Sep 17 00:00:00 2001 From: fiaxh Date: Thu, 4 Nov 2021 17:33:08 +0100 Subject: Add multiparty call support to libdino and xmpp-vala --- .../xep/0176_jingle_ice_udp/transport_parameters.vala | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'xmpp-vala/src/module/xep/0176_jingle_ice_udp') diff --git a/xmpp-vala/src/module/xep/0176_jingle_ice_udp/transport_parameters.vala b/xmpp-vala/src/module/xep/0176_jingle_ice_udp/transport_parameters.vala index 07b599ee..680d7c80 100644 --- a/xmpp-vala/src/module/xep/0176_jingle_ice_udp/transport_parameters.vala +++ b/xmpp-vala/src/module/xep/0176_jingle_ice_udp/transport_parameters.vala @@ -28,6 +28,7 @@ public abstract class Xmpp.Xep.JingleIceUdp.IceUdpTransportParameters : Jingle.T private bool connection_created = false; protected weak Jingle.Content? content = null; + protected bool use_raw = false; protected IceUdpTransportParameters(uint8 components, Jid local_full_jid, Jid peer_full_jid, StanzaNode? node = null) { this.components_ = components; @@ -80,10 +81,16 @@ public abstract class Xmpp.Xep.JingleIceUdp.IceUdpTransportParameters : Jingle.T node.put_node(fingerprint_node); } - foreach (Candidate candidate in unsent_local_candidates) { + if (action_type != "transport-info") { + foreach (Candidate candidate in unsent_local_candidates) { + node.put_node(candidate.to_xml()); + } + unsent_local_candidates.clear(); + } else if (!unsent_local_candidates.is_empty) { + Candidate candidate = unsent_local_candidates.first(); node.put_node(candidate.to_xml()); + unsent_local_candidates.remove(candidate); } - unsent_local_candidates.clear(); return node; } @@ -128,15 +135,15 @@ public abstract class Xmpp.Xep.JingleIceUdp.IceUdpTransportParameters : Jingle.T local_candidates.add(candidate); if (this.content != null && (this.connection_created || !this.incoming)) { - Timeout.add(50, () => { + Idle.add( () => { check_send_transport_info(); - return false; + return Source.REMOVE; }); } } private void check_send_transport_info() { - if (this.content != null && unsent_local_candidates.size > 0) { + if (this.content != null && !unsent_local_candidates.is_empty) { content.send_transport_info(to_transport_stanza_node("transport-info")); } } -- cgit v1.2.3-70-g09d2