]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Fixed searching in virtual mailboxes.
authorTimo Sirainen <tss@iki.fi>
Sat, 29 Nov 2008 21:15:24 +0000 (23:15 +0200)
committerTimo Sirainen <tss@iki.fi>
Sat, 29 Nov 2008 21:15:24 +0000 (23:15 +0200)
--HG--
branch : HEAD

src/lib-storage/index/index-search.c

index c2fa1b5e7c1799863e3fa2c3eab150b9449da70a..de1c360e70516528d2e7b9f2b215c045cf9f6eed 100644 (file)
@@ -1163,6 +1163,7 @@ int index_storage_search_next_nonblock(struct mail_search_context *_ctx,
 {
         struct index_search_context *ctx = (struct index_search_context *)_ctx;
        struct mailbox *box = _ctx->transaction->box;
+       struct mail_private *mail_private = (struct mail_private *)mail;
        unsigned int count = 0;
        bool match = FALSE;
 
@@ -1177,7 +1178,6 @@ int index_storage_search_next_nonblock(struct mail_search_context *_ctx,
        }
 
        ctx->mail = mail;
-       ctx->imail = ((struct mail_private *)mail)->v.get_index_mail(mail);
 
        if (ioloop_time - ctx->last_notify.tv_sec >=
            SEARCH_NOTIFY_INTERVAL_SECS)
@@ -1185,6 +1185,7 @@ int index_storage_search_next_nonblock(struct mail_search_context *_ctx,
 
        while (box->v.search_next_update_seq(_ctx)) {
                mail_set_seq(mail, _ctx->seq);
+               ctx->imail = mail_private->v.get_index_mail(mail);
 
                T_BEGIN {
                        match = search_match_next(ctx);