From 4216d041cdb42ae9844f1ec8e9711c966c7d8e20 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Fri, 30 Jun 2000 18:31:40 +0000 Subject: [PATCH] Change definition of CACHE? argument to WRITE-MIME-MESSAGE-BODY-PART. Now it may take the following values: #F don't cache #T cache conditionally cache; length of part is --- v7/src/imail/imail-imap.scm | 34 ++++++++++++++++++++-------------- v7/src/imail/imail-top.scm | 9 +++++---- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/v7/src/imail/imail-imap.scm b/v7/src/imail/imail-imap.scm index d9921fa1f..e4127765e 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.134 2000/06/30 17:24:07 cph Exp $ +;;; $Id: imail-imap.scm,v 1.135 2000/06/30 18:31:40 cph Exp $ ;;; ;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology ;;; @@ -911,7 +911,8 @@ (imap-message-bodystructure message)) (define-method write-message-body ((message ) port) - (write-mime-message-body-part message '(TEXT) #t port)) + (write-mime-message-body-part + message '(TEXT) (imap-message-length message) port)) (define-method write-mime-message-body-part ((message ) selector cache? port) @@ -925,18 +926,23 @@ (list-search-positive (imap-message-body-parts message) (lambda (entry) (equal? (car entry) section))))) - (if entry - (write-string (cdr entry) port) - (let ((part (%imap-message-body-part message section))) - (if (let ((limit (and cache? (imail-ui:body-cache-limit message)))) - (if (exact-nonnegative-integer? limit) - (< (string-length part) limit) - limit)) - (set-imap-message-body-parts! - message - (cons (cons section part) - (imap-message-body-parts message)))) - (write-string part port)))))) + (cond (entry + (write-string (cdr entry) port)) + ((and cache? + (let ((limit (imail-ui:body-cache-limit message))) + (and limit + (if (and (exact-nonnegative-integer? cache?) + (exact-nonnegative-integer? limit)) + (< cache? limit) + #t)))) + (let ((part (%imap-message-body-part message section))) + (set-imap-message-body-parts! + message + (cons (cons section part) + (imap-message-body-parts message))) + (write-string part port))) + (else + (write-string (%imap-message-body-part message section) port)))))) (define (%imap-message-body-part message section) (imap:response:fetch-body-part diff --git a/v7/src/imail/imail-top.scm b/v7/src/imail/imail-top.scm index 09bc99030..0a9fa271e 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.202 2000/06/29 22:01:51 cph Exp $ +;;; $Id: imail-top.scm,v 1.203 2000/06/30 18:31:31 cph Exp $ ;;; ;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology ;;; @@ -2187,13 +2187,14 @@ Negative argument means search in reverse." (mark-temporary! start))) (define (insert-mime-info-expanded info message mark) - (let ((context (mime-info-context info))) + (let ((body (mime-info-body info)) + (context (mime-info-context info))) (call-with-auto-wrapped-output-mark mark (insert-mime-context-left-margin context) (lambda (port) (call-with-mime-decoding-output-port - (mime-part-encoding context (mime-info-body info)) + (mime-part-encoding context body) port #t (lambda (port) @@ -2205,7 +2206,7 @@ Negative argument means search in reverse." (eq? (mime-body-subtype enclosure) 'RFC822)))) `(,@(mime-info-selector info) TEXT) (mime-info-selector info)) - #t + (mime-body-one-part-n-octets body) port))))))) (define (insert-mime-info-collapsed info message mark) -- 2.25.1