From be7da7e87f5cd3734df2974b8fdeba8faec55bf1 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Tue, 23 May 2000 04:35:48 +0000 Subject: [PATCH] Send STATUS folder event when IMAP folder opened. Guarantee that connection's folder is reset if the user aborts the SELECT. --- v7/src/imail/imail-imap.scm | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/v7/src/imail/imail-imap.scm b/v7/src/imail/imail-imap.scm index 20d5a97e1..7c00eb7e9 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.81 2000/05/23 04:23:05 cph Exp $ +;;; $Id: imail-imap.scm,v 1.82 2000/05/23 04:35:48 cph Exp $ ;;; ;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology ;;; @@ -444,6 +444,28 @@ (set-imap-folder-n-messages! folder 0) (set-imap-folder-messages! folder (initial-messages))))) +(define (guarantee-imap-folder-open folder) + (let ((connection (imap-folder-connection folder))) + (if (or (guarantee-imap-connection-open connection) + (not (eq? folder (imap-connection-folder connection)))) + (begin + (set-imap-folder-messages-synchronized?! folder #f) + (set-imap-connection-folder! connection folder) + (let ((selected? #f)) + (dynamic-wind + (lambda () unspecific) + (lambda () + (set! selected? + (imap:command:select + connection + (imap-url-mailbox (folder-url folder)))) + unspecific) + (lambda () + (if (not selected?) + (set-imap-connection-folder! connection #f))))) + (folder-modified! folder 'STATUS) + #t)))) + (define (new-imap-folder-uidvalidity! folder uidvalidity) (without-interrupts (lambda () @@ -812,19 +834,6 @@ (guarantee-imap-folder-open folder) folder)) -(define (guarantee-imap-folder-open folder) - (let ((connection (imap-folder-connection folder))) - (if (or (guarantee-imap-connection-open connection) - (not (eq? folder (imap-connection-folder connection)))) - (begin - (set-imap-folder-messages-synchronized?! folder #f) - (set-imap-connection-folder! connection folder) - (if (not - (imap:command:select connection - (imap-url-mailbox (folder-url folder)))) - (set-imap-connection-folder! connection #f)) - #t)))) - (define-method %close-folder ((folder )) (let ((connection (imap-folder-connection folder))) (maybe-close-imap-connection connection) -- 2.25.1