* sb-mixi.el (shimbun-comment-article): Simplify.
authorbg66 <bg66>
Thu, 30 Nov 2006 00:06:31 +0000 (00:06 +0000)
committerbg66 <bg66>
Thu, 30 Nov 2006 00:06:31 +0000 (00:06 +0000)
ChangeLog
sb-mixi.el

index 157b1ea..13d628d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2006-11-30  OHASHI Akira  <bg66@koka-in.org>
+
+       * sb-mixi.el (shimbun-comment-article): Simplify.
+
 2006-11-29  OHASHI Akira  <bg66@koka-in.org>
 
        * sb-mixi.el (shimbun-comment-article): Cache the content of all
index dffac84..a11ea26 100644 (file)
@@ -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)