summaryrefslogtreecommitdiff
path: root/program/steps/mail/list.inc
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2014-01-16 14:17:08 +0100
committerThomas Bruederli <thomas@roundcube.net>2014-01-16 14:17:08 +0100
commit2baeac116abef9d5bcb748c687577d16dce868a0 (patch)
tree448611cf8b0fdc435d6456350b6f831cb6fdbb92 /program/steps/mail/list.inc
parent25a244908b21b097f744c7194e4862ca6ebda391 (diff)
Fix sorting and paging in cross-folder searches
Diffstat (limited to 'program/steps/mail/list.inc')
-rw-r--r--program/steps/mail/list.inc16
1 files changed, 16 insertions, 0 deletions
diff --git a/program/steps/mail/list.inc b/program/steps/mail/list.inc
index 277564c38..4b2a955b7 100644
--- a/program/steps/mail/list.inc
+++ b/program/steps/mail/list.inc
@@ -75,6 +75,22 @@ if (!empty($_REQUEST['_search']) && isset($_SESSION['search'])
&& $_SESSION['search_request'] == $_REQUEST['_search']
) {
$_SESSION['search'] = $RCMAIL->storage->get_search_set();
+
+ // multi-folder search
+ if ($_SESSION['search'][1]->multi) {
+ if (empty($cols))
+ $cols = $_SESSION['list_attrib']['columns'] ? $_SESSION['list_attrib']['columns'] : (array)$CONFIG['list_cols'];
+ if (!in_array('folder', $cols))
+ $cols[] = 'folder'; // Add 'folder' column to list
+
+ // make message UIDs unique by appending the folder name
+ foreach ($a_headers as $i => $header) {
+ $header->uid .= '-'.$header->folder;
+ $header->flags['skip_mbox_check'] = true;
+ if ($header->parent_uid)
+ $header->parent_uid .= '-'.$header->folder;
+ }
+ }
}
// remove old search data
else if (empty($_REQUEST['_search']) && isset($_SESSION['search'])) {