From 9efffabe805b9d46dbb5052b28ebc01bde5c6403 Mon Sep 17 00:00:00 2001 From: jusax23 Date: Wed, 22 Mar 2023 21:10:54 +0100 Subject: [PATCH] bug fix --- src/api/acts/client.ts | 2 -- src/api/user.ts | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/api/acts/client.ts b/src/api/acts/client.ts index 9e82368..ac7ea2f 100644 --- a/src/api/acts/client.ts +++ b/src/api/acts/client.ts @@ -96,7 +96,6 @@ export const createRoom: Act = { right: PERMISSIONS.CAN_USE_API, data: { room: "name-100", - server: "string", // Unused/Ignored at the Moment title: "string-255", description: "string-255", visibility: "number", @@ -141,7 +140,6 @@ export const deleteRoom: Act = { right: PERMISSIONS.CAN_USE_API, data: { room: "string", - server: "string", // Unused/Ignored at the Moment }, func: async (client: Client, data: any, aws: (code: string, data: any) => void) => { let req = await remove(rooms) diff --git a/src/api/user.ts b/src/api/user.ts index bd7649d..5c1a81a 100644 --- a/src/api/user.ts +++ b/src/api/user.ts @@ -68,7 +68,7 @@ export class Client { .where(and( eq(rooms.name, name), eq(roomMembers.name, this.name), - eq(roomMembers.server, this.server.tag) + eq(roomMembers.server, this.state == STATE.client ? "local" : this.server.tag) )) .query(db); if (query.length == 0) return -1; @@ -81,7 +81,7 @@ export class Client { eq(rooms.name, name), eq(roomMembers.admin, true), eq(roomMembers.name, this.name), - eq(roomMembers.server, this.server.tag) + eq(roomMembers.server, this.state == STATE.client ? "local" : this.server.tag) )) .query(db); if (query.length == 0) return -1;