X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=emacs%2Fnotmuch-mua.el;h=2c5888600b6c6d2af795b39302d061935cf7aa0b;hp=ba3ef275ec5ef03f894602499f224cce99130ed1;hb=f5db7ad7d243785c274a99734c681e69d13313d0;hpb=d0c4cd7e58f2ccdadca9fb56efc80e9140995ed2 diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index ba3ef275..2c588860 100644 --- a/emacs/notmuch-mua.el +++ b/emacs/notmuch-mua.el @@ -115,6 +115,14 @@ list." (push header message-hidden-headers))) notmuch-mua-hidden-headers)) +(defun notmuch-mua-reply-crypto (parts) + "Add mml sign-encrypt flag if any part of original message is encrypted." + (loop for part in parts + if (notmuch-match-content-type (plist-get part :content-type) "multipart/encrypted") + do (mml-secure-message-sign-encrypt) + else if (notmuch-match-content-type (plist-get part :content-type) "multipart/*") + do (notmuch-mua-reply-crypto (plist-get part :content)))) + (defun notmuch-mua-get-quotable-parts (parts) (loop for part in parts if (notmuch-match-content-type (plist-get part :content-type) "multipart/alternative") @@ -151,9 +159,10 @@ list." (defun notmuch-mua-reply (query-string &optional sender reply-all) (let ((args '("reply" "--format=sexp" "--format-version=1")) + (process-crypto notmuch-show-process-crypto) reply original) - (when notmuch-show-process-crypto + (when process-crypto (setq args (append args '("--decrypt")))) (if reply-all @@ -224,7 +233,11 @@ list." (set-mark (point)) (goto-char start) ;; Quote the original message according to the user's configured style. - (message-cite-original)))) + (message-cite-original))) + + ;; Crypto processing based crypto content of the original message + (when process-crypto + (notmuch-mua-reply-crypto (plist-get original :body)))) ;; Push mark right before signature, if any. (message-goto-signature) @@ -333,7 +346,8 @@ the From: address first." (message-forward-make-body cur) ;; `message-forward-make-body' shows the User-agent header. Hide ;; it again. - (message-hide-headers))) + (message-hide-headers) + (set-buffer-modified-p nil))) (defun notmuch-mua-new-reply (query-string &optional prompt-for-sender reply-all) "Compose a reply to the message identified by QUERY-STRING.