| | |
| | | // @TODO: find better validity check for threaded index |
| | | if ($is_thread) { |
| | | // check messages number... |
| | | if ($mbox_data['EXISTS'] != @max(array_keys($index['depth']))) { |
| | | if (!$this->skip_deleted && $mbox_data['EXISTS'] != @max(array_keys($index['depth']))) { |
| | | return false; |
| | | } |
| | | return true; |
| | |
| | | private function build_thread_data($data, &$depth, &$children, $level = 0) |
| | | { |
| | | foreach ((array)$data as $key => $val) { |
| | | $children[$key] = !empty($val); |
| | | $depth[$key] = $level; |
| | | if (!empty($val)) |
| | | $empty = empty($val) || !is_array($val); |
| | | $children[$key] = !$empty; |
| | | $depth[$key] = $level; |
| | | if (!$empty) { |
| | | $this->build_thread_data($val, $depth, $children, $level + 1); |
| | | } |
| | | } |
| | | } |
| | | |