From ee8d6840f3c2fa748e560fd8bad78d1107121f6a Mon Sep 17 00:00:00 2001 From: bg66 Date: Tue, 11 Nov 2008 16:21:36 +0000 Subject: [PATCH] * mixi.el (mixi-message-box-list): Add `noticebox'. (mixi-message-list-regexp): Follow the change of mixi. (mixi-message-title-regexp): Ditto. (mixi-message-time-regexp): Ditto. (mixi-message-owner-regexp): Ditto. (mixi-message-content-regexp): Ditto. (mixi-realize-message): Follow the change above. * mixi-utils.el (mixi-make-author): Ditto. (mixi-make-id-1): Ditto. (mixi-make-reply-to): Ditto. * sb-mixi.el (shimbun-mixi-default-group-alist): Add `messages.notice'. --- ChangeLog | 14 ++++++++++++++ mixi-utils.el | 8 +++++++- mixi.el | 46 ++++++++++++++++++++++++++-------------------- sb-mixi.el | 5 ++++- 4 files changed, 51 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index ea2c3e0..f4d4fbb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2008-11-12 OHASHI Akira + + * mixi.el (mixi-message-box-list): Add `noticebox'. + (mixi-message-list-regexp): Follow the change of mixi. + (mixi-message-title-regexp): Ditto. + (mixi-message-time-regexp): Ditto. + (mixi-message-owner-regexp): Ditto. + (mixi-message-content-regexp): Ditto. + (mixi-realize-message): Follow the change above. + * mixi-utils.el (mixi-make-author): Ditto. + (mixi-make-id-1): Ditto. + (mixi-make-reply-to): Ditto. + * sb-mixi.el (shimbun-mixi-default-group-alist): Add `messages.notice'. + 2008-10-04 OHASHI Akira * mixi-el: Version 2.0.0 released. diff --git a/mixi-utils.el b/mixi-utils.el index 1ac5a4c..695dda1 100644 --- a/mixi-utils.el +++ b/mixi-utils.el @@ -92,6 +92,9 @@ (mixi-friend-nick (mixi-comment-owner object)))) ((eq class 'mixi-release) "mixi±¿±Ä»ö̳¶É") + ((eq class 'mixi-message) + (let ((owner (mixi-message-owner object))) + (if (null owner) "mixi" (mixi-friend-nick owner)))) (t (let ((owner (if (eq class 'mixi-log) (mixi-log-friend object) @@ -136,6 +139,8 @@ (concat (md5 (mixi-release-title object)) "@")) ((eq class 'mixi-echo) (concat (mixi-friend-id (mixi-echo-owner object)) "@")) + ((and (eq class 'mixi-message) (null (mixi-message-owner object))) + (concat (mixi-object-id object) "@")) (t (concat (mixi-object-id object) "@" (if (eq class 'mixi-news) @@ -263,7 +268,8 @@ (mixi-community-id object))) ((or (eq class 'mixi-news) (eq object (mixi-make-me))) (concat mixi-reply-to "diary")) - ((eq class 'mixi-message) + ((and (eq class 'mixi-message) + (not (null (mixi-message-owner object)))) (concat mixi-reply-to "message;" (mixi-friend-id (mixi-message-owner object)))) ((or (eq class 'mixi-friend) (eq class 'mixi-log)) diff --git a/mixi.el b/mixi.el index 9951032..749128c 100644 --- a/mixi.el +++ b/mixi.el @@ -138,7 +138,7 @@ (autoload 'w3m-retrieve "w3m") (autoload 'url-retrieve-synchronously "url")) -(defconst mixi-revision "$Revision: 1.198 $") +(defconst mixi-revision "$Revision: 1.199 $") (defgroup mixi nil "API library for accessing to mixi." @@ -2529,7 +2529,8 @@ Increase this value when unexpected error frequently occurs." (mixi-post-error 'cannot-find-succeed parent))))) ;; Message object. -(defconst mixi-message-box-list '(inbox outbox savebox thrash)) ; thrash? +(defconst mixi-message-box-list + '(inbox outbox savebox thrash noticebox)) ; thrash? (defmacro mixi-message-box-p (box) `(memq ,box mixi-message-box-list)) @@ -2565,35 +2566,40 @@ Increase this value when unexpected error frequently occurs." `(concat "/view_message.pl?id=" (mixi-message-id ,message) "&box=" (mixi-message-box ,message))) -(defconst mixi-message-owner-regexp - "\\(º¹½Ð¿Í\\|°¸ Àè\\) : \\(.*\\)\\(\\|\\)") -(defconst mixi-message-time-regexp -"Æü\\(¡¡\\| \\)ÉÕ : \\([0-9]+\\)ǯ\\([0-9]+\\)·î\\([0-9]+\\)Æü \\([0-9]+\\)»þ\\([0-9]+\\)ʬ  ") (defconst mixi-message-title-regexp -"·ï\\(¡¡\\| \\)̾ : \\(.*\\)\n?") +"
+

