Fix up Agent expiry of opportunistically cached messages
authorLars Magne Ingebrigtsen <larsi@stories.(none)>
Fri, 6 Jan 2012 22:27:44 +0000 (23:27 +0100)
committerLars Magne Ingebrigtsen <larsi@stories.(none)>
Fri, 6 Jan 2012 22:27:44 +0000 (23:27 +0100)
* gnus-agent.el (gnus-agent-store-article): Tell the Agent when the
article was fetched, so that it can be expired later (bug#9958).

lisp/ChangeLog
lisp/gnus-agent.el

index a18be11..976c903 100644 (file)
@@ -1,5 +1,8 @@
 2012-01-06  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * gnus-agent.el (gnus-agent-store-article): Tell the Agent when the
+       article was fetched, so that it can be expired later (bug#9958).
+
        * nntp.el (nntp-retrieve-groups): Refuse to do retrieval when an async
        retrieval is happening.
 
index 5e73432..9daa53f 100644 (file)
@@ -3888,7 +3888,12 @@ has been fetched."
         (coding-system-for-write gnus-cache-coding-system))
     (when (not (file-exists-p file))
       (gnus-make-directory (file-name-directory file))
-      (write-region (point-min) (point-max) file nil 'silent))))
+      (write-region (point-min) (point-max) file nil 'silent)
+      ;; Tell the Agent when the article was fetched, so that it can
+      ;; be expired later.
+      (gnus-agent-load-alist group)
+      (gnus-agent-save-alist group (list article)
+                            (time-to-days (current-time))))))
 
 (defun gnus-agent-regenerate-group (group &optional reread)
   "Regenerate GROUP.