From: bg66 Date: Thu, 30 Nov 2006 00:06:31 +0000 (+0000) Subject: * sb-mixi.el (shimbun-comment-article): Simplify. X-Git-Tag: mixi-el-1_0_0~182 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4cddb2386289ed14137ffaa5bd8baf8d924c233;p=elisp%2Fmixi.git * sb-mixi.el (shimbun-comment-article): Simplify. --- diff --git a/ChangeLog b/ChangeLog index 157b1ea..13d628d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-11-30 OHASHI Akira + + * sb-mixi.el (shimbun-comment-article): Simplify. + 2006-11-29 OHASHI Akira * sb-mixi.el (shimbun-comment-article): Cache the content of all diff --git a/sb-mixi.el b/sb-mixi.el index dffac84..a11ea26 100644 --- a/sb-mixi.el +++ b/sb-mixi.el @@ -196,27 +196,20 @@ FUNCTION is the function for getting articles." (shimbun-sort-headers (shimbun-mixi-get-headers shimbun objects range)))) (defun shimbun-comment-article (url shimbun header) - (let* ((parent (mixi-make-object-from-url url)) - (date (shimbun-header-date header)) - (message-id (shimbun-header-id header)) - (cache (gethash message-id - (shimbun-mixi-comment-cache-internal shimbun)))) - (if (stringp cache) - cache - (let (article) + (let* ((message-id (shimbun-header-id header)) + (cache (shimbun-mixi-comment-cache-internal shimbun)) + (article (gethash message-id cache))) + (unless (stringp article) + (let ((parent (mixi-make-object-from-url url))) (mapc (lambda (comment) - (let ((id (mixi-friend-id (mixi-comment-owner comment))) - (time (shimbun-mixi-make-date comment)) + (let ((id (shimbun-mixi-make-message-id comment)) ;; FIXME: Concat parent's information? (content (mixi-comment-content comment))) - (puthash (shimbun-mixi-make-message-id comment) content - (shimbun-mixi-comment-cache-internal shimbun)) - (when (and (string= time date) - (string-match (concat "^<[0-9]+\\." id "@") - message-id)) + (puthash id content cache) + (when (string= id message-id) (setq article content)))) - (mixi-get-comments parent)) - article)))) + (mixi-get-comments parent)))) + article)) (luna-define-method shimbun-article ((shimbun shimbun-mixi) header &optional outbuf)