From: David Bremner <david@tethera.net>
To: Daniel Kahn Gillmor <dkg@fifthhorseman.net>,
Notmuch Mail <notmuch@notmuchmail.org>
Subject: [PATCH] emacs: Prefer email address over User ID when showing valid signature
Date: Sat, 26 Jun 2021 13:41:44 -0300 [thread overview]
Message-ID: <20210626164144.227608-1-david@tethera.net> (raw)
In-Reply-To: <20210527014459.3082888-2-dkg@fifthhorseman.net>
From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Most concrete verification steps are likely only taken on the e-mail
address in the first place, and e-mail addresses render more
intelligibly than arbitrary User IDs in the first place.
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Amended-by: db, apply dme restructuring suggestions.
---
emacs/notmuch-crypto.el | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el
index db7cb75d..5edfe94c 100644
--- a/emacs/notmuch-crypto.el
+++ b/emacs/notmuch-crypto.el
@@ -119,14 +119,14 @@ mode."
(cond
((string= status "good")
(let ((fingerprint (concat "0x" (plist-get sigstatus :fingerprint)))
- (userid (plist-get sigstatus :userid)))
- ;; If userid is present it has full or greater validity.
- (if userid
- (progn
- (setq label (concat "Good signature by: " userid))
- (setq face 'notmuch-crypto-signature-good))
- (setq label (concat "Good signature by key: " fingerprint))
- (setq face 'notmuch-crypto-signature-good-key))
+ (email-or-userid (or (plist-get sigstatus :email)
+ (plist-get sigstatus :userid))))
+ ;; If email or userid are present, they have full or greater validity.
+ (setq label (concat "Good signature by key: " fingerprint))
+ (setq face 'notmuch-crypto-signature-good-key)
+ (when email-or-userid
+ (setq label (concat "Good signature by: " email-or-user-id))
+ (setq face 'notmuch-crypto-signature-good))
(setq button-action 'notmuch-crypto-sigstatus-good-callback)
(setq help-msg (concat "Click to list key ID 0x" fingerprint "."))))
((string= status "error")
--
2.30.2
next prev parent reply other threads:[~2021-06-26 16:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-26 23:32 difficulty in rendering S/MIME signature status from some certificates Daniel Kahn Gillmor
2021-05-27 1:44 ` [PATCH 1/2] cli/show: produce "email" element in sigstatus Daniel Kahn Gillmor
2021-05-27 1:44 ` [PATCH 2/2] emacs: Prefer email address over User ID when showing valid signature Daniel Kahn Gillmor
2021-06-07 12:07 ` David Edmondson
2021-06-07 12:24 ` Daniel Kahn Gillmor
2021-06-26 16:41 ` David Bremner [this message]
2021-06-27 15:13 ` [PATCH] " Daniel Kahn Gillmor
2021-06-27 17:21 ` David Bremner
2021-06-27 17:21 ` [PATCH 1/2] cli/show: produce "email" element in sigstatus David Bremner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210626164144.227608-1-david@tethera.net \
--to=david@tethera.net \
--cc=dkg@fifthhorseman.net \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).