Skip to content

Commit

Permalink
imap: Add imap_client_vfuncs.send_tagline()
Browse files Browse the repository at this point in the history
This allows plugins to catch all the IMAP command replies.
  • Loading branch information
sirainen committed Apr 21, 2017
1 parent 474e9ae commit f231cd7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/imap/imap-client.c
Expand Up @@ -570,6 +570,12 @@ client_cmd_append_timing_stats(struct client_command_context *cmd,
}

void client_send_tagline(struct client_command_context *cmd, const char *data)
{
cmd->client->v.send_tagline(cmd, data);
}

static void
client_default_send_tagline(struct client_command_context *cmd, const char *data)
{
struct client *client = cmd->client;
const char *tag = cmd->tag;
Expand Down Expand Up @@ -1415,5 +1421,6 @@ void clients_destroy_all(struct mail_storage_service_ctx *storage_service)
struct imap_client_vfuncs imap_client_vfuncs = {
imap_state_export_base,
imap_state_import_base,
client_default_destroy
client_default_destroy,
client_default_send_tagline,
};
3 changes: 3 additions & 0 deletions src/imap/imap-client.h
Expand Up @@ -130,6 +130,9 @@ struct imap_client_vfuncs {
const unsigned char *data, size_t size,
const char **error_r);
void (*destroy)(struct client *client, const char *reason);

void (*send_tagline)(struct client_command_context *cmd,
const char *data);
};

struct client {
Expand Down

0 comments on commit f231cd7

Please sign in to comment.