Use "StatusCounts" class

This commit is contained in:
Michael 2020-09-07 18:24:11 +00:00
parent 1bca280eae
commit 59374eb6c6
3 changed files with 65 additions and 10 deletions

View file

@ -23,8 +23,8 @@ namespace Friendica\Object\Api\Mastodon;
use Friendica\BaseEntity;
use Friendica\Content\Text\BBCode;
use Friendica\Object\Api\Mastodon\Status\StatusCounts;
use Friendica\Util\DateTimeFormat;
use stdClass;
/**
* Class Status
@ -96,7 +96,7 @@ class Status extends BaseEntity
* @param array $item
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public function __construct(array $item, Account $account, stdClass $count)
public function __construct(array $item, Account $account, StatusCounts $count)
{
$this->id = (string)$item['uri-id'];
$this->created_at = DateTimeFormat::utc($item['created'], DateTimeFormat::ATOM);
@ -115,9 +115,9 @@ class Status extends BaseEntity
$this->language = null;
$this->uri = $item['uri'];
$this->url = $item['plink'] ?? null;
$this->replies_count = $count->replies;
$this->reblogs_count = $count->reblogs;
$this->favourites_count = $count->favourites;
$this->replies_count = $count->__get('replies');
$this->reblogs_count = $count->__get('reblogs');
$this->favourites_count = $count->__get('favourites');
$this->favourited = false;
$this->reblogged = false;
$this->muted = false;