From e5b8fc824dfc8565c7c58e46d93f78b071af72d0 Mon Sep 17 00:00:00 2001 From: lkehresman Date: Fri, 24 Mar 2000 23:21:14 +0000 Subject: [PATCH] fixed bug with unseen messages git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@337 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- TODO | 8 ++++++-- functions/imap_messages.php | 29 +++++++++++++---------------- functions/mailbox_display.php | 6 +++--- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/TODO b/TODO index 699832c5..146b674a 100644 --- a/TODO +++ b/TODO @@ -3,8 +3,6 @@ Ideas to be implemented initials = taken by that person -(lme) Saving sent mail into folder "Sent" - - POP suport (maybe) - LDAP support for address books - Importing of address books - Better email message body parsing @@ -20,3 +18,9 @@ initials = taken by that person (lme) Fix "Seen" bug with UW IMAP server - Add "subscribe" to folders section. - Make Location redirects absolute rather than relative (index.php) + - POP suport (maybe) + + +Finished: +------------------------------------------------------ + (lme) Saving sent messages diff --git a/functions/imap_messages.php b/functions/imap_messages.php index 1b66ba23..57bc8fe3 100755 --- a/functions/imap_messages.php +++ b/functions/imap_messages.php @@ -33,13 +33,14 @@ function sqimap_messages_flag ($imap_stream, $start, $end, $flag) { fputs ($imap_stream, "a001 STORE $start:$end +FLAGS (\\$flag)\r\n"); $read = sqimap_read_data ($imap_stream, "a001", true, $response, $message); + } /****************************************************************************** ** Returns some general header information -- FROM, DATE, and SUBJECT ******************************************************************************/ function sqimap_get_small_header ($imap_stream, $id, &$from, &$subject, &$date) { - fputs ($imap_stream, "a001 FETCH $id:$id BODY[HEADER.FIELDS (From Subject Date)]\r\n"); + fputs ($imap_stream, "a001 FETCH $id:$id RFC822.HEADER.LINES (From Subject Date)\r\n"); $read = sqimap_read_data ($imap_stream, "a001", true, $response, $message); for ($i = 0; $i < count($read); $i++) { @@ -58,22 +59,18 @@ /****************************************************************************** ** Returns the flags for the specified messages ******************************************************************************/ - function sqimap_get_flags ($imap_stream, $start, $end) { - fputs ($imap_stream, "a001 FETCH $start:$end FLAGS\r\n"); + function sqimap_get_flags ($imap_stream, $i) { + fputs ($imap_stream, "a001 FETCH $i:$i FLAGS\r\n"); $read = sqimap_read_data ($imap_stream, "a001", true, $response, $message); - $i = 0; - while ($i < count($read)) { - if (strpos($read[$i], "FLAGS")) { - $tmp = ereg_replace("\(", "", $read[$i]); - $tmp = ereg_replace("\)", "", $tmp); - $tmp = str_replace("\\", "", $tmp); - $tmp = substr($tmp, strpos($tmp, "FLAGS")+6, strlen($tmp)); - $tmp = trim($tmp); - $flags[$i] = explode(" ", $tmp); - } else { - $flags[$i][0] = "None"; - } - $i++; + if (strpos($read[0], "FLAGS")) { + $tmp = ereg_replace("\(", "", $read[0]); + $tmp = ereg_replace("\)", "", $tmp); + $tmp = str_replace("\\", "", $tmp); + $tmp = substr($tmp, strpos($tmp, "FLAGS")+6, strlen($tmp)); + $tmp = trim($tmp); + $flags = explode(" ", $tmp); + } else { + $flags[0] = "None"; } return $flags; } diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index 2130cd2e..612a1562 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -20,12 +20,12 @@ if ($seen == false) { echo " \n"; echo " $senderName\n"; - echo "
$dateString
\n"; + echo "
$dateString
\n"; echo " $subject\n"; } else { echo " \n"; echo " $senderName\n"; - echo "
$dateString
\n"; + echo "
$dateString
\n"; echo " $subject\n"; } echo "\n"; @@ -43,8 +43,8 @@ $from[$q] = $f; $date[$q] = $d; $subject[$q] = $s; + $flags[$q] = sqimap_get_flags ($imapConnection, $q+1); } - $flags = sqimap_get_flags ($imapConnection, 1, $numMessages); } $j = 0; -- 2.25.1