From 3c9df73c631fab5936be30ee6936a3bbb4648151 Mon Sep 17 00:00:00 2001 From: Hri7566 Date: Tue, 9 Jul 2024 12:20:59 -0400 Subject: [PATCH] Fix matched channel ID joining bug --- README.md | 2 -- src/ws/Socket.ts | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fd5044c..71c07d7 100644 --- a/README.md +++ b/README.md @@ -40,11 +40,9 @@ Brandon's server originally used MongoDB for storing user data, but there are to ## TODO -- Fix chown - Add configuration options - Notifications - Ratelimit everything -- Test code for channel settings - Implement both UUID-based and JWT-based token auth for fun - Test tags - Test every frontend diff --git a/src/ws/Socket.ts b/src/ws/Socket.ts index cfde1c3..cfcee03 100644 --- a/src/ws/Socket.ts +++ b/src/ws/Socket.ts @@ -126,6 +126,9 @@ export class Socket extends EventEmitter { public setChannel(_id: string, set?: Partial) { if (this.isDestroyed()) return; + const ch = this.getCurrentChannel(); + if (ch && ch.getID() == _id) return; + this.desiredChannel._id = _id; this.desiredChannel.set = set;