]> git.mxchange.org Git - friendica.git/commitdiff
Fix "Undefined variable $success"
authorMichael <heluecht@pirati.ca>
Sat, 16 Mar 2024 07:58:51 +0000 (07:58 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 16 Mar 2024 07:58:51 +0000 (07:58 +0000)
src/Protocol/Delivery.php

index 436e949f30785fb17b34791a46c37a9fdf94278a..d479ad44220e808a9a1bb5ff1018444bf79b71a0 100644 (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);
 
+                               $success = ($deliver_status >= 200) && ($deliver_status <= 299);
+
                                if ($cmd == Delivery::POST) {
-                                       if (($deliver_status >= 200) && ($deliver_status <= 299)) {
-                                               Post\DeliveryData::incrementQueueDone($target_item['uri-id'], $protocol);
-
-                                               GServer::setProtocol($contact['gsid'] ?? 0, $protocol);
-                                               $success = true;
-                                       } else {
-                                               Post\DeliveryData::incrementQueueFailed($target_item['uri-id']);
-                                               $success = false;
-                                       }
+                                       Post\DeliveryData::incrementQueueDone($target_item['uri-id'], $protocol);
+                                       GServer::setProtocol($contact['gsid'] ?? 0, $protocol);
+                               } else {
+                                       Post\DeliveryData::incrementQueueFailed($target_item['uri-id']);
                                }
                                return $success;
                        }