[mastodon-client] Fix posts falsely showing as boosted

This commit is contained in:
Laura Hausmann 2023-09-25 23:00:47 +02:00
parent d9ec53db4c
commit f1f0fa3bc7
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -17,6 +17,7 @@ import { populatePoll } from "@/models/repositories/note.js";
import { FileConverter } from "@/server/api/mastodon/converters/file.js"; import { FileConverter } from "@/server/api/mastodon/converters/file.js";
import { awaitAll } from "@/prelude/await-all.js"; import { awaitAll } from "@/prelude/await-all.js";
import { AccountCache, UserHelpers } from "@/server/api/mastodon/helpers/user.js"; import { AccountCache, UserHelpers } from "@/server/api/mastodon/helpers/user.js";
import { IsNull } from "typeorm";
export class NoteConverter { export class NoteConverter {
public static async encode(note: Note, user: ILocalUser | null, cache: AccountCache = UserHelpers.getFreshAccountCache()): Promise<MastodonEntity.Status> { public static async encode(note: Note, user: ILocalUser | null, cache: AccountCache = UserHelpers.getFreshAccountCache()): Promise<MastodonEntity.Status> {
@ -49,7 +50,8 @@ export class NoteConverter {
const isReblogged = user ? Notes.exist({ const isReblogged = user ? Notes.exist({
where: { where: {
userId: user.id, userId: user.id,
renoteId: note.id renoteId: note.id,
text: IsNull(),
} }
}) : null; }) : null;