Always use the oldest creation data
This commit is contained in:
parent
247d87c4e5
commit
8402450101
1 changed files with 7 additions and 1 deletions
|
@ -103,7 +103,13 @@ class Account extends BaseEntity
|
|||
$this->bot = ($publicContact['contact-type'] == Contact::TYPE_NEWS);
|
||||
$this->discoverable = !$publicContact['unsearchable'];
|
||||
$this->group = ($publicContact['contact-type'] == Contact::TYPE_COMMUNITY);
|
||||
$this->created_at = DateTimeFormat::utc($publicContact['created'], DateTimeFormat::ATOM);
|
||||
|
||||
$publicContactCreated = $publicContact['created'] ?: DBA::NULL_DATETIME;
|
||||
$userContactCreated = $userContact['created'] ?? DBA::NULL_DATETIME;
|
||||
|
||||
$created = $userContactCreated < $publicContactCreated && ($userContactCreated != DBA::NULL_DATETIME) ? $userContactCreated : $publicContactCreated;
|
||||
$this->created_at = DateTimeFormat::utc($created, DateTimeFormat::ATOM);
|
||||
|
||||
$this->note = BBCode::convert($publicContact['about'], false);
|
||||
$this->url = $publicContact['url'];
|
||||
$this->avatar = $userContact['avatar'] ?? $publicContact['avatar'];
|
||||
|
|
Loading…
Reference in a new issue