From d3eb6a33409b9c22431a655bfc8aa797331abff7 Mon Sep 17 00:00:00 2001 From: Chloe Kudryavtsev Date: Sun, 2 Jul 2023 14:25:57 +0200 Subject: [PATCH] fix reply federation --- packages/backend/src/services/note/side-effects.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/services/note/side-effects.ts b/packages/backend/src/services/note/side-effects.ts index 1008facbd..e5e34807d 100644 --- a/packages/backend/src/services/note/side-effects.ts +++ b/packages/backend/src/services/note/side-effects.ts @@ -345,11 +345,12 @@ export async function sideEffects(user: User, note: Note, silent = false, create // If the post is a reply and the poster is a local user and the poster of the post to which you are replying is a remote user, deliver if (note.replyId) { const subquery = Notes.createQueryBuilder() - .select('userId') + .select('"userId"') .where('"id" = :replyId', { replyId: note.replyId }); const u = await Users.createQueryBuilder() .where('"id" IN (' + subquery.getQuery() + ')') - .andWhere('"userHost" IS NOT NULL') + .setParameters(subquery.getParameters()) + .andWhere('host IS NOT NULL') .getOne(); if (u != null) dm.addDirectRecipe(u); } @@ -357,11 +358,12 @@ export async function sideEffects(user: User, note: Note, silent = false, create // If the post is a Renote and the poster is a local user and the poster of the original Renote post is a remote user, deliver if (note.renoteId) { const subquery = Notes.createQueryBuilder() - .select('userId') + .select('"userId"') .where('"id" = :renoteId', { renoteId: note.renoteId }); const u = await Users.createQueryBuilder() .where('"id" IN (' + subquery.getQuery() + ')') - .andWhere('"userHost" IS NOT NULL') + .setParameters(subquery.getParameters()) + .andWhere('host IS NOT NULL') .getOne(); if (u != null) dm.addDirectRecipe(u); }