aboutsummaryrefslogtreecommitdiff
path: root/client-web/source/user.ts
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2022-09-09 12:45:37 +0200
committermetamuffin <metamuffin@disroot.org>2022-09-09 12:45:37 +0200
commite590ea788aefe0714bb9ce24976303566a648d42 (patch)
treed6b3d827512af388fe0ea4f2ac1c2f1fc983178a /client-web/source/user.ts
parentb25bbae82f9bfaf6f37dfb16e07708060dd3df55 (diff)
downloadkeks-meet-e590ea788aefe0714bb9ce24976303566a648d42.tar
keks-meet-e590ea788aefe0714bb9ce24976303566a648d42.tar.bz2
keks-meet-e590ea788aefe0714bb9ce24976303566a648d42.tar.zst
reworked websocket stuff with encryption and new spec
Diffstat (limited to 'client-web/source/user.ts')
-rw-r--r--client-web/source/user.ts13
1 files changed, 7 insertions, 6 deletions
diff --git a/client-web/source/user.ts b/client-web/source/user.ts
index dbf2862..057cdf4 100644
--- a/client-web/source/user.ts
+++ b/client-web/source/user.ts
@@ -6,13 +6,12 @@ import { TrackHandle } from "./track_handle.ts";
export abstract class User {
- el: HTMLElement
-
- local = false
-
+ protected el: HTMLElement
+ public local = false
+ public name?: string
protected tracks: Set<TrackHandle> = new Set()
- constructor(public room: Room, public id: number, public name: string) {
+ constructor(public room: Room, public id: number,) {
this.el = document.createElement("div")
this.el.classList.add("user")
this.room.el.append(this.el)
@@ -34,11 +33,13 @@ export abstract class User {
})
}
+ get display_name() { return this.name ?? `guest (${this.id})` }
+
setup_view() {
const info_el = document.createElement("div")
info_el.classList.add("info")
const name_el = document.createElement("span")
- name_el.textContent = this.name
+ name_el.textContent = this.display_name
name_el.classList.add("name")
info_el.append(name_el)
this.el.append(info_el)