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

nnimap 0.34 -> 0.35 patches



Index: nnimap/ChangeLog
diff -u nnimap/ChangeLog:1.103 nnimap/ChangeLog:1.105
--- nnimap/ChangeLog:1.103	Thu Oct 15 12:27:04 1998
+++ nnimap/ChangeLog	Thu Oct 15 18:17:26 1998
@@ -1,3 +1,41 @@
+1998-10-16 03:15:18  Simon Josefsson  <jas@pdc.kth.se>
+
+	* nnimap 0.35 released.
+
+1998-10-16 03:09:02  Simon Josefsson  <jas@pdc.kth.se>
+
+	* imap.el (imap-parse-line): Can't handle " and \ in status
+	response text.
+
+1998-10-16 01:45:03  Simon Josefsson  <jas@pdc.kth.se>
+
+	* nnimap.el (nnimap-list-pattern): Doc fix.
+
+1998-10-16 01:41:51  Simon Josefsson  <jas@pdc.kth.se>
+
+	* imap.el (imap-folder-reset): Typo.
+
+1998-10-16 01:41:05  Simon Josefsson  <jas@pdc.kth.se>
+
+	* imap.el (imap-data-namespace): New variable.
+	(imap-cb-function-alist): New callback.
+	(imap-locals): New local variable.
+	(imap-namespace-get): New function.
+	(imap-cb-namespace): New function.
+
+1998-10-16 01:02:40  Simon Josefsson  <jas@pdc.kth.se>
+
+	* nnimap.el (nnimap-date-days-ago): Remove padding.
+
+1998-10-16 00:34:00  Simon Josefsson  <jas@pdc.kth.se>
+
+	* imap.el (imap-folder-reset): New function.
+
+1998-10-15 22:13:30  Simon Josefsson  <jas@pdc.kth.se>
+
+	* nnimap.el (nnimap-request-update-info-internal): Make sure it's
+	an integer.
+
 1998-10-15 21:24:39  Simon Josefsson  <jas@pdc.kth.se>
 
 	* nnimap 0.34 released.
Index: nnimap/imap.el
diff -u nnimap/imap.el:1.45 nnimap/imap.el:1.48
--- nnimap/imap.el:1.45	Thu Oct 15 07:36:14 1998
+++ nnimap/imap.el	Thu Oct 15 18:11:18 1998
@@ -33,6 +33,7 @@
 ;;; RFC???? (UNSELECT ext): done
 ;;; RFC2195 (CRAM-MD5 auth): done
 ;;; RFC2086 (ACL ext): done
+;;; RFC2342 (NAMESPACE ext): done
 ;;; RFC2359 (UIDPLUS ext): done
 
 ;;; Todo:
@@ -118,6 +119,9 @@
 (defvar imap-data-capability nil
   "Current server's capability list")
 
+(defvar imap-data-namespace nil
+  "Current server's namespace.")
+
 (defvar imap-data-folder nil
   "Obarray which contains group information.")
 
@@ -167,6 +171,7 @@
 				 (SEARCH . imap-cb-search)
 				 (STATUS . imap-cb-status)
 				 (ACL . imap-cb-acl)
+				 (NAMESPACE . imap-cb-namespace)
 				 (default . imap-cb-default))
   "Alist of IMAP code to function callbacks.")
 
@@ -179,6 +184,7 @@
                       imap-current-message
                       imap-current-server
                       imap-data-capability
+		      imap-data-namespace
                       imap-data-folder
 		      imap-open-stream
 		      imap-auth-method
@@ -223,10 +229,12 @@
 ;	  imap-ok-p
 	  imap-wait-for-tag
 	  imap-capability-get
+	  imap-namespace-get
 	  imap-authinfo-get
           imap-folder-set
           imap-folder-get
           imap-folder-plist
+	  imap-folder-reset
           imap-dispatch
 	  imap-authenticate
 	  imap-authenticate-login
@@ -241,6 +249,7 @@
           imap-cb-bye
           imap-cb-numbered
           imap-cb-capability
+	  imap-cb-namespace
           imap-cb-list
           imap-cb-flags
           imap-cb-fetch
@@ -567,6 +576,14 @@
 	(setq imap-data-capability '(IMAP2))))
     imap-data-capability))
 
+(defun imap-namespace-get (&optional buffer)
+  "Return server's namespace."
+  (with-current-buffer (or buffer (current-buffer))
+    (unless imap-data-namespace
+      (when (memq 'NAMESPACE (imap-capability-get))
+	(imap-send-command-wait "NAMESPACE")))
+    imap-data-namespace))
+
 (defun imap-folder-plist (&optional folder buffer)
   "Set PROP to VALUE for FOLDER in BUFFER."
   (with-current-buffer (or buffer (current-buffer))
@@ -595,6 +612,10 @@
        (funcall func (symbol-name s)))
      imap-data-folder)))
 
