]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: Cleanup - Change client_enable() to return void
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 28 Nov 2018 11:19:02 +0000 (13:19 +0200)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Wed, 6 Feb 2019 08:09:12 +0000 (10:09 +0200)
Nothing cares about its return value. With the current features it's
not even possible to fail. Possibly mailbox_enable() should be also
changed to return void in the future.

src/imap/cmd-enable.c
src/imap/cmd-select.c
src/imap/cmd-store.c
src/imap/imap-client.c
src/imap/imap-client.h
src/imap/imap-fetch.c
src/imap/imap-search.c
src/imap/imap-status.c

index 81876973afcbdb28c34e6e855295e6dffaa929a8..904d6db356e5b5419e5bae0e4700ba447dde20cb 100644 (file)
@@ -22,7 +22,7 @@ bool cmd_enable(struct client_command_context *cmd)
                        return TRUE;
                }
                if (imap_feature_lookup(str, &feature_idx)) {
-                       (void)client_enable(cmd->client, feature_idx);
+                       client_enable(cmd->client, feature_idx);
                        str_append_c(reply, ' ');
                        str_append(reply, t_str_ucase(str));
                }
index 9b7c33d218a8e3203d8fd43153ffea4ad0e473dd..f17e7177305b9c773ad143f8e94f36bd300481c2 100644 (file)
@@ -409,7 +409,7 @@ bool cmd_select_full(struct client_command_context *cmd, bool readonly)
        if (ctx->condstore) {
                /* Enable while no mailbox is opened to avoid sending
                   HIGHESTMODSEQ for previously opened mailbox */
-               (void)client_enable(client, imap_feature_condstore);
+               client_enable(client, imap_feature_condstore);
        }
 
        ret = select_open(ctx, mailbox, readonly);
index be8ab2b0006e3488b4fd5e46d8fa1515383f499c..126c042b35cff393d19bf03fb14fefdfdf4b6299 100644 (file)
@@ -66,8 +66,7 @@ store_parse_modifiers(struct imap_store_context *ctx,
                                                          "Invalid modseq");
                                return FALSE;
                        }
-                       (void)client_enable(ctx->cmd->client,
-                                           imap_feature_condstore);
+                       client_enable(ctx->cmd->client, imap_feature_condstore);
                } else {
                        client_send_command_error(ctx->cmd,
                                                  "Unknown STORE modifier");
index 6341a99efe72f56d18a8b6fc964786c1b9d0be27..eb2829d9f78baaf1a9e8bba536a1bc52e7de3497 100644 (file)
@@ -1447,7 +1447,7 @@ bool client_handle_search_save_ambiguity(struct client_command_context *cmd)
        return TRUE;
 }
 
-int client_enable(struct client *client, unsigned int feature_idx)
+void client_enable(struct client *client, unsigned int feature_idx)
 {
        enum mailbox_feature features = feature_idx;
        struct mailbox_status status;
@@ -1458,11 +1458,11 @@ int client_enable(struct client *client, unsigned int feature_idx)
                features |= imap_feature_condstore;
 
        if ((client->enabled_features & features) == features)
-               return 0;
+               return;
 
        client->enabled_features |= features;
        if (client->mailbox == NULL)
-               return 0;
+               return;
 
        ret = mailbox_enable(client->mailbox, features);
        if (ret == 0 && !had_condstore &&
@@ -1481,7 +1481,6 @@ int client_enable(struct client *client, unsigned int feature_idx)
                client_send_untagged_storage_error(client,
                        mailbox_get_storage(client->mailbox));
        }
-       return ret;
 }
 
 bool client_has_enabled(struct client *client, unsigned int feature_idx)
index dbad74155b99c909ae13b3bfb16a68bad6956fe8..d8ed67734fe5f1df6726cf81320e4c36b9354bff 100644 (file)
@@ -305,7 +305,7 @@ bool client_read_string_args(struct client_command_context *cmd,
    have to wait for an existing SEARCH SAVE to finish. */
 bool client_handle_search_save_ambiguity(struct client_command_context *cmd);
 
-int client_enable(struct client *client, unsigned int feature_idx);
+void client_enable(struct client *client, unsigned int feature_idx);
 /* Returns TRUE if the given feature is enabled */
 bool client_has_enabled(struct client *client, unsigned int feature_idx);
 /* Returns mailbox features that are currently enabled. */
index ea5c00c8c9437b9a7dc1e550fd60abfd3c070b3d..ed1c51211c34c1484b9cca6c2e902acc6a4808c8 100644 (file)
@@ -870,7 +870,7 @@ bool imap_fetch_modseq_init(struct imap_fetch_init_context *ctx)
                ctx->error = "FETCH MODSEQ can't be used with non-permanent modseqs";
                return FALSE;
        }
-       (void)client_enable(ctx->fetch_ctx->client, imap_feature_condstore);
+       client_enable(ctx->fetch_ctx->client, imap_feature_condstore);
        imap_fetch_add_handler(ctx, IMAP_FETCH_HANDLER_FLAG_BUFFERED,
                               NULL, fetch_modseq, NULL);
        return TRUE;
index 521f3adc4d3522f634523e3d7f3bc1758ac2e01b..5a5372fd93c9616d5e6ae45f45a1baebf7b9eac2 100644 (file)
@@ -576,7 +576,7 @@ bool imap_search_start(struct imap_search_context *ctx,
 
        if (ctx->have_modseqs) {
                ctx->return_options |= SEARCH_RETURN_MODSEQ;
-               (void)client_enable(cmd->client, imap_feature_condstore);
+               client_enable(cmd->client, imap_feature_condstore);
        }
 
        ctx->box = cmd->client->mailbox;
index 5ab3958346670c4b906eda2b33f13c2e2bfc50e3..93a2b372f34c2428a16a08db276b61e14795e61d 100644 (file)
@@ -79,7 +79,7 @@ int imap_status_get(struct client_command_context *cmd,
        }
 
        if ((items->status & STATUS_HIGHESTMODSEQ) != 0)
-               (void)client_enable(client, imap_feature_condstore);
+               client_enable(client, imap_feature_condstore);
 
        ret = mailbox_get_status(box, items->status, &result_r->status);
        if (items->metadata != 0 && ret == 0) {