Merge pull request #33 from lqvp/master

visibility
This commit is contained in:
ひたりん 2024-09-29 20:19:48 +09:00 committed by hijiki
parent a313fc6366
commit 6d231c4bc9
2 changed files with 13 additions and 1 deletions

View File

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

View File

@ -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) {