From 9ab73c30efd7bfe17c88e1554eefbe2b7d7863af Mon Sep 17 00:00:00 2001 From: Hank Grabowski Date: Sun, 26 Feb 2023 11:27:01 -0500 Subject: [PATCH] Allow delivery stats to be null. --- src/Factory/Api/Mastodon/Status.php | 2 +- src/Object/Api/Mastodon/Status/FriendicaDeliveryData.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Factory/Api/Mastodon/Status.php b/src/Factory/Api/Mastodon/Status.php index db2f94d495..fed7ea4730 100644 --- a/src/Factory/Api/Mastodon/Status.php +++ b/src/Factory/Api/Mastodon/Status.php @@ -288,7 +288,7 @@ class Status extends BaseFactory $in_reply = []; } - $delivery_data = new FriendicaDeliveryData($item['delivery_queue_count'] ?? 0, $item['delivery_queue_done'] ?? 0, $item['delivery_queue_failed'] ?? 0); + $delivery_data = new FriendicaDeliveryData($item['delivery_queue_count'], $item['delivery_queue_done'], $item['delivery_queue_failed']); $friendica = new FriendicaExtension($item['title'], $counts->dislikes, $delivery_data); return new \Friendica\Object\Api\Mastodon\Status($item, $account, $counts, $userAttributes, $sensitive, $application, $mentions, $tags, $card, $attachments, $in_reply, $reshare, $friendica, $quote, $poll); diff --git a/src/Object/Api/Mastodon/Status/FriendicaDeliveryData.php b/src/Object/Api/Mastodon/Status/FriendicaDeliveryData.php index 2d9b151bee..3da0eae57c 100644 --- a/src/Object/Api/Mastodon/Status/FriendicaDeliveryData.php +++ b/src/Object/Api/Mastodon/Status/FriendicaDeliveryData.php @@ -32,13 +32,13 @@ use Friendica\BaseDataTransferObject; */ class FriendicaDeliveryData extends BaseDataTransferObject { - /** @var int */ + /** @var int|null */ protected $delivery_queue_count; - /** @var int */ + /** @var int|null */ protected $delivery_queue_done; - /** @var int */ + /** @var int|null */ protected $delivery_queue_failed; /** @@ -46,7 +46,7 @@ class FriendicaDeliveryData extends BaseDataTransferObject * * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public function __construct(int $delivery_queue_count, int $delivery_queue_done, int $delivery_queue_failed) + public function __construct(?int $delivery_queue_count, ?int $delivery_queue_done, ?int $delivery_queue_failed) { $this->delivery_queue_count = $delivery_queue_count; $this->delivery_queue_done = $delivery_queue_done; -- 2.39.5