From 78664dd4ef6d9777308df494e4d8abcfb2f421d4 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 - 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!" --- plugins/openpgp/src/gpgme_helper.vala | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'plugins/openpgp/src/gpgme_helper.vala') diff --git a/plugins/openpgp/src/gpgme_helper.vala b/plugins/openpgp/src/gpgme_helper.vala index 18d07c06..c53437d3 100644 --- a/plugins/openpgp/src/gpgme_helper.vala +++ b/plugins/openpgp/src/gpgme_helper.vala @@ -112,7 +112,13 @@ public static Gee.List get_keylist(string? pattern = null, bool secret_only try { while (true) { Key key = context.op_keylist_next(); - keys.add(key); + if (!key.expired && !key.revoked){ + debug("PGP Key " + key.fpr + " is valid!"); + keys.add(key); + } + else { + debug("PGP Key " + key.fpr + " is either expired or revoked!"); + } } } catch (Error e) { if (e.code != GPGError.ErrorCode.EOF) throw e; -- cgit v1.2.3-70-g09d2