From 8e4e7e0ca47c60177f6b43e99f9a422818ce6d2e Mon Sep 17 00:00:00 2001 From: "Taylor R. Campbell" Date: Fri, 16 Dec 2005 02:04:59 +0000 Subject: [PATCH] Expunge FOLDER-SUPPORTS-MIME? and restructure INSERT-MESSAGE in imail-top.scm slightly to fix bug introduced with new MIME parser, where non-MIME messages in folders that claim to support MIME would cause errors by trying to walk a MIME body structure that is #F. Folders that support MIME specially now need only to implement different MIME-MESSAGE-BODY-STRUCTURE & WRITE-MIME-MESSAGE-BODY-PART methods, since there is default MIME support for all folders now. --- v7/src/imail/imail-core.scm | 7 +------ v7/src/imail/imail-file.scm | 6 +----- v7/src/imail/imail-imap.scm | 6 +----- v7/src/imail/imail-mime.scm | 6 +----- v7/src/imail/imail-top.scm | 13 ++++++++----- 5 files changed, 12 insertions(+), 26 deletions(-) diff --git a/v7/src/imail/imail-core.scm b/v7/src/imail/imail-core.scm index bec3e345b..96700cd80 100644 --- a/v7/src/imail/imail-core.scm +++ b/v7/src/imail/imail-core.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: imail-core.scm,v 1.152 2005/12/10 06:45:32 riastradh Exp $ +$Id: imail-core.scm,v 1.153 2005/12/16 02:04:59 riastradh Exp $ Copyright 1999,2000,2001,2003,2005 Massachusetts Institute of Technology @@ -574,11 +574,6 @@ USA. (define-generic disconnect-folder (folder)) -;; ------------------------------------------------------------------- -;; Return #T if FOLDER supports MIME parsing. - -(define-generic folder-supports-mime? (folder)) - ;; ------------------------------------------------------------------- ;; Preload outline information about each message in the folder. ;; Normally used prior to generating a folder summary, to accelerate diff --git a/v7/src/imail/imail-file.scm b/v7/src/imail/imail-file.scm index 5a117c874..bb5e3f3bb 100644 --- a/v7/src/imail/imail-file.scm +++ b/v7/src/imail/imail-file.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: imail-file.scm,v 1.86 2005/12/10 06:45:32 riastradh Exp $ +$Id: imail-file.scm,v 1.87 2005/12/16 02:04:59 riastradh Exp $ Copyright 1999,2000,2001,2002,2003,2005 Massachusetts Institute of Technology @@ -461,10 +461,6 @@ USA. folder unspecific) -; (define-method folder-supports-mime? ((folder )) -; folder -; #f) - (define-method preload-folder-outlines ((folder )) folder unspecific) diff --git a/v7/src/imail/imail-imap.scm b/v7/src/imail/imail-imap.scm index 0eabac689..82beb7747 100644 --- a/v7/src/imail/imail-imap.scm +++ b/v7/src/imail/imail-imap.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: imail-imap.scm,v 1.205 2005/10/26 21:44:43 cph Exp $ +$Id: imail-imap.scm,v 1.206 2005/12/16 02:04:59 riastradh Exp $ Copyright 1999,2000,2001,2003,2004,2005 Massachusetts Institute of Technology @@ -1920,10 +1920,6 @@ USA. (define-method disconnect-folder ((folder )) (close-resource folder #t)) - -(define-method folder-supports-mime? ((folder )) - folder - #t) ;;;; Container operations diff --git a/v7/src/imail/imail-mime.scm b/v7/src/imail/imail-mime.scm index 098b21dc0..e9515fdbd 100644 --- a/v7/src/imail/imail-mime.scm +++ b/v7/src/imail/imail-mime.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: imail-mime.scm,v 1.2 2005/12/13 01:41:39 cph Exp $ +$Id: imail-mime.scm,v 1.3 2005/12/16 02:04:59 riastradh Exp $ Copyright 2005 Taylor Campbell @@ -27,10 +27,6 @@ USA. (declare (usual-integrations)) -(define-method folder-supports-mime? ((folder )) - folder - #t) - (define-method mime-message-body-structure ((message )) (or (get-property message 'MIME-MESSAGE-BODY-STRUCTURE #f) (cond ((mime:get-version-header message) diff --git a/v7/src/imail/imail-top.scm b/v7/src/imail/imail-top.scm index 351d0a2af..dcfaf22df 100644 --- a/v7/src/imail/imail-top.scm +++ b/v7/src/imail/imail-top.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: imail-top.scm,v 1.293 2005/12/10 06:45:32 riastradh Exp $ +$Id: imail-top.scm,v 1.294 2005/12/16 02:04:59 riastradh Exp $ Copyright 1999,2000,2001,2002,2003,2004 Massachusetts Institute of Technology Copyright 2005 Massachusetts Institute of Technology @@ -2307,8 +2307,10 @@ Negative argument means search in reverse." (insert-header-fields message (and raw? (not (eq? raw? 'BODY-ONLY))) mark) (cond ((and raw? (not (eq? raw? 'HEADERS-ONLY))) (insert-message-body message mark)) - ((folder-supports-mime? (message-folder message)) - (insert-mime-message-body message mark inline-only? left-margin)) + ((mime-message-body-structure message) + => (lambda (body-structure) + (insert-mime-message-body message body-structure + mark inline-only? left-margin))) (else (call-with-auto-wrapped-output-mark mark left-margin message (lambda (port) @@ -2380,10 +2382,11 @@ Negative argument means search in reverse." ;;;; MIME message formatting -(define (insert-mime-message-body message mark inline-only? left-margin) +(define (insert-mime-message-body message body-structure + mark inline-only? left-margin) (walk-mime-message-part message - (mime-message-body-structure message) + body-structure '() (make-walk-mime-context inline-only? left-margin #f '()) mark)) -- 2.25.1