From e46e89c03eb611b180701ce9652ef3cfdb52cc2c Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Sun, 10 Feb 2019 01:26:33 +0100 Subject: [PATCH] Ref T535, play different souns for private/supervisor message --- src/blackgui/components/textmessagecomponent.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/blackgui/components/textmessagecomponent.cpp b/src/blackgui/components/textmessagecomponent.cpp index 6cb955ac5..b3d22f92a 100644 --- a/src/blackgui/components/textmessagecomponent.cpp +++ b/src/blackgui/components/textmessagecomponent.cpp @@ -460,9 +460,18 @@ namespace BlackGui textEdit->insertTextMessage(textMessage); // sound - if (!m_usedAsOverlayWidget && sGui && !sGui->isShuttingDown() && sGui->getIContextAudio() && m_audioSettings.get().textMessagePrivate()) + const bool playSound = !m_usedAsOverlayWidget && sGui && !sGui->isShuttingDown() && sGui->getIContextAudio(); + if (playSound) { - sGui->getIContextAudio()->playNotification(CNotificationSounds::NotificationTextMessagePrivate, true); + const CSettings settings = m_audioSettings.get(); + if (textMessage.isSupervisorMessage() && settings.textMessageSupervisor()) + { + sGui->getIContextAudio()->playNotification(CNotificationSounds::NotificationTextMessageSupervisor, true); + } + else if (textMessage.isPrivateMessage() && settings.textMessagePrivate()) + { + sGui->getIContextAudio()->playNotification(CNotificationSounds::NotificationTextMessagePrivate, true); + } } }