Use most recent last item date in Mastodon\Account
This commit is contained in:
parent
0dbce6e58b
commit
4aa01ee17f
1 changed files with 5 additions and 2 deletions
|
@ -100,8 +100,11 @@ class Account
|
||||||
$account->group = ($publicContact['contact-type'] == Contact::TYPE_COMMUNITY);
|
$account->group = ($publicContact['contact-type'] == Contact::TYPE_COMMUNITY);
|
||||||
$account->discoverable = !$publicContact['unsearchable'];
|
$account->discoverable = !$publicContact['unsearchable'];
|
||||||
|
|
||||||
$last_item = $userContact['last-item'] ?? $publicContact['last-item'];
|
$publicContactLastItem = $publicContact['last-item'] ?: DBA::NULL_DATETIME;
|
||||||
$account->last_status_at = !empty($last_item) ? DateTimeFormat::utc($last_item, DateTimeFormat::ATOM) : null;
|
$userContactLastItem = $userContact['last-item'] ?? DBA::NULL_DATETIME;
|
||||||
|
|
||||||
|
$lastItem = $userContactLastItem > $publicContactLastItem ? $userContactLastItem : $publicContactLastItem;
|
||||||
|
$account->last_status_at = $lastItem != DBA::NULL_DATETIME ? DateTimeFormat::utc($lastItem, DateTimeFormat::ATOM) : null;
|
||||||
|
|
||||||
return $account;
|
return $account;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue