]> git.mxchange.org Git - friendica.git/commitdiff
Add dismissed field to Mastodon API Notification types
authorHank Grabowski <hankgrabowski@gmail.com>
Wed, 30 Nov 2022 19:23:20 +0000 (14:23 -0500)
committerHank Grabowski <hankgrabowski@gmail.com>
Wed, 30 Nov 2022 19:23:20 +0000 (14:23 -0500)
src/Factory/Api/Mastodon/Notification.php
src/Object/Api/Mastodon/Notification.php

index 32ea681daea2d6f9089e4ad7539abf77a0710d26..ec6581cc580b8a624cb2911b5b8ba049b50e1aec 100644 (file)
@@ -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);
        }
 
        /**
index a54eda45df2799028037a91a58174bc546edd58e..aeec924130c0822fa0096fb03cfc562ab285cafd 100644 (file)
@@ -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();