summaryrefslogtreecommitdiff
path: root/program/steps/mail/search.inc
diff options
context:
space:
mode:
authorThomas <tb@woodcrest.local>2013-10-09 17:12:30 +0200
committerThomas Bruederli <thomas@roundcube.net>2014-01-16 11:32:47 +0100
commit9684dc018f68b037e8ee369e7ed08f4c760fe736 (patch)
tree2e14b585c996e2daf61b7d5da87ff3123fa6ff7e /program/steps/mail/search.inc
parent628706acdcb973154161b5862c30ce706a08455a (diff)
Support globally unique message UIDs with IMAP folder name appended
Diffstat (limited to 'program/steps/mail/search.inc')
-rw-r--r--program/steps/mail/search.inc16
1 files changed, 15 insertions, 1 deletions
diff --git a/program/steps/mail/search.inc b/program/steps/mail/search.inc
index a80887254..9f4cdc9c9 100644
--- a/program/steps/mail/search.inc
+++ b/program/steps/mail/search.inc
@@ -127,9 +127,23 @@ $_SESSION['search_request'] = $search_request;
$result_h = $RCMAIL->storage->list_messages($mbox, 1, $sort_column, rcmail_sort_order());
$count = $RCMAIL->storage->count($mbox, $RCMAIL->storage->get_threading() ? 'THREADS' : 'ALL');
+// Add 'folder' column to list
+if ($multi_folder_search) {
+ $a_show_cols = $_SESSION['list_attrib']['columns'] ? $_SESSION['list_attrib']['columns'] : (array)$CONFIG['list_cols'];
+ if (!in_array($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;
+ if ($header->parent_uid)
+ $header->parent_uid .= '-'.$header->folder;
+ }
+}
+
// Make sure we got the headers
if (!empty($result_h)) {
- rcmail_js_message_list($result_h);
+ rcmail_js_message_list($result_h, false, $a_show_cols);
if ($search_str) {
$OUTPUT->show_message('searchsuccessful', 'confirmation', array('nr' => $RCMAIL->storage->count(NULL, 'ALL')));
}