From 2ad8bd901a15c0a8720b81e217429e7ab39547a2 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 18 Apr 2023 17:56:30 +0000 Subject: [PATCH] Fix: Only add link preview for selected networks --- src/Model/Post/Media.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Model/Post/Media.php b/src/Model/Post/Media.php index e80cc131f6..77ecf75214 100644 --- a/src/Model/Post/Media.php +++ b/src/Model/Post/Media.php @@ -635,7 +635,7 @@ class Media foreach ($matches[1] as $url) { Logger::info('Got page url (link without description)', ['uri-id' => $uriid, 'url' => $url]); $result = self::insert(['uri-id' => $uriid, 'type' => self::UNKNOWN, 'url' => $url], false, $network); - if ($result && ($network == Protocol::DFRN)) { + if ($result && !in_array($network, [Protocol::ACTIVITYPUB, Protocol::OSTATUS, Protocol::DIASPORA])) { self::revertHTMLType($uriid, $url, $fullbody); Logger::debug('Revert HTML type', ['uri-id' => $uriid, 'url' => $url]); } elseif ($result) { @@ -651,7 +651,7 @@ class Media foreach ($matches[1] as $url) { Logger::info('Got page url (link with description)', ['uri-id' => $uriid, 'url' => $url]); $result = self::insert(['uri-id' => $uriid, 'type' => self::UNKNOWN, 'url' => $url], false, $network); - if ($result && ($network == Protocol::DFRN)) { + if ($result && !in_array($network, [Protocol::ACTIVITYPUB, Protocol::OSTATUS, Protocol::DIASPORA])) { self::revertHTMLType($uriid, $url, $fullbody); Logger::debug('Revert HTML type', ['uri-id' => $uriid, 'url' => $url]); } elseif ($result) { -- 2.39.5