From 3bf08e4870bc05681dcf8ef4b1b8366213aeee23 Mon Sep 17 00:00:00 2001 From: tokul Date: Sun, 5 Feb 2006 11:01:35 +0000 Subject: [PATCH] update mailbox cache if new folders are created (first time login when special folders are created) git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@10644 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/left_main.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/left_main.php b/src/left_main.php index 1cab8cd0..79e41ede 100644 --- a/src/left_main.php +++ b/src/left_main.php @@ -646,11 +646,13 @@ sqgetGlobalVar('auto_create_done',$auto_create_done,SQ_SESSION); /* If requested and not yet complete, attempt to autocreate folders. */ if ($auto_create_special && !isset($auto_create_done)) { $autocreate = array($sent_folder, $trash_folder, $draft_folder); + $folders_created = false; foreach( $autocreate as $folder ) { if (($folder != '') && ($folder != 'none')) { // use $mailboxes array for checking if mailbox exists if ( !sqimap_mailbox_exists($imapConnection, $folder, $mailboxes)) { sqimap_mailbox_create($imapConnection, $folder, ''); + $folders_created = true; } else { // check for subscription is useless and expensive, just // surpress the NO response. Unless we're on Mecury, which @@ -659,6 +661,7 @@ if ($auto_create_special && !isset($auto_create_done)) { if ( strtolower($imap_server_type) != 'mercury32' || !sqimap_mailbox_is_subscribed($imapConnection, $folder) ) { sqimap_subscribe($imapConnection, $folder, false); + $folders_created = true; } } } @@ -667,6 +670,9 @@ if ($auto_create_special && !isset($auto_create_done)) { /* Let the world know that autocreation is complete! Hurrah! */ $auto_create_done = TRUE; sqsession_register($auto_create_done, 'auto_create_done'); + // reload mailbox list + if ($folders_created) + $mailboxes=sqimap_get_mailboxes($imapConnection,true,$show_only_subscribed_folders); } if ($advanced_tree) { -- 2.25.1