id = $publicContact['id']; $this->username = $publicContact['nick']; $this->acct = strpos($publicContact['url'], $baseUrl->get() . '/') === 0 ? $publicContact['nick'] : $publicContact['addr']; $this->display_name = $publicContact['name']; $this->locked = !empty($apcontact['manually-approve']); $this->created_at = DateTimeFormat::utc($publicContact['created'], DateTimeFormat::ATOM); $this->followers_count = $apcontact['followers_count'] ?? 0; $this->following_count = $apcontact['following_count'] ?? 0; $this->statuses_count = $apcontact['statuses_count'] ?? 0; $this->note = BBCode::convert($publicContact['about'], false); $this->url = $publicContact['url']; $this->avatar = $userContact['avatar'] ?? $publicContact['avatar']; $this->avatar_static = $userContact['avatar'] ?? $publicContact['avatar']; // No header picture in Friendica $this->header = ''; $this->header_static = ''; // No custom emojis per account in Friendica $this->emojis = []; // No metadata fields in Friendica $this->fields = []; $this->bot = ($publicContact['contact-type'] == Contact::TYPE_NEWS); $this->group = ($publicContact['contact-type'] == Contact::TYPE_COMMUNITY); $this->discoverable = !$publicContact['unsearchable']; $publicContactLastItem = $publicContact['last-item'] ?: DBA::NULL_DATETIME; $userContactLastItem = $userContact['last-item'] ?? DBA::NULL_DATETIME; $lastItem = $userContactLastItem > $publicContactLastItem ? $userContactLastItem : $publicContactLastItem; $this->last_status_at = $lastItem != DBA::NULL_DATETIME ? DateTimeFormat::utc($lastItem, DateTimeFormat::ATOM) : null; } }