Avoid unmarking for archival an empty contact in Protocol\ActivityPub\Receiver

- Address https://github.com/friendica/friendica/issues/9250#issuecomment-733198306
pull/9590/head
Hypolite Petovan 2020-11-24 17:32:52 -05:00
rodzic 1342825401
commit 486b43f09d
1 zmienionych plików z 6 dodań i 4 usunięć

Wyświetl plik

@ -99,13 +99,15 @@ class Receiver
$actor = JsonLD::fetchElement($ldactivity, 'as:actor', '@id');
$apcontact = APContact::getByURL($actor);
if (!empty($apcontact) && ($apcontact['type'] == 'Application') && ($apcontact['nick'] == 'relay')) {
if (empty($apcontact)) {
Logger::notice('Unable to retrieve AP contact for actor', ['actor' => $actor]);
} elseif ($apcontact['type'] == 'Application' && $apcontact['nick'] == 'relay') {
self::processRelayPost($ldactivity, $actor);
return;
} else {
APContact::unmarkForArchival($apcontact);
}
APContact::unMarkForArchival($apcontact);
$http_signer = HTTPSignature::getSigner($body, $header);
if (empty($http_signer)) {
Logger::warning('Invalid HTTP signature, message will be discarded.');
@ -235,7 +237,7 @@ class Receiver
$profile = APContact::getByURL($object_id);
if (!empty($profile['type'])) {
APContact::unMarkForArchival($profile);
APContact::unmarkForArchival($profile);
return 'as:' . $profile['type'];
}