From f3b27dc7894d644897af65e17aaad1f5f0742c9b Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 17 Apr 2021 07:26:03 +0000 Subject: [PATCH 1/2] Quickfix to avoid bad looking incoming tweets Fixes https://github.com/friendica/friendica/pull/10148#issuecomment-821512658 --- src/Util/ParseUrl.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Util/ParseUrl.php b/src/Util/ParseUrl.php index 683544f448..9ce9b0e9f9 100644 --- a/src/Util/ParseUrl.php +++ b/src/Util/ParseUrl.php @@ -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'] ?? []; From 79ec2cbc6dbf36878717efc809ab1b2b7090fe5f Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 17 Apr 2021 13:57:25 +0000 Subject: [PATCH 2/2] Prevent multiple videos from Peertube --- src/Model/Item.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Model/Item.php b/src/Model/Item.php index 863d89790e..4025ec4ffe 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -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;