Skip to content

Commit

Permalink
fix for To/From formatting in IMAP message lists
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonmunro committed Apr 6, 2017
1 parent c06f6c7 commit 6e954e1
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions modules/imap/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -2283,15 +2283,17 @@ function format_imap_message_list($msg_list, $output_module, $parent_list=false,
$subject = $msg['subject'];
if ($parent_list == 'sent') {
$icon = 'sent';
$from = preg_replace("/(\<.+\>)/U", '', $msg['to']);
$from = $msg['to'];
}
else {
$from = preg_replace("/(\<.+\>)/U", '', $msg['from']);
$from = $msg['from'];
}
$from = str_replace('"', '', $from);
$tmp_from = str_replace('"', '', $from);
$tmp_from = preg_replace("/(\<.+\>)/U", '', $tmp_from);
$nofrom = '';
if (!trim($from) && trim($msg['from'])) {
$from = $msg['from'];

if (trim($tmp_from)) {
$from = $tmp_from;
}
elseif (!trim($from) && $style == 'email') {
$from = '[No From]';
Expand All @@ -2308,19 +2310,13 @@ function format_imap_message_list($msg_list, $output_module, $parent_list=false,
}
}
if (trim($msg['x_auto_bcc']) === 'cypht') {
$from = preg_replace("/(\<.+\>)/U", '', $msg['to']);
$icon = 'sent';
}
if (stristr($msg['flags'], 'attachment')) {
$flags[] = 'attachment';
}
if (stristr($msg['flags'], 'deleted')) {
$flags[] = 'deleted';
}
if (stristr($msg['flags'], 'flagged')) {
$flags[] = 'flagged';
}
if (stristr($msg['flags'], 'answered')) {
$flags[] = 'answered';
foreach (array('attachment', 'deleted', 'flagged', 'answered') as $flag) {
if (stristr($msg['flags'], $flag)) {
$flags[] = $flag;
}
}
$source = $msg['server_name'];
$row_class .= ' '.str_replace(' ', '_', $source);
Expand Down

0 comments on commit 6e954e1

Please sign in to comment.