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->discoverable = !$publicContact['unsearchable'];
|
||||
|
||||
$last_item = $userContact['last-item'] ?? $publicContact['last-item'];
|
||||
$account->last_status_at = !empty($last_item) ? DateTimeFormat::utc($last_item, DateTimeFormat::ATOM) : null;
|
||||
$publicContactLastItem = $publicContact['last-item'] ?: DBA::NULL_DATETIME;
|
||||
$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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue