Skip to content

Commit

Permalink
include source folder name in message details when multi folder searc…
Browse files Browse the repository at this point in the history
…h active
  • Loading branch information
johndoh committed Mar 25, 2023
1 parent be15058 commit 2833367
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion program/actions/mail/show.php
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ public static function message_headers($attrib, $headers = null)

// show these headers
$standard_headers = ['subject', 'from', 'sender', 'to', 'cc', 'bcc', 'replyto',
'mail-reply-to', 'mail-followup-to', 'date', 'priority'];
'mail-reply-to', 'mail-followup-to', 'date', 'priority', 'folder'];
$exclude_headers = !empty($attrib['exclude']) ? explode(',', $attrib['exclude']) : [];
$output_headers = [];

Expand Down Expand Up @@ -512,6 +512,20 @@ public static function message_headers($attrib, $headers = null)
else if ($hkey == 'subject' && empty($value)) {
$header_value = $rcmail->gettext('nosubject');
}
else if ($hkey == 'folder') {
if (empty($_REQUEST['_search'])) {
continue;
}

$search_set = $rcmail->storage->get_search_set();
$multifolder = $search_set && !empty($search_set[1]->multi);
if ($multifolder) {
$mbox_name = $rcmail->storage->get_folder();
$delimiter = $rcmail->storage->get_hierarchy_delimiter();
$header_value = self::localize_foldername($mbox_name, true);
$header_value = str_replace($delimiter, " \xC2\xBB ", $header_value);
}
}
else {
$value = is_array($value) ? implode(' ', $value) : $value;
$header_value = trim(rcube_mime::decode_header($value, $charset));
Expand Down

0 comments on commit 2833367

Please sign in to comment.