From e69b04d2df9726cd43a7c801febe8e4f7668f790 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 12 Oct 2022 05:34:55 +0000 Subject: [PATCH] Only add the media for non federated posts --- src/Content/Item.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Content/Item.php b/src/Content/Item.php index d1cdbc679..1bf8410cd 100644 --- a/src/Content/Item.php +++ b/src/Content/Item.php @@ -657,7 +657,9 @@ class Item public function createSharedBlockByArray(array $item): string { if (!in_array($item['network'] ?? '', Protocol::FEDERATED)) { + $item['guid'] = ''; $item['uri'] = ''; + $item['body'] = Post\Media::addAttachmentsToBody($item['uri-id'], $item['body']); } $shared_content = BBCode::getShareOpeningTag($item['author-name'], $item['author-link'], $item['author-avatar'], $item['plink'], $item['created'], $item['guid'], $item['uri']); @@ -668,8 +670,6 @@ class Item $shared = BBCode::fetchShareAttributes($item['body']); - $item['body'] = Post\Media::addAttachmentsToBody($item['uri-id'], $item['body'], [Post\Media::IMAGE]); - // If it is a reshared post then reformat it to avoid display problems with two share elements if (Diaspora::isReshare($item['body'], false)) { if (!empty($shared['guid']) && ($encaspulated_share = self::createSharedPostByGuid($shared['guid']))) {