]> git.mxchange.org Git - friendica.git/commitdiff
Add to Mastodon Status/Context filter for ignored and blocked user's comments
authorHank Grabowski <hankgrabowski@gmail.com>
Tue, 21 Feb 2023 18:53:16 +0000 (13:53 -0500)
committerHank Grabowski <hankgrabowski@gmail.com>
Tue, 21 Feb 2023 18:53:16 +0000 (13:53 -0500)
src/Module/Api/Mastodon/Statuses/Context.php

index 76677de4ad292825a66a0a8e3d2961b09bc3422c..f15f71744cfa3880d27828911857845739bbfc9b 100644 (file)
@@ -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)) {