From 436d7f4e5fab503d787f60fad8aeaf4d6c7a679a Mon Sep 17 00:00:00 2001 From: alex-brainstorm Date: Tue, 11 Nov 2003 00:35:06 +0000 Subject: [PATCH] Take the thread type user setting in account git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@6140 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_asearch.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/functions/imap_asearch.php b/functions/imap_asearch.php index b986dbc8..a742296b 100644 --- a/functions/imap_asearch.php +++ b/functions/imap_asearch.php @@ -605,13 +605,14 @@ function sqimap_asearch_get_sub_mailboxes($cur_mailbox, $mboxes_array) * @global integer $sort sm internal sort order * @global bool $allow_thread_sort comes from config.php * @global bool $thread_sort_messages does it really need to global? + * @global integer $sort_by_ref thread by references * @global string $data_dir * @global string $username * @return array $mbox_msgs array(mailbox => array(UIDs)) */ function sqimap_asearch($imapConnection, $mailbox_array, $biop_array, $unop_array, $where_array, $what_array, $exclude_array, $sub_array, $mboxes_array) { - global $allow_server_sort, $sort, $allow_thread_sort, $thread_sort_messages; + global $allow_server_sort, $sort, $allow_thread_sort, $thread_sort_messages, $sort_by_ref; global $data_dir, $username; $search_charset = sqimap_asearch_get_charset(); @@ -636,7 +637,10 @@ function sqimap_asearch($imapConnection, $mailbox_array, $biop_array, $unop_arra sqimap_mailbox_select($imapConnection, $cur_mailbox); $thread_sort_messages = $allow_thread_sort && getPref($data_dir, $username, 'thread_' . $cur_mailbox); if ($thread_sort_messages) { - $thread_algorithm = 'REFERENCES'; + if ($sort_by_ref == 1) + $thread_algorithm = 'REFERENCES'; + else + $thread_algorithm = 'ORDEREDSUBJECT'; $found_msgs = sqimap_run_thread($imapConnection, $search_string, $search_charset, $thread_algorithm); } else -- 2.25.1