mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
IsQualifiedDaemon -> ByDefault
This commit is contained in:
parent
ff2bd86744
commit
dd70a6f659
1 changed files with 19 additions and 23 deletions
|
@ -302,28 +302,6 @@ void GetInhibited(Fn<void(bool)> callback) {
|
||||||
crl::on_main([=] { callback(false); });
|
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() {
|
ServerInformation CurrentServerInformationValue() {
|
||||||
return CurrentServerInformation.value_or(ServerInformation{});
|
return CurrentServerInformation.value_or(ServerInformation{});
|
||||||
}
|
}
|
||||||
|
@ -740,7 +718,25 @@ bool Enforced() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ByDefault() {
|
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) {
|
void Create(Window::Notifications::System *system) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue