unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] Add a defcustom for whether to block remote images by default.
@ 2015-01-29  1:39 Jinwoo Lee
  2015-01-29  6:40 ` David Edmondson
  2015-01-29  7:23 ` David Bremner
  0 siblings, 2 replies; 9+ messages in thread
From: Jinwoo Lee @ 2015-01-29  1:39 UTC (permalink / raw)
  To: notmuch

---
 emacs/notmuch-show.el | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 66350d4..bc48922 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -136,6 +136,11 @@ indentation."
   :type 'boolean
   :group 'notmuch-show)
 
+(defcustom notmuch-show-block-remote-images t
+  "Block remote images by default."
+  :type 'boolean
+  :group 'notmuch-show)
+
 (defvar notmuch-show-thread-id nil)
 (make-variable-buffer-local 'notmuch-show-thread-id)
 (put 'notmuch-show-thread-id 'permanent-local t)
@@ -798,10 +803,12 @@ will return nil if the CID is unknown or cannot be retrieved."
 	   ;; URL-decode it (see RFC 2392).
 	   (let ((cid (url-unhex-string url)))
 	     (first (notmuch-show--get-cid-content cid)))))
-	;; Block all external images to prevent privacy leaks and
-	;; potential attacks.  FIXME: If we block an image, offer a
-	;; button to load external images.
-	(shr-blocked-images "."))
+	;; By default, block all external images to prevent privacy
+	;; leaks and potential attacks.  FIXME: If we block an image,
+	;; offer a button to load external images.
+	(shr-blocked-images (if notmuch-show-block-remote-images
+				"."
+			      shr-blocked-images)))
     (shr-insert-document dom)
     t))
 
-- 
2.2.2

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-01-30  0:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-29  1:39 [PATCH] Add a defcustom for whether to block remote images by default Jinwoo Lee
2015-01-29  6:40 ` David Edmondson
2015-01-29  7:23 ` David Bremner
2015-01-29  8:58   ` Tomi Ollila
2015-01-29 17:31     ` Jinwoo Lee
2015-01-29 20:25       ` Tomi Ollila
2015-01-29 20:57         ` Jinwoo Lee
2015-01-29 21:39           ` Jinwoo Lee
2015-01-30  0:49             ` Jinwoo Lee

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).