Skip to content

Commit

Permalink
Merge PR #3474: Log: fix notification being triggered for own message…
Browse files Browse the repository at this point in the history
…s when TTS readback is enabled
  • Loading branch information
davidebeatrici committed Jul 17, 2018
2 parents 91601a1 + b7c9ae6 commit adcf9fe
Showing 1 changed file with 25 additions and 22 deletions.
47 changes: 25 additions & 22 deletions src/mumble/Log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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-]+://[^ <]*"),
Expand Down

0 comments on commit adcf9fe

Please sign in to comment.