]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: cmd-list - Make the list iter flags a parameter for list_send_status()
authorStephan Bosch <stephan.bosch@open-xchange.com>
Thu, 20 Feb 2025 02:44:20 +0000 (03:44 +0100)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Tue, 25 Feb 2025 11:24:51 +0000 (11:24 +0000)
Before, it was available only in the LIST command context. This is preparation
for adding infrastructure for dynamically adding support for new RETURN flags.

src/imap/cmd-list.c
src/imap/imap-list.h

index eec6fa3d24e67293fdb9dfd62f2f5ae39d867b6c..79ef22b87dd9e797e74f2ffb6c23018a41120a2b 100644 (file)
@@ -4,7 +4,6 @@
 #include "array.h"
 #include "str.h"
 #include "strescape.h"
-#include "mailbox-list-iter.h"
 #include "imap-utf7.h"
 #include "imap-quote.h"
 #include "imap-match.h"
@@ -184,6 +183,7 @@ list_send_status(struct cmd_list_context *ctx,
                 const struct imap_list_return_flag_params *params)
 {
        enum mailbox_info_flags mbox_flags = params->mbox_flags;
+       enum mailbox_list_iter_flags list_flags = params->list_flags;
        struct imap_status_result result;
 
        if ((mbox_flags & (MAILBOX_NONEXISTENT | MAILBOX_NOSELECT)) != 0) {
@@ -191,7 +191,7 @@ list_send_status(struct cmd_list_context *ctx,
                return;
        }
        if ((mbox_flags & MAILBOX_SUBSCRIBED) == 0 &&
-           (ctx->list_flags & MAILBOX_LIST_ITER_SELECT_SUBSCRIBED) != 0) {
+           (list_flags & MAILBOX_LIST_ITER_SELECT_SUBSCRIBED) != 0) {
                /* listing subscriptions, but only child is subscribed */
                i_assert((mbox_flags & MAILBOX_CHILD_SUBSCRIBED) != 0);
                return;
@@ -259,6 +259,7 @@ static bool cmd_list_continue(struct client_command_context *cmd)
                                .name = name,
                                .mutf7_name = str_c(mutf7_name),
                                .mbox_flags = flags,
+                               .list_flags = ctx->list_flags,
                        };
 
                        /* if we're listing subscriptions and there are
index f1ea12c0d368020a15cc37bf49d17e5f0380b73a..2dbbce3279bbf94c434a6ff99fae6c9708a487eb 100644 (file)
@@ -1,11 +1,14 @@
 #ifndef IMAP_LIST_H
 #define IMAP_LIST_H
 
+#include "mailbox-list-iter.h"
+
 struct imap_list_return_flag_params {
        const char *name;
        const char *mutf7_name;
 
        enum mailbox_info_flags mbox_flags;
+       enum mailbox_list_iter_flags list_flags;
        struct mail_namespace *ns;
 };