From ea782d97fc07d48e4cc0e41b2e81649807b8e074 Mon Sep 17 00:00:00 2001 From: Hank Grabowski Date: Sun, 26 Feb 2023 10:26:15 -0500 Subject: [PATCH] Make calls inline and return 0 if value is null --- src/Factory/Api/Mastodon/Status.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Factory/Api/Mastodon/Status.php b/src/Factory/Api/Mastodon/Status.php index c1065da45..db2f94d49 100644 --- a/src/Factory/Api/Mastodon/Status.php +++ b/src/Factory/Api/Mastodon/Status.php @@ -288,10 +288,7 @@ class Status extends BaseFactory $in_reply = []; } - $queue_count = $item['delivery_queue_count']; - $queue_done = $item['delivery_queue_done']; - $queue_failed = $item['delivery_queue_failed']; - $delivery_data = new FriendicaDeliveryData($queue_count, $queue_done, $queue_failed); + $delivery_data = new FriendicaDeliveryData($item['delivery_queue_count'] ?? 0, $item['delivery_queue_done'] ?? 0, $item['delivery_queue_failed'] ?? 0); $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);