From 2143a648734fe631bcab8516ca8f08128dd6a735 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 30 Oct 2013 09:47:56 +0100 Subject: Performance improvement - call IMAP LIST only once --- plugins/archive/archive.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/archive/archive.php b/plugins/archive/archive.php index 4ef46e4f4..420f6918b 100644 --- a/plugins/archive/archive.php +++ b/plugins/archive/archive.php @@ -170,7 +170,9 @@ class archive extends rcube_plugin // create archive subfolder if it doesn't yet exist // we'll create all folders in the path if (!in_array($folder, $folders)) { - $list = $storage->list_folders('', $archive_folder . '*', 'mail', null, true); + if (empty($list)) { + $list = $storage->list_folders('', $archive_folder . '*', 'mail', null, true); + } $path = explode($delimiter, $folder); for ($i=0; $icreate_folder($_folder, true)) { $result['reload'] = true; + $list[] = $_folder; } } } -- cgit v1.2.3