Bug 594355 - Default alert sound not playing on Mac when new email arrives; r=bienvenu
authorMark Banner <bugzilla@standard8.plus.com>
Mon, 01 Nov 2010 20:31:58 +0000
changeset 6625 8a850b6c8f62229b1c0595212246b64c19846c59
parent 6624 26435a548ad9c6f5df1482940d83c7024955372e
child 6626 e44305612904b3b70bdb6ff9634693337f8c2915
push idunknown
push userunknown
push dateunknown
reviewersbienvenu
bugs594355
Bug 594355 - Default alert sound not playing on Mac when new email arrives; r=bienvenu
mailnews/base/src/nsStatusBarBiffManager.cpp
--- a/mailnews/base/src/nsStatusBarBiffManager.cpp
+++ b/mailnews/base/src/nsStatusBarBiffManager.cpp
@@ -71,17 +71,16 @@ nsStatusBarBiffManager::~nsStatusBarBiff
     NS_IF_RELEASE(kBiffStateAtom);
 }
 
 #define PREF_PLAY_SOUND_ON_NEW_MAIL      "mail.biff.play_sound"
 #define PREF_NEW_MAIL_SOUND_URL          "mail.biff.play_sound.url"
 #define PREF_NEW_MAIL_SOUND_TYPE         "mail.biff.play_sound.type"
 #define SYSTEM_SOUND_TYPE 0
 #define CUSTOM_SOUND_TYPE 1
-#define DEFAULT_SYSTEM_SOUND NS_LITERAL_STRING("_moz_mailbeep")
 
 nsresult nsStatusBarBiffManager::Init()
 {
   if (mInitialized)
     return NS_ERROR_ALREADY_INITIALIZED;
 
   nsresult rv;
 
@@ -150,18 +149,23 @@ nsresult nsStatusBarBiffManager::PlayBif
         if (NS_SUCCEEDED(rv))
           customSoundPlayed = PR_TRUE;
       }
     }
   }    
   
   // if nothing played, play the default system sound
   if (!customSoundPlayed) {
-    rv = mSound->PlaySystemSound(DEFAULT_SYSTEM_SOUND);
-    NS_ENSURE_SUCCESS(rv,rv);
+#ifdef XP_MACOSX
+    // Mac has no specific event sounds, so just beep instead.
+    rv = mSound->Beep();
+#else
+    rv = mSound->PlayEventSound(nsISound::EVENT_NEW_MAIL_RECIEVED);
+#endif
+    NS_ENSURE_SUCCESS(rv, rv);
   }
   return rv;
 }
 
 // nsIFolderListener methods....
 NS_IMETHODIMP 
 nsStatusBarBiffManager::OnItemAdded(nsIMsgFolder *parentItem, nsISupports *item)
 {