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

nnimap 0.111 -> 0.112 patches



Index: nnimap/ChangeLog
diff -c nnimap/ChangeLog:1.222 nnimap/ChangeLog:1.225
*** nnimap/ChangeLog:1.222	Tue Jun  1 12:53:15 1999
--- nnimap/ChangeLog	Thu Jun  3 06:39:52 1999
***************
*** 1,4 ****
--- 1,26 ----
+ 1999-06-03  Simon Josefsson  <jas@pdc.kth.se>
+ 
+ 	* nnimap 0.112 released.
+ 
+ 	* imap.el (imap-parse-body): Sun SIMS bug workaround.
+ 
+ 1999-06-02  Simon Josefsson  <jas@pdc.kth.se>
+ 
+ 	* nnimap.el (nnimap-retrieve-headers-progress): Use In-Reply-To
+ 	field from envelope.
+ 	(nnimap-retrieve-headers): Don't request In-Reply-To field.
+ 	(nnimap-request-article-part): Return group/uid cons.
+ 
+ 	* imap.el (imap-current-mailbox-p): New function.
+ 	(imap-mailbox-select): Use it.
+ 	(imap-mailbox-expunge): Don't expunge examined mailboxes.
+ 	(imap-parse-fetch): Don't warn about missing uid.
+ 
+ 	* nnimap.el (nnimap-possibly-change-group): Use it.
+ 
  1999-06-01  Simon Josefsson  <jas@pdc.kth.se>
+ 
+ 	* nnimap.el (nnimap-expunge-close-group): Close mailbox when 'ask.
  
  	* nnimap 0.111 released.
  
