Feat: UGCの公開範囲設定機能 (#15938)

* wip

* Update CHANGELOG.md

* wip

* wip

* Update show.ts
This commit is contained in:
syuilo
2025-05-09 17:44:35 +09:00
committed by GitHub
parent 8c2ab25e5f
commit ebf291084f
12 changed files with 144 additions and 6 deletions

View File

@@ -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');