Don't show reply button in Linux native notifications when it's not supposed to

All modern notification daemons have support for the default action and it's a requirement with the portal spec
This commit is contained in:
Ilya Fedin 2022-11-29 00:29:45 +04:00 committed by John Preston
parent b9a766387c
commit 05524c3f6c

View file

@ -431,10 +431,12 @@ bool NotificationData::init(
idTuple); idTuple);
} }
if (!options.hideReplyButton) {
_notification->add_button( _notification->add_button(
tr::lng_notification_reply(tr::now).toStdString(), tr::lng_notification_reply(tr::now).toStdString(),
"app.notification-reply", "app.notification-reply",
idTuple); idTuple);
}
return true; return true;
} }
@ -520,7 +522,8 @@ bool NotificationData::init(
tr::lng_context_mark_read(tr::now).toStdString()); tr::lng_context_mark_read(tr::now).toStdString());
} }
if (capabilities.contains("inline-reply") && !options.hideReplyButton) { if (!options.hideReplyButton) {
if (capabilities.contains("inline-reply")) {
_actions.push_back("inline-reply"); _actions.push_back("inline-reply");
_actions.push_back( _actions.push_back(
tr::lng_notification_reply(tr::now).toStdString()); tr::lng_notification_reply(tr::now).toStdString());
@ -537,6 +540,7 @@ bool NotificationData::init(
_actions.push_back( _actions.push_back(
tr::lng_notification_reply(tr::now).toStdString()); tr::lng_notification_reply(tr::now).toStdString());
} }
}
_actionInvokedSignalId = _dbusConnection->signal_subscribe( _actionInvokedSignalId = _dbusConnection->signal_subscribe(
signalEmitted, signalEmitted,