From 691a0acdab8483c3bace8c7d50c01d3197585a3e Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 24 Jan 2025 22:23:21 +0400 Subject: [PATCH] Allow sound-without-toast again on macOS/Linux. --- .../platform/linux/notifications_manager_linux.cpp | 4 +++- .../SourceFiles/platform/mac/notifications_manager_mac.mm | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp index b701894686..892d0abd87 100644 --- a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp @@ -968,7 +968,9 @@ bool Manager::doSkipToast() const { } void Manager::doMaybePlaySound(Fn playSound) { - if (UseGNotification() || !HasCapability("sound")) { + if (UseGNotification() + || !HasCapability("sound") + || !Core::App().settings().desktopNotify()) { _private->invokeIfNotInhibited(std::move(playSound)); } } diff --git a/Telegram/SourceFiles/platform/mac/notifications_manager_mac.mm b/Telegram/SourceFiles/platform/mac/notifications_manager_mac.mm index 28ddec721b..8c7148ac1a 100644 --- a/Telegram/SourceFiles/platform/mac/notifications_manager_mac.mm +++ b/Telegram/SourceFiles/platform/mac/notifications_manager_mac.mm @@ -532,7 +532,10 @@ bool Manager::doSkipToast() const { } void Manager::doMaybePlaySound(Fn playSound) { - // Play through native notification system. + // Play through native notification system if toasts are enabled. + if (!Core::App().settings().desktopNotify()) { + playSound(); + } } void Manager::doMaybeFlashBounce(Fn flashBounce) {