Added X-Priority Detection Now puts a "!" in the coloum after Date if the message...
authororicn <oricn@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 30 Jun 2000 14:44:13 +0000 (14:44 +0000)
committeroricn <oricn@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 30 Jun 2000 14:44:13 +0000 (14:44 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@573 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_messages.php
functions/mailbox_display.php

index a2fce07cdfb4a58d6a893ed54510f4f2035f7e38..28af70265ef2ba9488da2824c65b05be95fad333 100755 (executable)
     **  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;
    }
 
index 5d95cdfeb1f09a58c578c6977a678ea95e7ecf51..217a6319d7d898a6ce7d91bcabd477f2221ace7e 100644 (file)
@@ -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 "   <td width=30% bgcolor=$hlt_color>$italic$bold$flag$senderName$flag_end$bold_end$italic_end</td>\n";
       echo "   <td nowrap width=1% bgcolor=$hlt_color><center>$bold$flag".$msg["DATE_STRING"]."$flag_end$bold_end</center></td>\n";
                if ($msg["FLAG_ANSWERED"] == true) echo "   <td bgcolor=$hlt_color width=1%><b><small>A</small></b></td>";
+               elseif ($msg["PRIORITY"] == 1) echo "   <td bgcolor=$hlt_color width=1%><b><small>!</small></b></td>";
                else    echo "   <td bgcolor=$hlt_color width=1%>&nbsp;</td>";
       echo "   <td bgcolor=$hlt_color width=%>$bold<a href=\"read_body.php?mailbox=$urlMailbox&passed_id=".$msg["ID"]."&startMessage=$startMessage&show_more=0\">$flag$subject$flag_end</a>$bold_end</td>\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])) {
             next($msort);
             $k++;
          } while (isset ($key) && ($k < $i));
+       echo $key;
          printMessageInfo($imapConnection, $t, $i, $key, $mailbox, $sort, $startMessage);
       } else {
          $i = $startMessage;