X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FObject%2FApi%2FMastodon%2FAccount.php;h=5a66209777c37c3469da55f13ea60b8de3402512;hb=32bb0976046ef9fa2296d0aeb39a01b0b916dc1e;hp=aac23ef5ed3d24163a10c49d41ae3a0f3cca7c1f;hpb=7e747b2f410e01576b809d0a52b79cbe3e660dce;p=friendica.git diff --git a/src/Object/Api/Mastodon/Account.php b/src/Object/Api/Mastodon/Account.php index aac23ef5ed..5a66209777 100644 --- a/src/Object/Api/Mastodon/Account.php +++ b/src/Object/Api/Mastodon/Account.php @@ -1,6 +1,6 @@ id = (string)$contact['pid']; - $this->username = $contact['nick']; + $this->id = (string)$account['pid']; + $this->username = $account['nick']; $this->acct = - strpos($contact['url'], $baseUrl->get() . '/') === 0 ? - $contact['nick'] : - $contact['addr']; - $this->display_name = $contact['name']; - $this->locked = (bool)$contact['manually-approve']; - $this->bot = ($contact['contact-type'] == Contact::TYPE_NEWS); - $this->discoverable = !$contact['unsearchable']; - $this->group = ($contact['contact-type'] == Contact::TYPE_COMMUNITY); + strpos($account['url'], $baseUrl . '/') === 0 ? + $account['nick'] : + $account['addr']; + $this->display_name = $account['name']; + $this->locked = (bool)$account['manually-approve']; + $this->bot = ($account['contact-type'] == Contact::TYPE_NEWS); + $this->discoverable = !$account['unsearchable']; + $this->group = ($account['contact-type'] == Contact::TYPE_COMMUNITY); - $this->created_at = DateTimeFormat::utc($contact['created'] ?: DBA::NULL_DATETIME, DateTimeFormat::JSON); + $this->created_at = DateTimeFormat::utc($account['created'] ?: DBA::NULL_DATETIME, DateTimeFormat::JSON); - $this->note = BBCode::convertForUriId($contact['uri-id'], $contact['about'], BBCode::EXTERNAL); - $this->url = $contact['url']; - $this->avatar = Contact::getAvatarUrlForId($contact['id'] ?? 0 ?: $contact['pid'], Proxy::SIZE_SMALL, $contact['updated'], $contact['guid'] ?? ''); - $this->avatar_static = $this->avatar; - $this->header = Contact::getHeaderUrlForId($contact['id'] ?? 0 ?: $contact['pid'], '', $contact['updated'], $contact['guid'] ?? ''); - $this->header_static = $this->header; - $this->followers_count = $contact['ap-followers_count'] ?? $contact['diaspora-interacted_count'] ?? 0; - $this->following_count = $contact['ap-following_count'] ?? $contact['diaspora-interacting_count'] ?? 0; - $this->statuses_count = $contact['ap-statuses_count'] ?? $contact['diaspora-post_count'] ?? 0; + $this->note = BBCode::convertForUriId($account['uri-id'], $account['about'], BBCode::EXTERNAL); + $this->url = $account['url']; + $this->avatar = Contact::getAvatarUrlForId($account['id'] ?? 0 ?: $account['pid'], Proxy::SIZE_SMALL, $account['updated'], $account['guid'] ?? ''); + $this->avatar_static = Contact::getAvatarUrlForId($account['id'] ?? 0 ?: $account['pid'], Proxy::SIZE_SMALL, $account['updated'], $account['guid'] ?? '', true); + $this->header = Contact::getHeaderUrlForId($account['id'] ?? 0 ?: $account['pid'], '', $account['updated'], $account['guid'] ?? ''); + $this->header_static = Contact::getHeaderUrlForId($account['id'] ?? 0 ?: $account['pid'], '', $account['updated'], $account['guid'] ?? '', true); + $this->followers_count = $account['ap-followers_count'] ?? $account['diaspora-interacted_count'] ?? 0; + $this->following_count = $account['ap-following_count'] ?? $account['diaspora-interacting_count'] ?? 0; + $this->statuses_count = $account['ap-statuses_count'] ?? $account['diaspora-post_count'] ?? 0; - $lastItem = $contact['last-item'] ?: DBA::NULL_DATETIME; + $lastItem = $account['last-item'] ?: DBA::NULL_DATETIME; $this->last_status_at = $lastItem != DBA::NULL_DATETIME ? DateTimeFormat::utc($lastItem, 'Y-m-d') : null; // No custom emojis per account in Friendica