2007-03-06 OHASHI Akira <bg66@koka-in.org>
+ * 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 <bg66@koka-in.org>
+
* 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.
;; NOTE: This is an add-on module for Riece.
+;; If you have bug reports and/or suggestions for improvement, please
+;; send them via <URL:http://mixi.jp/view_community.pl?id=1596390>.
+
;;; Code:
(require 'mixi)
: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).
(defvar riece-mixi-timer nil)
(defvar riece-mixi-last-check nil)
-(defvar riece-mixi-enabled nil)
-
(defconst riece-mixi-description
"Riece integration for mixi.")
(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)))
(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)))
'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
(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)))