IsQualifiedDaemon -> ByDefault

This commit is contained in:
Ilya Fedin 2022-07-26 05:47:30 +04:00 committed by John Preston
parent ff2bd86744
commit dd70a6f659
1 changed files with 19 additions and 23 deletions

View File

@ -302,28 +302,6 @@ void GetInhibited(Fn<void(bool)> 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) {