Merge pull request #4770 from annando/dfrn-delivery

Fix: Empty answers in DFRN-Delivery can be okay
2022.09-rc
Hypolite Petovan 2018-04-07 07:47:02 -04:00 zatwierdzone przez GitHub
commit a2e9c7a565
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 8 dodań i 3 usunięć

Wyświetl plik

@ -1361,10 +1361,15 @@ class DFRN
$res = XML::parseString($xml); $res = XML::parseString($xml);
if (empty($res->status)) { if (!isset($res->status)) {
return -11; return -11;
} }
// Possibly old servers had returned an empty value when everything was okay
if (empty($res->status)) {
$res->status = 200;
}
if (!empty($res->message)) { if (!empty($res->message)) {
logger('Delivery returned status '.$res->status.' - '.$res->message, LOGGER_DEBUG); logger('Delivery returned status '.$res->status.' - '.$res->message, LOGGER_DEBUG);
} }
@ -1405,7 +1410,7 @@ class DFRN
$fcontact = Diaspora::personByHandle($contact['addr']); $fcontact = Diaspora::personByHandle($contact['addr']);
if (empty($fcontact)) { if (empty($fcontact)) {
logger('Unable to find contact details for ' . $contact['id'] . ' - ' . $contact['addr']); logger('Unable to find contact details for ' . $contact['id'] . ' - ' . $contact['addr']);
return -21; return -22;
} }
$envelope = Diaspora::buildMessage($atom, $owner, $contact, $owner['uprvkey'], $fcontact['pubkey'], $public_batch); $envelope = Diaspora::buildMessage($atom, $owner, $contact, $owner['uprvkey'], $fcontact['pubkey'], $public_batch);
@ -1435,7 +1440,7 @@ class DFRN
$res = XML::parseString($xml); $res = XML::parseString($xml);
if (empty($res->status)) { if (empty($res->status)) {
return -11; return -23;
} }
if (!empty($res->message)) { if (!empty($res->message)) {