diff --git a/src/api/user.ts b/src/api/user.ts index 8c3547c..e7eaaa8 100644 --- a/src/api/user.ts +++ b/src/api/user.ts @@ -86,14 +86,13 @@ export class Client { let query = await select([rooms.roomID, rooms.owner, rooms.rights, roomMembers.admin], innerJoinUsing(rooms, roomMembers, rooms.roomID, roomMembers.roomID)) .where(and( eq(rooms.name, name), - eq(roomMembers.admin, true), eq(roomMembers.name, this.name), eq(roomMembers.server, this.state == STATE.client ? "local" : this.server.tag) )) .query(db); if (query.length == 0) return -1; if ( - query[0][roomMembers.admin] == 0 + !query[0][roomMembers.admin] && query[0][rooms.owner] != this.accID && !(query[0][rooms.rights] & roomRightRequires) ) return -1;