Merge pull request #10150 from annando/no-photo
Quickfix to avoid bad looking incoming tweets
This commit is contained in:
commit
a6eeb7af11
|
@ -2684,7 +2684,8 @@ class Item
|
||||||
{
|
{
|
||||||
$leading = '';
|
$leading = '';
|
||||||
$trailing = '';
|
$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) {
|
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'])) {
|
if (in_array($attachment['type'], [Post\Media::AUDIO, Post\Media::VIDEO]) && strpos($item['body'], $attachment['url'])) {
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -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
|
// Prevent to have a photo type without an image
|
||||||
if ($twitter_card && $twitter_image && !empty($siteinfo['image'])) {
|
// if ($twitter_card && $twitter_image && !empty($siteinfo['image'])) {
|
||||||
$siteinfo['type'] = 'photo';
|
// $siteinfo['type'] = 'photo';
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (!empty($siteinfo['image'])) {
|
if (!empty($siteinfo['image'])) {
|
||||||
$siteinfo['images'] = $siteinfo['images'] ?? [];
|
$siteinfo['images'] = $siteinfo['images'] ?? [];
|
||||||
|
|
Loading…
Reference in a new issue