From: Michael Date: Tue, 24 May 2022 08:06:48 +0000 (+0000) Subject: Use a better query to fetch the relay actor X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8969e83134ef487b1fcfe434a844b42e5f861864;p=friendica.git Use a better query to fetch the relay actor --- diff --git a/src/Protocol/ActivityPub/Delivery.php b/src/Protocol/ActivityPub/Delivery.php index c959d8c615..966f0e5e16 100644 --- a/src/Protocol/ActivityPub/Delivery.php +++ b/src/Protocol/ActivityPub/Delivery.php @@ -179,7 +179,8 @@ class Delivery */ private static function fetchActorForRelayInbox(string $inbox): string { - $apcontact = DBA::selectFirst('apcontact', ['url'], ['sharedinbox' => $inbox, 'type' => 'Application']); + $apcontact = DBA::selectFirst('apcontact', ['url'], ["`sharedinbox` = ? AND `type` = ? AND `url` IN (SELECT `url` FROM `contact` WHERE `uid` = ? AND `rel` = ?)", + $inbox, 'Application', 0, Contact::FRIEND]); return $apcontact['url'] ?? ''; }