cmd-thread.c revision 7725332a206824650d486f21cc3c62bad98e3be4
/* Copyright (c) 2002-2008 Dovecot authors, see the included COPYING file */
#include "common.h"
#include "str.h"
#include "ostream.h"
#include "commands.h"
#include "imap-search.h"
#include "mail-thread.h"
{
const struct mail_thread_child_node *node;
struct mail_thread_iterate_context *child_iter;
unsigned int count;
int ret = 0;
if (count == 0)
return 0;
/* only one child - special case to avoid extra paranthesis */
if (child_iter != NULL) {
T_BEGIN {
} T_END;
if (mail_thread_iterate_deinit(&child_iter) < 0)
return -1;
}
return ret;
}
if (child_iter == NULL) {
/* no children */
} else {
/* node with children */
T_BEGIN {
} T_END;
if (mail_thread_iterate_deinit(&child_iter) < 0 ||
ret < 0)
return -1;
}
}
return 0;
}
static int
{
struct mail_thread_iterate_context *iter;
int ret;
T_BEGIN {
} T_END;
if (mail_thread_iterate_deinit(&iter) < 0)
ret = -1;
return ret;
}
struct mail_search_args *search_args,
enum mail_thread_type thread_type)
{
struct mail_thread_context *ctx;
int ret;
for (;;) {
search_args, &ctx);
if (ret == 0) {
}
break;
/* try again with in-memory hash */
str_truncate(str, 0);
}
if (ret == 0) {
}
return ret;
}
{
enum mail_thread_type thread_type;
struct mail_search_args *sargs;
int ret, args_count;
if (args_count == -2)
return FALSE;
if (args_count < 3) {
"Missing or invalid arguments.");
return TRUE;
}
if (!client_verify_open_mailbox(cmd))
return TRUE;
"Invalid thread algorithm argument.");
return TRUE;
}
return TRUE;
}
args++;
/* charset */
"Invalid charset argument.");
return TRUE;
}
args++;
if (ret <= 0)
return ret < 0;
if (ret < 0) {
return TRUE;
}
0, "OK Thread completed.");
}