Queue: Better handling of return values of transmissions

This commit is contained in:
Michael 2018-04-04 19:03:05 +00:00
parent 64ea49788e
commit 3e6507441e
2 changed files with 30 additions and 29 deletions

View file

@ -313,7 +313,7 @@ class Delivery {
if (!Queue::wasDelayed($contact['id'])) {
$deliver_status = DFRN::deliver($owner, $contact, $atom);
} else {
$deliver_status = (-1);
$deliver_status = -1;
}
logger('notifier: dfrn_delivery to '.$contact["url"].' with guid '.$target_item["guid"].' returns '.$deliver_status);
@ -323,12 +323,12 @@ class Delivery {
Queue::add($contact['id'], NETWORK_DFRN, $atom, false, $target_item['guid']);
}
if ($deliver_status < 200) {
// The message could not be delivered. We mark the contact as "dead"
Contact::markForArchival($contact);
} else {
if (($deliver_status >= 200) && ($deliver_status <= 299)) {
// We successfully delivered a message, the contact is alive
Contact::unmarkForArchival($contact);
} else {
// The message could not be delivered. We mark the contact as "dead"
Contact::markForArchival($contact);
}
break;