From: Hank Grabowski Date: Tue, 21 Feb 2023 18:53:16 +0000 (-0500) Subject: Add to Mastodon Status/Context filter for ignored and blocked user's comments X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3958739d605baaabc78dd7c4ca97e23678c028a3;p=friendica.git Add to Mastodon Status/Context filter for ignored and blocked user's comments --- diff --git a/src/Module/Api/Mastodon/Statuses/Context.php b/src/Module/Api/Mastodon/Statuses/Context.php index 76677de4ad..f15f71744c 100644 --- a/src/Module/Api/Mastodon/Statuses/Context.php +++ b/src/Module/Api/Mastodon/Statuses/Context.php @@ -73,6 +73,13 @@ class Context extends BaseApi $condition = DBA::mergeConditions($condition, ["`uri-id` > ?", $request['min_id']]); $params['order'] = ['uri-id']; } + + if (!empty($uid)) { + $condition = DBA::mergeConditions( + $condition, + ["NOT `author-id` IN (SELECT `cid` FROM `user-contact` WHERE `uid` = ? AND (`blocked` OR `ignored`))", $uid] + ); + } $posts = Post::selectPosts(['uri-id', 'thr-parent-id'], $condition, $params); while ($post = Post::fetch($posts)) {