summaryrefslogtreecommitdiff
path: root/packages/backend/src/models
diff options
context:
space:
mode:
authorJohann150 <johann.galle@protonmail.com>2022-06-11 09:14:44 +0200
committerGitHub <noreply@github.com>2022-06-11 16:14:44 +0900
commit7db09103e76218f6c867f4a9f1cbc2dd25512e3d (patch)
tree755a9b534816938d94bd2fd67976c1b410b193e3 /packages/backend/src/models
parentNew Crowdin updates (#8669) (diff)
downloadmisskey-7db09103e76218f6c867f4a9f1cbc2dd25512e3d.tar.gz
misskey-7db09103e76218f6c867f4a9f1cbc2dd25512e3d.tar.bz2
misskey-7db09103e76218f6c867f4a9f1cbc2dd25512e3d.zip
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
Diffstat (limited to 'packages/backend/src/models')
-rw-r--r--packages/backend/src/models/repositories/note.ts1
1 files changed, 1 insertions, 0 deletions
diff --git a/packages/backend/src/models/repositories/note.ts b/packages/backend/src/models/repositories/note.ts
index c0abbb4f93..3fefab0319 100644
--- a/packages/backend/src/models/repositories/note.ts
+++ b/packages/backend/src/models/repositories/note.ts
@@ -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) {