From 91259369b2b87eb647e9743c874d7e58894149c1 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sat, 27 Jan 2024 19:59:39 +0100 Subject: handle room joins without page reload. --- client-web/source/user/remote.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'client-web/source/user/remote.ts') diff --git a/client-web/source/user/remote.ts b/client-web/source/user/remote.ts index 9964937..262efcd 100644 --- a/client-web/source/user/remote.ts +++ b/client-web/source/user/remote.ts @@ -6,7 +6,6 @@ /// import { RelayMessage } from "../../../common/packets.d.ts"; -import { GLOBAL_CHAT } from "../chat.ts"; import { notify } from "../helper.ts"; import { log } from "../logger.ts" import { PREFS } from "../preferences/mod.ts"; @@ -81,7 +80,7 @@ export class RemoteUser extends User { this.room.remote_users.delete(this.id) this.room.element.removeChild(this.el) if (PREFS.notify_leave) notify(`${this.display_name} left`) - GLOBAL_CHAT.add_control_message({ leave: this }) + this.room.chat.add_control_message({ leave: this }) } on_relay(message: RelayMessage) { if (message.chat) this.room.chat.add_message(this, message.chat) @@ -91,7 +90,7 @@ export class RemoteUser extends User { if (message.identify) { this.name = message.identify.username if (PREFS.notify_join) notify(`${this.display_name} joined`) - GLOBAL_CHAT.add_control_message({ join: this }) + this.room.chat.add_control_message({ join: this }) } if (message.provide) { const d = new_remote_resource(this, message.provide) -- cgit v1.2.3-70-g09d2