client->last_output = ioloop_time;
}
+static int
+client_default_sync_notify_more(struct imap_sync_context *ctx ATTR_UNUSED)
+{
+ return 1;
+}
+
void client_send_command_error(struct client_command_context *cmd,
const char *msg)
{
imap_state_import_base,
client_default_destroy,
client_default_send_tagline,
+ client_default_sync_notify_more,
};
void (*send_tagline)(struct client_command_context *cmd,
const char *data);
+ /* Run "mailbox syncing". This can send any unsolicited untagged
+ replies. Returns 1 = done, 0 = wait for more space in output buffer,
+ -1 = failed. */
+ int (*sync_notify_more)(struct imap_sync_context *ctx);
};
struct client {
unsigned int messages_count;
+ /* Module-specific contexts. */
+ ARRAY(union imap_module_context *) module_contexts;
+
bool failed:1;
bool finished:1;
bool no_newmail:1;
ctx->client = client;
ctx->box = box;
ctx->imap_flags = imap_flags;
+ i_array_init(&ctx->module_contexts, 5);
/* make sure user can't DoS the system by causing Dovecot to create
tons of useless namespaces. */
now it contains added/removed messages. */
if ((ret = imap_sync_send_search_updates(ctx, FALSE)) < 0)
ctx->failed = TRUE;
+
+ if (ret > 0)
+ ret = ctx->client->v.sync_notify_more(ctx);
return ret;
}
}
array_free(&ctx->tmp_keywords);
+ array_free(&ctx->module_contexts);
i_free(ctx);
return ret;
}