diff --git a/web/static/js/BareRTC.js b/web/static/js/BareRTC.js index 5fd47ed..5d654a5 100644 --- a/web/static/js/BareRTC.js +++ b/web/static/js/BareRTC.js @@ -333,6 +333,11 @@ const app = Vue.createApp({ this.dial(); }, + // Normalize a DM channel name into a username (remove the @ prefix) + normalizeUsername(channel) { + return channel.replace(/^@+/, ''); + }, + /** * Chat API Methods (WebSocket packets sent/received) */ @@ -417,6 +422,7 @@ const app = Vue.createApp({ // Mute or unmute a user. muteUser(username) { + username = this.normalizeUsername(username); let mute = this.muted[username] == undefined; if (mute) { this.muted[username] = true; @@ -442,7 +448,7 @@ const app = Vue.createApp({ })); }, isMutedUser(username) { - return this.muted[username] != undefined; + return this.muted[this.normalizeUsername(username)] != undefined; }, // Send a video request to access a user's camera. diff --git a/web/templates/chat.html b/web/templates/chat.html index 5736e3d..37a7218 100644 --- a/web/templates/chat.html +++ b/web/templates/chat.html @@ -853,6 +853,14 @@ + +
+ + [[channel]] is currently muted so you have not been seeing their recent + chat messages or DMs. + Unmute them? +
+