Messages now play notification sounds.
This commit is contained in:
parent
976e157cf1
commit
e85fb18ce5
3 changed files with 51 additions and 2 deletions
|
|
@ -37,6 +37,11 @@ class pmPanel extends panelObj{
|
|||
*/
|
||||
this.uuid = crypto.randomUUID();
|
||||
|
||||
/**
|
||||
* PM TX Sound
|
||||
*/
|
||||
this.txSound = '/nonfree/imsend.ogg';
|
||||
|
||||
//Tell PMHandler to start tracking this panel
|
||||
this.client.pmHandler.panelList.set(this.uuid, null);
|
||||
|
||||
|
|
@ -131,6 +136,10 @@ class pmPanel extends panelObj{
|
|||
|
||||
//Send message out to server
|
||||
this.client.pmSocket.emit("pm", preprocessedMessage);
|
||||
|
||||
if(localStorage.getItem('txPMSound') == 'true'){
|
||||
utils.ux.playSound(this.txSound);
|
||||
}
|
||||
}
|
||||
|
||||
//Clear our prompt
|
||||
|
|
@ -247,6 +256,13 @@ class pmPanel extends panelObj{
|
|||
* @param {Object} message - Message to render
|
||||
*/
|
||||
renderMessage(message){
|
||||
//If we have an empty message
|
||||
console.log(message);
|
||||
if(message.msg == null || message.msg == ''){
|
||||
//BAIL!!
|
||||
return;
|
||||
}
|
||||
|
||||
//Run postprocessing functions on chat message
|
||||
const postprocessedMessage = client.chatBox.chatPostprocessor.postprocess(message, true);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue