summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/notes/mentions.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/api/endpoints/notes/mentions.ts')
-rw-r--r--src/server/api/endpoints/notes/mentions.ts10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/server/api/endpoints/notes/mentions.ts b/src/server/api/endpoints/notes/mentions.ts
index 8a9d295d38..30368ea578 100644
--- a/src/server/api/endpoints/notes/mentions.ts
+++ b/src/server/api/endpoints/notes/mentions.ts
@@ -63,7 +63,11 @@ export default define(meta, async (ps, user) => {
.where(`:meId = ANY(note.mentions)`, { meId: user.id })
.orWhere(`:meId = ANY(note.visibleUserIds)`, { meId: user.id });
}))
- .leftJoinAndSelect('note.user', 'user');
+ .innerJoinAndSelect('note.user', 'user')
+ .leftJoinAndSelect('note.reply', 'reply')
+ .leftJoinAndSelect('note.renote', 'renote')
+ .leftJoinAndSelect('reply.user', 'replyUser')
+ .leftJoinAndSelect('renote.user', 'renoteUser');
generateVisibilityQuery(query, user);
generateMutedUserQuery(query, user);
@@ -79,9 +83,7 @@ export default define(meta, async (ps, user) => {
const mentions = await query.take(ps.limit!).getMany();
- for (const note of mentions) {
- read(user.id, note.id);
- }
+ read(user.id, mentions.map(note => note.id));
return await Notes.packMany(mentions, user);
});