diff options
author | fiaxh <git@lightrise.org> | 2021-11-04 17:33:08 +0100 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2021-11-10 11:05:34 +0100 |
commit | 26d10d1dcb95f11b65611473c9840e13683cb5ec (patch) | |
tree | fb09e36aba28ff1b971ea11ad3da2dd3d92f31d4 /xmpp-vala/src/module/xep/0176_jingle_ice_udp | |
parent | 38944d702331bb9d7a91d8ed05a33c935562e3c0 (diff) | |
download | dino-26d10d1dcb95f11b65611473c9840e13683cb5ec.tar.gz dino-26d10d1dcb95f11b65611473c9840e13683cb5ec.zip |
Add multiparty call support to libdino and xmpp-vala
Diffstat (limited to 'xmpp-vala/src/module/xep/0176_jingle_ice_udp')
-rw-r--r-- | xmpp-vala/src/module/xep/0176_jingle_ice_udp/transport_parameters.vala | 17 |
1 files changed, 12 insertions, 5 deletions
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")); } } |