diff options
author | fiaxh <git@lightrise.org> | 2022-02-02 21:37:05 +0100 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2022-02-07 01:21:11 +0100 |
commit | 4ef50db3e581016365087759d5af8649e37ab8a7 (patch) | |
tree | ec7d47401f8424b5b9999941e05f61409594c539 /plugins | |
parent | 5ed8d28a27948ed949eb80b0da06d2c4ec9571ff (diff) | |
download | dino-4ef50db3e581016365087759d5af8649e37ab8a7.tar.gz dino-4ef50db3e581016365087759d5af8649e37ab8a7.zip |
Various call UI/UX improvements
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/omemo/src/dtls_srtp_verification_draft.vala | 15 | ||||
-rw-r--r-- | plugins/rtp/src/plugin.vala | 3 |
2 files changed, 13 insertions, 5 deletions
diff --git a/plugins/omemo/src/dtls_srtp_verification_draft.vala b/plugins/omemo/src/dtls_srtp_verification_draft.vala index 0cb08696..577c77e7 100644 --- a/plugins/omemo/src/dtls_srtp_verification_draft.vala +++ b/plugins/omemo/src/dtls_srtp_verification_draft.vala @@ -101,11 +101,18 @@ namespace Dino.Plugins.Omemo.DtlsSrtpVerificationDraft { if (fingerprint_node == null) continue; string fingerprint = fingerprint_node.get_deep_string_content(); - Xep.Omemo.OmemoEncryptor encryptor = stream.get_module(Xep.Omemo.OmemoEncryptor.IDENTITY); - Xep.Omemo.EncryptionData enc_data = encryptor.encrypt_plaintext(fingerprint); - encryptor.encrypt_key(enc_data, iq.to.bare_jid, device_id_by_jingle_sid[sid]); + StanzaNode? encrypted_node = null; + try { + Xep.Omemo.OmemoEncryptor encryptor = stream.get_module(Xep.Omemo.OmemoEncryptor.IDENTITY); + Xep.Omemo.EncryptionData enc_data = encryptor.encrypt_plaintext(fingerprint); + encryptor.encrypt_key(enc_data, iq.to.bare_jid, device_id_by_jingle_sid[sid]); + encrypted_node = enc_data.get_encrypted_node(); + } catch (Error e) { + warning("Error while OMEMO-encrypting call keys: %s", e.message); + return; + } - StanzaNode new_fingerprint_node = new StanzaNode.build("fingerprint", NS_URI).add_self_xmlns().put_node(enc_data.get_encrypted_node()); + StanzaNode new_fingerprint_node = new StanzaNode.build("fingerprint", NS_URI).add_self_xmlns().put_node(encrypted_node); string? hash_attr = fingerprint_node.get_attribute("hash", Xep.JingleIceUdp.DTLS_NS_URI); string? setup_attr = fingerprint_node.get_attribute("setup", Xep.JingleIceUdp.DTLS_NS_URI); if (hash_attr != null) new_fingerprint_node.put_attribute("hash", hash_attr); diff --git a/plugins/rtp/src/plugin.vala b/plugins/rtp/src/plugin.vala index 6d6da79a..0e519b37 100644 --- a/plugins/rtp/src/plugin.vala +++ b/plugins/rtp/src/plugin.vala @@ -285,7 +285,7 @@ public class Dino.Plugins.Rtp.Plugin : RootInterface, VideoCallPlugin, Object { Gst.deinit(); } - public bool supports(string media) { + public bool supports(string? media) { if (!codec_util.is_element_supported("rtpbin")) return false; if (media == "audio") { @@ -310,6 +310,7 @@ public class Dino.Plugins.Rtp.Plugin : RootInterface, VideoCallPlugin, Object { } public Gee.List<MediaDevice> get_devices(string media, bool incoming) { + if (media == "video" && !incoming) { return get_video_sources(); } |