aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Magne Ingebrigtsen2010-09-02 01:29:42 +0000
committerKatsumi Yamaoka2010-09-02 01:29:42 +0000
commita93b858c988ce8c580ceccc4d49e08b3c2fef762 (patch)
treecab72c3058619633feabceb9284acfeaefb64b4a
parent846daf20c2e4e2c44dcc4c755d032c3aa1f1ccbd (diff)
downloademacs-a93b858c988ce8c580ceccc4d49e08b3c2fef762.tar.gz
emacs-a93b858c988ce8c580ceccc4d49e08b3c2fef762.zip
gnus-html.el (gnus-html-wash-tags): Don't show images that are really small. They're probably tracking images; nntp.el (nntp-request-set-mark): Refuse to do marks if nntp-marks-file-name is nil.
-rw-r--r--lisp/gnus/ChangeLog8
-rw-r--r--lisp/gnus/gnus-html.el39
-rw-r--r--lisp/gnus/nntp.el6
3 files changed, 37 insertions, 16 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index be773219137..1a0f2de1b93 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,11 @@
12010-09-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * gnus-html.el (gnus-html-wash-tags): Don't show images that are really
4 small. They're probably tracking images.
5
6 * nntp.el (nntp-request-set-mark): Refuse to do marks if
7 nntp-marks-file-name is nil.
8
12010-09-01 Teodor Zlatanov <tzz@lifelogs.com> 92010-09-01 Teodor Zlatanov <tzz@lifelogs.com>
2 10
3 * gnus-html.el (gnus-html-wash-tags) 11 * gnus-html.el (gnus-html-wash-tags)
diff --git a/lisp/gnus/gnus-html.el b/lisp/gnus/gnus-html.el
index 2d6637f253b..aa6d8fe297d 100644
--- a/lisp/gnus/gnus-html.el
+++ b/lisp/gnus/gnus-html.el
@@ -94,7 +94,7 @@ fit these criteria."
94 "-o" "pre_conv=1" 94 "-o" "pre_conv=1"
95 "-t" (format "%s" tab-width) 95 "-t" (format "%s" tab-width)
96 "-cols" (format "%s" gnus-html-frame-width) 96 "-cols" (format "%s" gnus-html-frame-width)
97 "-o" "display_image=off" 97 "-o" "display_image=on"
98 "-T" "text/html")))) 98 "-T" "text/html"))))
99 (gnus-html-wash-tags)))) 99 (gnus-html-wash-tags))))
100 100
@@ -142,19 +142,30 @@ fit these criteria."
142 (with-current-buffer gnus-summary-buffer 142 (with-current-buffer gnus-summary-buffer
143 gnus-blocked-images) 143 gnus-blocked-images)
144 gnus-blocked-images)) 144 gnus-blocked-images))
145 (let ((file (gnus-html-image-id url))) 145 (let ((file (gnus-html-image-id url))
146 (if (file-exists-p file) 146 width height)
147 ;; It's already cached, so just insert it. 147 (when (string-match "height=\"?\\([0-9]+\\)" parameters)
148 (let ((string (buffer-substring start end))) 148 (setq height (string-to-number (match-string 1 parameters))))
149 ;; Delete the ALT text. 149 (when (string-match "width=\"?\\([0-9]+\\)" parameters)
150 (delete-region start end) 150 (setq width (string-to-number (match-string 1 parameters))))
151 (gnus-html-put-image file (point) string)) 151 ;; Don't fetch images that are really small. They're
152 ;; We don't have it, so schedule it for fetching 152 ;; probably tracking pictures.
153 ;; asynchronously. 153 (when (and (or (null height)
154 (push (list url 154 (> height 4))
155 (set-marker (make-marker) start) 155 (or (null width)
156 (point-marker)) 156 (> width 4)))
157 images))))))) 157 (if (file-exists-p file)
158 ;; It's already cached, so just insert it.
159 (let ((string (buffer-substring start end)))
160 ;; Delete the ALT text.
161 (delete-region start end)
162 (gnus-html-put-image file (point) string))
163 ;; We don't have it, so schedule it for fetching
164 ;; asynchronously.
165 (push (list url
166 (set-marker (make-marker) start)
167 (point-marker))
168 images))))))))
158 ;; Add a link. 169 ;; Add a link.
159 ((or (equal tag "a") 170 ((or (equal tag "a")
160 (equal tag "A")) 171 (equal tag "A"))
diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el
index 4025b1f63bc..1d6c6a52444 100644
--- a/lisp/gnus/nntp.el
+++ b/lisp/gnus/nntp.el
@@ -1109,7 +1109,8 @@ command whose response triggered the error."
1109 t) 1109 t)
1110 1110
1111(deffoo nntp-request-set-mark (group actions &optional server) 1111(deffoo nntp-request-set-mark (group actions &optional server)
1112 (unless nntp-marks-is-evil 1112 (when (and (not nntp-marks-is-evil)
1113 nntp-marks-file-name)
1113 (nntp-possibly-create-directory group server) 1114 (nntp-possibly-create-directory group server)
1114 (nntp-open-marks group server) 1115 (nntp-open-marks group server)
1115 (dolist (action actions) 1116 (dolist (action actions)
@@ -1129,7 +1130,8 @@ command whose response triggered the error."
1129 nil) 1130 nil)
1130 1131
1131(deffoo nntp-request-update-info (group info &optional server) 1132(deffoo nntp-request-update-info (group info &optional server)
1132 (unless nntp-marks-is-evil 1133 (when (and (not nntp-marks-is-evil)
1134 nntp-marks-file-name)
1133 (nntp-possibly-create-directory group server) 1135 (nntp-possibly-create-directory group server)
1134 (when (nntp-marks-changed-p group server) 1136 (when (nntp-marks-changed-p group server)
1135 (nnheader-message 8 "Updating marks for %s..." group) 1137 (nnheader-message 8 "Updating marks for %s..." group)