First pass at full fork pretty much complete.
This commit is contained in:
+30
-2
@@ -2101,6 +2101,19 @@ function gotUserMessage(id, dest, username, time, privileged, kind, error, messa
|
||||
displayError(`${from} said: ${message}`, kind);
|
||||
break;
|
||||
}
|
||||
case 'recording': {
|
||||
if(!privileged) {
|
||||
console.error(`Got unprivileged message of kind ${kind}`);
|
||||
return;
|
||||
}
|
||||
let text = '' + message;
|
||||
if(text === 'Recording started')
|
||||
announceUrgent(text);
|
||||
else
|
||||
announceChat(text);
|
||||
displayMessage(text);
|
||||
break;
|
||||
}
|
||||
case 'mute': {
|
||||
if(!privileged) {
|
||||
console.error(`Got unprivileged message of kind ${kind}`);
|
||||
@@ -2283,9 +2296,10 @@ let lastMessage = {};
|
||||
|
||||
/**
|
||||
* @param {string} text
|
||||
* @param {string} elementId
|
||||
*/
|
||||
function announceChat(text) {
|
||||
let announcement = document.getElementById('chat-announcements');
|
||||
function announceLiveRegion(text, elementId) {
|
||||
let announcement = document.getElementById(elementId);
|
||||
if(!announcement)
|
||||
return;
|
||||
|
||||
@@ -2295,6 +2309,20 @@ function announceChat(text) {
|
||||
}, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} text
|
||||
*/
|
||||
function announceChat(text) {
|
||||
announceLiveRegion(text, 'chat-announcements');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} text
|
||||
*/
|
||||
function announceUrgent(text) {
|
||||
announceLiveRegion(text, 'urgent-announcements');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} id
|
||||
* @param {string} peerId
|
||||
|
||||
Reference in New Issue
Block a user