From 0bbc11858a29a9a5df38ee7dbeb9ff501423cb71 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 5 May 2023 08:54:58 +0200 Subject: [PATCH] By default subscribe to new non-mail folders --- plugins/kolab_folders/kolab_folders.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/plugins/kolab_folders/kolab_folders.php b/plugins/kolab_folders/kolab_folders.php index 369bf26e..f2d30520 100644 --- a/plugins/kolab_folders/kolab_folders.php +++ b/plugins/kolab_folders/kolab_folders.php @@ -325,7 +325,7 @@ class kolab_folders extends rcube_plugin $subtype = trim(rcube_utils::get_input_value('_subtype', rcube_utils::INPUT_POST)); $mbox = $args['record']['name']; $old_mbox = $args['record']['oldname'] ?? null; - $subscribe = $args['record']['subscribe']; + $subscribe = $args['record']['subscribe'] ?? true; if (empty($ctype)) { return $args; @@ -360,11 +360,8 @@ class kolab_folders extends rcube_plugin // Create folder if (!strlen($old_mbox)) { - // By default don't subscribe to non-mail folders - if ($subscribe) - $subscribe = (bool) preg_match('/^mail/', $ctype); - $result = $storage->create_folder($mbox, $subscribe); + // Set folder type if ($result) { $this->set_folder_type($mbox, $ctype);