[Hastymail-cvs] hastymail/lib imap.php,1.176,1.177
Brought to you by:
sailfrog,
slushpupie
From: <sai...@us...> - 2003-05-26 05:57:03
|
Update of /cvsroot/hastymail/hastymail/lib In directory sc8-pr-cvs1:/tmp/cvs-serv28621/lib Modified Files: imap.php Log Message: converted another notice message, working on the client side sorting a bit Index: imap.php =================================================================== RCS file: /cvsroot/hastymail/hastymail/lib/imap.php,v retrieving revision 1.176 retrieving revision 1.177 diff -u -d -r1.176 -r1.177 --- imap.php 25 May 2003 06:40:45 -0000 1.176 +++ imap.php 26 May 2003 05:57:00 -0000 1.177 @@ -159,6 +159,7 @@ $mailbox = the folder we are sorting */ function hm_client_side_sort($imap_stream, $mailbox, $sort_type) { + $reverse = false; $sort_keys = array(); $value = ''; $cont = false; @@ -166,6 +167,7 @@ switch ($sort_type) { case 'DATE': $command .= "BODY.PEEK[HEADER.FIELDS (DATE)]\r\n"; + $reverse = true; break; case 'R_DATE': $command .= "BODY.PEEK[HEADER.FIELDS (DATE)]\r\n"; @@ -175,9 +177,11 @@ break; case 'R_SIZE': $command .= "RFC822.SIZE\r\n"; + $reverse = true; break; case 'ARRIVAL': $command .= "INTERNALDATE\r\n"; + $reverse = true; break; case 'R_ARRIVAL': $command .= "INTERNALDATE\r\n"; @@ -187,15 +191,18 @@ break; case 'R_FROM': $command .= "BODY.PEEK[HEADER.FIELDS (FROM)]\r\n"; + $reverse = true; break; case 'SUBJECT': $command .= "BODY.PEEK[HEADER.FIELDS (SUBJECT)]\r\n"; break; case 'R_SUBJECT': $command .= "BODY.PEEK[HEADER.FIELDS (SUBJECT)]\r\n"; + $reverse = true; break; default: $command .= "INTERNALDATE\r\n"; + $reverse = true; break; } fputs($imap_stream, $command); @@ -277,8 +284,7 @@ foreach ($sort_keys as $key => $value) { $sorted_array[] = $key; } - if ($sort_type == 'DATE' || $sort_type == 'ARRIVAL' || $sort_type == 'R_SUBJECT' - || $sort_type == 'R_FROM' || $sort_type == 'R_SIZE') { + if ($reverse) { $sorted_array = array_reverse($sorted_array); } if (isset($_SESSION['settings']['page_count']) && |