mu4e/server: implement mark-as-read for (view ...)

Instead of a multi-step process to display an unread message (ie. get
the original, notice it's unread, then update it, replace the message
with update one etc.), we now handle that in the (view /./..) command on
the server side.

Simplifies things, and is faster (which could be noticeable, esp. if
e.g. signature verification is part of the process)
This commit is contained in:
Dirk-Jan C. Binnema
2020-06-10 17:36:38 +03:00
parent cf2e4f1dcd
commit 3dc4b93989
5 changed files with 79 additions and 90 deletions

View File

@ -1646,6 +1646,10 @@ window . "
(let* ((msg (mu4e-message-at-point))
(docid (or (mu4e-message-field msg :docid)
(mu4e-warn "No message at point")))
(mark-as-read
(if (functionp mu4e-view-auto-mark-as-read)
(funcall mu4e-view-auto-mark-as-read msg)
mu4e-view-auto-mark-as-read))
(decrypt (mu4e~decrypt-p msg))
(verify (not mu4e-view-use-gnus))
(viewwin (mu4e~headers-redraw-get-view-window)))
@ -1668,8 +1672,8 @@ window . "
;; (if mu4e-view-use-gnus
;; (mu4e-view msg)
;; (mu4e~proc-view docid mu4e-view-show-images decrypt))
(mu4e~proc-view docid mu4e-view-show-images decrypt verify)))
;; (mu4e~proc-view dowcid decrypt))
(mu4e~proc-view docid mark-as-read decrypt verify)))
(defun mu4e-headers-rerun-search ()
"Rerun the search for the last search expression."