From 32d0d45adf4d285d80af0d4906b92f7860ee018c Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 24 May 2021 10:51:21 +0000 Subject: [PATCH] Issue 10287: Don't show ignored and blocked posts --- database.sql | 6 ++++-- src/Module/Api/Mastodon/Timelines/PublicTimeline.php | 2 +- static/dbstructure.config.php | 2 +- static/dbview.config.php | 2 ++ 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/database.sql b/database.sql index 3e6d398cf1..202d536552 100644 --- a/database.sql +++ b/database.sql @@ -1,6 +1,6 @@ -- ------------------------------------------ -- Friendica 2021.06-rc (Siberian Iris) --- DB_UPDATE_VERSION 1419 +-- DB_UPDATE_VERSION 1420 -- ------------------------------------------ @@ -1685,7 +1685,9 @@ CREATE VIEW `post-user-view` AS SELECT `parent-post`.`author-id` AS `parent-author-id`, `parent-post-author`.`url` AS `parent-author-link`, `parent-post-author`.`name` AS `parent-author-name`, - `parent-post-author`.`network` AS `parent-author-network` + `parent-post-author`.`network` AS `parent-author-network`, + `parent-post-author`.`blocked` AS `parent-author-blocked`, + `parent-post-author`.`hidden` AS `parent-author-hidden` FROM `post-user` STRAIGHT_JOIN `post-thread-user` ON `post-thread-user`.`uri-id` = `post-user`.`parent-uri-id` AND `post-thread-user`.`uid` = `post-user`.`uid` STRAIGHT_JOIN `contact` ON `contact`.`id` = `post-user`.`contact-id` diff --git a/src/Module/Api/Mastodon/Timelines/PublicTimeline.php b/src/Module/Api/Mastodon/Timelines/PublicTimeline.php index 113a5cac2e..1efeabba80 100644 --- a/src/Module/Api/Mastodon/Timelines/PublicTimeline.php +++ b/src/Module/Api/Mastodon/Timelines/PublicTimeline.php @@ -58,7 +58,7 @@ class PublicTimeline extends BaseApi $params = ['order' => ['uri-id' => true], 'limit' => $request['limit']]; $condition = ['gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT], 'private' => Item::PUBLIC, - 'uid' => 0, 'network' => Protocol::FEDERATED]; + 'uid' => 0, 'network' => Protocol::FEDERATED, 'parent-author-blocked' => false, 'parent-author-hidden' => false]; if ($request['local']) { $condition = DBA::mergeConditions($condition, ["`uri-id` IN (SELECT `uri-id` FROM `post-user` WHERE `origin`)"]); diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index 14b7814c09..e3b1bea30c 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -55,7 +55,7 @@ use Friendica\Database\DBA; if (!defined('DB_UPDATE_VERSION')) { - define('DB_UPDATE_VERSION', 1419); + define('DB_UPDATE_VERSION', 1420); } return [ diff --git a/static/dbview.config.php b/static/dbview.config.php index 488cbceaa2..1582890e01 100644 --- a/static/dbview.config.php +++ b/static/dbview.config.php @@ -196,6 +196,8 @@ "parent-author-link" => ["parent-post-author", "url"], "parent-author-name" => ["parent-post-author", "name"], "parent-author-network" => ["parent-post-author", "network"], + "parent-author-blocked" => ["parent-post-author", "blocked"], + "parent-author-hidden" => ["parent-post-author", "hidden"], ], "query" => "FROM `post-user` STRAIGHT_JOIN `post-thread-user` ON `post-thread-user`.`uri-id` = `post-user`.`parent-uri-id` AND `post-thread-user`.`uid` = `post-user`.`uid`