From b4cddb2386289ed14137ffaa5bd8baf8d924c233 Mon Sep 17 00:00:00 2001 From: bg66 Date: Thu, 30 Nov 2006 00:06:31 +0000 Subject: [PATCH] * sb-mixi.el (shimbun-comment-article): Simplify. --- ChangeLog | 4 ++++ sb-mixi.el | 27 ++++++++++----------------- 2 files changed, 14 insertions(+), 17 deletions(-) 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) -- 1.7.10.4