Force drop crown when user leaves channel

This commit is contained in:
Hri7566 2024-07-09 12:52:37 -04:00
parent a78e188788
commit bb0516b367
2 changed files with 7 additions and 1 deletions

View File

@ -410,6 +410,13 @@ export class Channel extends EventEmitter {
if (p) {
this.ppl.splice(this.ppl.indexOf(p), 1);
if (this.crown) {
if (this.crown.participantId == p.id) {
// Channel owner left, reset crown timeout
this.chown();
}
}
}
// Broadcast bye

View File

@ -142,7 +142,6 @@ export class Socket extends EventEmitter {
// Does channel exist?
if (channel) {
logger.debug("Found channel:", channel.getID());
// Exists, join normally
(async () => {
await this.loadUser();