From 266fe27532056925949d233bd048c6ac0803bdab Mon Sep 17 00:00:00 2001 From: oricn Date: Fri, 30 Jun 2000 14:44:13 +0000 Subject: [PATCH] Added X-Priority Detection Now puts a "!" in the coloum after Date if the message has an X-Priority value of "1" Highest. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@573 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_messages.php | 10 +++++++--- functions/mailbox_display.php | 6 +++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/functions/imap_messages.php b/functions/imap_messages.php index a2fce07c..28af7026 100755 --- a/functions/imap_messages.php +++ b/functions/imap_messages.php @@ -41,15 +41,16 @@ ** Returns some general header information -- FROM, DATE, and SUBJECT ******************************************************************************/ class small_header { - var $from, $subject, $date, $to; + var $from, $subject, $date, $to, $priority; } function sqimap_get_small_header ($imap_stream, $id, $sent) { - fputs ($imap_stream, "a001 FETCH $id BODY.PEEK[HEADER.FIELDS (Date To From Subject)]\r\n"); + fputs ($imap_stream, "a001 FETCH $id BODY.PEEK[HEADER.FIELDS (Date To From Subject X-Priority)]\r\n"); $read = sqimap_read_data ($imap_stream, "a001", true, $response, $message); $subject = _("(no subject)"); $from = _("Unknown Sender"); + $priority = "0"; $g = 0; for ($i = 0; $i < count($read); $i++) { if (eregi ("^to:", $read[$i])) { @@ -58,6 +59,9 @@ if (eregi ("^from:", $read[$i])) { $from = sqimap_find_displayable_name(substr($read[$i], 5)); } + if (eregi ("^x-priority:", $read[$i])) { + $priority = trim(substr($read[$i], 11)); + } if (eregi ("^date:", $read[$i])) { $date = substr($read[$i], 5); } else if (eregi ("^subject:", $read[$i])) { @@ -75,7 +79,7 @@ $header->date = $date; $header->subject = $subject; $header->to = $to; - + $header->priority = $priority; return $header; } diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index 5d95cdfe..217a6319 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -8,7 +8,7 @@ ** **/ - $mailbox_info = true; + $mailbox_display_php = true; function printMessageInfo($imapConnection, $t, $i, $key, $mailbox, $sort, $startMessage) { global $color, $msgs, $msort; @@ -39,6 +39,7 @@ echo " $italic$bold$flag$senderName$flag_end$bold_end$italic_end\n"; echo "
$bold$flag".$msg["DATE_STRING"]."$flag_end$bold_end
\n"; if ($msg["FLAG_ANSWERED"] == true) echo " A"; + elseif ($msg["PRIORITY"] == 1) echo " !"; else echo "  "; echo " $bold$flag$subject$flag_end$bold_end\n"; @@ -65,6 +66,7 @@ $date[$q] = $hdr->date; $subject[$q] = $hdr->subject; $to[$q] = $hdr->to; + $priority[$q] = $hdr->priority; $flags[$q] = sqimap_get_flags ($imapConnection, $q+1); } @@ -81,6 +83,7 @@ $messages[$j]["FROM"] = decodeHeader($from[$j]); $messages[$j]["SUBJECT"] = decodeHeader($subject[$j]); $messages[$j]["TO"] = decodeHeader($to[$j]); + $messages[$j]["PRIORITY"] = $priority[$j]; $num = 0; while ($num < count($flags[$j])) { @@ -275,6 +278,7 @@ next($msort); $k++; } while (isset ($key) && ($k < $i)); + echo $key; printMessageInfo($imapConnection, $t, $i, $key, $mailbox, $sort, $startMessage); } else { $i = $startMessage; -- 2.25.1