From a27ffda59f76d4be6a10963c5d6365675e650268 Mon Sep 17 00:00:00 2001 From: Hank Grabowski Date: Wed, 30 Nov 2022 14:23:20 -0500 Subject: [PATCH] Add dismissed field to Mastodon API Notification types --- src/Factory/Api/Mastodon/Notification.php | 4 +++- src/Object/Api/Mastodon/Notification.php | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Factory/Api/Mastodon/Notification.php b/src/Factory/Api/Mastodon/Notification.php index 32ea681dae..ec6581cc58 100644 --- a/src/Factory/Api/Mastodon/Notification.php +++ b/src/Factory/Api/Mastodon/Notification.php @@ -70,7 +70,9 @@ class Notification extends BaseFactory $status = null; } - return new MstdnNotification($Notification->id, $type, $Notification->created, $account, $status); + $dismissed = $Notification->dismissed; + + return new MstdnNotification($Notification->id, $type, $Notification->created, $account, $status, $dismissed); } /** diff --git a/src/Object/Api/Mastodon/Notification.php b/src/Object/Api/Mastodon/Notification.php index a54eda45df..aeec924130 100644 --- a/src/Object/Api/Mastodon/Notification.php +++ b/src/Object/Api/Mastodon/Notification.php @@ -56,6 +56,8 @@ class Notification extends BaseDataTransferObject protected $type; /** @var string (Datetime) */ protected $created_at; + /** @var bool */ + protected $dismissed; /** @var Account */ protected $account; /** @var Status|null */ @@ -66,12 +68,13 @@ class Notification extends BaseDataTransferObject * * @throws HttpException\InternalServerErrorException|Exception */ - public function __construct(int $id, string $type, \DateTime $created_at, Account $account = null, Status $status = null) + public function __construct(int $id, string $type, \DateTime $created_at, Account $account = null, Status $status = null, bool $dismissed = false) { $this->id = (string)$id; $this->type = $type; $this->created_at = $created_at->format(DateTimeFormat::JSON); $this->account = $account->toArray(); + $this->dismissed = $dismissed; if (!empty($status)) { $this->status = $status->toArray();