summaryrefslogtreecommitdiff
path: root/lisp/gnus/gnus-gravatar.el
diff options
context:
space:
mode:
authorKatsumi Yamaoka <yamaoka@jpl.org>2010-10-07 12:31:39 +0000
committerKatsumi Yamaoka <yamaoka@jpl.org>2010-10-07 12:31:39 +0000
commitfcf2d385f2b91b9cd24821ec8bf55fbfacd51ee7 (patch)
tree490aeef94aaa16e70265cfe10726da07acf06085 /lisp/gnus/gnus-gravatar.el
parenta7dcc87b1b2ce2c4d8c4d26a95cbdb3df1b67a20 (diff)
downloademacs-fcf2d385f2b91b9cd24821ec8bf55fbfacd51ee7.tar.gz
[Gnus] Introduce gnus-gravatar-too-ugly.
gnus-gravatar.el (gnus-gravatar-too-ugly): New user option. gnus-gravatar.el (gnus-gravatar-transform-address): Don't show avatars of people of which mail addresses match gnus-gravatar-too-ugly. gnus.texi (Gravatars): Document gnus-gravatar-too-ugly.
Diffstat (limited to 'lisp/gnus/gnus-gravatar.el')
-rw-r--r--lisp/gnus/gnus-gravatar.el21
1 files changed, 17 insertions, 4 deletions
diff --git a/lisp/gnus/gnus-gravatar.el b/lisp/gnus/gnus-gravatar.el
index ecd9f753f5e..e974e9a8a89 100644
--- a/lisp/gnus/gnus-gravatar.el
+++ b/lisp/gnus/gnus-gravatar.el
@@ -42,6 +42,13 @@
:version "24.1"
:group 'gnus-gravatar)
+(defcustom gnus-gravatar-too-ugly (if (boundp 'gnus-article-x-face-too-ugly)
+ gnus-article-x-face-too-ugly)
+ "Regexp matching posters whose avatar shouldn't be shown automatically."
+ :type '(choice regexp (const nil))
+ :version "24.1"
+ :group 'gnus-gravatar)
+
(defun gnus-gravatar-transform-address (header category)
(gnus-with-article-headers
(let ((addresses
@@ -55,10 +62,16 @@
(mail-fetch-field header)))))
(let ((gravatar-size gnus-gravatar-size))
(dolist (address addresses)
- (gravatar-retrieve
- (car address)
- 'gnus-gravatar-insert
- (list header address category)))))))
+ (unless (and gnus-gravatar-too-ugly
+ (or (string-match gnus-gravatar-too-ugly
+ (car address))
+ (and (cdr address)
+ (string-match gnus-gravatar-too-ugly
+ (cdr address)))))
+ (gravatar-retrieve
+ (car address)
+ 'gnus-gravatar-insert
+ (list header address category))))))))
(defun gnus-gravatar-insert (gravatar header address category)
"Insert GRAVATAR for ADDRESS in HEADER in current article buffer.