]> git.eshelyaron.com Git - emacs.git/commitdiff
Divert to call `gnus-activate-group' with the SCAN argument set
authorDaiki Ueno <ueno@gnu.org>
Sun, 15 Apr 2018 14:11:46 +0000 (16:11 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 15 Apr 2018 14:11:46 +0000 (16:11 +0200)
* lisp/gnus/gnus-group.el (gnus-group-get-new-news-this-group):
Divert to call `gnus-activate-group' with the SCAN argument set,
if request-group-scan is not defined for the backend.  Ensure that
the server is open when calling `gnus-request-group-scan'
(bug#22649).

lisp/gnus/gnus-group.el

index 1a3646800e991767aa2b7d11c8b11e441955dfa7..d1f258fd92a268b4b67261730aa1118aef777af9 100644 (file)
@@ -4105,9 +4105,14 @@ If DONT-SCAN is non-nil, scan non-activated groups as well."
       (gnus-group-remove-mark group)
       ;; Bypass any previous denials from the server.
       (gnus-remove-denial (setq method (gnus-find-method-for-group group)))
-      (if (or (and (not dont-scan)
-                  (gnus-request-group-scan group (gnus-get-info group)))
-             (gnus-activate-group group (if dont-scan nil 'scan) nil method))
+      (if (if (and (not dont-scan)
+                  ;; Prefer request-group-scan if the backend supports it.
+                  (gnus-check-backend-function 'request-group-scan group))
+             (progn
+               ;; Ensure that the server is already open.
+               (gnus-activate-group group nil nil method)
+               (gnus-request-group-scan group (gnus-get-info group)))
+           (gnus-activate-group group (if dont-scan nil 'scan) nil method))
          (let ((info (gnus-get-info group))
                (active (gnus-active group)))
            (when info