]> git.eshelyaron.com Git - emacs.git/commitdiff
[Gnus] Introduce gnus-gravatar-too-ugly.
authorKatsumi Yamaoka <yamaoka@jpl.org>
Thu, 7 Oct 2010 12:31:39 +0000 (12:31 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Thu, 7 Oct 2010 12:31:39 +0000 (12:31 +0000)
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.

doc/misc/ChangeLog
doc/misc/gnus.texi
lisp/gnus/ChangeLog
lisp/gnus/gnus-gravatar.el

index 22208f6763d07a34f9646e58e9eee20da2a37093..2971701b1f29829bca9c6fb4d0ea3722b020d94e 100644 (file)
@@ -1,3 +1,7 @@
+2010-10-07  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus.texi (Gravatars): Document gnus-gravatar-too-ugly.
+
 2010-10-06  Julien Danjou  <julien@danjou.info>
 
        * sieve.texi (Manage Sieve API): Document sieve-manage-authenticate.
index bc2adb87a356a9f538f2e2ce797c78f6ff9171ca..1f78e8c563f769ca7173fc76432dd3d1904c2171 100644 (file)
@@ -827,6 +827,7 @@ Image Enhancements
 * Smileys::                     Show all those happy faces the way they were
                                   meant to be shown.
 * Picons::                      How to display pictures of what you're reading.
+* Gravatars::                   Display the avatar of people you read.
 * XVarious::                    Other XEmacsy Gnusey variables.
 
 Thwarting Email Spam
@@ -23195,6 +23196,12 @@ number for the size is enough.
 @vindex gnus-gravatar-properties
 List of image properties applied to Gravatar images.
 
+@item gnus-gravatar-too-ugly
+@vindex gnus-gravatar-too-ugly
+Regexp that matches mail addresses or names of people of which avatars
+should not be displayed, or @code{nil}.  It default to the value of
+@code{gnus-article-x-face-too-ugly} (@pxref{X-Face}).
+
 @end table
 
 If you want to see them in the From field, set:
index bb3d1ccacb647ca76ec65ae81681f314159d4972..2e07fa8798e6c2334da038f37a5ea6aabee35da1 100644 (file)
@@ -1,3 +1,9 @@
+2010-10-07  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * gnus-gravatar.el (gnus-gravatar-too-ugly): New user option.
+       (gnus-gravatar-transform-address): Don't show avatars of people of
+       which mail addresses match gnus-gravatar-too-ugly.
+
 2010-10-07  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
        * shr.el (shr-table-widths): Expand TD elements to fill available
index ecd9f753f5eb71e5f1c0ea8914ab3035910a9894..e974e9a8a8903f853bab283342a10b68d06f5a5c 100644 (file)
   :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
              (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.