# HG changeset patch # User Timo Sirainen # Date 1238700483 14400 # Node ID bf16646ec312e5656e47d6385b30ef8d160acc9f # Parent 66a8cbe7f007f4a80c28d7fba399bc8c12e6d7fd THREAD X-REFERENCES2: Don't return (0) nodes. diff -r 66a8cbe7f007 -r bf16646ec312 src/lib-storage/index/index-thread-finish.c --- a/src/lib-storage/index/index-thread-finish.c Thu Apr 02 15:02:58 2009 -0400 +++ b/src/lib-storage/index/index-thread-finish.c Thu Apr 02 15:28:03 2009 -0400 @@ -420,10 +420,20 @@ const struct mail_thread_node *node; struct mail_thread_root_node *roots, *root; struct mail_thread_child_node child; + const struct mail_thread_shadow_node *shadows; unsigned int root_count; uint32_t idx, parent_idx; roots = array_get_modifiable(&ctx->roots, &root_count); + + /* drop childless dummy nodes */ + shadows = array_idx(&ctx->shadow_nodes, 0); + for (idx = 1; idx < root_count; idx++) { + if (roots[idx].dummy && + shadows[roots[idx].node.idx].first_child_idx == 0) + roots[idx].ignore = TRUE; + } + for (idx = 1; idx < record_count; idx++) { node = array_idx(&ctx->cache->thread_nodes, idx); if (!MAIL_THREAD_NODE_EXISTS(node))