Don't send any marks updates to the server for articles we didn't get any headers...
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Tue, 29 Mar 2011 20:09:41 +0000 (22:09 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Tue, 29 Mar 2011 20:09:41 +0000 (22:09 +0200)
This is a sanity check.

lisp/ChangeLog
lisp/gnus-sum.el

index ad92e28..c65aa99 100644 (file)
@@ -1,3 +1,9 @@
+2011-03-29  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * gnus-sum.el (gnus-update-marks): Don't send any marks updates to the
+       server for articles we didn't get any headers for.  This is a sanity
+       check.
+
 2011-03-29  Michael Welsh Duggan  <md5i@md5i.com>
 
        * nnimap.el (nnimap-open-connection-1): Is the login responds with a
index e1b8775..91dc6fb 100644 (file)
@@ -6068,14 +6068,23 @@ If SELECT-ARTICLES, only select those articles from GROUP."
                    'request-set-mark gnus-newsgroup-name)
                   (not (gnus-article-unpropagatable-p (cdr type))))
          (let* ((old (cdr (assq (cdr type) (gnus-info-marks info))))
-                (del (gnus-remove-from-range (gnus-copy-sequence old) list))
-                (add (gnus-remove-from-range
-                      (gnus-copy-sequence list) old)))
+                ;; Don't do anything about marks for articles we
+                ;; didn't actually get any headers for.
+                (existing (gnus-compress-sequence gnus-newsgroup-articles))
+                (del
+                 (gnus-sorted-range-intersection
+                  existing
+                  (gnus-remove-from-range (gnus-copy-sequence old) list)))
+                (add
+                 (gnus-sorted-range-intersection
+                  existing
+                  (gnus-remove-from-range
+                   (gnus-copy-sequence list) old))))
            (when add
              (push (list add 'add (list (cdr type))) delta-marks))
            (when del
-             ;; Don't delete marks from outside the active range.  This
-             ;; shouldn't happen, but is a sanity check.
+             ;; Don't delete marks from outside the active range.
+             ;; This shouldn't happen, but is a sanity check.
              (setq del (gnus-sorted-range-intersection
                         (gnus-active gnus-newsgroup-name) del))
              (push (list del 'del (list (cdr type))) delta-marks))))