Okay I had a look at my code. What I did was get hold of the un-minified js files and removed the sound function from common.js:
function playSound(wav_file) {
var player = document.createElement("div");
var agt = navigator.userAgent.toLowerCase();
if(agt.indexOf('opera') != -1) {
player.style = "position: absolute; left: 0px; top: -200px;";
}
document.body.appendChild(player);
player.innerHTML = '<embed src="'+wav_file+'" hidden="true" autostart="true" loop="false">';
}
and placed it into a new js file called "sound.js" in the /js/164 folder. I then linked to this file from the chat.tpl file in my relevant /style folder with code instructions for only agents to load the file like this:
${if:agent}
<script type="text/javascript" src="${webimroot}/js/${jsver}/sound.js"></script>
${endif:agent}
Next was to stop the function from executing in case it gets called by client scripts somewhere along the line so in chats.js change this code:
if(!this.skipNextsound) {
var tsound = $('soundimg');
if(tsound == null || tsound.className.match(new RegExp("\\bisound\\b")) ) {
playSound(Chat.webimRoot+'/sounds/new_message.wav');
}
}
and replace it with this:
if (typeof playSound=="function") {
if(!this.skipNextsound) {
var tsound = $('soundimg');
if(tsound == null || tsound.className.match(new RegExp("\\bisound\\b")) ) {
playSound(Chat.webimRoot+'/sounds/new_message.wav');
}
}
}
What that means is that any only agents will get sound notifications for new messages and clients don't get the instruction to embed the Quicktime object in their browser. I actually edited the minified verions of these js files with the minified code versions of the above changes but I wouldn't recommend that to most people
Something else to keep in mind is that only the javascript files in the /js/164 folder are actually used during script execution. The /js/source folder only contains the unminified versions of the files in the /js/164 folder for reference so any changes have to be made to the files in the /js/164 folder to have any effect.