From dd70a6f659650b8cf2e4ea1c6becba96a071e4a1 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Tue, 26 Jul 2022 05:47:30 +0400 Subject: [PATCH] IsQualifiedDaemon -> ByDefault --- .../linux/notifications_manager_linux.cpp | 42 +++++++++---------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp index 0d454a1c0..9ae2bffff 100644 --- a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp @@ -302,28 +302,6 @@ void GetInhibited(Fn callback) { crl::on_main([=] { callback(false); }); } -bool IsQualifiedDaemon() { - // A list of capabilities that offer feature parity - // with custom notifications - static const auto NeededCapabilities = { - // To show message content - qsl("body"), - // To make the sender name bold - qsl("body-markup"), - // To have buttons on notifications - qsl("actions"), - // To have quick reply - qsl("inline-reply"), - // To not to play sound with Don't Disturb activated - // (no, using sound capability is not a way) - qsl("inhibitions"), - }; - - return ranges::all_of(NeededCapabilities, [&](const auto &capability) { - return CurrentCapabilities.contains(capability); - }); -} - ServerInformation CurrentServerInformationValue() { return CurrentServerInformation.value_or(ServerInformation{}); } @@ -740,7 +718,25 @@ bool Enforced() { } bool ByDefault() { - return IsQualifiedDaemon(); + // A list of capabilities that offer feature parity + // with custom notifications + static const auto NeededCapabilities = { + // To show message content + qsl("body"), + // To make the sender name bold + qsl("body-markup"), + // To have buttons on notifications + qsl("actions"), + // To have quick reply + qsl("inline-reply"), + // To not to play sound with Don't Disturb activated + // (no, using sound capability is not a way) + qsl("inhibitions"), + }; + + return ranges::all_of(NeededCapabilities, [&](const auto &capability) { + return CurrentCapabilities.contains(capability); + }); } void Create(Window::Notifications::System *system) {