Changes after code review
This commit is contained in:
parent
1ced4673fe
commit
fbcc56d42d
4 changed files with 4 additions and 4 deletions
|
@ -204,7 +204,7 @@ class Status extends BaseFactory
|
||||||
if ($is_reshare) {
|
if ($is_reshare) {
|
||||||
$reshare = $this->createFromUriId($uriId, $uid, false)->toArray();
|
$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);
|
return new \Friendica\Object\Api\Mastodon\Status($item, $account, $counts, $userAttributes, $sensitive, $application, $mentions, $tags, $card, $attachments, $reshare, $poll);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -266,7 +266,7 @@ class Relation
|
||||||
* @param integer $uid
|
* @param integer $uid
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
static public function updateSuggestions(int $uid)
|
static public function updateCachedSuggestions(int $uid)
|
||||||
{
|
{
|
||||||
if (DI::pConfig()->get($uid, 'suggestion', 'last_update') + 3600 > time()) {
|
if (DI::pConfig()->get($uid, 'suggestion', 'last_update') + 3600 > time()) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -34,7 +34,7 @@ class UpdateAllSuggestions
|
||||||
{
|
{
|
||||||
$users = DBA::select('user', ['uid'], ["`login_date` > ?", DateTimeFormat::utc('now - 7 days')]);
|
$users = DBA::select('user', ['uid'], ["`login_date` > ?", DateTimeFormat::utc('now - 7 days')]);
|
||||||
while ($user = DBA::fetch($users)) {
|
while ($user = DBA::fetch($users)) {
|
||||||
Contact\Relation::updateSuggestions($user['uid']);
|
Contact\Relation::updateCachedSuggestions($user['uid']);
|
||||||
}
|
}
|
||||||
DBA::close($users);
|
DBA::close($users);
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,6 @@ class UpdateSuggestions
|
||||||
{
|
{
|
||||||
public static function execute(int $uid)
|
public static function execute(int $uid)
|
||||||
{
|
{
|
||||||
Contact\Relation::updateSuggestions($uid);
|
Contact\Relation::updateCachedSuggestions($uid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue