Skip to content

Commit 6b87c7d

Browse files
committed
fix(backend): add session cache configuration and improve folder label retrieval logic
1 parent 345c5f5 commit 6b87c7d

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

config/app.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,9 @@
434434
| 'cache_class' => env('CACHE_CLASS')
435435
*/
436436

437+
'allow_session_cache' => env('ALLOW_SESSION_CACHE', false),
437438

439+
'cache_class' => env('CACHE_CLASS'),
438440
/*
439441
| -------------
440442
| Redis Support

modules/imap/handler_modules.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,12 @@ public function process() {
565565

566566
$mailbox = Hm_IMAP_List::get_mailbox_without_connection($details);
567567
$label = $mailbox->get_folder_name($folder);
568+
if(!$label) {
569+
$paths = explode("_", $path);
570+
$short_path = $paths[0] . "_" . $paths[1] . "_";
571+
$cached_folders = $this->cache->get('imap_folders_'.$short_path, true);
572+
$label = !empty($cached_folders[$folder]['name']) ? $cached_folders[$folder]['name'] : '';
573+
}
568574
$title = array(strtoupper($details['type'] ?? 'IMAP'), $details['name'], $label);
569575
if ($this->get('list_page', 0)) {
570576
$title[] = sprintf('Page %d', $this->get('list_page', 0));

0 commit comments

Comments
 (0)