]> git.mxchange.org Git - friendica.git/commitdiff
Make calls inline and return 0 if value is null
authorHank Grabowski <hankgrabowski@gmail.com>
Sun, 26 Feb 2023 15:26:15 +0000 (10:26 -0500)
committerHank Grabowski <hankgrabowski@gmail.com>
Sun, 26 Feb 2023 15:26:15 +0000 (10:26 -0500)
src/Factory/Api/Mastodon/Status.php

index c1065da4540c54dd92170ee8339d565cc1441c0f..db2f94d4953d43388a0ec173d86a13d589ef458e 100644 (file)
@@ -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);