* sb-mixi.el (shimbun-comment-article): Cache the content of all
authorbg66 <bg66>
Wed, 29 Nov 2006 07:32:23 +0000 (07:32 +0000)
committerbg66 <bg66>
Wed, 29 Nov 2006 07:32:23 +0000 (07:32 +0000)
comment.

ChangeLog
sb-mixi.el

index bb1a7f4..157b1ea 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2006-11-29  OHASHI Akira  <bg66@koka-in.org>
 
+       * sb-mixi.el (shimbun-comment-article): Cache the content of all
+       comment.
+
+2006-11-29  OHASHI Akira  <bg66@koka-in.org>
+
        * sb-mixi.el (shimbun-mixi): Add the COMMENT-CACHE slot.
        (initialize-instance): New method.
        (shimbun-mixi-get-headers): Cache the content of comment.
index 5b16ba8..dffac84 100644 (file)
@@ -203,19 +203,20 @@ FUNCTION is the function for getting articles."
                         (shimbun-mixi-comment-cache-internal shimbun))))
     (if (stringp cache)
        cache
-      (catch 'found
+      (let (article)
        (mapc (lambda (comment)
                (let ((id (mixi-friend-id (mixi-comment-owner comment)))
-                     (time (shimbun-mixi-make-date comment)))
+                     (time (shimbun-mixi-make-date 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))
-                   ;; FIXME: Concat parent's information?
-                   (let ((content (mixi-comment-content comment)))
-                     (puthash message-id content
-                              (shimbun-mixi-comment-cache-internal shimbun))
-                     (throw 'found content)))))
-             (mixi-get-comments parent))))))
+                   (setq article content))))
+             (mixi-get-comments parent))
+       article))))
 
 (luna-define-method shimbun-article ((shimbun shimbun-mixi)
                                     header &optional outbuf)