mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-06 15:13:57 +02:00
Don't subscribe to inhibiton changes when not supported
This commit is contained in:
parent
f9dd2b4a0a
commit
b4d310fd1e
1 changed files with 39 additions and 42 deletions
|
@ -258,11 +258,6 @@ void GetCapabilities(Fn<void(const QStringList &)> callback) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetInhibited(Fn<void(bool)> callback) {
|
void GetInhibited(Fn<void(bool)> callback) {
|
||||||
if (!CurrentCapabilities.contains(qsl("inhibitions"))) {
|
|
||||||
crl::on_main([=] { callback(false); });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Noexcept([&] {
|
Noexcept([&] {
|
||||||
const auto connection = Gio::DBus::Connection::get_sync(
|
const auto connection = Gio::DBus::Connection::get_sync(
|
||||||
Gio::DBus::BusType::SESSION);
|
Gio::DBus::BusType::SESSION);
|
||||||
|
@ -947,6 +942,7 @@ Manager::Private::Private(not_null<Manager*> manager, Type type)
|
||||||
.arg(capabilities.join(", ")));
|
.arg(capabilities.join(", ")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (capabilities.contains(qsl("inhibitions"))) {
|
||||||
Noexcept([&] {
|
Noexcept([&] {
|
||||||
_dbusConnection = Gio::DBus::Connection::get_sync(
|
_dbusConnection = Gio::DBus::Connection::get_sync(
|
||||||
Gio::DBus::BusType::SESSION);
|
Gio::DBus::BusType::SESSION);
|
||||||
|
@ -992,6 +988,7 @@ Manager::Private::Private(not_null<Manager*> manager, Type type)
|
||||||
"PropertiesChanged",
|
"PropertiesChanged",
|
||||||
std::string(kObjectPath));
|
std::string(kObjectPath));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Manager::Private::showNotification(
|
void Manager::Private::showNotification(
|
||||||
not_null<PeerData*> peer,
|
not_null<PeerData*> peer,
|
||||||
|
|
Loading…
Add table
Reference in a new issue