From: bg66 Date: Tue, 6 Mar 2007 08:13:02 +0000 (+0000) Subject: * riece-mixi.el (riece-mixi-reply-to-only-me): New user option. X-Git-Tag: mixi-el-1_0_0~60 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=4a05f8f16df2a9a2d5386ef8a19f5620191e7590;p=elisp%2Fmixi.git * riece-mixi.el (riece-mixi-reply-to-only-me): New user option. (riece-mixi-display-message-function): Use it. * riece-mixi.el (riece-mixi-enabled): Abolish. (riece-mixi-display-message-function): Follow the change above. (riece-mixi-check): Ditto. (riece-mixi-enable): Ditto. (riece-mixi-disable): Ditto. --- diff --git a/ChangeLog b/ChangeLog index d2b1e48..1e82a1e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,19 @@ 2007-03-06 OHASHI Akira + * riece-mixi.el (riece-mixi-reply-to-only-me): New user option. + (riece-mixi-display-message-function): Use it. + + * riece-mixi.el (riece-mixi-enabled): Abolish. + (riece-mixi-display-message-function): Follow the change above. + (riece-mixi-check): Ditto. + (riece-mixi-enable): Ditto. + (riece-mixi-disable): Ditto. + +2007-03-06 OHASHI Akira + * riece-mixi.el: New file. * configure.ac: Add AC_CHECK_RIECE and HAVE_RIECE. - * acinclude.m4 Add AC_CHECK_RIECE. + * acinclude.m4: Add AC_CHECK_RIECE. * Makefile.am (MODULES_ALL): Abolish. (MODULES_SHIMBUN): New variable. (MODULES_RIECE): Ditto. diff --git a/riece-mixi.el b/riece-mixi.el index a5002fb..22bfe04 100644 --- a/riece-mixi.el +++ b/riece-mixi.el @@ -25,6 +25,9 @@ ;; NOTE: This is an add-on module for Riece. +;; If you have bug reports and/or suggestions for improvement, please +;; send them via . + ;;; Code: (require 'mixi) @@ -54,6 +57,11 @@ :type 'string :group 'riece-mixi) +(defcustom riece-mixi-reply-to-only-me nil + "*If non-nil, reply to only my messages." + :type 'boolean + :group 'riece-mixi) + (defcustom riece-mixi-check-alist nil "*An alist for checking to detect new articles. Each element looks like (CHANNEL . URL) or (CHANNEL . FUNCTION). @@ -82,8 +90,6 @@ of mixi object." (defvar riece-mixi-timer nil) (defvar riece-mixi-last-check nil) -(defvar riece-mixi-enabled nil) - (defconst riece-mixi-description "Riece integration for mixi.") @@ -100,7 +106,10 @@ of mixi object." (error nil))) (defun riece-mixi-display-message-function (message) - (when (and riece-mixi-enabled + (when (and (get 'riece-mixi 'riece-addon-enabled) + (or (not riece-mixi-reply-to-only-me) + (and riece-mixi-reply-to-only-me + (riece-message-own-p message))) (string-match riece-mixi-regexp (riece-message-text message))) (let* ((url (match-string 1 (riece-message-text message))) (object (mixi-make-object-from-url url))) @@ -119,7 +128,7 @@ of mixi object." (defun riece-mixi-check () "Check to detect new articles. If they exist, send them as notice to the corresponding channel." - (when riece-mixi-enabled + (when (get 'riece-mixi 'riece-addon-enabled) (mapc (lambda (list) (let ((target (riece-parse-identity (car list))) (url-or-function (cdr list))) @@ -151,7 +160,6 @@ If they exist, send them as notice to the corresponding channel." 'riece-mixi-display-message-function)) (defun riece-mixi-enable () - (setq riece-mixi-enabled t) (when riece-mixi-check-alist (setq riece-mixi-timer (run-at-time riece-mixi-timer-step riece-mixi-timer-step @@ -159,7 +167,6 @@ If they exist, send them as notice to the corresponding channel." (setq riece-mixi-last-check (current-time)))) (defun riece-mixi-disable () - (setq riece-mixi-enabled nil) (when (timerp riece-mixi-timer) (cancel-timer riece-mixi-timer) (setq riece-mixi-timer nil)))