X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=mixi-wl.el;h=2e034f22ec5d9894f750abee66b106d8c7d42aef;hb=8dac51061d42b3d0759dbcfc29379313dc2ceb9b;hp=7ff0630a1af55c371b1b4a78cad048cc29c26fc0;hpb=1c6a9bf502392e9baf064321a60ed4b7f82d1966;p=elisp%2Fmixi.git diff --git a/mixi-wl.el b/mixi-wl.el index 7ff0630..2e034f2 100644 --- a/mixi-wl.el +++ b/mixi-wl.el @@ -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 'wl-draft) (defsubst mixi-wl-get-recipients-from-buffer () @@ -53,23 +53,23 @@ "$\\|^$") nil t) (point-marker))) (id (std11-field-body "message-id"))) - (shimbun-mixi-send-mail recipients - (eword-decode-string - (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)) - (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) - (setq wl-draft-send-mail-function 'wl-draft-send-mail-with-mixi))) + (let ((recipients (mixi-wl-get-recipients-from-buffer))) + (when (and recipients + (string-match mixi-to-regexp recipients)) + (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) + (setq wl-draft-send-mail-function 'wl-draft-send-mail-with-mixi)))) (defun mixi-wl-setup () (add-hook 'wl-draft-send-hook 'mixi-wl-setup-draft-buffer))