wip
This commit is contained in:
parent
6d68cfd1e3
commit
236eed94bb
|
@ -98,13 +98,13 @@ export class NoteEntityService implements OnModuleInit {
|
||||||
} else if (meId === packedNote.userId) {
|
} else if (meId === packedNote.userId) {
|
||||||
hide = false;
|
hide = false;
|
||||||
} else if (packedNote.reply && (meId === packedNote.reply.userId)) {
|
} else if (packedNote.reply && (meId === packedNote.reply.userId)) {
|
||||||
// 自分の投稿に対するリプライ
|
// 自分の投稿に対するリプライ
|
||||||
hide = false;
|
hide = false;
|
||||||
} else if (packedNote.mentions && packedNote.mentions.some(id => meId === id)) {
|
} else if (packedNote.mentions && packedNote.mentions.some(id => meId === id)) {
|
||||||
// 自分へのメンション
|
// 自分へのメンション
|
||||||
hide = false;
|
hide = false;
|
||||||
} else {
|
} else {
|
||||||
// フォロワーかどうか
|
// フォロワーかどうか
|
||||||
const isFollowing = await this.followingsRepository.exist({
|
const isFollowing = await this.followingsRepository.exist({
|
||||||
where: {
|
where: {
|
||||||
followeeId: packedNote.userId,
|
followeeId: packedNote.userId,
|
||||||
|
|
|
@ -65,10 +65,12 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
) {
|
) {
|
||||||
super(meta, paramDef, async (ps, me) => {
|
super(meta, paramDef, async (ps, me) => {
|
||||||
const [
|
const [
|
||||||
|
followings,
|
||||||
userIdsWhoMeMuting,
|
userIdsWhoMeMuting,
|
||||||
userIdsWhoMeMutingRenotes,
|
userIdsWhoMeMutingRenotes,
|
||||||
userIdsWhoBlockingMe,
|
userIdsWhoBlockingMe,
|
||||||
] = await Promise.all([
|
] = await Promise.all([
|
||||||
|
this.cacheService.userFollowingsCache.fetch(me.id),
|
||||||
this.cacheService.userMutingsCache.fetch(me.id),
|
this.cacheService.userMutingsCache.fetch(me.id),
|
||||||
this.cacheService.renoteMutingsCache.fetch(me.id),
|
this.cacheService.renoteMutingsCache.fetch(me.id),
|
||||||
this.cacheService.userBlockedCache.fetch(me.id),
|
this.cacheService.userBlockedCache.fetch(me.id),
|
||||||
|
@ -116,6 +118,9 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
if (ps.withRenotes === false) return false;
|
if (ps.withRenotes === false) return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (note.reply && note.reply.visibility === 'followers') {
|
||||||
|
if (!Object.hasOwn(followings, note.reply.userId)) return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue