summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/web/ClientServerService.ts
diff options
context:
space:
mode:
authorsyuilo <4439005+syuilo@users.noreply.github.com>2025-05-09 17:44:35 +0900
committerGitHub <noreply@github.com>2025-05-09 17:44:35 +0900
commitebf291084f9490f0345a488592e2b4cd2ffb9d91 (patch)
tree243df153ec60c16e495f344e9643bf0fc7668230 /packages/backend/src/server/web/ClientServerService.ts
parentFeat: No websocket mode (#15851) (diff)
downloadmisskey-ebf291084f9490f0345a488592e2b4cd2ffb9d91.tar.gz
misskey-ebf291084f9490f0345a488592e2b4cd2ffb9d91.tar.bz2
misskey-ebf291084f9490f0345a488592e2b4cd2ffb9d91.zip
Feat: UGCの公開範囲設定機能 (#15938)
* wip * Update CHANGELOG.md * wip * wip * Update show.ts
Diffstat (limited to 'packages/backend/src/server/web/ClientServerService.ts')
-rw-r--r--packages/backend/src/server/web/ClientServerService.ts15
1 files changed, 13 insertions, 2 deletions
diff --git a/packages/backend/src/server/web/ClientServerService.ts b/packages/backend/src/server/web/ClientServerService.ts
index 30a911088e..9a33d27d86 100644
--- a/packages/backend/src/server/web/ClientServerService.ts
+++ b/packages/backend/src/server/web/ClientServerService.ts
@@ -513,7 +513,12 @@ export class ClientServerService {
vary(reply.raw, 'Accept');
- if (user != null) {
+ if (
+ user != null && (
+ this.meta.ugcVisibilityForVisitor === 'all' ||
+ (this.meta.ugcVisibilityForVisitor === 'local' && user.host == null)
+ )
+ ) {
const profile = await this.userProfilesRepository.findOneByOrFail({ userId: user.id });
const me = profile.fields
? profile.fields
@@ -577,7 +582,13 @@ export class ClientServerService {
relations: ['user'],
});
- if (note && !note.user!.requireSigninToViewContents) {
+ if (
+ note &&
+ !note.user!.requireSigninToViewContents &&
+ (this.meta.ugcVisibilityForVisitor === 'all' ||
+ (this.meta.ugcVisibilityForVisitor === 'local' && note.userHost == null)
+ )
+ ) {
const _note = await this.noteEntityService.pack(note);
const profile = await this.userProfilesRepository.findOneByOrFail({ userId: note.userId });
reply.header('Cache-Control', 'public, max-age=15');