mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-08-06 11:52:58 +00:00
Check GNotification option via base::options::lookup
This commit is contained in:
@@ -57,6 +57,12 @@ bool ServiceRegistered = false;
|
||||
ServerInformation CurrentServerInformation;
|
||||
std::vector<std::string> CurrentCapabilities;
|
||||
|
||||
[[nodiscard]] const auto &OptionGNotification() {
|
||||
static const auto &result = base::options::lookup<bool>(
|
||||
Window::Notifications::kOptionGNotification);
|
||||
return result;
|
||||
}
|
||||
|
||||
[[nodiscard]] bool HasCapability(const char *value) {
|
||||
return ranges::contains(CurrentCapabilities, value);
|
||||
}
|
||||
@@ -137,7 +143,7 @@ bool UseGNotification() {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Window::Notifications::OptionGNotification.value()) {
|
||||
if (OptionGNotification().value()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -207,8 +213,7 @@ bool Enforced() {
|
||||
// Wayland doesn't support positioning
|
||||
// and custom notifications don't work here
|
||||
return IsWayland()
|
||||
|| (Gio::Application::get_default()
|
||||
&& Window::Notifications::OptionGNotification.value());
|
||||
|| (Gio::Application::get_default() && OptionGNotification().value());
|
||||
}
|
||||
|
||||
bool ByDefault() {
|
||||
|
||||
Reference in New Issue
Block a user