diff options
author | Miquel Lionel <lionel@les-miquelots.net> | 2024-01-20 14:24:30 +0100 |
---|---|---|
committer | Miquel Lionel <lionel@les-miquelots.net> | 2024-04-26 03:49:14 +0200 |
commit | 78664dd4ef6d9777308df494e4d8abcfb2f421d4 (patch) | |
tree | e8d689a496dc01f7f18387c9fe2aa79d2ad46569 /plugins/openpgp/src/account_settings_entry.vala | |
parent | 7e3cedaf3fa347bfa688e71b0f69e62725db395d (diff) | |
download | dino-78664dd4ef6d9777308df494e4d8abcfb2f421d4.tar.gz dino-78664dd4ef6d9777308df494e4d8abcfb2f421d4.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 'plugins/openpgp/src/account_settings_entry.vala')
-rw-r--r-- | plugins/openpgp/src/account_settings_entry.vala | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/plugins/openpgp/src/account_settings_entry.vala b/plugins/openpgp/src/account_settings_entry.vala index 7c99942f..0e28c68e 100644 --- a/plugins/openpgp/src/account_settings_entry.vala +++ b/plugins/openpgp/src/account_settings_entry.vala @@ -69,7 +69,7 @@ public class AccountSettingsEntry : Plugins.AccountSettingsEntry { return; } if (keys.size == 0) { - label.set_markup(build_markup_string(_("Key publishing disabled"), _("No keys available. Generate one!"))); + label.set_markup(build_markup_string(_("Key publishing disabled"), _("No keys available. Generate one or check if your keys aren't expired or revoked!"))); return; } @@ -88,6 +88,18 @@ public class AccountSettingsEntry : Plugins.AccountSettingsEntry { set_label_active(selected); combobox.changed.connect(key_changed); + if (account_key != null){ + try { + GPG.Key key_check = GPGHelper.get_public_key(account_key); + if(key_check.expired || key_check.revoked) { + string status_str = key_check.expired ? _("expired!") : _("revoked!"); + label.set_markup(build_markup_string(_("Attention required!"), _("Your key <span color='red'><b>"+ key_check.fpr +"</b></span> is " + status_str))); + } + } + catch { + debug("Coudn't check GPG key status."); + } + } } private void populate_list_store() { @@ -160,4 +172,4 @@ public class AccountSettingsEntry : Plugins.AccountSettingsEntry { return stack; } } -}
\ No newline at end of file +} |