Merge pull request #10150 from annando/no-photo

Quickfix to avoid bad looking incoming tweets
pull/10152/head
Tobias Diekershoff 2021-04-17 18:16:17 +02:00 zatwierdzone przez GitHub
commit a6eeb7af11
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 6 dodań i 4 usunięć

Wyświetl plik

@ -2684,7 +2684,8 @@ class Item
{
$leading = '';
$trailing = '';
foreach (Post\Media::getByURIId($item['uri-id'], [Post\Media::AUDIO, Post\Media::VIDEO,
// currently deactivated the request for Post\Media::VIDEO since it creates mutliple videos from Peertube
foreach (Post\Media::getByURIId($item['uri-id'], [Post\Media::AUDIO,
Post\Media::DOCUMENT, Post\Media::TORRENT, Post\Media::UNKNOWN]) as $attachment) {
if (in_array($attachment['type'], [Post\Media::AUDIO, Post\Media::VIDEO]) && strpos($item['body'], $attachment['url'])) {
continue;

Wyświetl plik

@ -477,10 +477,11 @@ class ParseUrl
}
}
// Currently deactivated, see https://github.com/friendica/friendica/pull/10148#issuecomment-821512658
// Prevent to have a photo type without an image
if ($twitter_card && $twitter_image && !empty($siteinfo['image'])) {
$siteinfo['type'] = 'photo';
}
// if ($twitter_card && $twitter_image && !empty($siteinfo['image'])) {
// $siteinfo['type'] = 'photo';
// }
if (!empty($siteinfo['image'])) {
$siteinfo['images'] = $siteinfo['images'] ?? [];