Return data in the nntp buffer so the agent can save it.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sun, 19 Sep 2010 00:58:43 +0000 (02:58 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sun, 19 Sep 2010 00:58:43 +0000 (02:58 +0200)
lisp/ChangeLog
lisp/gnus-start.el
lisp/nnimap.el

index 468f621..6b6004e 100644 (file)
@@ -1,3 +1,8 @@
+2010-09-19  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * nnimap.el (nnimap-finish-retrieve-group-infos): Return data in the
+       nntp buffer so the agent can save it.
+
 2010-09-18  Julien Danjou  <julien@danjou.info>
 
        * gnus-html.el (gnus-html-schedule-image-fetching): Fetch all images in
index b421cee..1855307 100644 (file)
@@ -1808,7 +1808,8 @@ If SCAN, request a scan of that group as well."
        (gnus-check-backend-function 'finish-retrieve-group-infos (car method))
        (or (not (gnus-agent-method-p method))
           (gnus-online method)))
-      (gnus-finish-retrieve-group-infos method infos early-data))
+      (gnus-finish-retrieve-group-infos method infos early-data)
+      (gnus-agent-save-active method))
      ((gnus-check-backend-function 'retrieve-groups (car method))
       (when (gnus-check-backend-function 'request-scan (car method))
        (dolist (info infos)
index 601683e..a19f96c 100644 (file)
@@ -320,7 +320,7 @@ not done by default on servers that doesn't support that command.")
                 article)))
        (let ((buffer (nnimap-find-process-buffer (current-buffer))))
          (when (car result)
-           (with-current-buffer to-buffer
+           (with-current-buffer (or to-buffer nntp-server-buffer)
              (insert-buffer-substring buffer)
              (goto-char (point-min))
              (let ((bytes (nnimap-get-length)))
@@ -611,7 +611,18 @@ not done by default on servers that doesn't support that command.")
       (nnimap-update-infos (nnimap-flags-to-marks
                            (nnimap-parse-flags
                             (nreverse sequences)))
-                          infos))))
+                          infos)
+      ;; Finally, just return something resembling an active file in
+      ;; the nntp buffer, so that the agent can save the info, too.
+      (with-current-buffer nntp-server-buffer
+       (erase-buffer)
+       (dolist (info infos)
+         (let* ((group (gnus-info-group info))
+                (active (gnus-active group)))
+           (insert (format "%S %d %d y\n"
+                           (gnus-group-real-name group)
+                           (cdr active)
+                           (car active)))))))))
 
 (defun nnimap-update-infos (flags infos)
   (dolist (info infos)