2010-09-18 Lars Magne Ingebrigtsen <larsi@gnus.org>
+ * gnus-start.el (gnus-activate-group): Send the info to
+ gnus-request-group.
+
+ * nnimap.el (nnimap-request-group): Have the "check" version of the
+ function parse flags and update the info, so that a `M-g' get a total
+ resync of all flags from the group.
+
* gnus-int.el (gnus-request-group): Take an optional `info' parameter
to allow backends to alter the info on group selection. Also alter all
the backend -request-group functions to take the parameter.
t)
(if (or debug-on-error debug-on-quit)
(inline (gnus-request-group group (or dont-sub-check dont-check)
- method))
+ method
+ (gnus-get-info group)))
(condition-case nil
(inline (gnus-request-group group (or dont-sub-check dont-check)
- method))
+ method
+ (gnus-get-info group)))
;;(error nil)
(quit
(message "Quit activating %s" group)
"Internal variable with default value for `nnimap-split-download-body'.")
(defstruct nnimap
- group process commands capabilities)
+ group process commands capabilities select-result)
(defvar nnimap-object nil)
(deffoo nnimap-request-group (group &optional server dont-check info)
(with-current-buffer nntp-server-buffer
(let ((result (nnimap-possibly-change-group group server))
- articles active)
+ articles active marks)
(when result
(if (and dont-check
(setq active (nth 2 (assoc group nnimap-current-infos))))
(car active)
(cdr active)
group))
- (setq articles (nnimap-get-flags "1:*"))
+ (with-current-buffer (nnimap-buffer)
+ (erase-buffer)
+ (let ((group-sequence
+ (nnimap-send-command "SELECT %S" (utf7-encode group)))
+ (flag-sequence
+ (nnimap-send-command "UID FETCH 1:* FLAGS")))
+ (nnimap-wait-for-response flag-sequence)
+ (setq marks
+ (nnimap-flags-to-marks
+ (nnimap-parse-flags
+ (list (list group-sequence flag-sequence 1 group)))))
+ (when info
+ (nnimap-update-infos marks (list info)))))
(erase-buffer)
- (insert
- (format
- "211 %d %d %d %S\n"
- (length articles)
- (or (caar articles) 0)
- (or (caar (last articles)) 0)
- group)))
+ (let ((high (nth 3 (car marks)))
+ (low (nth 4 (car marks))))
+ (insert
+ (format
+ "211 %d %d %d %S\n"
+ (1+ (- high low))
+ low high group))))
t))))
(defun nnimap-get-flags (spec)
t
(let ((result (nnimap-command "SELECT %S" (utf7-encode group t))))
(when (car result)
- (setf (nnimap-group nnimap-object) group)
+ (setf (nnimap-group nnimap-object) group
+ (nnimap-select-result nnimap-object) result)
result))))))))
(defun nnimap-find-connection (buffer)