mirror of
https://github.com/friendica/friendica
synced 2024-11-18 17:43:41 +00:00
Add blocked/ignored filters to Mastodon Timeline API Home and Tags endpoints
This commit is contained in:
parent
90717b602e
commit
d6c1e85b5f
2 changed files with 14 additions and 0 deletions
|
@ -90,6 +90,13 @@ class Home extends BaseApi
|
|||
$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);
|
||||
|
||||
$display_quotes = self::appSupportsQuotes();
|
||||
|
|
|
@ -104,6 +104,13 @@ class Tag extends BaseApi
|
|||
$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);
|
||||
|
||||
$display_quotes = self::appSupportsQuotes();
|
||||
|
|
Loading…
Reference in a new issue