]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Thread iteration no longer returns dummy nodes without children.
authorTimo Sirainen <tss@iki.fi>
Sat, 28 Jan 2012 18:21:10 +0000 (20:21 +0200)
committerTimo Sirainen <tss@iki.fi>
Sat, 28 Jan 2012 18:21:10 +0000 (20:21 +0200)
This fixes returning (0) nodes to IMAP client.

src/lib-storage/index/index-thread-finish.c

index 84e5b17d5a37e7862ceeec9680e8e8c184134bca..a5ddfb2fa56b761e9b7dd054e428bf052ee98ddf 100644 (file)
@@ -655,6 +655,11 @@ mail_thread_iterate_next(struct mail_thread_iterate_context *iter,
                *child_iter_r = shadow->first_child_idx == 0 ? NULL :
                        mail_thread_iterate_children(iter, child->idx);
        }
+       if (child->uid == 0 && *child_iter_r == NULL) {
+               /* this is a dummy node without children,
+                  there's no point in returning it */
+               return mail_thread_iterate_next(iter, child_iter_r);
+       }
        return child;
 }