Add blocked/ignored filters to Mastodon Timeline API Home and Tags endpoints
This commit is contained in:
parent
90717b602e
commit
d6c1e85b5f
|
@ -90,6 +90,13 @@ class Home extends BaseApi
|
||||||
$condition = DBA::mergeConditions($condition, ['gravity' => Item::GRAVITY_PARENT]);
|
$condition = DBA::mergeConditions($condition, ['gravity' => Item::GRAVITY_PARENT]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!empty($uid)) {
|
||||||
|
$condition = DBA::mergeConditions(
|
||||||
|
$condition,
|
||||||
|
["NOT `parent-author-id` IN (SELECT `cid` FROM `user-contact` WHERE `uid` = ? AND (`blocked` OR `ignored`) AND `cid` = `parent-author-id`)", $uid]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$items = Post::selectForUser($uid, ['uri-id'], $condition, $params);
|
$items = Post::selectForUser($uid, ['uri-id'], $condition, $params);
|
||||||
|
|
||||||
$display_quotes = self::appSupportsQuotes();
|
$display_quotes = self::appSupportsQuotes();
|
||||||
|
|
|
@ -104,6 +104,13 @@ class Tag extends BaseApi
|
||||||
$params['order'] = ['uri-id'];
|
$params['order'] = ['uri-id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!empty($uid)) {
|
||||||
|
$condition = DBA::mergeConditions(
|
||||||
|
$condition,
|
||||||
|
["NOT `parent-author-id` IN (SELECT `cid` FROM `user-contact` WHERE `uid` = ? AND (`blocked` OR `ignored`) AND `cid` = `parent-author-id`)", $uid]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$items = DBA::select('tag-search-view', ['uri-id'], $condition, $params);
|
$items = DBA::select('tag-search-view', ['uri-id'], $condition, $params);
|
||||||
|
|
||||||
$display_quotes = self::appSupportsQuotes();
|
$display_quotes = self::appSupportsQuotes();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user