Index: nnimap/imap.el
diff -c nnimap/imap.el:1.140 nnimap/imap.el:1.143
*** nnimap/imap.el:1.140	Tue Jun  1 12:52:40 1999
--- nnimap/imap.el	Thu Jun  3 06:38:54 1999
***************
*** 686,700 ****
         imap-mailbox-data)
        result)))
  
  (defun imap-mailbox-select (mailbox &optional buffer examine)
    "Select MAILBOX on server in BUFFER. If EXAMINE is non-nil, do a
  read-only select."
    (with-current-buffer (or buffer (current-buffer))
!     (if (and (string= mailbox imap-current-mailbox)
! 	     (or (and examine
! 		      (eq imap-state 'examine))
! 		 (and (not examine)
! 		      (eq imap-state 'selected))))
  	imap-current-mailbox
        (let ((old-mailbox imap-current-mailbox)
  	    (old-data imap-mailbox-data))
--- 686,704 ----
         imap-mailbox-data)
        result)))
  
+ (defun imap-current-mailbox-p (mailbox &optional examine buffer)
+   (with-current-buffer (or buffer (current-buffer))
+     (and (string= mailbox imap-current-mailbox)
+ 	 (or (and examine
+ 		  (eq imap-state 'examine))
+ 	     (and (not examine)
+ 		  (eq imap-state 'selected))))))
+ 
  (defun imap-mailbox-select (mailbox &optional buffer examine)
    "Select MAILBOX on server in BUFFER. If EXAMINE is non-nil, do a
  read-only select."
    (with-current-buffer (or buffer (current-buffer))
!     (if (imap-current-mailbox-p mailbox examine)
  	imap-current-mailbox
        (let ((old-mailbox imap-current-mailbox)
  	    (old-data imap-mailbox-data))
***************
*** 730,736 ****
    "Expunge articles in current folder in BUFFER. If BUFFER is
  nil the current buffer is assumed."
    (with-current-buffer (or buffer (current-buffer))
!     (imap-ok-p (imap-send-command-wait "EXPUNGE"))))
  
  (defun imap-mailbox-close (&optional buffer)
    "Expunge articles and close current folder in BUFFER. If BUFFER is
--- 734,741 ----
    "Expunge articles in current folder in BUFFER. If BUFFER is
  nil the current buffer is assumed."
    (with-current-buffer (or buffer (current-buffer))
!     (unless (eq imap-state 'examine)
!       (imap-ok-p (imap-send-command-wait "EXPUNGE")))))
  
  (defun imap-mailbox-close (&optional buffer)
    "Expunge articles and close current folder in BUFFER. If BUFFER is
***************
*** 1629,1635 ****
  
  (defsubst imap-parse-header-list ()
    (when (eq (char-after) ?\()
!     (let (strlist str)
        (while (not (eq (char-after) ?\)))
  	(imap-forward)
  	(push (imap-parse-astring) strlist))
--- 1634,1640 ----
  
  (defsubst imap-parse-header-list ()
    (when (eq (char-after) ?\()
!     (let (strlist)
        (while (not (eq (char-after) ?\)))
  	(imap-forward)
  	(push (imap-parse-astring) strlist))
***************
*** 1682,1689 ****
  		   (setq body (imap-parse-body))))
  		((eq token 'BODYSTRUCTURE)
  		 (setq bodystructure (imap-parse-body))))))
!       (if (not uid)
! 	  (message "Skipping UID-less fetch response (broken server?)...")
  	(setq imap-current-message uid)
  	(imap-message-put uid 'UID uid)
  	(and flags (imap-message-put uid 'FLAGS flags))
--- 1687,1693 ----
  		   (setq body (imap-parse-body))))
  		((eq token 'BODYSTRUCTURE)
  		 (setq bodystructure (imap-parse-body))))))
!       (when uid
  	(setq imap-current-message uid)
  	(imap-message-put uid 'UID uid)
  	(and flags (imap-message-put uid 'FLAGS flags))
***************
*** 1976,1981 ****
--- 1980,1987 ----
  	(imap-forward)
  	(push (imap-parse-string) body)                   ;; media-subtype
  	(imap-forward)
+ 	;; next line for Sun SIMS bug
+ 	(and (eq (char-after) ? ) (imap-forward))
  	(if (eq (char-after) ?\()                         ;; body-fld-param
  	    (push (imap-parse-string-list) body)
  	  (push (and (imap-parse-nil) nil) body))
Index: nnimap/nnimap.el
diff -c nnimap/nnimap.el:1.176 nnimap/nnimap.el:1.179
*** nnimap/nnimap.el:1.176	Tue Jun  1 12:52:57 1999
--- nnimap/nnimap.el	Thu Jun  3 06:39:13 1999
***************
*** 99,105 ****
  (gnus-declare-backend "nnimap" 'mail 'address 'prompt-address 
  		      'physical-address)
  
! (defconst nnimap-version "nnimap 0.111")
  
  (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.112")
  
  (defvoo nnimap-address nil
    "Address of physical IMAP server.  If nil, use the virtual server's name.")
***************
*** 323,329 ****
      (with-current-buffer nnimap-server-buffer
        (if (null group)
  	  imap-current-mailbox
! 	(if (and imap-current-mailbox (string= group imap-current-mailbox))
  	    t
  	  (when imap-current-mailbox
  	    (nnimap-expunge-close-group))
--- 323,329 ----
      (with-current-buffer nnimap-server-buffer
        (if (null group)
  	  imap-current-mailbox
! 	(if (imap-current-mailbox-p group)
  	    t
  	  (when imap-current-mailbox
  	    (nnimap-expunge-close-group))
***************
*** 365,384 ****
  		(imap-message-envelope-date imap-current-message))
  	       (nnimap-replace-whitespace
  		(imap-message-envelope-message-id imap-current-message))
! 	       (let ((str (if (imap-capability 'IMAP4rev1)
! 			      (nth 2 (assoc
! 				      "HEADER.FIELDS REFERENCES IN-REPLY-TO"
! 				      (imap-message-get
! 				       imap-current-message 'BODYDETAIL)))
! 			    (imap-message-get imap-current-message 
! 					      'RFC822.HEADER)))
! 		     out)
! 		 (when (string-match "<[^>]+>" str)
! 		   (setq out (substring str (match-beginning 0) (match-end 0)))
! 		   (while (string-match "<[^>]+>" str (match-end 0))
! 		     (setq out (concat " "  (substring str (match-beginning 0)
! 						       (match-end 0))))))
! 		 (and out (gnus-strip-whitespace out)))
  	       (imap-message-get imap-current-message 'RFC822.SIZE)
  	       (imap-body-lines (imap-message-body imap-current-message))
  	       nil ;; xref
--- 365,384 ----
  		(imap-message-envelope-date imap-current-message))
  	       (nnimap-replace-whitespace
  		(imap-message-envelope-message-id imap-current-message))
! 	       (nnimap-replace-whitespace
! 		(let ((str (if (imap-capability 'IMAP4rev1)
! 			       (nth 2 (assoc
! 				       "HEADER.FIELDS REFERENCES"
! 				       (imap-message-get
! 					imap-current-message 'BODYDETAIL)))
! 			     (imap-message-get imap-current-message 
! 					       'RFC822.HEADER))))
! 		  (if (> (length str) (length "References: "))
! 		      (substring str (length "References: "))
! 		    (if (and (setq str (imap-message-envelope-in-reply-to
! 					imap-current-message))
! 			     (string-match "<[^>]+>" str))
! 			(substring str (match-beginning 0) (match-end 0))))))
  	       (imap-message-get imap-current-message 'RFC822.SIZE)
  	       (imap-body-lines (imap-message-body imap-current-message))
  	       nil ;; xref
***************
*** 413,420 ****
  		  (concat 
  		   "(UID RFC822.SIZE ENVELOPE BODY "
  		   (if (imap-capability 'IMAP4rev1 nnimap-server-buffer)
! 		       "BODY.PEEK[HEADER.FIELDS (References In-Reply-To)])"
! 		     "RFC822.HEADER.LINES (References In-Reply-To))"))
  		  nil nil nnimap-server-buffer)
        (and (numberp nnmail-large-newsgroup)
  	   (> nnimap-length nnmail-large-newsgroup)
--- 413,420 ----
  		  (concat 
  		   "(UID RFC822.SIZE ENVELOPE BODY "
  		   (if (imap-capability 'IMAP4rev1 nnimap-server-buffer)
! 		       "BODY.PEEK[HEADER.FIELDS (References)])"
! 		     "RFC822.HEADER.LINES (References))"))
  		  nil nil nnimap-server-buffer)
        (and (numberp nnmail-large-newsgroup)
  	   (> nnimap-length nnmail-large-newsgroup)
***************
*** 515,533 ****
    (when (nnimap-possibly-change-group group server)
      (with-current-buffer (or to-buffer nntp-server-buffer)
        (erase-buffer)
!       (insert (nnimap-demule
! 	       (or (imap-fetch
! 		    (if (stringp article)
! 			(car-safe (imap-search 
! 				   (format "HEADER Message-Id %s" article
! 					   nnimap-server-buffer)))
! 		      article)
! 		    part prop nil nnimap-server-buffer)
! 		   "")))
!       (nnheader-ms-strip-cr)
!       (if (bobp)
! 	  (nnheader-report 'nnimap "No such article")
! 	t))))
  
  (deffoo nnimap-request-article (article &optional group server to-buffer)
    (nnimap-request-article-part 
--- 515,536 ----
    (when (nnimap-possibly-change-group group server)
      (with-current-buffer (or to-buffer nntp-server-buffer)
        (erase-buffer)
!       (let (artnum)
! 	(insert (nnimap-demule
! 		 (or (imap-fetch
! 		      (setq artnum
! 			    (if (stringp article)
! 				(car-safe (imap-search 
! 					   (format "HEADER Message-Id %s"
! 						   article)
! 					   nnimap-server-buffer))
! 			      article))
! 		      part prop nil nnimap-server-buffer)
! 		     "")))
! 	(nnheader-ms-strip-cr)
! 	(if (bobp)
! 	    (nnheader-report 'nnimap "No such article")
! 	  (cons group artnum))))))
  
  (deffoo nnimap-request-article (article &optional group server to-buffer)
    (nnimap-request-article-part 
***************
*** 564,575 ****
        (case nnimap-expunge-on-close
  	('always (imap-mailbox-expunge)
  		 (imap-mailbox-close))
! 	('ask (when (imap-search "DELETED")
! 		(if (gnus-y-or-n-p (format "Expunge articles in group `%s'? "
! 					   imap-current-mailbox))
! 		    (and (imap-mailbox-expunge)
  			 (imap-mailbox-close))
! 		  (imap-mailbox-unselect))))
  	(t (imap-mailbox-unselect)))
        (not imap-current-mailbox))))
  
--- 567,579 ----
        (case nnimap-expunge-on-close
  	('always (imap-mailbox-expunge)
  		 (imap-mailbox-close))
! 	('ask (if (and (imap-search "DELETED")
! 		       (gnus-y-or-n-p (format 
! 				       "Expunge articles in group `%s'? "
! 				       imap-current-mailbox)))
! 		  (progn (imap-mailbox-expunge)
  			 (imap-mailbox-close))
! 		(imap-mailbox-unselect)))
  	(t (imap-mailbox-unselect)))
        (not imap-current-mailbox))))
  
***************
*** 1133,1143 ****
          '(
  nnimap-possibly-change-server
  nnimap-verify-uidvalidity
  nnimap-possibly-change-group
! nnimap-replace-whitespace
! ;nnimap-retrieve-headers-progress
! ;nnimap-retrieve-headers-store-uids
! ;nnimap-retrieve-headers-get-uids
  nnimap-retrieve-headers
  nnimap-open-connection
  nnimap-open-server
--- 1137,1148 ----
          '(
  nnimap-possibly-change-server
  nnimap-verify-uidvalidity
+ nnimap-find-minmax-uid
  nnimap-possibly-change-group
! ;nnimap-replace-whitespace
! nnimap-retrieve-headers-progress
! nnimap-retrieve-headers-store-uids
! nnimap-retrieve-headers-get-uids
  nnimap-retrieve-headers
  nnimap-open-connection
  nnimap-open-server
***************
*** 1145,1151 ****
  nnimap-close-server
  nnimap-request-close
  nnimap-status-message
! nnimap-demule
  nnimap-request-article-part
  nnimap-request-article
  nnimap-request-head
--- 1150,1156 ----
  nnimap-close-server
  nnimap-request-close
  nnimap-status-message
! ;nnimap-demule
  nnimap-request-article-part
  nnimap-request-article
  nnimap-request-head
***************
*** 1156,1161 ****
--- 1161,1167 ----
  nnimap-pattern-to-list-arguments
  nnimap-request-list
  nnimap-request-post
+ nnimap-retrieve-groups
  nnimap-request-type
  nnimap-request-set-mark
  nnimap-split-to-groups
***************
*** 1166,1172 ****
  nnimap-request-create-group
  nnimap-time-substract
  nnimap-date-days-ago
! ;nnimap-request-expire-articles-progress
  nnimap-request-expire-articles
  nnimap-request-move-article
  nnimap-request-accept-article
--- 1172,1178 ----
  nnimap-request-create-group
  nnimap-time-substract
  nnimap-date-days-ago
! nnimap-request-expire-articles-progress
  nnimap-request-expire-articles
  nnimap-request-move-article
  nnimap-request-accept-article
***************
*** 1176,1188 ****
  gnus-group-nnimap-edit-acl
  gnus-group-nnimap-edit-acl-done
  nnimap-group-mode-hook
- nnimap-request-list-mapper
- nnimap-retrieve-groups
  nnimap-request-update-info-internal
! ;nnimap-mark-to-predicate
! ;nnimap-mark-to-flag-1
! ;nnimap-mark-to-flag
! ;nnimap-mark-permanent-p
  nnimap-update-alist-soft
  nnimap-range-to-string
  nnimap-send-command-wait
--- 1182,1192 ----
  gnus-group-nnimap-edit-acl
  gnus-group-nnimap-edit-acl-done
  nnimap-group-mode-hook
  nnimap-request-update-info-internal
! nnimap-mark-to-predicate
! nnimap-mark-to-flag-1
! nnimap-mark-to-flag
! nnimap-mark-permanent-p
  nnimap-update-alist-soft
  nnimap-range-to-string
  nnimap-send-command-wait