From 9db5f5fc3c67b940d241be4dfec6e922bcc11af2 Mon Sep 17 00:00:00 2001 From: lkehresman Date: Thu, 12 Oct 2000 14:35:58 +0000 Subject: [PATCH] If a message has attachments, it is shown in the message index by putting a "+" in the flags area. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@792 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- ChangeLog | 1 + config/config_default.php | 2 +- functions/imap_messages.php | 11 ++++++++++- functions/mailbox_display.php | 21 ++++++++++++++++++--- 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index dad842bc..418a5f2e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ Version 0.6pre1 -- DEVELOPMENT ------------------------------ +- Attachments are shown in message index (shown as a "+") - Updated attachment plugin support and passing values to hooks (see plugins.txt) - Added file and message size in many locations - Made message index order customizable (from, subject, date) can be (date, from, subject) diff --git a/config/config_default.php b/config/config_default.php index b8bbcb92..116742c8 100644 --- a/config/config_default.php +++ b/config/config_default.php @@ -9,7 +9,7 @@ // // don't change - $config_version = "x53"; + $config_version = "x61"; // Organization's logo picture (blank if none) $org_logo = "../images/sm_logo.jpg"; diff --git a/functions/imap_messages.php b/functions/imap_messages.php index c0850443..f9da824d 100755 --- a/functions/imap_messages.php +++ b/functions/imap_messages.php @@ -46,7 +46,7 @@ function sqimap_get_small_header ($imap_stream, $id, $sent) { - fputs ($imap_stream, "a001 FETCH $id BODY.PEEK[HEADER.FIELDS (Date To From Cc Subject Message-Id X-Priority)]\r\n"); + fputs ($imap_stream, "a001 FETCH $id BODY.PEEK[HEADER.FIELDS (Date To From Cc Subject Message-Id X-Priority Content-Type)]\r\n"); $read = sqimap_read_data ($imap_stream, "a001", true, $response, $message); $subject = _("(no subject)"); @@ -74,7 +74,14 @@ $subject = htmlspecialchars(eregi_replace ("^subject: ", "", $read[$i])); if (trim($subject) == "") $subject = _("(no subject)"); + } else if (eregi ("^content-type:", $read[$i])) { + $type = substr($read[$i], 14); + $type = strtolower(trim($type)); + if ($pos = strpos($type, ";")) + $type = substr($type, 0, $pos); + $type = explode("/", $type); } + } // If there isn't a date, it takes the internal date and uses @@ -110,6 +117,8 @@ $header->message_id = $messageid; $header->cc = $cc; $header->size = $size; + $header->type0 = $type[0]; + $header->type1 = $type[1]; return $header; } diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index 6d29d7c5..c06adbef 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -66,9 +66,22 @@ echo " $bold$flag$subject$flag_end$bold_end\n"; break; case 5: # flags - if ($msg["FLAG_ANSWERED"] == true) echo " A\n"; - elseif (ereg("(1|2)",substr($msg["PRIORITY"],0,1))) echo " !\n"; - else echo "  \n"; + $stuff = false; + echo " \n"; + if ($msg["FLAG_ANSWERED"] == true) { + echo "A\n"; + $stuff = true; + } + if ($msg["TYPE0"] == "multipart") { + echo "+\n"; + $stuff = true; + } + if (ereg("(1|2)",substr($msg["PRIORITY"],0,1))) { + echo "!\n"; + $stuff = true; + } + if (!$stuff) echo " \n"; + echo "\n"; break; case 6: # size echo " $bold".show_readable_size($msg['SIZE'])."$bold_end\n"; @@ -109,6 +122,7 @@ $priority[$q] = $hdr->priority; $cc[$q] = $hdr->cc; $size[$q] = $hdr->size; + $type[$q] = $hdr->type0; $flags[$q] = sqimap_get_flags ($imapConnection, $q+1); } @@ -130,6 +144,7 @@ $messages[$j]["PRIORITY"] = $priority[$j]; $messages[$j]["CC"] = $cc[$j]; $messages[$j]["SIZE"] = $size[$j]; + $messages[$j]["TYPE0"] = $type[$j]; # fix SUBJECT-SORT to remove Re: if (substr($messages[$j]["SUBJECT-SORT"], 0, 3) == "re:" || -- 2.25.1