]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: Remove mailbox_set_reason() calls
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 11 Mar 2021 13:44:47 +0000 (15:44 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Wed, 29 Sep 2021 10:09:58 +0000 (10:09 +0000)
They are now unnecessary because of the new reason_code field.

13 files changed:
src/imap/cmd-create.c
src/imap/cmd-delete.c
src/imap/cmd-getmetadata.c
src/imap/cmd-notify.c
src/imap/cmd-rename.c
src/imap/cmd-resetkey.c
src/imap/cmd-select.c
src/imap/cmd-setmetadata.c
src/imap/cmd-subscribe.c
src/imap/imap-commands-util.c
src/imap/imap-notify.c
src/imap/imap-state.c
src/imap/imap-status.c

index 75f23b41598d94b3c0f5df6e2329fbc36d650f3e..2459173c27ea3ceef917026c0c4fa91c0785db6c 100644 (file)
@@ -39,7 +39,6 @@ bool cmd_create(struct client_command_context *cmd)
 
        box = mailbox_alloc(ns->list, mailbox, 0);
        event_add_str(cmd->global_event, "mailbox", mailbox_get_vname(box));
-       mailbox_set_reason(box, "CREATE");
        if (mailbox_create(box, NULL, directory) < 0)
                client_send_box_error(cmd, box);
        else
index f8bb053b20cc0010606fc8ebb48d8a04743e62c0..e095321cdbae83a652130224a1aa0c17ec2c4666 100644 (file)
@@ -22,7 +22,6 @@ bool cmd_delete(struct client_command_context *cmd)
 
        box = mailbox_alloc(ns->list, name, 0);
        event_add_str(cmd->global_event, "mailbox", mailbox_get_vname(box));
-       mailbox_set_reason(box, "DELETE");
        if (mailbox_is_any_inbox(box)) {
                /* IMAP protocol allows this, but I think it's safer to
                   not allow it. */
index 676d4e466ff212dabf158330e700a7dda252d0f2..ec23135c6c8fa0b22d3cc9b57897ba0e3daf529c 100644 (file)
@@ -437,7 +437,6 @@ cmd_getmetadata_try_mailbox(struct imap_getmetadata_context *ctx,
        ctx->box = mailbox_alloc(ns->list, mailbox, MAILBOX_FLAG_READONLY);
        event_add_str(ctx->cmd->global_event, "mailbox",
                      mailbox_get_vname(ctx->box));
-       mailbox_set_reason(ctx->box, "GETMETADATA");
 
        enum mailbox_existence existence;
        if (mailbox_exists(ctx->box, TRUE, &existence) < 0) {
index 5c7564c49eaa4f80a67bdeeeeda474c1a75f4da2..e043e9726858cca7c85467230d19a2e592a452f6 100644 (file)
@@ -441,7 +441,6 @@ imap_notify_box_send_status(struct client_command_context *cmd,
                items.flags |= IMAP_STATUS_ITEM_HIGHESTMODSEQ;
 
        box = mailbox_alloc(info->ns->list, info->vname, MAILBOX_FLAG_READONLY);
-       mailbox_set_reason(box, "NOTIFY send STATUS");
        (void)mailbox_enable(box, client_enabled_mailbox_features(ctx->client));
 
        if (imap_status_get(cmd, info->ns, info->vname, &items, &result) < 0) {
index db706221b46e9ee98282121ff7c3f0e8bc8ecb7c..45b44fd183c5eb64ed8f05fcdd77f35d2c972e1c 100644 (file)
@@ -37,8 +37,6 @@ bool cmd_rename(struct client_command_context *cmd)
 
        old_box = mailbox_alloc(old_ns->list, oldname, 0);
        new_box = mailbox_alloc(new_ns->list, newname, 0);
-       mailbox_set_reason(old_box, "RENAME from");
-       mailbox_set_reason(new_box, "RENAME to");
        event_add_str(cmd->global_event, "old_mailbox",
                      mailbox_get_vname(old_box));
        event_add_str(cmd->global_event, "new_mailbox",
index 230056d38e4e313d65bb50f4fd7930b0264418a7..34759949c3474aa264bff83eaff6a20bac56ddd7 100644 (file)
@@ -50,7 +50,6 @@ cmd_resetkey_mailbox(struct client_command_context *cmd,
        /* open mailbox */
        box = mailbox_alloc(ns->list, mailbox, flags);
        event_add_str(cmd->global_event, "mailbox", mailbox_get_vname(box));
-       mailbox_set_reason(box, "RESETKEY");
        if (mailbox_open(box) < 0) {
                client_send_box_error(cmd, box);
                mailbox_free(&box);
index 6a45b2de2019249d361061eeaeace66e5d7acfc8..c9af870ec4c891c2644c6a5faaaa3d0818bfa001 100644 (file)
@@ -285,7 +285,6 @@ select_open(struct imap_select_context *ctx, const char *mailbox, bool readonly)
        ctx->box = mailbox_alloc(ctx->ns->list, mailbox, flags);
        event_add_str(ctx->cmd->global_event, "mailbox",
                      mailbox_get_vname(ctx->box));
-       mailbox_set_reason(ctx->box, readonly ? "EXAMINE" : "SELECT");
        if (mailbox_open(ctx->box) < 0) {
                client_send_box_error(ctx->cmd, ctx->box);
                mailbox_free(&ctx->box);
index 614a166595ee6133ba706f3285e60d74592cf64a..247afce0df6d7a38c360f239793b716262d5ec88 100644 (file)
@@ -324,7 +324,6 @@ cmd_setmetadata_mailbox(struct imap_setmetadata_context *ctx,
        else {
                ctx->box = mailbox_alloc(ns->list, mailbox,
                                         MAILBOX_FLAG_ATTRIBUTE_SESSION);
-               mailbox_set_reason(ctx->box, "SETMETADATA");
                enum mailbox_existence existence;
                if (mailbox_exists(ctx->box, TRUE, &existence) < 0) {
                        client_send_box_error(cmd, ctx->box);
index 24741af49786780df9ee7e328e6f8604026650d6..03c2684c08046547cd0f6e1eca655d89356e734a 100644 (file)
@@ -49,7 +49,6 @@ bool cmd_subscribe_full(struct client_command_context *cmd, bool subscribe)
 
        box = mailbox_alloc(ns->list, mailbox, 0);
        event_add_str(cmd->global_event, "mailbox", mailbox_get_vname(box));
-       mailbox_set_reason(box, subscribe ? "SUBSCRIBE" : "UNSUBSCRIBE");
        if (subscribe) {
                if (!subscribe_is_valid_name(cmd, box)) {
                        mailbox_free(&box);
@@ -65,7 +64,6 @@ bool cmd_subscribe_full(struct client_command_context *cmd, bool subscribe)
                /* try to unsubscribe both "box" and "box/" */
                const char *name2 = t_strdup_printf("%s%c", mailbox, sep);
                box2 = mailbox_alloc(ns->list, name2, 0);
-               mailbox_set_reason(box2, "UNSUBSCRIBE");
                if (mailbox_set_subscribed(box2, FALSE) == 0)
                        unsubscribed_mailbox2 = TRUE;
                mailbox_free(&box2);
index f6194811f1ed00d66d4ad698079641af2698cf4d..2d454a7d7dbeb23369560d2fc4f2007883628fe1 100644 (file)
@@ -112,7 +112,6 @@ int client_open_save_dest_box(struct client_command_context *cmd,
                return 0;
        }
        box = mailbox_alloc(ns->list, name, MAILBOX_FLAG_SAVEONLY);
-       mailbox_set_reason(box, cmd->name);
        if (mailbox_open(box) < 0) {
                error_string = mailbox_get_last_error(box, &error);
                if (error == MAIL_ERROR_NOTFOUND) {
index ea441a27938e5a587ec341fe4d1e3cd4c4d15647..fa2c9ef4c143e99ff3471ab97b290ad88405618e 100644 (file)
@@ -55,7 +55,6 @@ static int imap_notify_status(struct imap_notify_namespace *notify_ns,
                items.flags |= IMAP_STATUS_ITEM_HIGHESTMODSEQ;
 
        box = mailbox_alloc(notify_ns->ns->list, rec->vname, 0);
-       mailbox_set_reason(box, "NOTIFY STATUS");
        if ((rec->events & MAILBOX_LIST_NOTIFY_UIDVALIDITY) != 0) {
                items.flags |= IMAP_STATUS_ITEM_UIDVALIDITY |
                        IMAP_STATUS_ITEM_UIDNEXT | IMAP_STATUS_ITEM_MESSAGES |
@@ -198,7 +197,6 @@ bool imap_notify_match_mailbox(struct imap_notify_namespace *notify_ns,
        switch (notify_boxes->type) {
        case IMAP_NOTIFY_TYPE_SUBSCRIBED:
                box = mailbox_alloc(notify_ns->ns->list, vname, 0);
-               mailbox_set_reason(box, "NOTIFY is subscribed");
                ret = mailbox_is_subscribed(box);
                mailbox_free(&box);
                return ret;
index bdae5189f01fb0a0a00844826fd49fe7cd3dded2..2b064ec80971ec1bfabb20288bb7fbff4d7ad89d 100644 (file)
@@ -571,7 +571,6 @@ import_state_mailbox_open(struct client *client,
        else
                flags |= MAILBOX_FLAG_DROP_RECENT;
        box = mailbox_alloc(ns->list, state->vname, flags);
-       mailbox_set_reason(box, "unhibernate");
        if (mailbox_open(box) < 0) {
                *error_r = t_strdup_printf("Couldn't open mailbox: %s",
                        mailbox_get_last_internal_error(box, NULL));
index ef521cb2f21f28e44457e01cf99e7fe5453a47d4..341e537ac28b79d7d8252253e69204049b22e9b3 100644 (file)
@@ -109,7 +109,6 @@ int imap_status_get(struct client_command_context *cmd,
        } else {
                /* open the mailbox */
                box = mailbox_alloc(ns->list, mailbox, MAILBOX_FLAG_READONLY);
-               mailbox_set_reason(box, "STATUS");
                (void)mailbox_enable(box, client_enabled_mailbox_features(client));
        }