imapc-mailbox.c revision d1b3f17d857237ea9a27bb58785bd5c6f0d3a185
/* Copyright (c) 2011 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "ioloop.h"
#include "imap-arg.h"
#include "imap-util.h"
#include "imapc-client.h"
#include "imapc-mail.h"
#include "imapc-msgmap.h"
#include "imapc-sync.h"
#include "imapc-storage.h"
#define NOTIFY_DELAY_MSECS 500
const char *reason, ...)
{
i_error("imapc: Mailbox '%s' state corrupted: %s",
sleep(3600);
}
static struct mail_index_view *
{
}
{
return;
}
bool *changes_r)
{
int ret = 0;
ret = -1;
}
}
return ret;
}
static void
struct imapc_mailbox *mbox)
{
const struct mail_index_header *hdr;
return;
/* We don't know the latest flags, refresh them. */
}
}
{
}
{
}
}
{
const unsigned int *kw_idx;
unsigned int i, j, count;
return FALSE;
/* there are normally only a few keywords, so O(n^2) is fine */
for (i = 0; i < count; i++) {
for (j = 0; j < count; j++) {
break;
}
if (j == count)
return FALSE;
}
return TRUE;
}
struct imapc_mailbox *mbox)
{
struct imapc_mail *const *mailp;
const char *atom;
struct imapc_msgmap *msgmap;
enum mail_flags flags;
unsigned int i, j;
bool seen_flags = FALSE;
return;
return;
return;
return;
seen_flags = TRUE;
return;
if (atom[0] == '\\')
else {
/* keyword */
}
}
}
}
/* FIXME: need to do something about recent flags */
flags &= ~MAIL_RECENT;
/* newly seen message */
/* can't handle this one now. we should get another
FETCH reply for it. */
return;
}
"Expunged message reappeared "
"(uid=%u < next_uid=%u)",
return;
}
/* message is already added to index */
lseq = 0;
}
} else {
"FETCH UID mismatch (%u != %u)",
return;
}
lseq = 0;
}
/* if this is a reply to some FETCH request, update the mail's fields */
}
if (lseq == 0) {
/* already expunged by another session */
return;
}
}
/* we're doing the initial full sync of mails. expunge any
mails that no longer exist. */
mbox->sync_next_lseq++;
}
mbox->sync_next_rseq++;
mbox->sync_next_lseq++;
}
}
if (seen_flags) T_BEGIN {
struct mail_keywords *kw;
&old_kws);
(void)array_append_space(&keywords);
}
} T_END;
}
struct imapc_mailbox *mbox)
{
struct imapc_msgmap *msgmap;
return;
/* we haven't even seen this message yet */
return;
}
/* already expunged by another session */
} else {
}
}
static void
struct imapc_mailbox *mbox)
{
return;
}
static void
struct imapc_mailbox *mbox)
{
return;
}
static void
struct imapc_mailbox *mbox)
{
const char *flag;
return;
mbox->permanent_flags = 0;
continue;
else if (*flag == '\\')
else {
/* this wastes some memory when called multiple times,
but that should happen quite rarely */
}
}
/* NULL-terminate it */
}
const char *key,
{
struct imapc_mailbox_event_callback *cb;
}
const char *key,
{
struct imapc_mailbox_event_callback *cb;
}
{
}