mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2025-09-18 21:38:07 +00:00
fix visibility regressions and merge typos
This commit is contained in:
parent
aba4b537ad
commit
d222fafc1b
2 changed files with 13 additions and 12 deletions
|
@ -168,8 +168,10 @@ export class QueryService {
|
||||||
.orWhere(':meId = note.replyUserId')
|
.orWhere(':meId = note.replyUserId')
|
||||||
// DM to me
|
// DM to me
|
||||||
.orWhere(':meIdAsList <@ note.visibleUserIds')
|
.orWhere(':meIdAsList <@ note.visibleUserIds')
|
||||||
// Mentions me
|
// Mentions me (and not a direct message)
|
||||||
.orWhere(':meIdAsList <@ note.mentions')
|
.orWhere(new Brackets(qb =>
|
||||||
|
qb.andWhere(':meIdAsList <@ note.mentions')
|
||||||
|
.andWhere('note.visibility != \'specified\'')))
|
||||||
// Followers-only post
|
// Followers-only post
|
||||||
.orWhere(new Brackets(qb => this
|
.orWhere(new Brackets(qb => this
|
||||||
.andFollowingUser(qb, ':meId', 'note.userId')
|
.andFollowingUser(qb, ':meId', 'note.userId')
|
||||||
|
|
|
@ -77,17 +77,21 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
))
|
))
|
||||||
.setParameters({ meIdAsList: [me.id] })
|
.setParameters({ meIdAsList: [me.id] })
|
||||||
, 'source')
|
, 'source')
|
||||||
.innerJoin(MiNote, 'note', 'note.id = source.id');
|
.innerJoin(MiNote, 'note', 'note.id = source.id')
|
||||||
|
.innerJoinAndSelect('note.user', 'user')
|
||||||
|
.leftJoinAndSelect('note.reply', 'reply')
|
||||||
|
.leftJoinAndSelect('note.renote', 'renote')
|
||||||
|
.leftJoinAndSelect('reply.user', 'replyUser')
|
||||||
|
.leftJoinAndSelect('renote.user', 'renoteUser');
|
||||||
|
|
||||||
// Mentioned or visible users can always access
|
this.queryService.generateVisibilityQuery(qb, me);
|
||||||
//this.queryService.generateVisibilityQuery(query, me);
|
|
||||||
this.queryService.generateBlockedHostQueryForNote(qb);
|
this.queryService.generateBlockedHostQueryForNote(qb);
|
||||||
this.queryService.generateSuspendedUserQueryForNote(query);
|
this.queryService.generateSuspendedUserQueryForNote(qb);
|
||||||
this.queryService.generateMutedUserQueryForNotes(qb, me);
|
this.queryService.generateMutedUserQueryForNotes(qb, me);
|
||||||
this.queryService.generateMutedNoteThreadQuery(qb, me);
|
this.queryService.generateMutedNoteThreadQuery(qb, me);
|
||||||
this.queryService.generateBlockedUserQueryForNotes(qb, me);
|
this.queryService.generateBlockedUserQueryForNotes(qb, me);
|
||||||
// A renote can't mention a user, so it will never appear here anyway.
|
// A renote can't mention a user, so it will never appear here anyway.
|
||||||
//this.queryService.generateMutedUserRenotesQueryForNotes(query, me);
|
//this.queryService.generateMutedUserRenotesQueryForNotes(qb, me);
|
||||||
|
|
||||||
if (ps.visibility) {
|
if (ps.visibility) {
|
||||||
qb.andWhere('note.visibility = :visibility', { visibility: ps.visibility });
|
qb.andWhere('note.visibility = :visibility', { visibility: ps.visibility });
|
||||||
|
@ -101,11 +105,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
|
|
||||||
return qb;
|
return qb;
|
||||||
}, 'source', 'source.id = note.id')
|
}, 'source', 'source.id = note.id')
|
||||||
.innerJoinAndSelect('note.user', 'user')
|
|
||||||
.leftJoinAndSelect('note.reply', 'reply')
|
|
||||||
.leftJoinAndSelect('note.renote', 'renote')
|
|
||||||
.leftJoinAndSelect('reply.user', 'replyUser')
|
|
||||||
.leftJoinAndSelect('renote.user', 'renoteUser')
|
|
||||||
.limit(ps.limit);
|
.limit(ps.limit);
|
||||||
|
|
||||||
const mentions = await query.getMany();
|
const mentions = await query.getMany();
|
||||||
|
|
Loading…
Add table
Reference in a new issue