aboutsummaryrefslogtreecommitdiff
path: root/plugins/omemo/src/jingle/jingle_helper.vala
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2026-10-04 14:42:16 +0200
committerMarvin W <git@larma.de>2026-10-23 16:59:59 +0200
commitdba577f39c489b9db29960f2bf5cc78ac4f29d7b (patch)
treea8354c9fc328c1442d5e8c5c2adec4b428c92f44 /plugins/omemo/src/jingle/jingle_helper.vala
parent2413442905e31f34cb0f77c9167003b3725760fe (diff)
Move OMEMO, OpenPGP and RTP plugins into main/libdino
Diffstat (limited to 'plugins/omemo/src/jingle/jingle_helper.vala')
-rw-r--r--plugins/omemo/src/jingle/jingle_helper.vala53
1 files changed, 0 insertions, 53 deletions
diff --git a/plugins/omemo/src/jingle/jingle_helper.vala b/plugins/omemo/src/jingle/jingle_helper.vala
deleted file mode 100644
index ec6c0eca..00000000
--- a/plugins/omemo/src/jingle/jingle_helper.vala
+++ /dev/null
@@ -1,53 +0,0 @@
-using Dino.Entities;
-using Xmpp;
-
-namespace Dino.Plugins.JetOmemo {
-public class EncryptionHelper : JingleFileEncryptionHelper, Object {
- private StreamInteractor stream_interactor;
-
- public EncryptionHelper(StreamInteractor stream_interactor) {
- this.stream_interactor = stream_interactor;
- }
-
- public bool can_transfer(Conversation conversation) {
- return true;
- }
-
- public async bool can_encrypt(Conversation conversation, FileTransfer file_transfer, Jid? full_jid) {
- XmppStream? stream = stream_interactor.get_stream(conversation.account);
- if (stream == null) return false;
-
- Gee.List<Jid>? resources = stream.get_flag(Presence.Flag.IDENTITY).get_resources(conversation.counterpart);
- if (resources == null) return false;
-
- if (full_jid == null) {
- foreach (Jid test_jid in resources) {
- if (yield stream.get_module(Module.IDENTITY).is_available(stream, test_jid)) {
- return true;
- }
- }
- } else {
- if (yield stream.get_module(Module.IDENTITY).is_available(stream, full_jid)) {
- return true;
- }
- }
- return false;
- }
-
- public string? get_precondition_name(Conversation conversation, FileTransfer file_transfer) {
- return Xep.Jet.NS_URI;
- }
-
- public Object? get_precondition_options(Conversation conversation, FileTransfer file_transfer) {
- return new Xep.Jet.Options(Omemo.NS_URI, AES_128_GCM_URI);
- }
-
- public Encryption get_encryption(Xmpp.Xep.JingleFileTransfer.FileTransfer jingle_transfer) {
- Xep.Jet.SecurityParameters? security = jingle_transfer.security as Xep.Jet.SecurityParameters;
- if (security != null && security.encoding.get_type_uri() == Omemo.NS_URI) {
- return Encryption.OMEMO;
- }
- return Encryption.NONE;
- }
-}
-}