#| -*-Scheme-*-
-$Id: imail-core.scm,v 1.172 2008/08/11 22:27:26 riastradh Exp $
+$Id: imail-core.scm,v 1.173 2008/08/29 20:14:50 riastradh Exp $
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
((EXPUNGE)
(let ((tree (folder-order-tree order)))
(if tree
- (let ((index (car arguments))
- (key (cadr arguments)))
+ (let ((message (car arguments))
+ (%index (cadr arguments))
+ (index (caddr arguments))
+ (key (cadddr arguments)))
+ message index ;ignore
(let ((cache (folder-order-cache order)))
- (if cache (hash-table/remove! cache index)))
+ (if cache (hash-table/remove! cache %index)))
(wt-tree/delete! tree key)))))))))))
\f
;;;; Message flags
#| -*-Scheme-*-
-$Id: imail-file.scm,v 1.95 2008/07/03 20:08:09 cph Exp $
+$Id: imail-file.scm,v 1.96 2008/08/29 20:14:50 riastradh Exp $
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
(let ((m (vector-ref messages i)))
(if (message-deleted? m)
(begin
- (let ((key (message-order-key m)))
- (detach-message! m)
- (object-modified! folder 'EXPUNGE i* key))
+ (let ((index (message-index m))
+ (key (message-order-key m)))
+ (detach-message! m)
+ (object-modified! folder 'EXPUNGE
+ m i* index key))
(loop (fix:+ i 1) i*))
(begin
(set-message-index! m i*)
#| -*-Scheme-*-
-$Id: imail-imap.scm,v 1.227 2008/08/27 14:22:09 riastradh Exp $
+$Id: imail-imap.scm,v 1.228 2008/08/29 20:14:50 riastradh Exp $
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
start #f '(UID FLAGS))))))
\f
(define (remove-imap-folder-message folder index)
- (let* ((message (%get-message folder index))
- (key (message-order-key message)))
- (delete-cached-message message)
- (without-interrupts
- (lambda ()
- (let ((v (imap-folder-messages folder))
- (n (fix:- (folder-length folder) 1)))
- (detach-message! (vector-ref v index))
- (do ((i index (fix:+ i 1)))
- ((fix:= i n))
- (let ((m (vector-ref v (fix:+ i 1))))
- (set-message-index! m i)
- (vector-set! v i m)))
- (vector-set! v n #f)
- (set-imap-folder-length! folder n)
- (set-imap-folder-unseen! folder #f)
- (let ((new-length (compute-messages-length v n)))
- (if new-length
- (set-imap-folder-messages! folder
- (vector-head v new-length))))
- (object-modified! folder 'EXPUNGE index key))))))
+ (let ((message (%get-message folder index)))
+ (let ((unmapped-index (message-index message))
+ (key (message-order-key message)))
+ (delete-cached-message message)
+ (without-interrupts
+ (lambda ()
+ (let ((v (imap-folder-messages folder))
+ (n (fix:- (folder-length folder) 1)))
+ (detach-message! (vector-ref v index))
+ (do ((i index (fix:+ i 1)))
+ ((fix:= i n))
+ (let ((m (vector-ref v (fix:+ i 1))))
+ (set-message-index! m i)
+ (vector-set! v i m)))
+ (vector-set! v n #f)
+ (set-imap-folder-length! folder n)
+ (set-imap-folder-unseen! folder #f)
+ (let ((new-length (compute-messages-length v n)))
+ (if new-length
+ (set-imap-folder-messages! folder
+ (vector-head v new-length))))
+ (object-modified! folder 'EXPUNGE
+ message index unmapped-index key)))))))
(define (initial-messages)
(make-vector 64 #f))