]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Transaction view: If index is reset, don't return old to-be-removed sequences.
authorTimo Sirainen <tss@iki.fi>
Mon, 22 Sep 2008 20:49:33 +0000 (23:49 +0300)
committerTimo Sirainen <tss@iki.fi>
Mon, 22 Sep 2008 20:49:33 +0000 (23:49 +0300)
--HG--
branch : HEAD

src/lib-index/mail-index-transaction-view.c

index 05a62a18a399d348fa06f6bb12e971b727549205..3f1acc53adc71792294dc976204b4ed28304905d 100644 (file)
@@ -109,8 +109,14 @@ static void tview_lookup_seq_range(struct mail_index_view *view,
        const struct mail_index_record *rec;
        uint32_t seq;
 
-       tview->super->lookup_seq_range(view, first_uid, last_uid,
-                                      first_seq_r, last_seq_r);
+       if (!tview->t->reset) {
+               tview->super->lookup_seq_range(view, first_uid, last_uid,
+                                              first_seq_r, last_seq_r);
+       } else {
+               /* index is being reset. we never want to return old
+                  sequences. */
+               *first_seq_r = *last_seq_r = 0;
+       }
        if (tview->t->last_new_seq == 0) {
                /* no new messages, the results are final. */
                return;