Make calls inline and return 0 if value is null

This commit is contained in:
Hank Grabowski 2023-02-26 10:26:15 -05:00
parent e92b0a73f4
commit ea782d97fc

View 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);