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 <tb@woodcrest.local>2013-10-09 17:12:30 +0200
commit9e63cd5f24defa521724dfe3dcbbaa4385761836 (patch)
tree9e089f565808323f66ff10eb6d78f133ed859f5a /program/steps/mail/search.inc
parentf540f86d19ae1d374ba3c78fe11eaf3f771af150 (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 fb1b48797..0632b042a 100644
--- a/program/steps/mail/search.inc
+++ b/program/steps/mail/search.inc
@@ -126,9 +126,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')));
}