fix for bug #511673
authorjmunro <jmunro@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 2 Apr 2002 06:47:48 +0000 (06:47 +0000)
committerjmunro <jmunro@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 2 Apr 2002 06:47:48 +0000 (06:47 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2664 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_messages.php

index 1835bdb35cf4bfa68028adea84f16a5e1f7e1162..18b89234fdcbefae11c24c8f0cacaf0220171760 100755 (executable)
@@ -97,7 +97,10 @@ function get_reference_header ($imap_stream, $message) {
  */
  
 function sqimap_get_sort_order ($imap_stream, $sort) {
-    global  $default_charset, $thread_sort_messages, $internal_date_sort, $server_sort_array;
+    global  $default_charset, $thread_sort_messages,
+            $internal_date_sort, $server_sort_array,
+            $sent_folder, $mailbox;
+            
     if (session_is_registered('server_sort_array')) {
         session_unregister('server_sort_array');
     }
@@ -118,6 +121,10 @@ function sqimap_get_sort_order ($imap_stream, $sort) {
         $sort_on[0] = 'ARRIVAL';
         $sort_on[1] = 'ARRIVAL';
     }
+    if ($sent_folder == $mailbox) {
+        $sort_on[2] = 'TO';
+        $sort_on[3] = 'TO';
+    }
     if (!empty($sort_on[$sort])) {
         $sort_query = "$sid SORT ($sort_on[$sort]) ".strtoupper($default_charset)." ALL\r\n";
         fputs($imap_stream, $sort_query);
@@ -134,8 +141,8 @@ function sqimap_get_sort_order ($imap_stream, $sort) {
 }
        
 /* returns an indent array for printMessageinfo()
-   this represents the amount of indent needed
-   for this message number
+   this represents the amount of indent needed (value)
+   for this message number (key)
 */
 
 function get_parent_level ($imap_stream) {