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.
This commit is contained in:
Daniel Kahn Gillmor 2021-05-26 21:44:59 -04:00 committed by David Bremner
parent 8c29a5da09
commit 29d43b7f44

View file

@ -119,14 +119,14 @@ mode."
(cond (cond
((string= status "good") ((string= status "good")
(let ((fingerprint (concat "0x" (plist-get sigstatus :fingerprint))) (let ((fingerprint (concat "0x" (plist-get sigstatus :fingerprint)))
(userid (plist-get sigstatus :userid))) (email-or-userid (or (plist-get sigstatus :email)
;; If userid is present it has full or greater validity. (plist-get sigstatus :userid))))
(if userid ;; If email or userid are present, they have full or greater validity.
(progn (setq label (concat "Good signature by key: " fingerprint))
(setq label (concat "Good signature by: " userid)) (setq face 'notmuch-crypto-signature-good-key)
(setq face 'notmuch-crypto-signature-good)) (when email-or-userid
(setq label (concat "Good signature by key: " fingerprint)) (setq label (concat "Good signature by: " email-or-user-id))
(setq face 'notmuch-crypto-signature-good-key)) (setq face 'notmuch-crypto-signature-good))
(setq button-action 'notmuch-crypto-sigstatus-good-callback) (setq button-action 'notmuch-crypto-sigstatus-good-callback)
(setq help-msg (concat "Click to list key ID 0x" fingerprint ".")))) (setq help-msg (concat "Click to list key ID 0x" fingerprint "."))))
((string= status "error") ((string= status "error")