support user option sort by internal date
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 15 Mar 2002 11:55:57 +0000 (11:55 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 15 Mar 2002 11:55:57 +0000 (11:55 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2586 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_messages.php

index 3452214..a411f68 100755 (executable)
@@ -89,7 +89,7 @@ function sqimap_message_list_squisher($messages_array) {
 }   
 
 function sqimap_get_small_header_list ($imap_stream, $msg_list, $issent) {
-    global $squirrelmail_language, $color;
+    global $squirrelmail_language, $color, $data_dir, $username;
 
     /* Get the small headers for each message in $msg_list */
     $sid = sqimap_session_id();
@@ -205,7 +205,8 @@ function sqimap_get_small_header_list ($imap_stream, $msg_list, $issent) {
                 }
             }
         }
-        if (trim($date) == "") {
+       $internaldate = getPref($data_dir, $username, 'internal_date_sort');
+        if (trim($date) == "" || $internaldate) {
             fputs($imap_stream, "$sid FETCH $msg_list[$msgi] INTERNALDATE\r\n");
             $readdate = sqimap_read_data($imap_stream, $sid, true, $response, $message);
             if (eregi(".*INTERNALDATE \"(.*)\".*", $readdate[0], $regs)) {