mirror of
https://github.com/friendica/friendica
synced 2024-11-18 17:03:41 +00:00
Add blocked/ignored filters to Mastodon Timeline API Direct and List endpoints
This commit is contained in:
parent
d6c1e85b5f
commit
a4515daca4
2 changed files with 14 additions and 0 deletions
|
@ -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 a new issue