From 2d2bcd59933fc5c0c75e3c158576c140142f7597 Mon Sep 17 00:00:00 2001 From: teranisi Date: Wed, 6 Jun 2001 04:03:44 +0000 Subject: [PATCH] * elmo-shimbun.el (elmo-shimbun-parse-time-string): New function. (elmo-shimbun-msgdb-to-headers): Added `expire-days' argument. (elmo-shimbun-get-headers): Use return value of `shimbun-article-expiration-days'. --- elmo/ChangeLog | 5 +++++ elmo/elmo-shimbun.el | 21 ++++++++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 37234e8..feabe69 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,5 +1,10 @@ 2001-06-06 Yuuichi Teranishi + * elmo-shimbun.el (elmo-shimbun-parse-time-string): New function. + (elmo-shimbun-msgdb-to-headers): Added `expire-days' argument. + (elmo-shimbun-get-headers): Use return value of + `shimbun-article-expiration-days'. + * elmo-pop3.el (elmo-pop3-process-filter): Show retrieve progress. (elmo-pop3-total-size): New variable. (elmo-message-fetch-plugged): Bind elmo-pop3-total-size while fetching. diff --git a/elmo/elmo-shimbun.el b/elmo/elmo-shimbun.el index 08e3046..23b3243 100644 --- a/elmo/elmo-shimbun.el +++ b/elmo/elmo-shimbun.el @@ -66,6 +66,14 @@ (+ (* (- (car now) (car time)) 65536) (- (nth 1 now) (nth 1 time))))) +(defun elmo-shimbun-parse-time-string (string) + "Parse the time-string STRING and return its time as Emacs style." + (ignore-errors + (let ((x (timezone-fix-time string nil nil))) + (encode-time (aref x 5) (aref x 4) (aref x 3) + (aref x 2) (aref x 1) (aref x 0) + (aref x 6))))) + (defsubst elmo-shimbun-headers-check-p (folder) (or (null (elmo-shimbun-folder-last-check-internal folder)) (and (elmo-shimbun-folder-last-check-internal folder) @@ -73,10 +81,15 @@ (elmo-shimbun-folder-last-check-internal folder)) elmo-shimbun-check-interval)))) -(defun elmo-shimbun-msgdb-to-headers (folder) +(defun elmo-shimbun-msgdb-to-headers (folder expire-days) (let (headers) (dolist (ov (elmo-msgdb-get-overview (elmo-folder-msgdb folder))) - (when (elmo-msgdb-overview-entity-get-extra-field ov "xref") + (when (and (elmo-msgdb-overview-entity-get-extra-field ov "xref") + (> (elmo-shimbun-lapse-seconds + (elmo-shimbun-parse-time-string + (elmo-msgdb-overview-entity-get-date ov))) + (* expire-days 86400 ; seconds per day + ))) (setq headers (cons (shimbun-make-header (elmo-msgdb-overview-entity-get-number ov) @@ -115,7 +128,9 @@ (elmo-shimbun-folder-shimbun-internal folder))))) (elmo-shimbun-folder-set-headers-internal folder - (nconc (elmo-shimbun-msgdb-to-headers folder) + (nconc (elmo-shimbun-msgdb-to-headers + folder (shimbun-article-expiration-days + (elmo-shimbun-folder-shimbun-internal folder))) headers)) (setq hash (elmo-shimbun-folder-set-header-hash-internal -- 1.7.10.4