mirror of
https://github.com/versia-pub/server.git
synced 2025-12-07 08:48:19 +01:00
fix(federation): 🐛 Don't try to federate to local users
This commit is contained in:
parent
32cb0ea733
commit
0eee4a1f20
|
|
@ -13,6 +13,7 @@ import {
|
||||||
eq,
|
eq,
|
||||||
gte,
|
gte,
|
||||||
inArray,
|
inArray,
|
||||||
|
isNotNull,
|
||||||
isNull,
|
isNull,
|
||||||
sql,
|
sql,
|
||||||
} from "drizzle-orm";
|
} from "drizzle-orm";
|
||||||
|
|
@ -522,6 +523,7 @@ export class User {
|
||||||
// Get followers
|
// Get followers
|
||||||
const followers = await User.manyFromSql(
|
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)`,
|
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) {
|
for (const follower of followers) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue