mu4e: display signers in signature header
Display the signers in the signature headers, so users can easily very that a verified signed message was indeed signed by the expected sender. We can't check using 'From:' automatically as that gives too many false negatives.
This commit is contained in:
@ -310,7 +310,7 @@ marking if it still had that."
|
|||||||
(get-buffer-create mu4e~view-buffer-name))))
|
(get-buffer-create mu4e~view-buffer-name))))
|
||||||
(with-current-buffer buf
|
(with-current-buffer buf
|
||||||
(unless (eq major-mode 'mu4e-view-mode)
|
(unless (eq major-mode 'mu4e-view-mode)
|
||||||
(mu4e-view-mode))
|
(mu4e-view-mode))
|
||||||
(setq mu4e~view-msg msg)
|
(setq mu4e~view-msg msg)
|
||||||
(switch-to-buffer buf)
|
(switch-to-buffer buf)
|
||||||
;; When MSG is unread, mu4e~view-mark-as-read-maybe will trigger
|
;; When MSG is unread, mu4e~view-mark-as-read-maybe will trigger
|
||||||
@ -460,6 +460,11 @@ add text-properties to VAL."
|
|||||||
(remove-if 'null
|
(remove-if 'null
|
||||||
(mapcar (lambda (part) (mu4e-message-part-field part :signature))
|
(mapcar (lambda (part) (mu4e-message-part-field part :signature))
|
||||||
parts)))
|
parts)))
|
||||||
|
(signers
|
||||||
|
(mapconcat 'identity
|
||||||
|
(remove-if 'null
|
||||||
|
(mapcar (lambda (part) (mu4e-message-part-field part :signers))
|
||||||
|
parts)) ", "))
|
||||||
(val (when verdicts
|
(val (when verdicts
|
||||||
(mapconcat
|
(mapconcat
|
||||||
(lambda (v)
|
(lambda (v)
|
||||||
@ -474,7 +479,7 @@ add text-properties to VAL."
|
|||||||
(mu4e-view-verify-msg-popup
|
(mu4e-view-verify-msg-popup
|
||||||
(button-get b 'msg))))
|
(button-get b 'msg))))
|
||||||
(buffer-string))))
|
(buffer-string))))
|
||||||
(val (when val (concat val " (" btn ")"))))
|
(val (when val (concat val signers " (" btn ")"))))
|
||||||
(mu4e~view-construct-header :signature val t)))
|
(mu4e~view-construct-header :signature val t)))
|
||||||
|
|
||||||
(defun mu4e~view-construct-decryption-header (msg)
|
(defun mu4e~view-construct-decryption-header (msg)
|
||||||
@ -926,13 +931,13 @@ this view."
|
|||||||
(unless (buffer-live-p (mu4e-get-headers-buffer))
|
(unless (buffer-live-p (mu4e-get-headers-buffer))
|
||||||
(mu4e-error "no headers buffer connected"))
|
(mu4e-error "no headers buffer connected"))
|
||||||
(let* ((msg (mu4e-message-at-point))
|
(let* ((msg (mu4e-message-at-point))
|
||||||
(docid (mu4e-message-field msg :docid)))
|
(docid (mu4e-message-field msg :docid)))
|
||||||
(unless docid
|
(unless docid
|
||||||
(mu4e-error "message without docid: action is not possible."))
|
(mu4e-error "message without docid: action is not possible."))
|
||||||
(with-current-buffer (mu4e-get-headers-buffer)
|
(with-current-buffer (mu4e-get-headers-buffer)
|
||||||
(unless (eq mu4e-split-view 'single-window)
|
(unless (eq mu4e-split-view 'single-window)
|
||||||
(when (get-buffer-window)
|
(when (get-buffer-window)
|
||||||
(select-window (get-buffer-window))))
|
(select-window (get-buffer-window))))
|
||||||
(if (mu4e~headers-goto-docid docid)
|
(if (mu4e~headers-goto-docid docid)
|
||||||
,@body
|
,@body
|
||||||
(mu4e-error "cannot find message in headers buffer."))))))
|
(mu4e-error "cannot find message in headers buffer."))))))
|
||||||
@ -964,8 +969,8 @@ return nil."
|
|||||||
(mu4e~headers-prev-or-next-unread backwards))
|
(mu4e~headers-prev-or-next-unread backwards))
|
||||||
(if (eq mu4e-split-view 'single-window)
|
(if (eq mu4e-split-view 'single-window)
|
||||||
(when (eq (window-buffer) (mu4e-get-view-buffer))
|
(when (eq (window-buffer) (mu4e-get-view-buffer))
|
||||||
(with-current-buffer (mu4e-get-headers-buffer)
|
(with-current-buffer (mu4e-get-headers-buffer)
|
||||||
(mu4e-headers-view-message)))
|
(mu4e-headers-view-message)))
|
||||||
(mu4e-select-other-view)
|
(mu4e-select-other-view)
|
||||||
(mu4e-headers-view-message)))
|
(mu4e-headers-view-message)))
|
||||||
|
|
||||||
@ -1582,40 +1587,40 @@ other windows."
|
|||||||
(interactive)
|
(interactive)
|
||||||
(if (eq mu4e-split-view 'single-window)
|
(if (eq mu4e-split-view 'single-window)
|
||||||
(when (buffer-live-p (mu4e-get-view-buffer))
|
(when (buffer-live-p (mu4e-get-view-buffer))
|
||||||
(kill-buffer (mu4e-get-view-buffer)))
|
(kill-buffer (mu4e-get-view-buffer)))
|
||||||
(unless (eq major-mode 'mu4e-view-mode)
|
(unless (eq major-mode 'mu4e-view-mode)
|
||||||
(mu4e-error "Must be in mu4e-view-mode (%S)" major-mode))
|
(mu4e-error "Must be in mu4e-view-mode (%S)" major-mode))
|
||||||
(let ((curbuf (current-buffer))
|
(let ((curbuf (current-buffer))
|
||||||
(curwin (selected-window))
|
(curwin (selected-window))
|
||||||
(headers-win))
|
(headers-win))
|
||||||
(walk-windows
|
(walk-windows
|
||||||
(lambda (win)
|
(lambda (win)
|
||||||
;; check whether the headers buffer window is visible
|
;; check whether the headers buffer window is visible
|
||||||
(when (eq (mu4e-get-headers-buffer) (window-buffer win))
|
(when (eq (mu4e-get-headers-buffer) (window-buffer win))
|
||||||
(setq headers-win win))
|
(setq headers-win win))
|
||||||
;; and kill any _other_ (non-selected) window that shows the current
|
;; and kill any _other_ (non-selected) window that shows the current
|
||||||
;; buffer
|
;; buffer
|
||||||
(when
|
(when
|
||||||
(and
|
(and
|
||||||
(eq curbuf (window-buffer win)) ;; does win show curbuf?
|
(eq curbuf (window-buffer win)) ;; does win show curbuf?
|
||||||
(not (eq curwin win)) ;; but it's not the curwin?
|
(not (eq curwin win)) ;; but it's not the curwin?
|
||||||
(not (one-window-p))) ;; and not the last one on the frame?
|
(not (one-window-p))) ;; and not the last one on the frame?
|
||||||
(delete-window win)))) ;; delete it!
|
(delete-window win)))) ;; delete it!
|
||||||
;; now, all *other* windows should be gone.
|
;; now, all *other* windows should be gone.
|
||||||
;; if the headers view is also visible, kill ourselves + window; otherwise
|
;; if the headers view is also visible, kill ourselves + window; otherwise
|
||||||
;; switch to the headers view
|
;; switch to the headers view
|
||||||
(if (window-live-p headers-win)
|
(if (window-live-p headers-win)
|
||||||
;; headers are visible
|
;; headers are visible
|
||||||
(progn
|
(progn
|
||||||
(kill-buffer-and-window) ;; kill the view win
|
(kill-buffer-and-window) ;; kill the view win
|
||||||
(setq mu4e~headers-view-win nil)
|
(setq mu4e~headers-view-win nil)
|
||||||
(select-window headers-win)) ;; and switch to the headers win...
|
(select-window headers-win)) ;; and switch to the headers win...
|
||||||
;; headers are not visible...
|
;; headers are not visible...
|
||||||
(progn
|
(progn
|
||||||
(kill-buffer)
|
(kill-buffer)
|
||||||
(setq mu4e~headers-view-win nil)
|
(setq mu4e~headers-view-win nil)
|
||||||
(when (buffer-live-p (mu4e-get-headers-buffer))
|
(when (buffer-live-p (mu4e-get-headers-buffer))
|
||||||
(switch-to-buffer (mu4e-get-headers-buffer))))))))
|
(switch-to-buffer (mu4e-get-headers-buffer))))))))
|
||||||
|
|
||||||
(provide 'mu4e-view)
|
(provide 'mu4e-view)
|
||||||
;; end of mu4e-view
|
;; end of mu4e-view
|
||||||
|
|||||||
Reference in New Issue
Block a user