* sb-mixi.el: (shimbun-mixi-get-headers): Stop getting comment's
authorbg66 <bg66>
Fri, 10 Nov 2006 07:17:42 +0000 (07:17 +0000)
committerbg66 <bg66>
Fri, 10 Nov 2006 07:17:42 +0000 (07:17 +0000)
headers when it was already shown.
(shimbun-get-headers): Follow the change above.

ChangeLog
sb-mixi.el

index 43dc682..c45f988 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2006-11-10  OHASHI Akira  <bg66@koka-in.org>
 
+       * sb-mixi.el: (shimbun-mixi-get-headers): Stop getting comment's
+       headers when it was already shown.
+       (shimbun-get-headers): Follow the change above.
+
+2006-11-10  OHASHI Akira  <bg66@koka-in.org>
+
        * sb-mixi.el: New file.
 
 2006-11-10  OHASHI Akira  <bg66@koka-in.org>
index da75401..1e47c4b 100644 (file)
@@ -103,33 +103,39 @@ FUNCTION is the function for getting articles."
           (concat (shimbun-mixi-make-xref (mixi-comment-parent object))
                   "#comment")))))
 
-(defun shimbun-mixi-get-headers (objects &optional range)
+(defun shimbun-mixi-get-headers (shimbun objects &optional range)
   (when objects
     (let (headers)
-      (mapc (lambda (object)
-             (when (mixi-object-p object)
-               (let ((class (mixi-object-class object)))
-                 (push
-                  (shimbun-create-header
-                   0
-                   (shimbun-mixi-make-subject object)
-                   (shimbun-mixi-make-from object)
-                   (shimbun-mixi-make-date object)
-                   (shimbun-mixi-make-message-id object)
-                   (if (eq class 'mixi-comment)
-                       (shimbun-mixi-make-message-id
-                        (mixi-comment-parent object))
-                     "")
-                   0 0
-                   (shimbun-mixi-make-xref object))
-                  headers)
-                 (when (or (eq class 'mixi-diary)
-                           (eq class 'mixi-topic))
-                   (let ((comments (mixi-get-comments object range)))
-                     (mapc (lambda (header)
-                             (push header headers))
-                           (shimbun-mixi-get-headers comments)))))))
-           objects)
+      (catch 'stop
+       (mapc (lambda (object)
+               (when (mixi-object-p object)
+                 (let ((class (mixi-object-class object))
+                       (id (shimbun-mixi-make-message-id object)))
+                   (when (and (eq class 'mixi-comment)
+                              (shimbun-search-id shimbun id))
+                     (throw 'stop nil))
+                   (push
+                    (shimbun-create-header
+                     0
+                     (shimbun-mixi-make-subject object)
+                     (shimbun-mixi-make-from object)
+                     (shimbun-mixi-make-date object)
+                     id
+                     (if (eq class 'mixi-comment)
+                         (shimbun-mixi-make-message-id
+                          (mixi-comment-parent object))
+                       "")
+                     0 0
+                     (shimbun-mixi-make-xref object))
+                    headers)
+                   (when (or (eq class 'mixi-diary)
+                             (eq class 'mixi-topic))
+                     (let ((comments (mixi-get-comments object range)))
+                       (mapc (lambda (header)
+                               (push header headers))
+                             (shimbun-mixi-get-headers shimbun
+                                                       comments)))))))
+             objects))
       headers)))
 
 (luna-define-method shimbun-get-headers ((shimbun shimbun-mixi)
@@ -151,7 +157,7 @@ FUNCTION is the function for getting articles."
                                  " is not supported yet.")))))
       (when (fboundp url-or-function)
        (setq objects (funcall url-or-function range))))
-    (shimbun-sort-headers (shimbun-mixi-get-headers objects range))))
+    (shimbun-sort-headers (shimbun-mixi-get-headers shimbun objects range))))
 
 (defun shimbun-comment-article (url header)
   (let ((parent (mixi-make-object-from-url url))