X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=mixi-gnus.el;h=1d008933cd1fa9899d6d58a363a6419a58cbd1ad;hb=c73fdb7f7f5ab5319afbce969ec9b2ab10c9c421;hp=4e7c72c87b20dd2cf2eddd232ee5d2c122640962;hpb=7a8f1aff028d6f1abf59a99d5524f676176fa7bc;p=elisp%2Fmixi.git diff --git a/mixi-gnus.el b/mixi-gnus.el index 4e7c72c..1d00893 100644 --- a/mixi-gnus.el +++ b/mixi-gnus.el @@ -1,6 +1,6 @@ ;;; mixi-gnus.el --- Gnus integration for mixi -;; Copyright (C) 2007 OHASHI Akira +;; Copyright (C) 2007, 2008 OHASHI Akira ;; Author: OHASHI Akira ;; Keywords: news @@ -18,9 +18,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program; if not, you can either send email to this -;; program's maintainer or write to: The Free Software Foundation, -;; Inc.; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -34,7 +34,7 @@ ;;; Code: -(require 'sb-mixi) +(require 'mixi-utils) (require 'message) (defun message-mixi-p () @@ -44,8 +44,7 @@ (save-restriction (message-narrow-to-headers) (or (message-fetch-field "mixi-to") - (string-match shimbun-mixi-to-regexp - (message-fetch-field "to"))))))) + (string-match mixi-to-regexp (message-fetch-field "to"))))))) (defun message-send-via-mixi (arg) "Send the current message via mixi." @@ -55,8 +54,9 @@ ;; Avoid matching with message-mail-p. (with-current-buffer mailbuf (goto-char (point-min)) - (when (search-forward "\nTo: " nil t) - (replace-match "\nMixi-To: "))) + (unless (search-forward "\nMixi-To: " nil t) + (when (search-forward "\nTo: " nil t) + (replace-match "\nMixi-To: ")))) (unwind-protect (save-excursion (set-buffer tembuf) @@ -65,10 +65,10 @@ (insert (with-current-buffer mailbuf (mml-buffer-substring-no-properties-except-hard-newlines (point-min) (point-max)))) - (shimbun-mixi-send-mail (message-fetch-field "mixi-to") - (message-fetch-field "subject") - (buffer-substring (message-goto-body) - (point-max)))) + (mixi-send-mail (message-fetch-field "mixi-to") + (message-fetch-field "subject") + (buffer-substring (message-goto-body) + (point-max)))) (kill-buffer tembuf)) (set-buffer mailbuf) (push 'mixi message-sent-message-via))) @@ -77,8 +77,10 @@ (let ((method '(mixi message-mixi-p message-send-via-mixi))) (unless (member method message-send-method-alist) (setq message-send-method-alist - (cons '(mixi message-mixi-p message-send-via-mixi) - message-send-method-alist))))) + (cons method message-send-method-alist)))) + ;; Avoid matching with bogus addresses for `message-send-via-mixi'. + (setq message-bogus-addresses + (remove "[ \t]" message-bogus-addresses))) (provide 'mixi-gnus)