Add blocked/ignored filters to Mastodon Timeline API Direct and List endpoints
This commit is contained in:
parent
d6c1e85b5f
commit
a4515daca4
|
@ -65,6 +65,13 @@ class Direct 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]
|
||||
);
|
||||
}
|
||||
|
||||
$mails = DBA::select('mail', ['id', 'uri-id'], $condition, $params);
|
||||
|
||||
$statuses = [];
|
||||
|
|
|
@ -95,6 +95,13 @@ class ListTimeline extends BaseApi
|
|||
$condition = DBA::mergeConditions($condition, ["NOT `uri-id` IN (SELECT `uri-id` FROM `post-user` WHERE `origin` AND `post-user`.`uri-id` = `post-user-view`.`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 = Post::selectForUser($uid, ['uri-id'], $condition, $params);
|
||||
|
||||
$display_quotes = self::appSupportsQuotes();
|
||||
|
|
Loading…
Reference in New Issue
Block a user