fix: not checking for renotes during packing of note

Closes transfem-org/Sharkey#108
This commit is contained in:
Mar0xy 2023-10-22 19:20:06 +02:00
parent d49099baeb
commit 6d290225ef
No known key found for this signature in database
GPG Key ID: 56569BBE47D2C828
1 changed files with 21 additions and 8 deletions

View File

@ -110,16 +110,29 @@ export class NoteEntityService implements OnModuleInit {
} else if (packedNote.mentions && packedNote.mentions.some(id => meId === id)) {
// 自分へのメンション
hide = false;
} else if (packedNote.renote && (meId === packedNote.renote.userId)) {
hide = false;
} else {
// フォロワーかどうか
const isFollowing = await this.followingsRepository.exist({
where: {
followeeId: packedNote.userId,
followerId: meId,
},
});
if (packedNote.renote) {
const isFollowing = await this.followingsRepository.exist({
where: {
followeeId: packedNote.renote.userId,
followerId: meId,
},
});
hide = !isFollowing;
} else {
// フォロワーかどうか
const isFollowing = await this.followingsRepository.exist({
where: {
followeeId: packedNote.userId,
followerId: meId,
},
});
hide = !isFollowing;
hide = !isFollowing;
}
}
}