fix: check visibility when serving Like activity
This commit is contained in:
parent
375323bc25
commit
2ed46aaebb
1 changed files with 7 additions and 4 deletions
|
@ -206,16 +206,19 @@ router.get('/emojis/:emoji', async ctx => {
|
||||||
|
|
||||||
// like
|
// like
|
||||||
router.get('/likes/:like', async ctx => {
|
router.get('/likes/:like', async ctx => {
|
||||||
const reaction = await NoteReactions.findOneBy({ id: ctx.params.like });
|
const note = await Notes.findOneBy({
|
||||||
|
id: reaction.noteId,
|
||||||
|
visibility: In(['public' as const, 'home' as const]),
|
||||||
|
});
|
||||||
|
|
||||||
if (reaction == null) {
|
if (note == null) {
|
||||||
ctx.status = 404;
|
ctx.status = 404;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const note = await Notes.findOneBy({ id: reaction.noteId });
|
const reaction = await NoteReactions.findOneBy({ id: ctx.params.like });
|
||||||
|
|
||||||
if (note == null) {
|
if (reaction == null) {
|
||||||
ctx.status = 404;
|
ctx.status = 404;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue