Fix federated interactions and reply threads

This commit is contained in:
cyph3rasi
2026-03-07 21:27:22 -08:00
parent 1e2da4f2da
commit 5d524a0354
21 changed files with 241 additions and 59 deletions
+7 -1
View File
@@ -5,6 +5,7 @@ import { eq, and, sql } from 'drizzle-orm';
import { requireAuth } from '@/lib/auth';
import { requireSignedAction } from '@/lib/auth/verify-signature';
import { isSwarmNode, deliverSwarmFollow, deliverSwarmUnfollow, cacheSwarmUserPosts } from '@/lib/swarm/interactions';
import { discoverNode } from '@/lib/swarm/discovery';
type RouteContext = { params: Promise<{ handle: string }> };
@@ -115,7 +116,12 @@ export async function POST(request: Request, context: RouteContext) {
}
// Only allow following swarm nodes
const isSwarm = await isSwarmNode(remote.domain);
let isSwarm = await isSwarmNode(remote.domain);
if (!isSwarm) {
const discovery = await discoverNode(remote.domain, nodeDomain);
isSwarm = discovery.success;
}
if (!isSwarm) {
return NextResponse.json({ error: 'Can only follow users on Synapsis swarm nodes' }, { status: 400 });
}