From 566747af00ae413c942a7c6702e24c044af36f17 Mon Sep 17 00:00:00 2001 From: Thomas Date: Mon, 14 Oct 2013 21:57:53 +0200 Subject: First attempt to search in multiple folders; do it multi-threaded using pthreads if available --- program/steps/mail/search.inc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'program/steps/mail/search.inc') diff --git a/program/steps/mail/search.inc b/program/steps/mail/search.inc index 9f4cdc9c9..9b5aa2fc1 100644 --- a/program/steps/mail/search.inc +++ b/program/steps/mail/search.inc @@ -106,6 +106,9 @@ if (!empty($subject)) { $search_str = trim($search_str); $sort_column = rcmail_sort_column(); +// TEMPORARY: search all folders +$mboxes = $RCMAIL->storage->list_folders_subscribed('', '*', 'mail'); + // execute IMAP search if ($search_str) { $RCMAIL->storage->search($mbox, $search_str, $imap_charset, $sort_column); @@ -128,17 +131,20 @@ $result_h = $RCMAIL->storage->list_messages($mbox, 1, $sort_column, rcmail_sort_ $count = $RCMAIL->storage->count($mbox, $RCMAIL->storage->get_threading() ? 'THREADS' : 'ALL'); // Add 'folder' column to list -if ($multi_folder_search) { +if ($_SESSION['search'][1]->multi) { $a_show_cols = $_SESSION['list_attrib']['columns'] ? $_SESSION['list_attrib']['columns'] : (array)$CONFIG['list_cols']; - if (!in_array($a_show_cols)) + if (!in_array('folder', $a_show_cols)) $a_show_cols[] = 'folder'; // make message UIDs unique by appending the folder name foreach ($result_h as $i => $header) { $header->uid .= '-'.$header->folder; + $header->flags['skip_mbox_check'] = true; if ($header->parent_uid) $header->parent_uid .= '-'.$header->folder; } + + $OUTPUT->command('select_folder', ''); } // Make sure we got the headers -- cgit v1.2.3