diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el index 353f721e..4216f583 100644 --- a/emacs/notmuch-crypto.el +++ b/emacs/notmuch-crypto.el @@ -93,7 +93,8 @@ mode." (defun notmuch-crypto-insert-sigstatus-button (sigstatus from) (let* ((status (plist-get sigstatus :status)) (help-msg nil) - (label "Signature not processed") + (show-button t) + (label nil) (face 'notmuch-crypto-signature-unknown) (button-action (lambda (button) (message (button-get button 'help-echo))))) (cond @@ -118,19 +119,21 @@ mode." (let ((keyid (concat "0x" (plist-get sigstatus :keyid)))) (setq label (concat "Bad signature (claimed key ID " keyid ")")) (setq face 'notmuch-crypto-signature-bad))) + (status + (setq label (concat "Unknown signature status: " status))) (t - (setq label (concat "Unknown signature status" - (if status (concat ": " status)))))) - (insert-button - (concat "[ " label " ]") - :type 'notmuch-crypto-status-button-type - 'help-echo help-msg - 'face face - 'mouse-face face - 'action button-action - :notmuch-sigstatus sigstatus - :notmuch-from from) - (insert "\n"))) + (setq show-button nil))) + (when show-button + (insert-button + (concat "[ " label " ]") + :type 'notmuch-crypto-status-button-type + 'help-echo help-msg + 'face face + 'mouse-face face + 'action button-action + :notmuch-sigstatus sigstatus + :notmuch-from from) + (insert "\n")))) (declare-function notmuch-show-refresh-view "notmuch-show" (&optional reset-state)) diff --git a/test/emacs-show.expected-output/notmuch-show-decrypted-message b/test/emacs-show.expected-output/notmuch-show-decrypted-message index 08a9e4f6..c4ec4b32 100644 --- a/test/emacs-show.expected-output/notmuch-show-decrypted-message +++ b/test/emacs-show.expected-output/notmuch-show-decrypted-message @@ -5,7 +5,6 @@ Date: Sat, 01 Jan 2000 12:00:00 +0000 [ multipart/encrypted ] [ Decryption successful ] -[ Unknown signature status ] [ application/pgp-encrypted ] [ text/plain ] The password is "abcd1234!", please do not tell anyone. diff --git a/test/emacs-show.expected-output/notmuch-show-decrypted-message-no-crypto b/test/emacs-show.expected-output/notmuch-show-decrypted-message-no-crypto index e302e452..49d85337 100644 --- a/test/emacs-show.expected-output/notmuch-show-decrypted-message-no-crypto +++ b/test/emacs-show.expected-output/notmuch-show-decrypted-message-no-crypto @@ -5,6 +5,5 @@ Date: Sat, 01 Jan 2000 12:00:00 +0000 [ multipart/encrypted ] [ Unknown encryption status ] -[ Unknown signature status ] [ application/pgp-encrypted ] [ application/octet-stream ] diff --git a/test/emacs-show.expected-output/notmuch-show-process-crypto-mime-parts-off b/test/emacs-show.expected-output/notmuch-show-process-crypto-mime-parts-off index ce2892a0..3282c7b1 100644 --- a/test/emacs-show.expected-output/notmuch-show-process-crypto-mime-parts-off +++ b/test/emacs-show.expected-output/notmuch-show-process-crypto-mime-parts-off @@ -9,7 +9,6 @@ Subject: [notmuch] Working with Maildir storage? [ multipart/mixed ] [ multipart/signed ] - [ Unknown signature status ] [ text/plain ] > See the patch just posted here. diff --git a/test/emacs-show.expected-output/notmuch-show-undecryptable-message b/test/emacs-show.expected-output/notmuch-show-undecryptable-message index 530ff286..95c1646b 100644 --- a/test/emacs-show.expected-output/notmuch-show-undecryptable-message +++ b/test/emacs-show.expected-output/notmuch-show-undecryptable-message @@ -5,6 +5,5 @@ Date: Thu, 22 Dec 2016 08:34:56 -0400 [ multipart/encrypted ] [ Decryption error ] -[ Unknown signature status ] [ application/pgp-encrypted ] [ application/octet-stream ]