summaryrefslogtreecommitdiffstats
path: root/emacs
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2021-05-26 21:44:59 -0400
committerDavid Bremner <david@tethera.net>2021-06-26 13:34:54 -0300
commit29d43b7f44568315a7645a93d2ea82306b2c4aa8 (patch)
treed00883ddf65b8753e6ce52a66d03be4487bf32e6 /emacs
parent8c29a5da096b0314c6cca8889b740b79a9a548ed (diff)
emacs: Prefer email address over User ID when showing valid signature
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.
Diffstat (limited to 'emacs')
-rw-r--r--emacs/notmuch-crypto.el16
1 files 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")