]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imapc: imapc_untagged_list() - Handle the \Subscribed flag
authorMarco Bettini <marco.bettini@open-xchange.com>
Mon, 14 Jul 2025 10:02:53 +0000 (10:02 +0000)
committerMarco Bettini <marco.bettini@open-xchange.com>
Mon, 14 Jul 2025 10:23:21 +0000 (10:23 +0000)
These are especially needed in the following change that uses LIST (SUBSCRIBED)

src/lib-storage/index/imapc/imapc-list.c

index b40eddf01116e08ac26078e947e7d278a41fa6a7..3eb3dfc63f34c5eef68f3272fdadb0ee95b3b312 100644 (file)
@@ -272,7 +272,15 @@ static void imapc_untagged_list(const struct imapc_untagged_reply *reply,
                list->root_sep = sep == NULL ? '/' : sep[0];
                mailbox_tree_set_separator(list->mailboxes, list->root_sep);
        } else {
-               (void)imapc_list_update_tree(list, list->mailboxes, args);
+               struct mailbox_node *node =
+                       imapc_list_update_tree(list, list->mailboxes, args);
+               if (node != NULL && (node->flags & MAILBOX_SUBSCRIBED) != 0) {
+                       struct mailbox_tree_context *tree =
+                               list->tmp_subscriptions != NULL ?
+                               list->tmp_subscriptions :
+                               list->list.subscriptions;
+                       (void)imapc_list_update_tree(list, tree, args);
+               }
        }
 }