(nnimap-open-connection-1): Is the login responds with a new CAPABILITY, use it.
authorMichael Welsh Duggan <md5i@md5i.com>
Tue, 29 Mar 2011 18:17:27 +0000 (20:17 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Tue, 29 Mar 2011 18:17:27 +0000 (20:17 +0200)
lisp/ChangeLog
lisp/nnimap.el

index dfd7a34..ad92e28 100644 (file)
@@ -1,3 +1,8 @@
+2011-03-29  Michael Welsh Duggan  <md5i@md5i.com>
+
+       * nnimap.el (nnimap-open-connection-1): Is the login responds with a
+       new CAPABILITY, use it.
+
 2011-03-29  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
        * gnus-agent.el (gnus-agent-fetch-headers): Don't message if we're not
index 15d7f46..d18d78b 100644 (file)
@@ -408,11 +408,18 @@ textual parts.")
                  (setq login-result
                        (nnimap-login (car credentials) (cadr credentials))))
                (if (car login-result)
-                    ;; save the credentials if a save function exists
+                   (progn
+                    ;; Save the credentials if a save function exists
                     ;; (such a function will only be passed if a new
-                    ;; token was created)
-                    (when (functionp (nth 2 credentials))
-                      (funcall (nth 2 credentials)))
+                    ;; token was created).
+                     (when (functionp (nth 2 credentials))
+                       (funcall (nth 2 credentials)))
+                     ;; See if CAPABILITY is set as part of login
+                     ;; response.
+                     (dolist (response (cddr login-result))
+                       (when (string= "CAPABILITY" (upcase (car response)))
+                         (setf (nnimap-capabilities nnimap-object)
+                               (mapcar #'upcase (cdr response))))))
                  ;; If the login failed, then forget the credentials
                  ;; that are now possibly cached.
                  (dolist (host (list (nnoo-current-server 'nnimap)