chore: synchronize visibility checks (#8687)
* reuse single meId parameter * unify code style Use template string to avoid having to use escaped quote marks. * fix: follower only notes are visible to mentioned users This synchronizes the visibility rules with the Notes.isVisibleForMe method from packages/backend/src/models/repositories/note.ts * add comment
This commit is contained in:
parent
2a4eddc80f
commit
7db09103e7
2 changed files with 9 additions and 6 deletions
|
@ -136,6 +136,7 @@ async function populateMyReaction(note: Note, meId: User['id'], _hint_?: {
|
|||
|
||||
export const NoteRepository = db.getRepository(Note).extend({
|
||||
async isVisibleForMe(note: Note, meId: User['id'] | null): Promise<boolean> {
|
||||
// This code must always be synchronized with the checks in generateVisibilityQuery.
|
||||
// visibility が specified かつ自分が指定されていなかったら非表示
|
||||
if (note.visibility === 'specified') {
|
||||
if (meId == null) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue