/* Copyright (c) 2002-2018 Dovecot authors, see the included COPYING file */
#include "imap-common.h"
#include "str.h"
#include "ostream.h"
#include "imap-base-subject.h"
#include "imap-commands.h"
#include "imap-search-args.h"
#include "mail-thread.h"
{
unsigned int count;
int ret = 0;
if (count == 0)
return 0;
/* only one child - special case to avoid extra parenthesis */
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
{
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)
{
int ret;
search_args, &ctx);
if (ret == 0) {
}
if (ret == 0)
return ret;
}
struct orderedsubject_thread {
};
const struct orderedsubject_thread *t2)
{
return -1;
return 1;
return -1;
return 1;
i_unreached();
}
static void
const struct orderedsubject_thread *thread)
{
unsigned int i, count;
str_truncate(reply, 0);
}
switch (count) {
case 1:
break;
case 2:
break;
default:
/* (1 (2)(3)) */
for (i = 1; i < count; i++) {
str_truncate(reply, 0);
}
}
}
}
struct mail_search_args *search_args)
{
0
};
bool reply_or_fw;
/* first read all of the threads into memory */
0, NULL);
subject = "";
T_BEGIN {
&reply_or_fw);
/* thread changed */
cur_thread = NULL;
}
str_truncate(prev_subject, 0);
} T_END;
if (cur_thread == NULL) {
/* starting a new thread. get the first message's
date */
&tz) == 0 &&
cur_thread->timestamp == 0) {
(void)mail_get_received_date(mail,
&cur_thread->timestamp);
}
}
}
(void)mailbox_transaction_commit(&trans);
if (ret < 0) {
pool_unref(&pool);
return -1;
}
/* sort the threads by their first message's timestamp */
/* write the threads to client */
}
pool_unref(&pool);
return 0;
}
{
int ret;
return FALSE;
if (!client_verify_open_mailbox(cmd))
return TRUE;
return TRUE;
}
args += 2;
return TRUE;
}
if (ret <= 0)
return ret < 0;
else
if (ret < 0) {
return TRUE;
}
0, "OK Thread completed.");
}