Generalize MESSAGE-MIME-BODY-PART to allow passing selector ending in
authorChris Hanson <org/chris-hanson/cph>
Thu, 1 Jun 2000 20:08:26 +0000 (20:08 +0000)
committerChris Hanson <org/chris-hanson/cph>
Thu, 1 Jun 2000 20:08:26 +0000 (20:08 +0000)
HEADER or TEXT.

v7/src/imail/imail-imap.scm

index bed90d16a671ba78921df388cce94631cf4c7d07..3e3c69ade43cf96d1d4ff22b87a40b406887e97b 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: imail-imap.scm,v 1.98 2000/06/01 19:29:35 cph Exp $
+;;; $Id: imail-imap.scm,v 1.99 2000/06/01 20:08:26 cph Exp $
 ;;;
 ;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology
 ;;;
   (parse-mime-body (imap-message-bodystructure message)))
 
 (define-method message-mime-body-part ((message <imap-message>) selector)
-  (let ((section (map (lambda (n) (+ n 1)) selector)))
+  (let ((section
+        (map (lambda (x)
+               (if (exact-nonnegative-integer? x)
+                   (+ x 1)
+                   x))
+             selector)))
     (imap:response:fetch-body-part
      (imap:command:uid-fetch
       (imap-folder-connection (message-folder message))
       (imap-message-uid message)
       `(',(string-append "body["
                         (decorated-string-append
-                         "" "." "" (map number->string section))
+                         "" "." ""
+                         (map (lambda (x)
+                                (if (exact-nonnegative-integer? x)
+                                    (number->string x)
+                                    (symbol->string x)))
+                              section))
                         "]")))
      section
      #f)))