gnus-notifications: add actions support
[gnus] / lisp / gnus-gravatar.el
index 5be838b..b6e760b 100644 (file)
@@ -1,6 +1,6 @@
 ;;; gnus-gravatar.el --- Gnus Gravatar support
 
-;; Copyright (C) 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2012 Free Software Foundation, Inc.
 
 ;; Author: Julien Danjou <julien@danjou.info>
 ;; Keywords: news
@@ -80,9 +80,8 @@ If nil, default to `gravatar-size'."
   "Insert GRAVATAR for ADDRESS in HEADER in current article buffer.
 Set image category to CATEGORY."
   (unless (eq gravatar 'error)
-    (with-current-buffer gnus-article-buffer
+    (gnus-with-article-buffer
       (let ((mark (point-marker))
-           (inhibit-read-only t)
            (inhibit-point-motion-hooks t)
            (case-fold-search t))
        (save-restriction
@@ -113,7 +112,7 @@ Set image category to CATEGORY."
                  (let ((point (point)))
                    (unless (featurep 'xemacs)
                      (setq gravatar (append gravatar gnus-gravatar-properties)))
-                   (gnus-put-image gravatar nil category)
+                   (gnus-put-image gravatar (buffer-substring (point) (1+ point)) category)
                    (put-text-property point (point) 'gnus-gravatar address)
                    (gnus-add-wash-type category)
                    (gnus-add-image category gravatar)))))))