mirror of
https://github.com/friendica/friendica
synced 2025-04-29 23:04:24 +02:00
Reduce the usage of the "proxifyUrl" function
This commit is contained in:
parent
3fe6789c9c
commit
b46b7b08ba
11 changed files with 205 additions and 71 deletions
|
@ -67,17 +67,16 @@ class Attachment extends BaseFactory
|
|||
|
||||
$remote = $attachment['url'];
|
||||
if ($type == 'image') {
|
||||
if (Proxy::isLocalImage($attachment['url'])) {
|
||||
$url = $attachment['url'];
|
||||
$preview = $attachment['preview'] ?? $url;
|
||||
$remote = '';
|
||||
} else {
|
||||
$url = Proxy::proxifyUrl($attachment['url']);
|
||||
$preview = Proxy::proxifyUrl($attachment['url'], false, Proxy::SIZE_SMALL);
|
||||
}
|
||||
$url = Post\Media::getPreviewUrlForId($attachment['id']);
|
||||
$preview = Post\Media::getPreviewUrlForId($attachment['id'], Proxy::SIZE_SMALL);
|
||||
} else {
|
||||
$url = Proxy::proxifyUrl($attachment['url']);
|
||||
$preview = Proxy::proxifyUrl($attachment['preview'] ?? '');
|
||||
$url = Proxy::proxifyUrl($attachment['url']);
|
||||
|
||||
if (!empty($attachment['preview'])) {
|
||||
$preview = Post\Media::getPreviewUrlForId($attachment['id'], Proxy::SIZE_SMALL);
|
||||
} else {
|
||||
$preview = '';
|
||||
}
|
||||
}
|
||||
|
||||
$object = new \Friendica\Object\Api\Mastodon\Attachment($attachment, $type, $url, $preview, $remote);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue