]> git.mxchange.org Git - friendica.git/commitdiff
Use a better query to fetch the relay actor
authorMichael <heluecht@pirati.ca>
Tue, 24 May 2022 08:06:48 +0000 (08:06 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 24 May 2022 08:06:48 +0000 (08:06 +0000)
src/Protocol/ActivityPub/Delivery.php

index c959d8c615bd2f6058888ff1f4e631627cfd0b82..966f0e5e16880fb089047f7b09b914dd66bb58b1 100644 (file)
@@ -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'] ?? '';
        }