X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=functions%2Fmailbox_display.php;h=30d36f7133934689716f521cafb03ec67f9f982b;hp=6f8a248658ec209e21ffe749016366948d8abaef;hb=fc60dc76838c279329fe080c69bec540af5d6d83;hpb=5bba30b514be8bee857af4237e28c52a9e916948 diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index 6f8a2486..30d36f71 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -73,11 +73,13 @@ function printMessageInfo($imapConnection, $t, $not_last=true, $key, $mailbox, if (handleAsSent($mailbox)) { $msg['FROM'] = $msg['TO']; } + $msg['FROM'] = parseAddress($msg['FROM']); + /* * This is done in case you're looking into Sent folders, * because you can have multiple receivers. */ - + $senderNames = $msg['FROM']; $senderName = ''; if (sizeof($senderNames)){ @@ -91,11 +93,11 @@ function printMessageInfo($imapConnection, $t, $not_last=true, $key, $mailbox, $senderName .= htmlspecialchars($senderNames_part[0]); } } - } - - $subject_full = decodeHeader($msg['SUBJECT']); - $subject = processSubject($subject_full, $indent_array[$msg['ID']]); + } + $msg['SUBJECT'] = decodeHeader($msg['SUBJECT']); + $subject = processSubject($msg['SUBJECT'], $indent_array[$msg['ID']]); + echo html_tag( 'tr','','','','VALIGN="top"') . "\n"; if (isset($msg['FLAG_FLAGGED']) && ($msg['FLAG_FLAGGED'] == true)) { @@ -132,34 +134,40 @@ function printMessageInfo($imapConnection, $t, $not_last=true, $key, $mailbox, } else { $searchstr = ''; } - /** - * AAAAH! Make my eyes stop bleeding! - * Who wrote this?! - */ - if (is_array($message_highlight_list) && count($message_highlight_list)){ + + if (is_array($message_highlight_list) && count($message_highlight_list)) { + $msg['TO'] = parseAddress($msg['TO']); + $msg['CC'] = parseAddress($msg['CC']); foreach ($message_highlight_list as $message_highlight_list_part) { if (trim($message_highlight_list_part['value']) != '') { $high_val = strtolower($message_highlight_list_part['value']); $match_type = strtoupper($message_highlight_list_part['match_type']); - if ($match_type == 'TO_CC') { - foreach ($msg['TO'] as $address) { - if (strstr('^^' . strtolower($address[0]), $high_val) || - strstr('^^' . strtolower($address[1]), $high_val)) { - $hlt_color = $message_highlight_list_part['color']; - continue; - } - } - foreach ($msg['CC'] as $address) { - if( strstr('^^' . strtolower($address[0]), $high_val) || - strstr('^^' . strtolower($address[1]), $high_val)) { - $hlt_color = $message_highlight_list_part['color']; - continue; - } - } + if($match_type == 'TO_CC') { + $match = array('TO', 'CC'); } else { - if (strstr('^^' . strtolower($msg[$match_type]), $high_val)) { - $hlt_color = $message_highlight_list_part['color']; - continue; + $match = array($match_type); + } + foreach($match as $match_type) { + switch($match_type) { + case('TO'): + case('CC'): + case('FROM'): + foreach ($msg[$match_type] as $address) { + $address[0] = decodeHeader($address[0]); + $address[1] = decodeHeader($address[1]); + if (strstr('^^' . strtolower($address[0]), $high_val) || + strstr('^^' . strtolower($address[1]), $high_val)) { + $hlt_color = $message_highlight_list_part['color']; + break 4; + } + } + break; + default: + if (strstr('^^' . strtolower($msg[$match_type]), $high_val)) { + $hlt_color = $message_highlight_list_part['color']; + break 3; + } + break; } } } @@ -209,11 +217,11 @@ function printMessageInfo($imapConnection, $t, $not_last=true, $key, $mailbox, $td_str .= ''; - $t = elapsed($start); + //$t = elapsed($start); //echo("elapsed time = $t seconds\n"); } @@ -506,8 +528,8 @@ function calc_msort($msgs, $sort) { return $msort; } -function fillMessageArray($imapConnection, $id, $count) { - return sqimap_get_small_header_list($imapConnection, $id); +function fillMessageArray($imapConnection, $id, $count, $show_num=false) { + return sqimap_get_small_header_list($imapConnection, $id, $show_num); } @@ -806,7 +828,7 @@ function printHeader($mailbox, $sort, $color, $showsort=true) { echo "\n"; break; case 6: /* size */ - echo html_tag( 'td', '' . _("Size") . '', 'center', '', 'width="5%"' ); + echo html_tag( 'td', '' . _("Size") . '', 'center', '', 'width="5%" nowrap' ); break; } } @@ -1234,4 +1256,5 @@ function handleAsSent($mailbox) { /* And return the result. */ return $handleAsSent_result; } + ?>