Mercurial > dovecot > original-hg > dovecot-1.2
changeset 7064:046d06f52aa6 HEAD
mail_index_lookup_seq*() were broken for updated transaction view when
trying to find messages past the first newly appended message.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sat, 29 Dec 2007 18:45:11 +0200 |
parents | f9fa0f38cb0e |
children | 04e048fcd6d7 |
files | src/lib-index/mail-index-transaction-view.c |
diffstat | 1 files changed, 13 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-index/mail-index-transaction-view.c Sat Dec 29 18:01:19 2007 +0200 +++ b/src/lib-index/mail-index-transaction-view.c Sat Dec 29 18:45:11 2007 +0200 @@ -124,8 +124,19 @@ } /* at least some of the wanted messages are newly created */ - if (*first_seq_r == 0) - *first_seq_r = tview->t->first_new_seq; + if (*first_seq_r == 0) { + seq = tview->t->first_new_seq; + for (; seq <= tview->t->last_new_seq; seq++) { + if (first_uid <= rec->uid) + break; + rec = mail_index_transaction_lookup(tview->t, seq); + } + if (seq > tview->t->last_new_seq) { + /* no messages in range */ + return; + } + *first_seq_r = seq; + } seq = tview->t->last_new_seq; for (; seq >= tview->t->first_new_seq; seq--) {