From 6d231c4bc9d319e47523b883a267a13f93b1e5eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B2=E3=81=9F=E3=82=8A=E3=82=93?= Date: Sun, 29 Sep 2024 20:19:48 +0900 Subject: [PATCH] Merge pull request #33 from lqvp/master visibility --- packages/backend/src/core/QueryService.ts | 4 +++- .../backend/src/core/entities/NoteEntityService.ts | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/core/QueryService.ts b/packages/backend/src/core/QueryService.ts index c4feeaf971..00f0c0afba 100755 --- a/packages/backend/src/core/QueryService.ts +++ b/packages/backend/src/core/QueryService.ts @@ -195,7 +195,9 @@ export class QueryService { qb .where('note.visibility = \'public\'') .orWhere('note.visibility = \'home\''); - })); + }) + .andWhere('note.localOnly = FALSE') // 連合なしのノートは未ログイン者には見せない + ); } else { const followingQuery = this.followingsRepository.createQueryBuilder('following') .select('following.followeeId') diff --git a/packages/backend/src/core/entities/NoteEntityService.ts b/packages/backend/src/core/entities/NoteEntityService.ts index 7b5d46e41c..1a6e209021 100755 --- a/packages/backend/src/core/entities/NoteEntityService.ts +++ b/packages/backend/src/core/entities/NoteEntityService.ts @@ -97,6 +97,11 @@ export class NoteEntityService implements OnModuleInit { } } + // 連合なしで未ログインなら非表示 + if(packedNote.localOnly && !meId){ + hide = true; + } + // visibility が followers かつ自分が投稿者のフォロワーでなかったら非表示 if (packedNote.visibility === 'followers') { if (meId == null) { @@ -241,6 +246,11 @@ export class NoteEntityService implements OnModuleInit { } } + // 連合なし、かつ visibility が home で未ログインなら非表示 + if(note.localOnly && note.visibility === 'home' && !meId){ + return false; + } + // visibility が followers かつ自分が投稿者のフォロワーでなかったら非表示 if (note.visibility === 'followers') { if (meId == null) {