From: Domovoy Date: Sun, 29 Jul 2012 18:09:51 +0000 (+0200) Subject: Fixed misbehaviour in collapsing X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3b330510eaf0113c472e583919d351695df89a9c;p=friendica.git Fixed misbehaviour in collapsing --- diff --git a/include/conversation.php b/include/conversation.php index 878fabc082..1adb39bb11 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -467,6 +467,7 @@ function prepare_threads_body($a, $items, $cmnt_tpl, $page_writeable, $mode, $pr if($items_seen == 1) { $firstcollapsed = true; } + logger('Thread level: '. $thread_level .', items seen: '. $items_seen .', nb items: '. $nb_items .', body: ['. $item['body'] .']', LOGGER_DEBUG); if($thread_level > 2) { if($items_seen == $nb_items) $lastcollapsed = true; @@ -584,9 +585,7 @@ function prepare_threads_body($a, $items, $cmnt_tpl, $page_writeable, $mode, $pr // Show children of children only if enabled if(count($item['children']) && (($thread_level < 2) || get_config('system','thread_allow'))) { - - $thread_level++; - $item_result['children'] = prepare_threads_body($a, $item['children'], $cmnt_tpl, $page_writeable, $mode, $profile_owner, $thread_level); + $item_result['children'] = prepare_threads_body($a, $item['children'], $cmnt_tpl, $page_writeable, $mode, $profile_owner, ($thread_level + 1)); } $item_result['private'] = $item['private']; $item_result['toplevel'] = ($toplevelpost ? 'toplevel_item' : '');