From 16530f8b571a483145ef053c9d884e23dea6c7c1 Mon Sep 17 00:00:00 2001 From: lkehresman Date: Sat, 29 Apr 2000 22:18:10 +0000 Subject: [PATCH] updated code for folder list and fixed a few bugs git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@480 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- BUG | 4 ++-- functions/imap_mailbox.php | 28 +++------------------------- functions/imap_messages.php | 4 +--- 3 files changed, 6 insertions(+), 30 deletions(-) diff --git a/BUG b/BUG index 813305fa..3364bb2e 100644 --- a/BUG +++ b/BUG @@ -1,11 +1,11 @@ Known BUGS to be fixed before 0.4pre2: ------------------------------------------------------- - - In "Sent" folder, "from" is "Unknown Sender" - - Does not delete folders correctly in UW that end in / -----------------------SQUASHED------------------------ --Fixed for 0.4pre2-- +(lme) Does not delete folders correctly in UW that end in / +(lme) In "Sent" folder, "from" is "Unknown Sender" --Fixed for 0.4pre1-- diff --git a/functions/imap_mailbox.php b/functions/imap_mailbox.php index 8a06f551..4cf6e3a6 100755 --- a/functions/imap_mailbox.php +++ b/functions/imap_mailbox.php @@ -73,18 +73,6 @@ function sqimap_unsubscribe ($imap_stream, $mailbox) { global $imap_server_type; - /** This is a hack for UW server - ** Sometimes a folder will have a / at the end. If that's the case, - ** the unsubscribe doesn't work for a box named "mailbox/". We have - ** to strip off the / at the end. There may be a better way of doing - ** this, but this is the best I've found so far. (lme - April 26, 2000) - **/ - if ($imap_server_type == "uw") { - if (substr($mailbox, -1) == "/") { - $mailbox = substr($mailbox, 0, strlen($mailbox)-1); - } - } - fputs ($imap_stream, "a001 UNSUBSCRIBE \"$mailbox\"\r\n"); $read_ary = sqimap_read_data($imap_stream, "a001", true, $response, $message); } @@ -105,12 +93,12 @@ /****************************************************************************** ** Formats a mailbox into 4 parts for the $boxes array ******************************************************************************/ - function sqimap_mailbox_parse ($line, $dm) { + function sqimap_mailbox_parse ($line, $line_lsub, $dm) { global $folder_prefix; for ($g=0; $g < count($line); $g++) { $boxes[$g]["raw"] = $line[$g]; - $mailbox = find_mailbox_name($line[$g]); + $mailbox = $line_lsub[$g]; $dm_count = countCharInString($mailbox, $dm); if (substr($mailbox, -1) == $dm) $dm_count--; @@ -132,14 +120,6 @@ if ($flags) { $boxes[$g]["flags"] = explode(" ", $flags); } - /**** I'm not sure why this was even in here to begin with.. (lme) - for ($i=0; $i < count($boxes[$g]["flags"]); $i++) { - if ($boxes[$g]["flags"][$i] == "noselect") { - $boxes[$g]["unformatted-dm"] = $boxes[$g]["unformatted-dm"].$dm; -// echo $boxes[$g]["unformatted-dm"]." - debug
"; - } - } - ****/ } return $boxes; } @@ -168,8 +148,6 @@ $lsub_ary = sqimap_read_data ($imap_stream, "a001", true, $response, $message); for ($i=0;$i < count($lsub_ary); $i++) { $sorted_lsub_ary[$i] = find_mailbox_name($lsub_ary[$i]); - if (substr($sorted_lsub_ary[$i], -1) == $dm) - $sorted_lsub_ary[$i] = substr($sorted_lsub_ary[$i], 0, strlen($sorted_lsub_ary[$i])-1); if ($sorted_lsub_ary[$i] == "INBOX") $inbox_subscribed = true; } @@ -198,7 +176,7 @@ $sorted_list_ary[count($sorted_list_ary)] = $inbox_ary[0]; } - $boxes = sqimap_mailbox_parse ($sorted_list_ary, $dm); + $boxes = sqimap_mailbox_parse ($sorted_list_ary, $sorted_lsub_ary, $dm); /** Now, lets sort for special folders **/ for ($i = 0; $i < count($boxes); $i++) { diff --git a/functions/imap_messages.php b/functions/imap_messages.php index e44424c0..9898710e 100755 --- a/functions/imap_messages.php +++ b/functions/imap_messages.php @@ -43,9 +43,7 @@ } function sqimap_get_small_header ($imap_stream, $id, $sent) { - //fputs ($imap_stream, "a001 FETCH $id BODY[HEADER.FIELDS (DATE FROM SUBJECT)]\r\n"); - //fputs ($imap_stream, "a001 FETCH $start:$end RFC822.HEADER\r\n"); - fputs ($imap_stream, "a001 FETCH $id BODY.PEEK[HEADER.FIELDS (Date From Subject)]\r\n"); + fputs ($imap_stream, "a001 FETCH $id BODY.PEEK[HEADER.FIELDS (Date To From Subject)]\r\n"); $read = sqimap_read_data ($imap_stream, "a001", true, $response, $message); $subject = _("(no subject)"); -- 2.25.1