+(defun imap-folder-reset (&optional buffer)
+  (with-current-buffer (or buffer (current-buffer)) 
+    (setq imap-data-folder (make-vector imap-convenient-group-prime 0))))
+
 ;;; Internal functions
 
 (defun imap-read-passwd (prompt &rest args)
@@ -807,7 +828,8 @@
   ;; the entirety of the block (you should know the end of it...).
 
   ;; The only place we could have a problem is in the arbitrary TEXT
-  ;; following a status response.  So we quote that first.
+  ;; following a status response.  So we quote that first, and be
+  ;; sure to remove all " and \'s that we can't handle.
 
   (let ((leave-brackets 0))
     (goto-char (point-min))
@@ -822,7 +844,7 @@
         (narrow-to-region (point) (- (point-max) 2))
         (insert "\"")
         (while (re-search-forward "\\\\\\|\"" nil 00)
-          (replace-match "\\\\\\&"))
+          (replace-match "")) ; xxx
         (insert "\""))
       (goto-char (point-min)))
     (goto-char (- (point-max) 2))
@@ -955,6 +977,9 @@
 
 (defun imap-cb-acl (code group &rest acls)
   (imap-folder-set 'acl acls (symbol-name group)))
+
+(defun imap-cb-namespace (code &rest namespace)
+  (setq imap-data-namespace namespace))
 
 (defun imap-cb-status (code folder statuses)
 ;  (check-valid-plist statuses)
Index: nnimap/nnimap.el
diff -u nnimap/nnimap.el:1.80 nnimap/nnimap.el:1.82
--- nnimap/nnimap.el:1.80	Thu Oct 15 12:26:54 1998
+++ nnimap/nnimap.el	Thu Oct 15 16:47:39 1998
@@ -95,7 +95,7 @@
 
 (nnoo-declare nnimap) ; we derive from no one
 
-(defconst nnimap-version "nnimap 0.34")
+(defconst nnimap-version "nnimap 0.35")
 
 ;; Various server variables.
 
@@ -122,15 +122,15 @@
 Example:
  '(\"INBOX\" \"Mail/*\" \"alt.sex.*\" (\"~friend/Mail/\" . \"list/*\"))
 
-Also note that currently groups that start with a '.' cause Gnus
-to choke (a patch is pending acceptance), so instead of something
-like \"*\" which might match \".mailboxlist\" you could use
-\"~/*\" which would match \"~/.mailboxlist\" and not cause problems.
+Also note that currently groups that start with a '.' cause Gnus to
+choke, so instead of using something like \"*\" which might match
+\".mailboxlist\" you could use \"~/*\" which would match
+\"~/.mailboxlist\" and not cause problems.
 
 The two wildcards are * and %.  * means match anything, much like in
 shell globbing in Unix.  * does match hierarchy delimiters (. or /, in
 the usual case.)  % is the same as *, but does not match the hierarchy
-symbol.")
+delimiter.")
 
 (defvoo nnimap-list-method "LIST" ; "LSUB"
   "*Function called on IMAP server to list groups.  One of \"LSUB\" or
@@ -695,9 +695,9 @@
 
 ;;; Interface functions, optional backend functions
 
-;;; This gets called instead of `nnimap-request-list' when
-;;; `gnus-read-active-file' is 'some instead of t.
-;;; Returns: GROUP HIGHEST LOWEST [ynmxj=] ???
+;; 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))
@@ -749,7 +749,7 @@
 	   ;; 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))
+           (if (and (integerp (car read))
 		    (null (cdr read)))
                (list (cons (car read) (car read)))
              read))))
@@ -769,7 +769,7 @@
 	      gnus-article-mark-lists)))
   info)
 
-;;; Respond to articles with mail
+;; Respond to articles with mail
 (deffoo nnimap-request-type (group article)
   'mail)
 
@@ -926,19 +926,22 @@
 	(list (- ms 1) (+ (expt 2 16) ls))
       (list ms ls))))
 
-;; xxx: day should not be zero-padded or blank-padded.
 (defun nnimap-date-days-ago (daysago)
-  "Return date, in format \"03-Aug-98\", for DAYSAGO days ago."
-  (format-time-string "%d-%b-%y" (nnimap-time-substract
-				  (current-time)
-				  (if (fboundp 'days-to-time)
-				      (days-to-time daysago)
-				    (nnmail-days-to-time daysago)))))
+  "Return date, in format \"3-Aug-98\", for DAYSAGO days ago."
+  (let ((date (format-time-string "%d-%b-%y" 
+				  (nnimap-time-substract
+				   (current-time)
+				   (if (fboundp 'days-to-time)
+				       (days-to-time daysago)
+				     (nnmail-days-to-time daysago))))))
+    (if (eq ?0 (string-to-char date))
+	(substring date 1)
+      date)))
 
 (defun nnimap-request-expire-articles-progress (num fetch data)
   (gnus-message 5 "Expiring; marking article %d for deletion..." num))
 
-;;; Notice that we don't actually delete anything, we just mark them deleted.
+;; Notice that we don't actually delete anything, we just mark them deleted.
 (deffoo nnimap-request-expire-articles (articles group &optional server force)
   (let (oldarts (artseq (gnus-compress-sequence articles)))
     (when (and artseq (nnimap-possibly-change-group group server))