index-sync.c revision 48465c578a61127ba6069cf00e987078b8460e22
/* Copyright (C) 2002 Timo Sirainen */
#include "lib.h"
#include "index-storage.h"
#include "mail-index-util.h"
#include "mail-modifylog.h"
#include "mail-custom-flags.h"
{
return;
/* new messages in mailbox */
ibox->sync_context);
}
}
/* may leave the index locked */
{
/* reset every time it has worked */
} else {
return mail_storage_set_index_error(ibox);
}
/* notify client once about it */
if (!ibox->sent_diskspace_warning &&
}
}
/* notify about changes in mailbox size. */
return TRUE; /* no changes - must be no new mail either */
if (sync_size)
/* notify changes in custom flags */
}
return TRUE;
}
{
void *sc_context;
const char **custom_flags;
unsigned int first_flag_change, first_flag_messages_count;
/* show the log */
return mail_storage_set_index_error(ibox);
/* first show expunges. this makes it easier to deal with sequence
numbers. */
if (i == count1)
/* client doesn't know about this message yet */
continue;
}
case RECORD_TYPE_EXPUNGE:
break;
}
break;
if (first_flag_change == total_count) {
first_flag_change = i;
}
break;
}
}
/* set synced messages count before flag changes break it */
/* now show the flags */
/* don't bother going through, we're not printing them anyway */
total_count = 0;
}
if (i == count1)
/* client doesn't know about this message yet */
continue;
}
case RECORD_TYPE_EXPUNGE:
break;
flags |= MAIL_RECENT;
/* \Deleted-hiding is useful when syncing just
before doing EXPUNGE. */
if ((flags & MAIL_DELETED) == 0 ||
!hide_deleted) {
}
seq++;
}
break;
}
}
/* mark synced */
return mail_storage_set_index_error(ibox);
return TRUE;
}
{
int failed;
return FALSE;
if (!sync_expunges) {
/* FIXME: we could still send flag changes */
} else {
return mail_storage_set_index_error(ibox);
}
/* check size only if we're locked (== at least something changed) */
return mail_storage_set_index_error(ibox);
return !failed;
}