Save server capabilities for later reference.
authorChris Hanson <org/chris-hanson/cph>
Mon, 5 Jun 2000 17:25:38 +0000 (17:25 +0000)
committerChris Hanson <org/chris-hanson/cph>
Mon, 5 Jun 2000 17:25:38 +0000 (17:25 +0000)
v7/src/imail/imail-imap.scm

index b65d7d88c69b3abc087191811c5a09800f2c0961..18abfe088042ab0ebabb61d8894c3c4038b96cb0 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: imail-imap.scm,v 1.104 2000/06/05 17:20:47 cph Exp $
+;;; $Id: imail-imap.scm,v 1.105 2000/06/05 17:25:38 cph Exp $
 ;;;
 ;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology
 ;;;
   (url             define accessor)
   (port            define standard initial-value #f)
   (greeting        define standard initial-value #f)
+  (capabilities    define standard initial-value '())
   (sequence-number define standard initial-value 0)
   (response-queue  define accessor initializer (lambda () (cons '() '())))
   (folder          define standard initial-value #f)
 (define (reset-imap-connection connection)
   (without-interrupts
    (lambda ()
+     (set-imap-connection-greeting! connection #f)
+     (set-imap-connection-capabilities! connection '())
      (set-imap-connection-sequence-number! connection 0)
      (let ((queue (imap-connection-response-queue connection)))
        (set-car! queue '())
                                (imap:response:response-text-string response)
                                response)))
                         (reset-imap-connection connection)
-                        (if (not (memq 'IMAP4REV1
-                                       (imap:command:capability connection)))
+                        (imap:command:capability connection)
+                        (if (not
+                             (memq 'IMAP4REV1
+                                   (imap-connection-capabilities connection)))
                             (error "Server doesn't support IMAP4rev1:" url))
                         (let ((response
                                (imail-call-with-pass-phrase url
 ;;;; IMAP command invocation
 
 (define (imap:command:capability connection)
-  (imap:response:capabilities
-   (imap:command:single-response imap:response:capability? connection
-                                'CAPABILITY)))
+  (imap:command:no-response connection 'CAPABILITY))
 
 (define (imap:command:login connection user-id pass-phrase)
   ((imail-message-wrapper "Logging in as " user-id)
        ((imap:response:recent? response)
         #f)
        ((imap:response:capability? response)
-        (eq? command 'CAPABILITY))
+        (set-imap-connection-capabilities!
+         connection
+         (imap:response:capabilities response))
+        #f)
        ((imap:response:list? response)
         (eq? command 'LIST))
        ((imap:response:lsub? response)