Still working on stability

This commit is contained in:
Owen
2025-04-20 14:25:53 -04:00
parent e2efd0e65a
commit f6a19631dc
6 changed files with 128 additions and 86 deletions

View File

@@ -1,6 +1,6 @@
import db from "@server/db";
import { MessageHandler } from "../ws";
import { clients, clientSites, Olm, olms, sites } from "@server/db/schema";
import { clients, clientSites, Olm } from "@server/db/schema";
import { eq } from "drizzle-orm";
import { updatePeer } from "../newt/peers";
import logger from "@server/logger";
@@ -42,6 +42,13 @@ export const handleOlmRelayMessage: MessageHandler = async (context) => {
const { siteId } = message.data;
await db
.update(clientSites)
.set({
isRelayed: true
})
.where(eq(clientSites.clientId, olm.clientId));
// update the peer on the exit node
await updatePeer(siteId, client.pubKey, {
endpoint: "" // this removes the endpoint