\\(.*\\)

") +(defconst mixi-message-time-regexp +"
ÆüÉÕ
+
\\([0-9]+\\)ǯ\\([0-9]+\\)·î\\([0-9]+\\)Æü \\([0-9]+\\)»þ\\([0-9]+\\)ʬ
") +(defconst mixi-message-owner-regexp + "
º¹½Ð¿Í
+
\\( +\\(.*\\)\\|mixi
\\)") (defconst mixi-message-content-regexp - "\\(.*\\)") + "
\\(\\(.\\|\r?\n\\)*?\\)
") (defun mixi-realize-message (message) "Realize a MESSAGE." (unless (mixi-object-realized-p message) (with-mixi-retrieve (mixi-message-page message) - (if (re-search-forward mixi-message-owner-regexp nil t) - (mixi-message-set-owner message - (mixi-make-friend (match-string 2) - (match-string 3))) - (mixi-realization-error 'cannot-find-owner message)) + (if (re-search-forward mixi-message-title-regexp nil t) + (mixi-message-set-title message (match-string 1)) + (mixi-realization-error 'cannot-find-title message)) (if (re-search-forward mixi-message-time-regexp nil t) (mixi-message-set-time - message (encode-time 0 (string-to-number (match-string 6)) - (string-to-number (match-string 5)) + message (encode-time 0 (string-to-number (match-string 5)) (string-to-number (match-string 4)) (string-to-number (match-string 3)) - (string-to-number (match-string 2)))) + (string-to-number (match-string 2)) + (string-to-number (match-string 1)))) (mixi-realization-error 'cannot-find-time message)) - (if (re-search-forward mixi-message-title-regexp nil t) - (mixi-message-set-title message (match-string 2)) - (mixi-realization-error 'cannot-find-title message)) + (if (re-search-forward mixi-message-owner-regexp nil t) + (unless (string= (match-string 1) "mixi") + (mixi-message-set-owner message + (mixi-make-friend (match-string 2) + (match-string 3)))) + (mixi-realization-error 'cannot-find-owner message)) (if (re-search-forward mixi-message-content-regexp nil t) (mixi-message-set-content message (match-string 1)) (mixi-realization-error 'cannot-find-content message))) @@ -2668,7 +2674,7 @@ Increase this value when unexpected error frequently occurs." (when ,box (concat "&box=" ,box)))) (defconst mixi-message-list-regexp - "") + "") ;;;###autoload (defun mixi-get-messages (&rest box-or-range) diff --git a/sb-mixi.el b/sb-mixi.el index 0acacd5..43d0d72 100644 --- a/sb-mixi.el +++ b/sb-mixi.el @@ -33,7 +33,7 @@ (require 'mixi-utils) (require 'shimbun) -(defconst shimbun-mixi-revision "$Revision: 1.64 $") +(defconst shimbun-mixi-revision "$Revision: 1.65 $") (eval-and-compile (luna-define-class shimbun-mixi (shimbun) (comment-cache release-cache)) @@ -49,6 +49,9 @@ ("messages.sent" . (lambda (range) (mixi-get-messages 'outbox range))) + ("messages.notice" . + (lambda (range) + (mixi-get-messages 'noticebox range))) ("logs" . mixi-get-logs) ("my-diaries" . "/home.pl") ("mixi-el" . "/view_community.pl?id=1596390") -- 1.7.10.4