Weird socket channel joining bug

This commit is contained in:
Hri7566 2024-07-09 12:41:32 -04:00
parent 3c9df73c63
commit a78e188788
1 changed files with 6 additions and 6 deletions

View File

@ -125,24 +125,24 @@ export class Socket extends EventEmitter {
public setChannel(_id: string, set?: Partial<IChannelSettings>) { public setChannel(_id: string, set?: Partial<IChannelSettings>) {
if (this.isDestroyed()) return; if (this.isDestroyed()) return;
if (this.currentChannelID === _id) {
const ch = this.getCurrentChannel(); logger.debug("Guy in channel was already in");
if (ch && ch.getID() == _id) return; return;
}
this.desiredChannel._id = _id; this.desiredChannel._id = _id;
this.desiredChannel.set = set; this.desiredChannel.set = set;
let channel; let channel;
for (const ch of ChannelList.getPublicList()) { for (const ch of ChannelList.getList()) {
if (ch.getID() == _id) { if (ch.getID() == _id) {
channel = ch; channel = ch;
} }
} }
// logger.debug("Found channel:", channel);
// Does channel exist? // Does channel exist?
if (channel) { if (channel) {
logger.debug("Found channel:", channel.getID());
// Exists, join normally // Exists, join normally
(async () => { (async () => {
await this.loadUser(); await this.loadUser();