aboutsummaryrefslogtreecommitdiff
path: root/emacs
diff options
context:
space:
mode:
authorDavid Edmondson <dme@dme.org>2016-04-03 16:38:22 +0100
committerDavid Bremner <david@tethera.net>2016-04-10 20:46:58 -0300
commitf8effea9a3da8701b4edb0c64dbcb333d3ce4320 (patch)
tree7548ab32e1cf88e8bb524925b61655f4d022eb94 /emacs
parentf0881394bd8bec4af8ddedf0a128648a3a4e2127 (diff)
emacs: Always insert crypto buttons.
When no decryption or signature examination is happening (i.e. `notmuch-crypto-process-mime' is `nil') insert buttons that indicate this, rather than remaining silent.
Diffstat (limited to 'emacs')
-rw-r--r--emacs/notmuch-show.el34
1 files changed, 11 insertions, 23 deletions
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index f6a21e47..46e3869d 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -642,15 +642,10 @@ will return nil if the CID is unknown or cannot be retrieved."
(defun notmuch-show-insert-part-multipart/signed (msg part content-type nth depth button)
(when button
(button-put button 'face 'notmuch-crypto-part-header))
- ;; Add signature status button if sigstatus provided.
- (if (plist-member part :sigstatus)
- (let* ((from (notmuch-show-get-header :From msg))
- (sigstatus (car (plist-get part :sigstatus))))
- (notmuch-crypto-insert-sigstatus-button sigstatus from))
- ;; If we're not adding the signature status, tell the user how
- ;; they can get it.
- (when button
- (button-put button 'help-echo "Set notmuch-crypto-process-mime to process cryptographic MIME parts.")))
+
+ ;; Insert a button detailing the signature status.
+ (notmuch-crypto-insert-sigstatus-button (car (plist-get part :sigstatus))
+ (notmuch-show-get-header :From msg))
(let ((inner-parts (plist-get part :content))
(start (point)))
@@ -666,20 +661,13 @@ will return nil if the CID is unknown or cannot be retrieved."
(defun notmuch-show-insert-part-multipart/encrypted (msg part content-type nth depth button)
(when button
(button-put button 'face 'notmuch-crypto-part-header))
- ;; Add encryption status button if encryption status is specified.
- (if (plist-member part :encstatus)
- (let ((encstatus (car (plist-get part :encstatus))))
- (notmuch-crypto-insert-encstatus-button encstatus)
- ;; Add signature status button if signature status is
- ;; specified.
- (if (plist-member part :sigstatus)
- (let* ((from (notmuch-show-get-header :From msg))
- (sigstatus (car (plist-get part :sigstatus))))
- (notmuch-crypto-insert-sigstatus-button sigstatus from))))
- ;; If we're not adding the encryption status, tell the user how
- ;; they can get it.
- (when button
- (button-put button 'help-echo "Set notmuch-crypto-process-mime to process cryptographic MIME parts.")))
+
+ ;; Insert a button detailing the encryption status.
+ (notmuch-crypto-insert-encstatus-button (car (plist-get part :encstatus)))
+
+ ;; Insert a button detailing the signature status.
+ (notmuch-crypto-insert-sigstatus-button (car (plist-get part :sigstatus))
+ (notmuch-show-get-header :From msg))
(let ((inner-parts (plist-get part :content))
(start (point)))