From fbcc56d42dfcf5e628fe6c5fd7be3be598b53797 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 30 Nov 2022 14:33:55 +0000 Subject: [PATCH] Changes after code review --- src/Factory/Api/Mastodon/Status.php | 2 +- src/Model/Contact/Relation.php | 2 +- src/Worker/UpdateAllSuggestions.php | 2 +- src/Worker/UpdateSuggestions.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Factory/Api/Mastodon/Status.php b/src/Factory/Api/Mastodon/Status.php index 7aa31077ba..dba74b1407 100644 --- a/src/Factory/Api/Mastodon/Status.php +++ b/src/Factory/Api/Mastodon/Status.php @@ -204,7 +204,7 @@ class Status extends BaseFactory if ($is_reshare) { $reshare = $this->createFromUriId($uriId, $uid, false)->toArray(); } -// $mentions = array_unique($mentions); + return new \Friendica\Object\Api\Mastodon\Status($item, $account, $counts, $userAttributes, $sensitive, $application, $mentions, $tags, $card, $attachments, $reshare, $poll); } diff --git a/src/Model/Contact/Relation.php b/src/Model/Contact/Relation.php index 5f2f07d397..5a85ebebc5 100644 --- a/src/Model/Contact/Relation.php +++ b/src/Model/Contact/Relation.php @@ -266,7 +266,7 @@ class Relation * @param integer $uid * @return void */ - static public function updateSuggestions(int $uid) + static public function updateCachedSuggestions(int $uid) { if (DI::pConfig()->get($uid, 'suggestion', 'last_update') + 3600 > time()) { return; diff --git a/src/Worker/UpdateAllSuggestions.php b/src/Worker/UpdateAllSuggestions.php index b1c84b639e..5bc6476145 100644 --- a/src/Worker/UpdateAllSuggestions.php +++ b/src/Worker/UpdateAllSuggestions.php @@ -34,7 +34,7 @@ class UpdateAllSuggestions { $users = DBA::select('user', ['uid'], ["`login_date` > ?", DateTimeFormat::utc('now - 7 days')]); while ($user = DBA::fetch($users)) { - Contact\Relation::updateSuggestions($user['uid']); + Contact\Relation::updateCachedSuggestions($user['uid']); } DBA::close($users); } diff --git a/src/Worker/UpdateSuggestions.php b/src/Worker/UpdateSuggestions.php index c756ed10f5..509fee05a9 100644 --- a/src/Worker/UpdateSuggestions.php +++ b/src/Worker/UpdateSuggestions.php @@ -30,6 +30,6 @@ class UpdateSuggestions { public static function execute(int $uid) { - Contact\Relation::updateSuggestions($uid); + Contact\Relation::updateCachedSuggestions($uid); } }