* sb-mixi.el (shimbun-mixi-to-regexp): Abolish.
authorbg66 <bg66>
Thu, 19 Apr 2007 08:42:28 +0000 (08:42 +0000)
committerbg66 <bg66>
Thu, 19 Apr 2007 08:42:28 +0000 (08:42 +0000)
(shimbun-mixi-send-mail): Ditto.
* mixi-utils.el (mixi-to-regexp): New constant.
(mixi-send-mail): New function.
* mixi-gnus.el (message-mixi-p): Follow the change above.
(message-send-via-mixi): Ditto.
* mixi-wl.el (wl-draft-send-mail-with-mixi): Ditto.
(mixi-wl-setup-draft-buffer): Ditto.
* acinclude.m4 (AC_EXAMINE_MODULES): Ditto.

ChangeLog
acinclude.m4
mixi-gnus.el
mixi-utils.el
mixi-wl.el
sb-mixi.el

index 5fe242f..491be8b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2007-04-19  OHASHI Akira  <bg66@koka-in.org>
+
+       * sb-mixi.el (shimbun-mixi-to-regexp): Abolish.
+       (shimbun-mixi-send-mail): Ditto.
+       * mixi-utils.el (mixi-to-regexp): New constant.
+       (mixi-send-mail): New function.
+       * mixi-gnus.el (message-mixi-p): Follow the change above.
+       (message-send-via-mixi): Ditto.
+       * mixi-wl.el (wl-draft-send-mail-with-mixi): Ditto.
+       (mixi-wl-setup-draft-buffer): Ditto.
+       * acinclude.m4 (AC_EXAMINE_MODULES): Ditto.
+
 2007-04-16  OHASHI Akira  <bg66@koka-in.org>
 
        * mixi-wl.el (wl-draft-send-mail-with-mixi): Check that title is not
index 92d09ee..d3161fd 100644 (file)
@@ -301,12 +301,12 @@ AC_DEFUN([AC_EXAMINE_MODULES],
 
   if test ${HAVE_SHIMBUN} = yes; then
     MODULES="${MODULES} ${MODULES_SHIMBUN}"
-    if test ${HAVE_GNUS} = yes; then
-      MODULES="${MODULES} ${MODULES_GNUS}"
-    fi
-    if test ${HAVE_WL} = yes; then
-      MODULES="${MODULES} ${MODULES_WL}"
-    fi
+  fi
+  if test ${HAVE_GNUS} = yes; then
+    MODULES="${MODULES} ${MODULES_GNUS}"
+  fi
+  if test ${HAVE_WL} = yes; then
+    MODULES="${MODULES} ${MODULES_WL}"
   fi
   if test ${HAVE_RIECE} = yes; then
     MODULES="${MODULES} ${MODULES_RIECE}"
index 77b7312..009dd21 100644 (file)
@@ -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."
          (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)))
index 8008f8e..82b996b 100644 (file)
                  (concat mixi-reply-to "message;"
                          (mixi-friend-id object))))))))
 
+(defconst mixi-to-regexp
+  "^mixi;\\([a-z]+\\);?\\([a-z0-9]+\\)?;?\\([0-9]+\\)?;?\\([0-9]+\\)?")
+
+(defun mixi-send-mail (to title content)
+  (when (string-match mixi-to-regexp to)
+    (let ((method (match-string 1 to)))
+      (cond ((string= method "comment")
+            (let ((parent (match-string 2 to))
+                  (owner-id (match-string 3 to))
+                  (id (match-string 4 to)))
+              (if (string= parent "diary")
+                  (mixi-post-comment
+                   (mixi-make-diary (mixi-make-friend owner-id) id) content)
+                (let ((func (intern
+                             (concat mixi-object-prefix "make-" parent))))
+                  (mixi-post-comment
+                   (funcall func (mixi-make-community owner-id) id)
+                   content)))))
+           ((string= method "topic")
+            (mixi-post-topic (mixi-make-community (match-string 2 to))
+                             title content))
+           ((string= method "diary")
+            (mixi-post-diary title content))
+           ((string= method "message")
+            (mixi-post-message (mixi-make-friend (match-string 2 to))
+                               title content))))))
+
 (provide 'mixi-utils)
 
 ;;; mixi-utils.el ends here
index db06074..7f404eb 100644 (file)
@@ -34,7 +34,7 @@
 
 ;;; Code:
 
-(require 'sb-mixi)
+(require 'mixi-utils)
 (require 'wl-draft)
 
 (defsubst mixi-wl-get-recipients-from-buffer ()
                                "$\\|^$") nil t)
                       (point-marker)))
          (id (std11-field-body "message-id")))
-      (shimbun-mixi-send-mail recipients
-                             (eword-decode-string
-                              (or (std11-field-body "subject") ""))
-                             (decode-mime-charset-string
-                              (buffer-substring (1+ delimline)
-                                                (point-max))
-                              wl-mime-charset))
+      (mixi-send-mail recipients
+                     (eword-decode-string (or (std11-field-body "subject")
+                                              ""))
+                     (decode-mime-charset-string
+                      (buffer-substring (1+ delimline) (point-max))
+                      wl-mime-charset))
       (wl-draft-set-sent-message 'mail 'sent)
       (wl-draft-write-sendlog 'ok 'mixi nil (list recipients) id))))
 
 (defun mixi-wl-setup-draft-buffer ()
-  (when (string-match shimbun-mixi-to-regexp
-                     (mixi-wl-get-recipients-from-buffer))
+  (when (string-match mixi-to-regexp (mixi-wl-get-recipients-from-buffer))
     (make-local-variable 'wl-draft-send-confirm-with-preview)
     (setq wl-draft-send-confirm-with-preview nil)
     (make-local-variable 'wl-draft-send-mail-function)
index 22c9e4c..8a6234f 100644 (file)
@@ -235,33 +235,6 @@ of mixi object."
               (shimbun-message shimbun "shimbun: Make contents...done")))
           "")))))
 
-(defconst shimbun-mixi-to-regexp
-  "^mixi;\\([a-z]+\\);?\\([a-z0-9]+\\)?;?\\([0-9]+\\)?;?\\([0-9]+\\)?")
-
-(defun shimbun-mixi-send-mail (to title content)
-  (when (string-match shimbun-mixi-to-regexp to)
-    (let ((method (match-string 1 to)))
-      (cond ((string= method "comment")
-            (let ((parent (match-string 2 to))
-                  (owner-id (match-string 3 to))
-                  (id (match-string 4 to)))
-              (if (string= parent "diary")
-                  (mixi-post-comment
-                   (mixi-make-diary (mixi-make-friend owner-id) id) content)
-                (let ((func (intern
-                             (concat mixi-object-prefix "make-" parent))))
-                  (mixi-post-comment
-                   (funcall func (mixi-make-community owner-id) id)
-                   content)))))
-           ((string= method "topic")
-            (mixi-post-topic (mixi-make-community (match-string 2 to))
-                             title content))
-           ((string= method "diary")
-            (mixi-post-diary title content))
-           ((string= method "message")
-            (mixi-post-message (mixi-make-friend (match-string 2 to))
-                               title content))))))
-
 (provide 'sb-mixi)
 
 ;;; sb-mixi.el ends here