Skip to content

Commit

Permalink
OPENPGP PLUGIN: Show key as expired or revoked in account manager window
Browse files Browse the repository at this point in the history
  • Loading branch information
eerielili committed Jun 9, 2024
1 parent a7c58bc commit 890882c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion plugins/openpgp/src/account_settings_entry.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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() {
Expand Down

0 comments on commit 890882c

Please sign in to comment.