enforce DM visibility in generateVisibilityQuery

This commit is contained in:
Hazelnoot 2025-06-10 19:52:47 -04:00
parent 8cf6f32869
commit 27c27529f6

View file

@ -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')
// Mentions me
.orWhere(':meIdAsList <@ note.mentions')
// Followers-only post // Followers-only post
.orWhere(new Brackets(qb => this .orWhere(new Brackets(qb => qb
.andFollowingUser(qb, ':meId', 'note.userId') .andWhere(new Brackets(qbb => this
// Following author
.orFollowingUser(qbb, ':meId', 'note.userId')
// Mentions me
.orWhere(':meIdAsList <@ note.mentions')
// Reply to me
.orWhere(':meId = note.replyUserId')))
.andWhere('note.visibility = \'followers\''))); .andWhere('note.visibility = \'followers\'')));
q.setParameters({ meId: me.id, meIdAsList: [me.id] }); q.setParameters({ meId: me.id, meIdAsList: [me.id] });