maildir-sync-index.c revision d61a5e0e4ff58d1aa613f0d51161e5bb0f092514
a6ab8f00351265e35b79f3a22b1f5a4978ae5c35Timo Sirainen/* Copyright (C) 2007 Timo Sirainen */
23878bd03d1de531e3261a25598beec621351910Timo Sirainen struct maildir_sync_context *maildir_sync_ctx;
cf63dc8723b971cc80638fccbf494d961cbafc7fTimo Sirainen struct maildir_keywords_sync_ctx *keywords_sync_ctx;
a6ab8f00351265e35b79f3a22b1f5a4978ae5c35Timo Sirainen struct maildir_uidlist_sync_ctx *uidlist_sync_ctx;
1db62753d9e3b5d71018889c8ef0a3722a307455Timo Sirainen struct index_sync_changes_context *sync_changes;
1db62753d9e3b5d71018889c8ef0a3722a307455Timo Sirainenmaildir_sync_get_keywords_sync_ctx(struct maildir_index_sync_context *ctx)
1db62753d9e3b5d71018889c8ef0a3722a307455Timo Sirainenstatic int maildir_expunge(struct maildir_mailbox *mbox, const char *path,
a6ab8f00351265e35b79f3a22b1f5a4978ae5c35Timo Sirainen mail_storage_set_critical(&mbox->storage->storage,
a6ab8f00351265e35b79f3a22b1f5a4978ae5c35Timo Sirainenstatic int maildir_sync_flags(struct maildir_mailbox *mbox, const char *path,
97afa073e3e1e0301dc41173ec34beb08edcce50Timo Sirainen /* get the current flags and keywords */
97afa073e3e1e0301dc41173ec34beb08edcce50Timo Sirainen maildir_filename_get_flags(ctx->keywords_sync_ctx,
b8b085f7bc6f1c0367802a9f00062bbbd981690dTimo Sirainen /* apply changes */
cf63dc8723b971cc80638fccbf494d961cbafc7fTimo Sirainen index_sync_changes_apply(ctx->sync_changes, NULL,
23878bd03d1de531e3261a25598beec621351910Timo Sirainen /* and try renaming with the new name */
23878bd03d1de531e3261a25598beec621351910Timo Sirainen newfname = maildir_filename_set_flags(ctx->keywords_sync_ctx, fname,
int ret;
return ret;
const void *data;
data_size = 0;
bool partial)
const char *filename;
unsigned int changes = 0;
int ret = 0;
seq--;
goto __again;
seq--;
&expunged) < 0) {
if (expunged) {
if (!partial) {
if (uid_validity == 0) {
uid_validity, 0);
} else if (uid_validity == 0) {