fix(federation): 🐛 Don't try to federate to local users

This commit is contained in:
Jesse Wierzbinski 2024-06-05 19:12:23 -10:00
parent 32cb0ea733
commit 0eee4a1f20
No known key found for this signature in database

View file

@ -13,6 +13,7 @@ import {
eq,
gte,
inArray,
isNotNull,
isNull,
sql,
} from "drizzle-orm";
@ -522,6 +523,7 @@ export class User {
// Get followers
const followers = await User.manyFromSql(
sql`EXISTS (SELECT 1 FROM "Relationships" WHERE "Relationships"."subjectId" = ${this.id} AND "Relationships"."ownerId" = ${Users.id} AND "Relationships"."following" = true)`,
isNotNull(Users.instanceId),
);
for (const follower of followers) {