aboutsummaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorMiquel Lionel <lionel@les-miquelots.net>2024-01-20 14:24:30 +0100
committerMiquel Lionel <lionel@les-miquelots.net>2024-04-26 03:49:14 +0200
commit78664dd4ef6d9777308df494e4d8abcfb2f421d4 (patch)
treee8d689a496dc01f7f18387c9fe2aa79d2ad46569 /main
parent7e3cedaf3fa347bfa688e71b0f69e62725db395d (diff)
downloaddino-openpgp-plugin-hide-revoked-expired.tar.gz
dino-openpgp-plugin-hide-revoked-expired.zip
OPENPGP PLUGIN: Don't list expired/revoked GPG keyopenpgp-plugin-hide-revoked-expired
- closes #91 - Mention that GPG key may be expired or revoked in chat input box - in the account dialog if the number of OpenPGP keys found is 0, the label also notes that a key may have been revoked or expired. - blocks input in chat box if key is use is revoked or expired when switching conversation and can detect if your key has expired while chatting - if current selected key is revoked or expired, it'll be shown in account manager with a warning message: "Attention required: your key xxxx is revoked/expired!"
Diffstat (limited to 'main')
-rw-r--r--main/src/ui/chat_input/chat_input_controller.vala6
1 files changed, 5 insertions, 1 deletions
diff --git a/main/src/ui/chat_input/chat_input_controller.vala b/main/src/ui/chat_input/chat_input_controller.vala
index d1c42d35..025834d6 100644
--- a/main/src/ui/chat_input/chat_input_controller.vala
+++ b/main/src/ui/chat_input/chat_input_controller.vala
@@ -25,6 +25,7 @@ public class ChatInputController : Object {
private ChatTextViewController chat_text_view_controller;
private ContentItem? quoted_content_item = null;
+ private Encryption encryption;
public ChatInputController(ChatInput.View chat_input, StreamInteractor stream_interactor) {
this.chat_input = chat_input;
@@ -102,7 +103,7 @@ public class ChatInputController : Object {
private void on_encryption_changed(Encryption encryption) {
reset_input_field_status();
-
+ this.encryption = encryption;
if (encryption == Encryption.NONE) return;
Application app = GLib.Application.get_default() as Application;
@@ -127,6 +128,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 == Encryption.PGP) on_encryption_changed(this.encryption);
+
// 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();