From 3b8fe16c6c92c04070b81018f8860868dea52289 Mon Sep 17 00:00:00 2001 From: stekkel Date: Sun, 12 Feb 2006 18:24:50 +0000 Subject: [PATCH] small thread code correction git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@10736 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_messages.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/functions/imap_messages.php b/functions/imap_messages.php index f9e0e16e..f16b5d2b 100755 --- a/functions/imap_messages.php +++ b/functions/imap_messages.php @@ -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; } -- 2.25.1