mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-08 04:54:32 +00:00
enforce DM visibility in generateVisibilityQuery
This commit is contained in:
parent
8cf6f32869
commit
27c27529f6
1 changed files with 9 additions and 7 deletions
|
@ -157,15 +157,17 @@ export class QueryService {
|
||||||
qb
|
qb
|
||||||
// My post
|
// My post
|
||||||
.orWhere(':meId = note.userId')
|
.orWhere(':meId = note.userId')
|
||||||
// Reply to me
|
// Visible to me
|
||||||
.orWhere(':meId = note.replyUserId')
|
|
||||||
// DM to me
|
|
||||||
.orWhere(':meIdAsList <@ note.visibleUserIds')
|
.orWhere(':meIdAsList <@ note.visibleUserIds')
|
||||||
|
// Followers-only post
|
||||||
|
.orWhere(new Brackets(qb => qb
|
||||||
|
.andWhere(new Brackets(qbb => this
|
||||||
|
// Following author
|
||||||
|
.orFollowingUser(qbb, ':meId', 'note.userId')
|
||||||
// Mentions me
|
// Mentions me
|
||||||
.orWhere(':meIdAsList <@ note.mentions')
|
.orWhere(':meIdAsList <@ note.mentions')
|
||||||
// Followers-only post
|
// Reply to me
|
||||||
.orWhere(new Brackets(qb => this
|
.orWhere(':meId = note.replyUserId')))
|
||||||
.andFollowingUser(qb, ':meId', 'note.userId')
|
|
||||||
.andWhere('note.visibility = \'followers\'')));
|
.andWhere('note.visibility = \'followers\'')));
|
||||||
|
|
||||||
q.setParameters({ meId: me.id, meIdAsList: [me.id] });
|
q.setParameters({ meId: me.id, meIdAsList: [me.id] });
|
||||||
|
|
Loading…
Add table
Reference in a new issue