Add to Mastodon Status/Context filter for ignored and blocked user's comments

This commit is contained in:
Hank Grabowski 2023-02-21 13:53:16 -05:00
parent b1b3b0ffe7
commit 3958739d60

View file

@ -74,6 +74,13 @@ class Context extends BaseApi
$params['order'] = ['uri-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); $posts = Post::selectPosts(['uri-id', 'thr-parent-id'], $condition, $params);
while ($post = Post::fetch($posts)) { while ($post = Post::fetch($posts)) {
if ($post['uri-id'] == $post['thr-parent-id']) { if ($post['uri-id'] == $post['thr-parent-id']) {