unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
To: David Bremner <david@tethera.net>,
	Notmuch Mail <notmuch@notmuchmail.org>
Subject: Re: [PATCH] emacs: Prefer email address over User ID when showing valid signature
Date: Sun, 27 Jun 2021 11:13:04 -0400	[thread overview]
Message-ID: <874kdjuyrj.fsf@fifthhorseman.net> (raw)
In-Reply-To: <20210626164144.227608-1-david@tethera.net>


[-- Attachment #1.1: Type: text/plain, Size: 1928 bytes --]

On Sat 2021-06-26 13:41:44 -0300, David Bremner wrote:
> 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

LGTM.

Thanks, Bremner!

        --dkg

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2021-06-27 16:36 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     ` [PATCH] " David Bremner
2021-06-27 15:13       ` Daniel Kahn Gillmor [this message]
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=874kdjuyrj.fsf@fifthhorseman.net \
    --to=dkg@fifthhorseman.net \
    --cc=david@tethera.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).