Fix reply indentation. It was an ordinary typo ;)
[squirrelmail.git] / functions / imap_messages.php
index f9e0e16e1dbac7b3fedb2e0505c9dcc3739b62e7..7f9f26309e1ffe28515337d53a20bb8380e0143a 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;
 }
@@ -918,7 +923,7 @@ function sqimap_get_message($imap_stream, $id, $mailbox) {
     if ($read) {
         if (preg_match('/.+FLAGS\s\((.*)\)\s/AUi',$read[0],$regs)) {
             if (trim($regs[1])) {
-                $flags = preg_split('/ /', $regs[1],-1,'PREG_SPLIT_NI_EMPTY');
+                $flags = preg_split('/ /', $regs[1],-1,PREG_SPLIT_NO_EMPTY);
             }
         }
     } else {
@@ -939,5 +944,3 @@ function sqimap_get_message($imap_stream, $id, $mailbox) {
     $msg->rfc822_header = $rfc822_header;
     return $msg;
 }
-
-?>