[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

nnimap 0.33 -> 0.34 patches



Index: nnimap/ChangeLog
diff -u nnimap/ChangeLog:1.102 nnimap/ChangeLog:1.103
--- nnimap/ChangeLog:1.102	Thu Oct 15 10:54:15 1998
+++ nnimap/ChangeLog	Thu Oct 15 12:27:04 1998
@@ -1,3 +1,12 @@
+1998-10-15 21:24:39  Simon Josefsson  <jas@pdc.kth.se>
+
+	* nnimap 0.34 released.
+
+1998-10-15 21:24:31  Simon Josefsson  <jas@pdc.kth.se>
+
+	* nnimap.el (nnimap-request-update-info-internal): Revert to old
+	behaviour.
+
 1998-10-15 19:52:19  Simon Josefsson  <jas@pdc.kth.se>
 
 	* nnimap 0.33 released.
Index: nnimap/nnimap.el
diff -u nnimap/nnimap.el:1.79 nnimap/nnimap.el:1.80
--- nnimap/nnimap.el:1.79	Thu Oct 15 10:53:59 1998
+++ nnimap/nnimap.el	Thu Oct 15 12:26:54 1998
@@ -95,7 +95,7 @@
 
 (nnoo-declare nnimap) ; we derive from no one
 
-(defconst nnimap-version "nnimap 0.33")
+(defconst nnimap-version "nnimap 0.34")
 
 ;; Various server variables.
 
@@ -731,14 +731,28 @@
       ;; of server (all mark memory in client).
 
       (when (nnimap-mark-permanent-p 'read)
-	(let ((seen (gnus-compress-sequence (imap-search "SEEN") t)))
-	  ;; we can't return '(1) since this isn't a "list of ranges",
-	  ;; and we can't return '((1)) since gnus-list-of-unread-articles
-	  ;; is buggy so we return '((1 . 1)).
-	  (gnus-info-set-read info (if (and (atom (car seen))
-					    (null (cdr seen)))
-				       (list (cons (car seen) (car seen)))
-				     seen))))
+	(gnus-info-set-read 
+         info
+         (let* (;; oldseen could contain articles marked unread by other
+                ;; imap clients!  we correct this
+                (oldseentmp (gnus-uncompress-range (gnus-info-read info)))
+                (unseen (imap-search "UNSEEN UNDELETED"))
+                (oldseen (gnus-set-difference oldseentmp unseen))
+                ;; oldseen might lack articles marked as read by other
+                ;; imap clients! we correct this
+                (newseen (imap-search "SEEN"))
+                ;; ok, read articles are in oldseen+newseen (xxx lots of dupes)
+                (seen (append oldseen newseen))
+                ;; sort to have gnus-compress-sequence remove dupes
+                (seens (sort seen '<))
+                (read (gnus-compress-sequence seens t)))
+	   ;; we can't return '(1) since this isn't a "list of ranges",
+	   ;; and we can't return '((1)) since gnus-list-of-unread-articles
+	   ;; is buggy so we return '((1 . 1)).
+           (if (and (atom (car read))
+		    (null (cdr read)))
+               (list (cons (car read) (car read)))
+             read))))
 
       (mapc (lambda (pred)
 	      (when (and (nnimap-mark-permanent-p (cdr pred))
@@ -1334,7 +1348,7 @@
 	
 	(nnimap-request-set-mark group delta-marks)
 	(nnimap-expunge-close-group)))))
-  
+
 ;;; Gnus glue
 
 (defun nnimap-group-mode-hook ()