mail-index-view-sync.c revision ba94d6d7e2f7b07d51f5c27e7532f6502ac9a298
6ae232055d4d8a97267517c5e50074c2c819941and/* Copyright (C) 2003-2004 Timo Sirainen */
6ae232055d4d8a97267517c5e50074c2c819941and const void *data;
6ae232055d4d8a97267517c5e50074c2c819941andmail_transaction_log_sort_expunges(ARRAY_TYPE(seq_range) *expunges,
b43f840409794ed298e8634f6284741f193b6c4ftakashi /* Note that all the sequences are actually still UIDs at this point */
b43f840409794ed298e8634f6284741f193b6c4ftakashi /* @UNSAFE */
6ae232055d4d8a97267517c5e50074c2c819941and /* src[] must be sorted. */
6ae232055d4d8a97267517c5e50074c2c819941and return -1;
6ae232055d4d8a97267517c5e50074c2c819941and for (; i < dest_count; i++) {
6ae232055d4d8a97267517c5e50074c2c819941and /* we can/must merge with next record */
6ae232055d4d8a97267517c5e50074c2c819941and /* continue previous record */
6ae232055d4d8a97267517c5e50074c2c819941and } else if (i == first) {
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi /* use next record */
6ae232055d4d8a97267517c5e50074c2c819941and if (i > first) {
6ae232055d4d8a97267517c5e50074c2c819941andview_sync_set_log_view_range(struct mail_index_view *view, bool sync_expunges)
6ae232055d4d8a97267517c5e50074c2c819941and const struct mail_index_header *hdr = &view->index->map->hdr;
6ae232055d4d8a97267517c5e50074c2c819941and for (;;) {
6ae232055d4d8a97267517c5e50074c2c819941and /* the view begins from the first non-synced transaction */
6ae232055d4d8a97267517c5e50074c2c819941and if (ret <= 0) {
6ae232055d4d8a97267517c5e50074c2c819941and return -1;
6ae232055d4d8a97267517c5e50074c2c819941and /* FIXME: use the new index to get needed
6ae232055d4d8a97267517c5e50074c2c819941and changes */
6ae232055d4d8a97267517c5e50074c2c819941and "Transaction log got desynced for index %s",
6ae232055d4d8a97267517c5e50074c2c819941and return -1;
6ae232055d4d8a97267517c5e50074c2c819941and /* we can't do this. sync only up to reset. */
6ae232055d4d8a97267517c5e50074c2c819941and /* we have only this reset log */
727872d18412fc021f03969b8641810d8896820bhumbedooh const void *data;
0d0ba3a410038e179b695446bb149cce6264e0abnd unsigned int count;
0d0ba3a410038e179b695446bb149cce6264e0abnd /* get a list of expunge transactions. there may be some that we have
0d0ba3a410038e179b695446bb149cce6264e0abnd already synced, but it doesn't matter because they'll get dropped
0d0ba3a410038e179b695446bb149cce6264e0abnd out when converting to sequences */
0d0ba3a410038e179b695446bb149cce6264e0abnd while ((ret = mail_transaction_log_view_next(view->log_view,
0d0ba3a410038e179b695446bb149cce6264e0abnd /* this is simply a request for expunge */
7fec19672a491661b2fe4b29f685bc7f4efa64d4nd "Corrupted expunge record");
if (ret < 0) {
count--;
dest++;
if (seq1 != 0)
const void *data;
int ret = 0;
if (ret != 0)
return ret != 0;
bool sync_expunges;
if (sync_expunges) {
#ifdef DEBUG
unsigned int i, count;
return FALSE;
for (i = 0; i < count; i++) {
return TRUE;
return FALSE;
return FALSE;
return FALSE;
return FALSE;
return TRUE;
int ret;
bool synced_to_map;
if (ret <= 0) {
if (ret < 0)
store +flags.silent command) */
#define FLAG_UPDATE_IS_INTERNAL(u) \
case MAIL_TRANSACTION_APPEND: {
case MAIL_TRANSACTION_EXPUNGE: {
case MAIL_TRANSACTION_FLAG_UPDATE: {
case MAIL_TRANSACTION_KEYWORD_UPDATE: {
case MAIL_TRANSACTION_KEYWORD_RESET: {
return FALSE;
return TRUE;
int ret;
if (ret <= 0)
return ret;
unsigned int i, count;
for (i = 0; i < count; i++) {
#ifdef DEBUG
unsigned int length)