From 8969e83134ef487b1fcfe434a844b42e5f861864 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 24 May 2022 08:06:48 +0000 Subject: [PATCH] Use a better query to fetch the relay actor --- src/Protocol/ActivityPub/Delivery.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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'] ?? ''; }