imap-sync.c revision 18634dae6e304bac982bb1e0ff1b6b88fc448dbc
/* Copyright (C) 2002-2004 Timo Sirainen */
#include "common.h"
#include "str.h"
#include "mail-storage.h"
#include "imap-util.h"
#include "imap-sync.h"
#include "commands.h"
struct cmd_sync_context {
const char *tagline;
struct imap_sync_context *sync_ctx;
};
struct imap_sync_context {
struct mailbox_transaction_context *t;
struct mailbox_sync_context *sync_ctx;
struct mailbox_sync_rec sync_rec;
unsigned int messages_count;
int failed;
};
struct imap_sync_context *
enum mailbox_sync_flags flags)
{
struct imap_sync_context *ctx;
return ctx;
}
{
struct mailbox_status status;
return -1;
}
mailbox_transaction_commit(ctx->t, 0);
t_push();
}
}
/*FIXME:client_save_keywords(&client->keywords, keywords, keywords_count);
client_send_mailbox_flags(client, mailbox, keywords, keywords_count);*/
t_pop();
return 0;
}
{
enum mail_flags flags;
const char *const *keywords;
int ret = 1;
t_push();
for (;;) {
/* get next one */
if (ret <= 0) {
if (ret == 0) {
/* all finished ok */
ret = 1;
}
break;
}
}
case MAILBOX_SYNC_TYPE_FLAGS:
t_pop();
return -1;
}
str_truncate(str, 0);
if (ret <= 0) {
t_pop();
return ret;
}
}
break;
ctx->messages_count -=
}
str_truncate(str, 0);
if (ret <= 0) {
t_pop();
return ret;
}
}
break;
}
}
t_pop();
return ret;
}
{
struct mailbox_sync_context *ctx;
struct mailbox_sync_rec sync_rec;
struct mailbox_status status;
;
}
{
return FALSE;
}
return TRUE;
}
const char *tagline)
{
struct cmd_sync_context *ctx;
return TRUE;
}
if ((client_workarounds & WORKAROUND_DELAY_NEWMAIL) != 0 &&
(flags & MAILBOX_SYNC_FLAG_FAST) != 0) {
/* expunges might break just as badly as new mail
notifications. besides, currently indexing code doesn't
handle expunges + no-newmail so this is required, unless
we did this only for no-expunges case.. */
}
flags);
return cmd_sync_continue(cmd);
}