]> git.mxchange.org Git - friendica.git/commitdiff
Fix: Only add link preview for selected networks
authorMichael <heluecht@pirati.ca>
Tue, 18 Apr 2023 17:56:30 +0000 (17:56 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 18 Apr 2023 17:56:30 +0000 (17:56 +0000)
src/Model/Post/Media.php

index e80cc131f6a5ec000a698df17f37dd7bf951b85d..77ecf752148dd8cd3ac7c217f77c17e75f545325 100644 (file)
@@ -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) {