From 7a3ca3a235040f816084e7f436055a4a57aa5716 Mon Sep 17 00:00:00 2001 From: Suyash Agarwal Date: Tue, 28 Apr 2015 06:19:00 +0200 Subject: [PATCH] Bug 1152926 - New mail sound preview doesn't work for default system sound on Mac OS X. r=aleth --- mail/components/preferences/general.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mail/components/preferences/general.js b/mail/components/preferences/general.js index 547ba463db..6aff0557cf 100644 --- a/mail/components/preferences/general.js +++ b/mail/components/preferences/general.js @@ -110,12 +110,16 @@ var gGeneralPane = { var soundLocation; soundLocation = document.getElementById('soundType').value == 1 ? - document.getElementById('soundUrlLocation').value : "_moz_mailbeep" + document.getElementById('soundUrlLocation').value : ""; - if (!soundLocation.contains("file://")) - sound.playSystemSound(soundLocation); - else + if (!soundLocation.contains("file://")) { + if (Services.appinfo.OS == "Darwin") // OS X + sound.beep(); + else + sound.playEventSound(Components.interfaces.nsISound.EVENT_NEW_MAIL_RECEIVED); + } else { sound.play(Services.io.newURI(soundLocation, null, null)); + } }, browseForSoundFile: function ()