mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-06 15:13:57 +02:00
Revert "Remove not really needed notification capability checks"
This reverts commit abdfa4f785
.
This commit is contained in:
parent
b1e64419a5
commit
471831bcd6
1 changed files with 62 additions and 50 deletions
|
@ -300,18 +300,22 @@ bool NotificationData::init(
|
||||||
_body = msg.toStdString();
|
_body = msg.toStdString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (HasCapability("actions")) {
|
||||||
_actions.push_back("default");
|
_actions.push_back("default");
|
||||||
_actions.push_back(tr::lng_open_link(tr::now).toStdString());
|
_actions.push_back(tr::lng_open_link(tr::now).toStdString());
|
||||||
|
|
||||||
if (!options.hideMarkAsRead) {
|
if (!options.hideMarkAsRead) {
|
||||||
// icon name according to https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
|
// icon name according to https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
|
||||||
_actions.push_back("mail-mark-read");
|
_actions.push_back("mail-mark-read");
|
||||||
_actions.push_back(tr::lng_context_mark_read(tr::now).toStdString());
|
_actions.push_back(
|
||||||
|
tr::lng_context_mark_read(tr::now).toStdString());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (HasCapability("inline-reply") && !options.hideReplyButton) {
|
if (HasCapability("inline-reply")
|
||||||
|
&& !options.hideReplyButton) {
|
||||||
_actions.push_back("inline-reply");
|
_actions.push_back("inline-reply");
|
||||||
_actions.push_back(tr::lng_notification_reply(tr::now).toStdString());
|
_actions.push_back(
|
||||||
|
tr::lng_notification_reply(tr::now).toStdString());
|
||||||
|
|
||||||
_notificationRepliedSignalId
|
_notificationRepliedSignalId
|
||||||
= _interface.signal_notification_replied().connect([=](
|
= _interface.signal_notification_replied().connect([=](
|
||||||
|
@ -328,7 +332,8 @@ bool NotificationData::init(
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
_actionInvokedSignalId = _interface.signal_action_invoked().connect([=](
|
_actionInvokedSignalId = _interface.signal_action_invoked().connect(
|
||||||
|
[=](
|
||||||
XdgNotifications::Notifications,
|
XdgNotifications::Notifications,
|
||||||
uint id,
|
uint id,
|
||||||
std::string actionName) {
|
std::string actionName) {
|
||||||
|
@ -343,8 +348,8 @@ bool NotificationData::init(
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
_activationTokenSignalId = _interface.signal_activation_token().connect(
|
_activationTokenSignalId
|
||||||
[=](
|
= _interface.signal_activation_token().connect([=](
|
||||||
XdgNotifications::Notifications,
|
XdgNotifications::Notifications,
|
||||||
uint id,
|
uint id,
|
||||||
std::string token) {
|
std::string token) {
|
||||||
|
@ -352,11 +357,15 @@ bool NotificationData::init(
|
||||||
GLib::setenv("XDG_ACTIVATION_TOKEN", token, true);
|
GLib::setenv("XDG_ACTIVATION_TOKEN", token, true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (HasCapability("action-icons")) {
|
||||||
_hints.insert_value("action-icons", GLib::Variant::new_boolean(true));
|
_hints.insert_value("action-icons", GLib::Variant::new_boolean(true));
|
||||||
|
}
|
||||||
|
|
||||||
// suppress system sound if telegram sound activated,
|
// suppress system sound if telegram sound activated,
|
||||||
// otherwise use system sound
|
// otherwise use system sound
|
||||||
|
if (HasCapability("sound")) {
|
||||||
if (Core::App().settings().soundNotify()) {
|
if (Core::App().settings().soundNotify()) {
|
||||||
_hints.insert_value(
|
_hints.insert_value(
|
||||||
"suppress-sound",
|
"suppress-sound",
|
||||||
|
@ -367,10 +376,13 @@ bool NotificationData::init(
|
||||||
"sound-name",
|
"sound-name",
|
||||||
GLib::Variant::new_string("message-new-instant"));
|
GLib::Variant::new_string("message-new-instant"));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (HasCapability("x-canonical-append")) {
|
||||||
_hints.insert_value(
|
_hints.insert_value(
|
||||||
"x-canonical-append",
|
"x-canonical-append",
|
||||||
GLib::Variant::new_string("true"));
|
GLib::Variant::new_string("true"));
|
||||||
|
}
|
||||||
|
|
||||||
_hints.insert_value("category", GLib::Variant::new_string("im.received"));
|
_hints.insert_value("category", GLib::Variant::new_string("im.received"));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue