]> git.mxchange.org Git - friendica.git/commitdiff
Code standards
authorMichael <heluecht@pirati.ca>
Mon, 28 Nov 2022 10:54:26 +0000 (10:54 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 28 Nov 2022 10:54:26 +0000 (10:54 +0000)
src/Module/Api/Mastodon/Trends/Statuses.php

index 70b23f5cc1e6963b563d200ef6b0d0a40b413734..cb69be5ed7f919feab48ab4c9667da445195074d 100644 (file)
@@ -43,9 +43,10 @@ class Statuses extends BaseApi
                        'limit' => 10, // Maximum number of results to return. Defaults to 10.
                ], $request);
 
-               $trending = [];
                $condition = ["NOT `private` AND `commented` > ?", DateTimeFormat::utc('now -1 day')];
                $condition = DBA::mergeConditions($condition, ['network' => Protocol::FEDERATED]);
+
+               $trending = [];
                $statuses = Post::selectPostThread(['uri-id'], $condition, ['limit' => $request['limit'], 'order' => ['total-comments' => true]]);
                while ($status = Post::fetch($statuses)) {
                        $trending[] = DI::mstdnStatus()->createFromUriId($status['uri-id']);