Fix thread sorting when a UID is out of order.
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 5 Dec 2008 21:18:11 +0000 (14:18 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 5 Dec 2008 21:18:11 +0000 (14:18 -0700)
imp/lib/IMAP/Thread.php

index 760f305..14e73cf 100644 (file)
@@ -60,9 +60,7 @@ class IMP_IMAP_Thread
         $thread_level = $tree = array();
         $t = &$this->_thread;
 
-        if ($sortdir) {
-            $indices = array_reverse($indices);
-        }
+        $indices = array_intersect($t->messageList($sortdir), $indices);
 
         /* If starting in the middle of a thread, the threadLevel tree needs
          * to be built from the base of the current thread. */