Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log: fix notification being triggered for own messages when TTS readback is enabled #3474

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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