[Date Prev][Date Next] [Chronological] [Thread] [Top]

nnimap 0.109 -> 0.110 patches



Index: nnimap/ChangeLog
diff -c nnimap/ChangeLog:1.220 nnimap/ChangeLog:1.221
*** nnimap/ChangeLog:1.220	Thu May 27 10:05:53 1999
--- nnimap/ChangeLog	Mon May 31 09:24:25 1999
***************
*** 1,3 ****
--- 1,12 ----
+ 1999-05-31  Simon Josefsson  <jas@pdc.kth.se>
+ 
+ 	* nnimap 0.110 released.
+ 
+ 	* nnimap.el (nnimap-find-minmax-uid): New function.
+ 	(nnimap-request-group): Use it.
+ 	(nnimap-retrieve-groups): Rewrite.
+ 	(nnimap-request-list-mapper): Removed.
+ 
  1999-05-27  Simon Josefsson  <jas@pdc.kth.se>
  
  	* nnimap 0.109 released.
Index: nnimap/nnimap.el
diff -c nnimap/nnimap.el:1.173 nnimap/nnimap.el:1.175
*** nnimap/nnimap.el:1.173	Thu May 27 09:37:15 1999
--- nnimap/nnimap.el	Mon May 31 09:23:59 1999
***************
*** 99,105 ****
  (gnus-declare-backend "nnimap" 'mail 'address 'prompt-address 
  		      'physical-address)
  
! (defconst nnimap-version "nnimap 0.109")
  
  (defvoo nnimap-address nil
    "Address of physical IMAP server.  If nil, use the virtual server's name.")
--- 99,105 ----
  (gnus-declare-backend "nnimap" 'mail 'address 'prompt-address 
  		      'physical-address)
  
! (defconst nnimap-version "nnimap 0.110")
  
  (defvoo nnimap-address nil
    "Address of physical IMAP server.  If nil, use the virtual server's name.")
***************
*** 307,312 ****
--- 307,324 ----
        (gnus-group-add-parameter gnusgroup (cons 'uidvalidity new-uidvalidity))
        t)))
  
+ (defun nnimap-find-minmax-uid (group &optional examine)
+   (with-current-buffer nnimap-server-buffer
+     (when (or (string= group imap-current-mailbox)
+ 	      (imap-mailbox-select group nil examine))
+       (let (minuid maxuid)
+ 	(imap-fetch "1,*" "UID" nil 'nouidfetch)
+ 	(imap-message-map (lambda (uid Uid)
+ 			    (setq minuid (if minuid (min minuid uid) uid)
+ 				  maxuid (if maxuid (max maxuid uid) uid)))
+ 			  'UID)
+ 	(list (imap-mailbox-get 'exists) minuid maxuid)))))
+   
  (defun nnimap-possibly-change-group (group &optional server)
    (when (nnimap-possibly-change-server server)
      (with-current-buffer nnimap-server-buffer
***************
*** 532,545 ****
    (when (nnimap-possibly-change-group group server)
      (with-current-buffer nnimap-server-buffer
        (unless fast
! 	(let ((minuid 1) (maxuid 0))
! 	  (imap-fetch "1,*" "UID" nil 'nouidfetch)
! 	  (imap-message-map (lambda (uid Uid)
! 			      (setq minuid (min minuid uid)
! 				    maxuid (max maxuid uid)))
! 			    'UID)
! 	  (nnheader-insert "211 %d %d %d %s\n" (imap-mailbox-get 'exists)
! 			   (max 1 minuid) maxuid group)))
        (nnheader-report 'nnimap "Group %s selected" group)
        t)))
        
--- 544,554 ----
    (when (nnimap-possibly-change-group group server)
      (with-current-buffer nnimap-server-buffer
        (unless fast
! 	(let (info)
! 	  (when (setq info (nnimap-find-minmax-uid group))
! 	    (nnheader-insert "211 %d %d %d %s\n" (or (nth 0 info) 0)
! 			     (max 1 (or (nth 1 info) 1))
! 			     (or (nth 2 info) 0) group))))
        (nnheader-report 'nnimap "Group %s selected" group)
        t)))
        
***************
*** 592,597 ****
--- 601,622 ----
  
  ;; Optional backend functions
  
+ (deffoo nnimap-retrieve-groups (groups &optional server)
+   (when (nnimap-possibly-change-server server)
+     (gnus-message 5 "nnimap: Checking mailboxes...")
+     (with-current-buffer nntp-server-buffer
+       (erase-buffer)
+       (dolist (group groups)
+ 	(gnus-message 7 "nnimap: Checking mailbox %s" group)
+ 	(or (member "\\NoSelect" 
+ 		    (imap-mailbox-get 'list-flags group nnimap-server-buffer))
+ 	    (let ((info (nnimap-find-minmax-uid group 'examine)))
+ 	      (insert (format "211 %d %d %d %s\n" (or (nth 0 info) 0)
+ 			      (max 1 (or (nth 1 info) 1))
+ 			      (or (nth 2 info) 0) group))))))
+     (gnus-message 5 "nnimap: Checking mailboxes...done")
+     'groups))
+ 
  (deffoo nnimap-request-type (group &optional article)
    'mail)
  
***************
*** 913,955 ****
  (add-hook 'gnus-group-mode-hook 'nnimap-group-mode-hook)
  
  ;; legacy functions:
- 
- ;;; Returns: GROUP HIGHEST LOWEST [ynmxj=]
- (defun nnimap-request-list-mapper (group)
-   (unless (or (member "\\NoSelect" (imap-mailbox-get 'list-flags group))
- 	      ;; We ignore groups with spaces (Gnus can't handle them)
- 	      (string-match " " group))
-     (gnus-message 7 "Generating active list for nnimap group %s" group)
-     (when (imap-mailbox-select group)
-       (let ((exists (imap-mailbox-get 'exists))
- 	    articles)
- 	(if (eq 0 exists)
- 	    (with-current-buffer nntp-server-buffer
- 	      (insert (format "%s 0 1 y\n" group)))
- 	  (when (nnimap-ok-p (nnimap-send-command-wait "FETCH 1,* (UID)"))
- 	    (imap-message-map (lambda (uid Uid)
- 				(push uid articles)) 'UID)
- 	    (with-current-buffer nntp-server-buffer
- 	      (insert (format "%s %d %d y\n" group
- 			      (apply 'max articles)
- 			      (apply 'min articles))))))
- 	t))))
- 
- ;; This gets called instead of `nnimap-request-list' when
- ;; `gnus-read-active-file' is 'some instead of t.
- ;; Returns: GROUP HIGHEST LOWEST [ynmxj=] ???
- (deffoo nnimap-retrieve-groups (groups &optional server)
-   (when (nnimap-possibly-change-server server)
-     (with-current-buffer nntp-server-buffer (erase-buffer))
-     (with-current-buffer nnimap-server-buffer
-       ;; Force the slow method for now since this will only be called
-       ;; for subscribed groups. 
-       (let (group)
-         (gnus-message 5 "Generating active info for certain groups on %s"
-                       server)
-         (while (setq group (pop groups))
-           (nnimap-request-list-mapper group)))
-       'active)))
  
  ;; This is nnimap-request-update-info, but it's so extremely slow
  ;; we can't have Gnus call it all the time. Instead, it's called by
--- 938,943 ----