Issue 10443: Fix requesting media content

pull/10444/head
Michael 2021-06-28 18:53:10 +00:00
rodzic 5333ae4a3c
commit ffdbac7e41
1 zmienionych plików z 1 dodań i 7 usunięć

Wyświetl plik

@ -168,9 +168,6 @@ class Photo extends BaseModule
return false;
}
$author = Contact::selectFirst([], ["`id` IN (SELECT `author-id` FROM `post` WHERE `uri-id` = ?)", $media['uri-id']]);
$url = Contact::magicLinkByContact($author, $url);
return MPhoto::createPhotoForExternalResource($url, (int)local_user());
case "media":
$media = DBA::selectFirst('post-media', ['url', 'uri-id'], ['id' => $uid, 'type' => Post\Media::IMAGE]);
@ -178,10 +175,7 @@ class Photo extends BaseModule
return false;
}
$author = Contact::selectFirst([], ["`id` IN (SELECT `author-id` FROM `post` WHERE `uri-id` = ?)", $media['uri-id']]);
$url = Contact::magicLinkByContact($author, $media['url']);
return MPhoto::createPhotoForExternalResource($url, (int)local_user());
return MPhoto::createPhotoForExternalResource($media['url'], (int)local_user());
case "contact":
$contact = Contact::getById($uid, ['uid', 'url', 'avatar', 'photo', 'xmpp', 'addr']);
if (empty($contact)) {