]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: copy/move: Move copy_update_trashed() earlier
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 12 Dec 2019 14:35:46 +0000 (16:35 +0200)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Thu, 6 Feb 2020 16:14:32 +0000 (16:14 +0000)
src/imap/cmd-copy.c

index 2237cc603fffaebb8e7992bbda6f4f8688430da3..43840551cbf6e6812b65d38ab2c75388caba9c68 100644 (file)
@@ -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;