mirror of
https://github.com/friendica/friendica
synced 2025-04-26 13:10:11 +00:00
Issue 12603: Support quote in the api / Issue 12654: prevent privacy leakage
This commit is contained in:
parent
3c14cd65fa
commit
d0373ab414
3 changed files with 81 additions and 16 deletions
|
@ -41,6 +41,8 @@ class Status extends BaseDataTransferObject
|
|||
protected $created_at;
|
||||
/** @var string|null */
|
||||
protected $in_reply_to_id = null;
|
||||
/** @var Status|null - Fedilab extension, see issue https://github.com/friendica/friendica/issues/12672 */
|
||||
protected $in_reply_to_status = null;
|
||||
/** @var string|null */
|
||||
protected $in_reply_to_account_id = null;
|
||||
/** @var bool */
|
||||
|
@ -75,7 +77,7 @@ class Status extends BaseDataTransferObject
|
|||
protected $content;
|
||||
/** @var Status|null */
|
||||
protected $reblog = null;
|
||||
/** @var Status|null */
|
||||
/** @var Status|null - Akkoma extension, see issue https://github.com/friendica/friendica/issues/12603 */
|
||||
protected $quote = null;
|
||||
/** @var Application */
|
||||
protected $application = null;
|
||||
|
@ -100,13 +102,14 @@ class Status extends BaseDataTransferObject
|
|||
* @param array $item
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public function __construct(array $item, Account $account, Counts $counts, UserAttributes $userAttributes, bool $sensitive, Application $application, array $mentions, array $tags, Card $card, array $attachments, array $reblog, array $quote = null, array $poll = null)
|
||||
public function __construct(array $item, Account $account, Counts $counts, UserAttributes $userAttributes, bool $sensitive, Application $application, array $mentions, array $tags, Card $card, array $attachments, array $in_reply, array $reblog, array $quote = null, array $poll = null)
|
||||
{
|
||||
$this->id = (string)$item['uri-id'];
|
||||
$this->created_at = DateTimeFormat::utc($item['created'], DateTimeFormat::JSON);
|
||||
|
||||
if ($item['gravity'] == Item::GRAVITY_COMMENT) {
|
||||
$this->in_reply_to_id = (string)$item['thr-parent-id'];
|
||||
$this->in_reply_to_status = $in_reply;
|
||||
$this->in_reply_to_account_id = (string)$item['parent-author-id'];
|
||||
}
|
||||
|
||||
|
@ -172,6 +175,10 @@ class Status extends BaseDataTransferObject
|
|||
$status['quote'] = null;
|
||||
}
|
||||
|
||||
if (empty($status['in_reply_to_status'])) {
|
||||
$status['in_reply_to_status'] = null;
|
||||
}
|
||||
|
||||
return $status;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue