(riece-mixi-message-filter-function): New function.
authorbg66 <bg66>
Wed, 20 Aug 2008 01:03:36 +0000 (01:03 +0000)
committerbg66 <bg66>
Wed, 20 Aug 2008 01:03:36 +0000 (01:03 +0000)
(riece-mixi-insinuate): Use it.
(riece-mixi-uninstall): New function.

ChangeLog
riece-mixi.el

index 55743f7..0328558 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-08-20  OHASHI Akira  <bg66@koka-in.org>
+
+       * riece-mixi.el (riece-mixi-message-filter-function): New function.
+       (riece-mixi-insinuate): Use it.
+       (riece-mixi-uninstall): New function.
+
 2008-08-18  OHASHI Akira  <bg66@koka-in.org>
 
        * mixi.el (mixi-warning-continuously-accessing): Follow the change of
index 03d7b09..6c4ae4e 100644 (file)
@@ -1,5 +1,5 @@
 ;;; riece-mixi.el --- Riece integration for mixi
-;; Copyright (C) 2007 OHASHI Akira
+;; Copyright (C) 2007, 2008 OHASHI Akira
 
 ;; Author: OHASHI Akira <bg66@koka-in.org>
 ;; Keywords: IRC, riece
@@ -139,9 +139,23 @@ If they exist, send them as notice to the corresponding channel."
          riece-mixi-check-alist)
     (setq riece-mixi-last-check (current-time))))
 
+(defun riece-mixi-message-filter-function (message)
+  (when (and (get 'riece-mixi 'riece-addon-enabled)
+            (riece-message-own-p message)
+            (eq 'action (riece-message-type message)))
+    (mixi-post-echo (riece-message-text message))))
+
 (defun riece-mixi-insinuate ()
   (add-hook 'riece-after-display-message-functions
-           'riece-mixi-display-message-function))
+           'riece-mixi-display-message-function)
+  (add-hook 'riece-message-filter-functions
+           'riece-mixi-message-filter-function))
+
+(defun riece-mixi-uninstall ()
+  (remove-hook 'riece-after-display-message-functions
+              'riece-mixi-display-message-function)
+  (remove-hook 'riece-message-filter-functions
+              'riece-mixi-message-filter-function))
 
 (defun riece-mixi-enable ()
   (when riece-mixi-check-alist