From: Timo Sirainen Date: Thu, 12 Dec 2019 14:35:46 +0000 (+0200) Subject: imap: copy/move: Move copy_update_trashed() earlier X-Git-Tag: 2.3.10~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c5b1e171793b44dac386126931b6b73e3d3bdaa;p=thirdparty%2Fdovecot%2Fcore.git imap: copy/move: Move copy_update_trashed() earlier --- diff --git a/src/imap/cmd-copy.c b/src/imap/cmd-copy.c index 2237cc603f..43840551cb 100644 --- a/src/imap/cmd-copy.c +++ b/src/imap/cmd-copy.c @@ -40,6 +40,19 @@ static void client_send_sendalive_if_needed(struct client *client) } } +static void copy_update_trashed(struct client *client, struct mailbox *box, + unsigned int count) +{ + const struct mailbox_settings *set; + + set = mailbox_settings_find(mailbox_get_namespace(box), + mailbox_get_vname(box)); + if (set != NULL && set->special_use[0] != '\0' && + str_array_icase_find(t_strsplit_spaces(set->special_use, " "), + "\\Trash")) + client->trashed_count += count; +} + static int fetch_and_copy(struct cmd_copy_context *copy_ctx, struct mail_search_args *search_args, struct mail_transaction_commit_changes *changes_r) @@ -111,19 +124,6 @@ static int fetch_and_copy(struct cmd_copy_context *copy_ctx, return ret; } -static void copy_update_trashed(struct client *client, struct mailbox *box, - unsigned int count) -{ - const struct mailbox_settings *set; - - set = mailbox_settings_find(mailbox_get_namespace(box), - mailbox_get_vname(box)); - if (set != NULL && set->special_use[0] != '\0' && - str_array_icase_find(t_strsplit_spaces(set->special_use, " "), - "\\Trash")) - client->trashed_count += count; -} - static bool cmd_copy_full(struct client_command_context *cmd, bool move) { struct client *client = cmd->client;