]> git.mxchange.org Git - friendica.git/commitdiff
Used `$this->isThreaded()` instead as suggested by @MrPetovan
authorRoland Häder <roland@mxchange.org>
Wed, 26 Oct 2022 15:55:52 +0000 (17:55 +0200)
committerRoland Häder <roland@mxchange.org>
Wed, 26 Oct 2022 15:59:07 +0000 (17:59 +0200)
src/Object/Post.php

index 7467e4ffc753dbf47aa3a908b86ac85ddaa1fb0e..ddbc1a73682e69831f1dc48eb3cd56c364932e2f 100644 (file)
@@ -587,16 +587,10 @@ class Post
 
                // Copy values/set defaults
                $result['total_comments_num'] = $this->isToplevel() ? $total_children : 0;
-               $result['private'] = $item['private'];
-               $result['toplevel'] = ($this->isToplevel() ? 'toplevel_item' : '');
-               $result['flatten'] = false;
-               $result['threaded'] = false;
-
-               if ($this->isThreaded()) {
-                       $result['threaded'] = true;
-               } else {
-                       $result['flatten'] = true;
-               }
+               $result['private']            = $item['private'];
+               $result['toplevel']           = ($this->isToplevel() ? 'toplevel_item' : '');
+               $result['flatten']            = !$this->isThreaded();
+               $result['threaded']           = $this->isThreaded();
 
                return $result;
        }