}
ctx->last_stale = stale;
- ctx->index->lock_notify_cb(stale ? MAIL_LOCK_NOTIFY_MAILBOX_OVERRIDE :
- MAIL_LOCK_NOTIFY_MAILBOX_ABORT,
- secs_left, ctx->index->lock_notify_context);
+ if (ctx->index->lock_notify_cb != NULL) {
+ ctx->index->lock_notify_cb(stale ?
+ MAIL_LOCK_NOTIFY_MAILBOX_OVERRIDE :
+ MAIL_LOCK_NOTIFY_MAILBOX_ABORT,
+ secs_left,
+ ctx->index->lock_notify_context);
+ }
return TRUE;
}
int failed = FALSE;
/* update flags by rewrite mbox file */
+ index_storage_init_lock_notify(ibox);
if (!mbox_index_rewrite(ibox->index)) {
mail_storage_set_index_error(ibox);
failed = TRUE;
}
+ ibox->index->set_lock_notify_callback(ibox->index, NULL, NULL);
return index_storage_close(box) && !failed;
}