From 28529f0038543e8a7fef2f10ef8231355a0dbca3 Mon Sep 17 00:00:00 2001 From: Miquel Lionel Date: Sat, 20 Jan 2024 14:24:30 +0100 Subject: OPENPGP PLUGIN: Don't list expired/revoked GPG key - Closes #91 - Blocks input in chat box if the key in use becomes revoked or expired - Mention GPG key status below chat input box if it's expired or revoked - Account manager will show a warning message: "Key is revoked/expired!" below the selected GPG key for the corresponding account. --- main/src/ui/chat_input/chat_input_controller.vala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'main/src/ui/chat_input') diff --git a/main/src/ui/chat_input/chat_input_controller.vala b/main/src/ui/chat_input/chat_input_controller.vala index 07499aa4..7f461123 100644 --- a/main/src/ui/chat_input/chat_input_controller.vala +++ b/main/src/ui/chat_input/chat_input_controller.vala @@ -27,6 +27,7 @@ public class ChatInputController : Object { private ChatTextViewController chat_text_view_controller; private ContentItem? quoted_content_item = null; + private Encryption encryption_mode; public ChatInputController(ChatInput.View chat_input, StreamInteractor stream_interactor) { this.chat_input = chat_input; @@ -104,7 +105,7 @@ public class ChatInputController : Object { private void on_encryption_changed(Encryption encryption) { reset_input_field_status(); - + this.encryption_mode = encryption; if (encryption == Encryption.NONE) return; Application app = GLib.Application.get_default() as Application; @@ -129,6 +130,9 @@ public class ChatInputController : Object { } private void send_text() { + // Double check GPG keys before sending in case of expired / revoked keys while Dino is in use + if (this.encryption_mode == Encryption.PGP) on_encryption_changed(this.encryption_mode); + // Don't do anything if we're in a NO_SEND state. Don't clear the chat input, don't send. if (input_field_status.input_state == Plugins.InputFieldStatus.InputState.NO_SEND) { chat_input.highlight_state_description(); -- cgit v1.2.3-70-g09d2