Fix "Undefined variable $success"

This commit is contained in:
Michael 2024-03-16 07:58:51 +00:00
parent b8396daca2
commit 28363a5416

View file

@ -338,16 +338,13 @@ class Delivery
if ($public_dfrn) {
Logger::info('Relay delivery to ' . $contact['url'] . ' with guid ' . $target_item['guid'] . ' returns ' . $deliver_status);
if ($cmd == Delivery::POST) {
if (($deliver_status >= 200) && ($deliver_status <= 299)) {
Post\DeliveryData::incrementQueueDone($target_item['uri-id'], $protocol);
$success = ($deliver_status >= 200) && ($deliver_status <= 299);
GServer::setProtocol($contact['gsid'] ?? 0, $protocol);
$success = true;
} else {
Post\DeliveryData::incrementQueueFailed($target_item['uri-id']);
$success = false;
}
if ($cmd == Delivery::POST) {
Post\DeliveryData::incrementQueueDone($target_item['uri-id'], $protocol);
GServer::setProtocol($contact['gsid'] ?? 0, $protocol);
} else {
Post\DeliveryData::incrementQueueFailed($target_item['uri-id']);
}
return $success;
}