[mastodon-client] Add note.user joins to all timeline queries

This commit is contained in:
Laura Hausmann 2023-11-25 01:50:49 +01:00
parent b1d3e1d05f
commit 60a6e08c0b
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -81,7 +81,9 @@ export class TimelineHelpers {
if (local) query.andWhere("note.userHost IS NULL"); if (local) query.andWhere("note.userHost IS NULL");
if (!local) query.andWhere("note.channelId IS NULL"); if (!local) query.andWhere("note.channelId IS NULL");
query.leftJoinAndSelect("note.renote", "renote"); query
.leftJoinAndSelect("note.user", "user")
.leftJoinAndSelect("note.renote", "renote");
generateRepliesQuery(query, true, user); generateRepliesQuery(query, true, user);
if (user) { if (user) {
@ -113,6 +115,7 @@ export class TimelineHelpers {
) )
.andWhere(`note.userId IN (${listQuery.getQuery()})`) .andWhere(`note.userId IN (${listQuery.getQuery()})`)
.andWhere("note.visibility != 'specified'") .andWhere("note.visibility != 'specified'")
.leftJoinAndSelect("note.user", "user")
.leftJoinAndSelect("note.renote", "renote") .leftJoinAndSelect("note.renote", "renote")
.setParameters({ listId: list.id }); .setParameters({ listId: list.id });
@ -148,7 +151,9 @@ export class TimelineHelpers {
if (local) query.andWhere("note.userHost IS NULL"); if (local) query.andWhere("note.userHost IS NULL");
if (!local) query.andWhere("note.channelId IS NULL"); if (!local) query.andWhere("note.channelId IS NULL");
query.leftJoinAndSelect("note.renote", "renote"); query
.leftJoinAndSelect("note.user", "user")
.leftJoinAndSelect("note.renote", "renote");
generateRepliesQuery(query, true, user); generateRepliesQuery(query, true, user);
if (user) { if (user) {