From 0f3d4e725d778537472684e1a093646d95ba15f1 Mon Sep 17 00:00:00 2001 From: bg66 Date: Wed, 20 Aug 2008 01:03:36 +0000 Subject: [PATCH] (riece-mixi-message-filter-function): New function. (riece-mixi-insinuate): Use it. (riece-mixi-uninstall): New function. --- ChangeLog | 6 ++++++ riece-mixi.el | 18 ++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 55743f7..0328558 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-08-20 OHASHI Akira + + * 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 * mixi.el (mixi-warning-continuously-accessing): Follow the change of diff --git a/riece-mixi.el b/riece-mixi.el index 03d7b09..6c4ae4e 100644 --- a/riece-mixi.el +++ b/riece-mixi.el @@ -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 ;; 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 -- 1.7.10.4