Skip to content
Permalink
Browse files

Merge PR #3474: Log: fix notification being triggered for own message…

…s when TTS readback is enabled
  • Loading branch information...
davidebeatrici committed Jul 17, 2018
2 parents 91601a1 + b7c9ae6 commit adcf9fea49939372ce98f52a601d0dd08a23fa34
Showing with 25 additions and 22 deletions.
  1. +25 −22 src/mumble/Log.cpp
@@ -500,38 +500,41 @@ void Log::log(MsgType mt, const QString &console, const QString &terse, bool own
tlog->setLogScroll(oldscrollvalue);
}

if (!g.s.bTTSMessageReadBack && ownMessage)
return;
if (!ownMessage) {
if (!(g.mw->isActiveWindow() && g.mw->qdwLog->isVisible())) {
// Message notification with window highlight
if (flags & Settings::LogHighlight) {
QApplication::alert(g.mw);
}

if (!(g.mw->isActiveWindow() && g.mw->qdwLog->isVisible())) {
// Message notification with window highlight
if (flags & Settings::LogHighlight) {
QApplication::alert(g.mw);
// Message notification with balloon tooltips
if (flags & Settings::LogBalloon) {
postNotification(mt, plain);
}
}

// Message notification with balloon tooltips
if (flags & Settings::LogBalloon) {
postNotification(mt, plain);
// Don't make any noise if we are self deafened (Unless it is the sound for activating self deaf)
if (g.s.bDeaf && mt != Log::SelfDeaf) {
return;
}
}

// Don't make any noise if we are self deafened (Unless it is the sound for activating self deaf)
if (g.s.bDeaf && mt != Log::SelfDeaf)
return;

// Message notification with static sounds
if ((flags & Settings::LogSoundfile)) {
QString sSound = g.s.qmMessageSounds.value(mt);
AudioOutputPtr ao = g.ao;
if (!ao || !ao->playSample(sSound, false)) {
qWarning() << "Sound file" << sSound << "is not a valid audio file, fallback to TTS.";
flags ^= Settings::LogSoundfile | Settings::LogTTS; // Fallback to TTS
// Message notification with static sounds
if ((flags & Settings::LogSoundfile)) {
QString sSound = g.s.qmMessageSounds.value(mt);
AudioOutputPtr ao = g.ao;
if (!ao || !ao->playSample(sSound, false)) {
qWarning() << "Sound file" << sSound << "is not a valid audio file, fallback to TTS.";
flags ^= Settings::LogSoundfile | Settings::LogTTS; // Fallback to TTS
}
}
} else if (!g.s.bTTSMessageReadBack) {
return;
}

// Message notification with Text-To-Speech
if (! g.s.bTTS || !(flags & Settings::LogTTS))
if (g.s.bDeaf || !g.s.bTTS || !(flags & Settings::LogTTS)) {
return;
}

// Apply simplifications to spoken text
QRegExp identifyURL(QLatin1String("[a-z-]+://[^ <]*"),

0 comments on commit adcf9fe

Please sign in to comment.
You can’t perform that action at this time.