Bug 503248 - Use nsISound::EVENT_NEW_MAIL_RECEIVED r=iann_bugzilla a=kairo for CLOSED TREE
authorEdmund Wong <ewong@pw-wspx.org>
Wed, 15 Jun 2011 22:46:18 +0100
changeset 7809 54a07d87ea36faa2b5147994460d683073e7e1d6
parent 7808 48b34c3d35b6d854e67a7836c85422350bcc7775
child 7810 bc9932900a348ee6b6f2cf561ec30cd09c665c60
push id15
push useriann_cvs@blueyonder.co.uk
push dateWed, 15 Jun 2011 22:22:34 +0000
treeherdercomm-beta@54a07d87ea36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersiann_bugzilla, kairo
bugs503248
Bug 503248 - Use nsISound::EVENT_NEW_MAIL_RECEIVED r=iann_bugzilla a=kairo for CLOSED TREE
suite/mailnews/prefs/pref-notifications.js
--- a/suite/mailnews/prefs/pref-notifications.js
+++ b/suite/mailnews/prefs/pref-notifications.js
@@ -103,17 +103,20 @@ function ReadSoundLocation(aElement)
 {
   aElement.value = gSoundUrlPref.value;
   if (aElement.value)
     aElement.file = gFileHandler.getFileFromURLSpec(aElement.value);
 }
 
 function PlaySound()
 {
+  const nsISound = Components.interfaces.nsISound;
   if (!gSound)
     gSound = Components.classes["@mozilla.org/sound;1"]
-                       .createInstance(Components.interfaces.nsISound);
+                       .createInstance(nsISound);
   var soundURL = gSoundUrlPref.value;
   if (soundURL)
     gSound.play(gIOService.newURI(soundURL, null, null));
+  else if (/Mac/.test(navigator.platform))
+    gSound.beep();
   else
-    gSound.playSystemSound("_moz_mailbeep");
+    gSound.playEventSound(nsISound.EVENT_NEW_MAIL_RECEIVED);
 }