Compare commits

...

3 commits

View file

@ -344,24 +344,26 @@ 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 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) { if (note.replyId) {
const subquery = Notes.createaQueryBuilder() const subquery = Notes.createQueryBuilder()
.select('userId') .select('"userId"')
.where('"id" = :replyId', { replyId: note.replyId }); .where('"id" = :replyId', { replyId: note.replyId });
const u = await Users.createQueryBuilder() const u = await Users.createQueryBuilder()
.where('"id" IN (' + subquery.getQuery() + ')') .where('"id" IN (' + subquery.getQuery() + ')')
.andWhere('"userHost" IS NOT NULL') .setParameters(subquery.getParameters())
.andWhere('host IS NOT NULL')
.getOne(); .getOne();
if (u != null) dm.addDirectRecipe(u); if (u != null) dm.addDirectRecipe(u);
} }
// 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 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) { if (note.renoteId) {
const subquery = Notes.createaQueryBuilder() const subquery = Notes.createQueryBuilder()
.select('userId') .select('"userId"')
.where('"id" = :renoteId', { renoteId: note.renoteId }); .where('"id" = :renoteId', { renoteId: note.renoteId });
const u = await Users.createQueryBuilder() const u = await Users.createQueryBuilder()
.where('"id" IN (' + subquery.getQuery() + ')') .where('"id" IN (' + subquery.getQuery() + ')')
.andWhere('"userHost" IS NOT NULL') .setParameters(subquery.getParameters())
.andWhere('host IS NOT NULL')
.getOne(); .getOne();
if (u != null) dm.addDirectRecipe(u); if (u != null) dm.addDirectRecipe(u);
} }