This allows better finding out what changed in the transaction.
} else if (t->box->v.transaction_save_commit_pre(t->save_ctx) < 0) {
t->save_ctx = NULL;
ret = -1;
- } else {
- t->changes->changed = TRUE;
}
}
if (t->super.commit(index_trans, result_r) < 0) {
mailbox_set_index_error(t->box);
ret = -1;
- } else if (result_r->commit_size > 0) {
- /* something was written to the transaction log */
- t->changes->changed = TRUE;
+ } else {
+ t->changes->changes_mask = result_r->changes_mask;
}
}
return -1;
t = NULL;
- if (!changes_r->changed)
+ /* check all changes here, because e.g. vsize update is _OTHERS */
+ if (changes_r->changes_mask == 0)
return 0;
/* this transaction commit may have been done in error handling path
/* number of modseq changes that couldn't be changed as requested */
unsigned int ignored_modseq_changes;
- /* TRUE if anything actually changed with this commit */
- bool changed;
+ /* Changes that occurred within this transaction */
+ enum mail_index_transaction_change changes_mask;
/* User doesn't have read ACL for the mailbox, so don't show the
uid_validity / saved_uids. */
bool no_read_perm;
enum replication_priority priority;
if (ruser != NULL && !ctx->sync_trans &&
- (ctx->new_messages || changes->changed)) {
+ (ctx->new_messages || changes->changes_mask != 0)) {
priority = !ctx->new_messages ? REPLICATION_PRIORITY_LOW :
ruser->sync_secs == 0 ? REPLICATION_PRIORITY_HIGH :
REPLICATION_PRIORITY_SYNC;