aboutsummaryrefslogtreecommitdiff
path: root/libdino/src
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2021-05-03 13:17:17 +0200
committerfiaxh <git@lightrise.org>2021-05-11 12:52:00 +0200
commit90f9ecf62b2ebfef14de2874e7942552409632bf (patch)
treec9cd6da902ee89ab9cfcc435c2e98680e2ec3c50 /libdino/src
parent8044b546d0ac15d34a3e6499b9c0d55d3d8f9c94 (diff)
downloaddino-90f9ecf62b2ebfef14de2874e7942552409632bf.tar.gz
dino-90f9ecf62b2ebfef14de2874e7942552409632bf.zip
Calls: Indicate whether OMEMO key is verified
Diffstat (limited to 'libdino/src')
-rw-r--r--libdino/src/plugin/interfaces.vala10
-rw-r--r--libdino/src/plugin/registry.vala8
-rw-r--r--libdino/src/service/calls.vala4
3 files changed, 20 insertions, 2 deletions
diff --git a/libdino/src/plugin/interfaces.vala b/libdino/src/plugin/interfaces.vala
index 97951850..eadbb085 100644
--- a/libdino/src/plugin/interfaces.vala
+++ b/libdino/src/plugin/interfaces.vala
@@ -29,6 +29,16 @@ public interface EncryptionListEntry : Object {
public abstract Object? get_encryption_icon(Entities.Conversation conversation, ContentItem content_item);
}
+public interface CallEncryptionEntry : Object {
+ public abstract CallEncryptionWidget? get_widget(Account account, Xmpp.Xep.Jingle.ContentEncryption encryption);
+}
+
+public interface CallEncryptionWidget : Object {
+ public abstract string? get_title();
+ public abstract bool show_keys();
+ public abstract string? get_icon_name();
+}
+
public abstract class AccountSettingsEntry : Object {
public abstract string id { get; }
public virtual Priority priority { get { return Priority.DEFAULT; } }
diff --git a/libdino/src/plugin/registry.vala b/libdino/src/plugin/registry.vala
index 27d72b80..e28c4de7 100644
--- a/libdino/src/plugin/registry.vala
+++ b/libdino/src/plugin/registry.vala
@@ -4,6 +4,7 @@ namespace Dino.Plugins {
public class Registry {
internal ArrayList<EncryptionListEntry> encryption_list_entries = new ArrayList<EncryptionListEntry>();
+ internal HashMap<string, CallEncryptionEntry> call_encryption_entries = new HashMap<string, CallEncryptionEntry>();
internal ArrayList<AccountSettingsEntry> account_settings_entries = new ArrayList<AccountSettingsEntry>();
internal ArrayList<ContactDetailsProvider> contact_details_entries = new ArrayList<ContactDetailsProvider>();
internal Map<string, TextCommand> text_commands = new HashMap<string, TextCommand>();
@@ -25,6 +26,13 @@ public class Registry {
}
}
+ public bool register_call_entryption_entry(string ns, CallEncryptionEntry entry) {
+ lock (call_encryption_entries) {
+ call_encryption_entries[ns] = entry;
+ }
+ return true;
+ }
+
public bool register_account_settings_entry(AccountSettingsEntry entry) {
lock(account_settings_entries) {
foreach(var e in account_settings_entries) {
diff --git a/libdino/src/service/calls.vala b/libdino/src/service/calls.vala
index a44b59fd..4c3bbea7 100644
--- a/libdino/src/service/calls.vala
+++ b/libdino/src/service/calls.vala
@@ -75,7 +75,7 @@ namespace Dino {
call.account = conversation.account;
call.counterpart = conversation.counterpart;
call.ourpart = conversation.account.full_jid;
- call.time = call.local_time = new DateTime.now_utc();
+ call.time = call.local_time = call.end_time = new DateTime.now_utc();
call.state = Call.State.RINGING;
stream_interactor.get_module(CallStore.IDENTITY).add_call(call, conversation);
@@ -380,7 +380,7 @@ namespace Dino {
call.counterpart = from;
}
call.account = account;
- call.time = call.local_time = new DateTime.now_utc();
+ call.time = call.local_time = call.end_time = new DateTime.now_utc();
call.state = Call.State.RINGING;
Conversation conversation = stream_interactor.get_module(ConversationManager.IDENTITY).create_conversation(call.counterpart.bare_jid, account, Conversation.Type.CHAT);