changeset 8893:bf16646ec312 HEAD

THREAD X-REFERENCES2: Don't return (0) nodes.
author Timo Sirainen <tss@iki.fi>
date Thu, 02 Apr 2009 15:28:03 -0400
parents 66a8cbe7f007
children 266266e90384
files src/lib-storage/index/index-thread-finish.c
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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))