From: Michael Date: Tue, 13 Dec 2022 23:26:58 +0000 (+0000) Subject: Only search for empty quoted reshares (Diaspora type) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f013c92487b5590b226e864ab9eb4c807dfe8faf;p=friendica.git Only search for empty quoted reshares (Diaspora type) --- diff --git a/src/Content/Conversation.php b/src/Content/Conversation.php index f8885b5b07..aa7c016180 100644 --- a/src/Content/Conversation.php +++ b/src/Content/Conversation.php @@ -1020,7 +1020,7 @@ class Conversation DBA::close($thread_items); - $quotes = Post::select(array_merge(ItemModel::DISPLAY_FIELDLIST, ['featured', 'contact-uid', 'gravity', 'post-type', 'post-reason']), ['quote-uri-id' => array_column($quoteuriids, 'uri-id'), 'uid' => 0]); + $quotes = Post::select(array_merge(ItemModel::DISPLAY_FIELDLIST, ['featured', 'contact-uid', 'gravity', 'post-type', 'post-reason']), ['quote-uri-id' => array_column($quoteuriids, 'uri-id'), 'body' => '', 'uid' => 0]); while ($quote = Post::fetch($quotes)) { $row = $quote; diff --git a/src/Factory/Api/Mastodon/Status.php b/src/Factory/Api/Mastodon/Status.php index 698c127f72..df5970d298 100644 --- a/src/Factory/Api/Mastodon/Status.php +++ b/src/Factory/Api/Mastodon/Status.php @@ -117,7 +117,8 @@ class Status extends BaseFactory 'deleted' => false ]) + Post::countPosts([ 'quote-uri-id' => $uriId, - 'deleted' => false + 'body' => '', + 'deleted' => false ]); $count_like = Post::countPosts([ @@ -152,6 +153,7 @@ class Status extends BaseFactory 'quote-uri-id' => $uriId, 'uid' => $uid, 'origin' => true, + 'body' => '', 'deleted' => false ]); $userAttributes = new \Friendica\Object\Api\Mastodon\Status\UserAttributes( diff --git a/src/Module/Api/Mastodon/Statuses/Unreblog.php b/src/Module/Api/Mastodon/Statuses/Unreblog.php index faacefe38d..afb84e2630 100644 --- a/src/Module/Api/Mastodon/Statuses/Unreblog.php +++ b/src/Module/Api/Mastodon/Statuses/Unreblog.php @@ -50,7 +50,7 @@ class Unreblog extends BaseApi } if ($item['network'] == Protocol::DIASPORA) { - $item = Post::selectFirstForUser($uid, ['id'], ['quote-uri-id' => $this->parameters['id'], 'origin' => true, 'uid' => $uid]); + $item = Post::selectFirstForUser($uid, ['id'], ['quote-uri-id' => $this->parameters['id'], 'body' => '', 'origin' => true, 'uid' => $uid]); if (empty($item['id'])) { DI::mstdnError()->RecordNotFound(); } diff --git a/src/Module/Item/Activity.php b/src/Module/Item/Activity.php index c52882efb8..bcfb83513b 100644 --- a/src/Module/Item/Activity.php +++ b/src/Module/Item/Activity.php @@ -53,7 +53,7 @@ class Activity extends BaseModule if (in_array($verb, ['announce', 'unannounce'])) { $item = Post::selectFirst(['network', 'uri-id'], ['id' => $itemId, 'uid' => [DI::userSession()->getLocalUserId(), 0]]); if ($item['network'] == Protocol::DIASPORA) { - $quote = Post::selectFirst(['id'], ['quote-uri-id' => $item['uri-id'], 'origin' => true, 'uid' => DI::userSession()->getLocalUserId()]); + $quote = Post::selectFirst(['id'], ['quote-uri-id' => $item['uri-id'], 'body' => '', 'origin' => true, 'uid' => DI::userSession()->getLocalUserId()]); if (!empty($quote['id'])) { if (!Item::markForDeletionById($quote['id'])) { throw new HTTPException\BadRequestException();