(riece-mixi-message-filter): Rename from
[elisp/mixi.git] / mixi-gnus.el
index 82fb1cc..1d00893 100644 (file)
@@ -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 <bg66@koka-in.org>
 ;; 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:
 
 
 ;;; Code:
 
-(require 'sb-mixi)
-
-;; Functions and variables which should be defined in the other module
-;; at run-time.
-(eval-when-compile
-  (defvar message-this-is-news)
-  (defvar message-sent-message-via)
-  (defvar message-send-method-alist)
-  (autoload 'message-narrow-to-headers "message")
-  (autoload 'message-fetch-field "message")
-  (autoload 'message-generate-new-buffer-clone-locals "message")
-  (autoload 'message-goto-body "message")
-  (autoload 'mml-buffer-substring-no-properties-except-hard-newlines "mml"))
+(require 'mixi-utils)
+(require 'message)
 
 (defun message-mixi-p ()
   "Say whether the current buffer contains a mixi message."
@@ -55,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."
          (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)))
   (let ((method '(mixi message-mixi-p message-send-via-mixi)))
     (unless (member method message-send-method-alist)
       (setq message-send-method-alist
-           (cons method 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)