small thread code correction
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 12 Feb 2006 18:24:50 +0000 (18:24 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 12 Feb 2006 18:24:50 +0000 (18:24 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@10736 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_messages.php

index f9e0e16e1dbac7b3fedb2e0505c9dcc3739b62e7..f16b5d2b7ffcb3331b6f00ffc9ba4dbbac802285 100755 (executable)
@@ -400,6 +400,10 @@ function get_thread_sort($imap_stream, $search='ALL') {
             $cChar = $sThreadResponse{$i};
             switch ($cChar) {
                 case '(': // new sub thread
+                    // correction for a subthread of a thread with no parents in thread
+                    if (!count($aUidSubThread) && $j > 0) {
+                       --$l;
+                    }
                     $aDepthStack[$j] = $l;
                     ++$j;
                     break;
@@ -625,7 +629,7 @@ function sqimap_get_small_header_list($imap_stream, $msg_list,
  * @return array   $aMessageList associative array with messages. Key is the UID, value is an associative array
  * @author Marc Groot Koerkamp
  */
-function parseFetch($aResponse,$aMessageList = array()) {
+function parseFetch(&$aResponse,$aMessageList = array()) {
     for ($j=0,$iCnt=count($aResponse);$j<$iCnt;++$j) {
         $aMsg = array();
 
@@ -778,6 +782,7 @@ function parseFetch($aResponse,$aMessageList = array()) {
             $msgi = '';
        }
        $aMessageList[$msgi] = $aMsg;
+       $aResponse[$j] = NULL;
     }
     return $aMessageList;
 }