From: bg66 Date: Fri, 10 Nov 2006 07:17:42 +0000 (+0000) Subject: * sb-mixi.el: (shimbun-mixi-get-headers): Stop getting comment's X-Git-Tag: cache-file-branchpoint~15 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5138d6e72d32a6e8725ed2d4ad5f1e8eec4f01b5;p=elisp%2Fmixi.git * sb-mixi.el: (shimbun-mixi-get-headers): Stop getting comment's headers when it was already shown. (shimbun-get-headers): Follow the change above. --- diff --git a/ChangeLog b/ChangeLog index 43dc682..c45f988 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2006-11-10 OHASHI Akira + * 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 + * sb-mixi.el: New file. 2006-11-10 OHASHI Akira diff --git a/sb-mixi.el b/sb-mixi.el index da75401..1e47c4b 100644 --- a/sb-mixi.el +++ b/sb-mixi.el @@ -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))