index-sync-pvt.c revision be871058b8d5a3e023ebbb385277543df5d790f9
/* Copyright (c) 2012 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "mail-index-alloc-cache.h"
#include "mailbox-list-private.h"
#include "index-sync-private.h"
{
const char *index_dir;
return 1;
/* no private indexes */
return 0;
}
return -1;
}
return 1;
}
{
int ret;
return 1;
return ret;
return -1;
return 1;
}
struct mail_index_view *view_pvt,
struct mail_index_transaction *trans_pvt,
struct mail_index_view *view_shared)
{
if (uid_pvt == uid_shared) {
seq_pvt++;
seq_shared++;
} else if (uid_pvt < uid_shared) {
/* message expunged */
seq_pvt++;
} else {
"%s: Message UID=%u unexpectedly inserted to mailbox",
return -1;
}
}
return 0;
}
static void
struct mail_index_view *view,
struct mail_index_transaction *trans,
{
const struct mail_index_record *old_rec;
}
if (array_count(keywords) > 0) {
struct mail_keywords *kw;
keywords);
}
}
static int
{
struct mail_index_sync_ctx *sync_ctx;
struct mail_index_view *view_pvt;
struct mail_index_transaction *trans_pvt;
struct mail_index_view *view_shared;
int ret;
/* open a view for the latest version of the index */
return -1;
}
if (hdr_shared->uid_validity == 0) {
/* the mailbox hasn't been fully created yet,
no need for a private index yet */
return 0;
}
/* no new or expunged mails, don't bother syncing */
return 0;
}
return -1;
}
/* get an updated private header */
/* same mailbox. expunge messages from private index that
no longer exist. */
}
}
if (!reset) {
&seq_shared, &seq2)) {
/* no new messages */
}
} else {
seq_shared = 1;
}
if (preserve_old_flags &&
/* copy flags from the original index */
&keywords,
}
}
return ret;
}
{
struct mail_index_view_sync_ctx *view_sync_ctx;
enum mail_flags pvt_flags;
bool delayed_expunges;
int ret;
if (pvt_flags == 0)
return 0;
return ret;
if (index_storage_mailbox_sync_pvt_index(box) < 0)
return -1;
/* sync the private view */
return -1;
return 0;
}