/* set the search time in here, in case a plugin
already spent some time indexing the mailbox */
ctx->search_start_time = ioloop_timeval;
- } else if (box->storage->callbacks->notify_ok != NULL &&
+ } else if (box->storage->callbacks.notify_ok != NULL &&
!ctx->mail_ctx.progress_hidden) {
percentage = ctx->mail_ctx.progress_cur * 100.0 /
ctx->mail_ctx.progress_max;
text = t_strdup_printf("Searched %d%% of the mailbox, "
"ETA %d:%02d", (int)percentage,
secs/60, secs%60);
- box->storage->callbacks->
+ box->storage->callbacks.
notify_ok(box, text,
box->storage->callback_context);
} T_END;
case MAILBOX_LOCK_NOTIFY_NONE:
break;
case MAILBOX_LOCK_NOTIFY_MAILBOX_ABORT:
- if (storage->callbacks->notify_no == NULL)
+ if (storage->callbacks.notify_no == NULL)
break;
str = t_strdup_printf("Mailbox is locked, will abort in "
"%u seconds", secs_left);
- storage->callbacks->notify_no(&ibox->box, str,
- storage->callback_context);
+ storage->callbacks.notify_no(&ibox->box, str,
+ storage->callback_context);
break;
case MAILBOX_LOCK_NOTIFY_MAILBOX_OVERRIDE:
- if (storage->callbacks->notify_ok == NULL)
+ if (storage->callbacks.notify_ok == NULL)
break;
str = t_strdup_printf("Stale mailbox lock file detected, "
"will override in %u seconds", secs_left);
- storage->callbacks->notify_ok(&ibox->box, str,
- storage->callback_context);
+ storage->callbacks.notify_ok(&ibox->box, str,
+ storage->callback_context);
break;
}
}
if (now - ctx->last_notify > MAIL_STORAGE_STAYALIVE_SECS) {
struct mailbox *box = &ctx->mbox->ibox.box;
- if (box->storage->callbacks->notify_ok != NULL) {
- box->storage->callbacks->
+ if (box->storage->callbacks.notify_ok != NULL) {
+ box->storage->callbacks.
notify_ok(box, "Hang in there..",
box->storage->callback_context);
}
return -1;
}
- if (storage->callbacks->notify_no != NULL) {
- storage->callbacks->notify_no(&ctx->mbox->ibox.box,
+ if (storage->callbacks.notify_no != NULL) {
+ storage->callbacks.notify_no(&ctx->mbox->ibox.box,
"Internal mailbox synchronization failure, "
"showing only old mails.",
storage->callback_context);
enum mail_storage_flags flags;
- struct mail_storage_callbacks *callbacks;
+ struct mail_storage_callbacks callbacks;
void *callback_context;
/* Module-specific contexts. See mail_storage_module_id. */
storage->user = ns->user;
storage->set = ns->mail_set;
storage->flags = flags;
-
- storage->callbacks =
- p_new(storage->pool, struct mail_storage_callbacks, 1);
p_array_init(&storage->module_contexts, storage->pool, 5);
if (storage->v.create != NULL &&
struct mail_storage_callbacks *callbacks,
void *context)
{
- *storage->callbacks = *callbacks;
+ storage->callbacks = *callbacks;
storage->callback_context = context;
}
if (ioloop_time - ctx->search_start_time.tv_sec >=
FTS_BUILD_NOTIFY_INTERVAL_SECS) {
/* we notified at least once */
- box->storage->callbacks->
+ box->storage->callbacks.
notify_ok(box, "Mailbox indexing finished",
box->storage->callback_context);
}
/* set the search time in here, in case a plugin
already spent some time indexing the mailbox */
ctx->search_start_time = ioloop_timeval;
- } else if (box->storage->callbacks->notify_ok != NULL) {
+ } else if (box->storage->callbacks.notify_ok != NULL) {
range = array_idx(&ctx->search_args->args->value.seqset, 0);
percentage = (ctx->mail->seq - range->seq1) * 100.0 /
(range->seq2 - range->seq1);
text = t_strdup_printf("Indexed %d%% of the mailbox, "
"ETA %d:%02d", (int)percentage,
secs/60, secs%60);
- box->storage->callbacks->
+ box->storage->callbacks.
notify_ok(box, text,
box->storage->callback_context);
} T_END;