Fix bug in updating folder orders after a message is expunged.
authorTaylor R. Campbell <net/mumble/campbell>
Thu, 11 Sep 2008 17:49:09 +0000 (17:49 +0000)
committerTaylor R. Campbell <net/mumble/campbell>
Thu, 11 Sep 2008 17:49:09 +0000 (17:49 +0000)
v7/src/imail/imail-core.scm

index 280a243092c4c810334021429983be0042472241..62eb061884ccd6db2d888a97361aa1331996a7ba 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: imail-core.scm,v 1.175 2008/09/08 03:55:17 riastradh Exp $
+$Id: imail-core.scm,v 1.176 2008/09/11 17:49:09 riastradh Exp $
 
 Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
     1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
@@ -818,16 +818,11 @@ USA.
                           (%message-order-key message order index)
                           message)))))))
             ((EXPUNGE)
-             (let ((tree (folder-order-tree order)))
-               (if tree
-                   (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)))
-                     (wt-tree/delete! tree key)))))))))))
+             ;; Expunging a message may change the indices of
+             ;; existing messages, which invalidates our data
+             ;; structures, which were designed with UIDs, not
+             ;; sequence numbers, in mind.
+             (reset-folder-order! order))))))))
 \f
 ;;;; Message flags