diff --git a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp index b5569a315..8c854012d 100644 --- a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp @@ -107,13 +107,22 @@ NotificationData::NotificationData( if (capabilities.contains(qsl("actions"))) { _actions << qsl("default") << QString(); - // icon name according to https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html - _actions << qsl("mail-reply-sender") - << tr::lng_notification_reply(tr::now); - connect(_notificationInterface.get(), SIGNAL(ActionInvoked(uint, QString)), this, SLOT(notificationClicked(uint))); + + if (capabilities.contains(qsl("inline-reply"))) { + _actions << qsl("inline-reply") + << tr::lng_notification_reply(tr::now); + + connect(_notificationInterface.get(), + SIGNAL(NotificationReplied(uint,QString)), + this, SLOT(notificationReplied(uint,QString))); + } else { + // icon name according to https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html + _actions << qsl("mail-reply-sender") + << tr::lng_notification_reply(tr::now); + } } if (capabilities.contains(qsl("action-icons"))) { @@ -236,6 +245,15 @@ void NotificationData::notificationClicked(uint id) { } } +void NotificationData::notificationReplied(uint id, const QString &text) { + if (id == _notificationId) { + const auto manager = _manager; + crl::on_main(manager, [=] { + manager->notificationReplied(_peerId, _msgId, { text, {} }); + }); + } +} + QDBusArgument &operator<<(QDBusArgument &argument, const NotificationData::ImageData &imageData) { argument.beginStructure(); diff --git a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.h b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.h index b5bcc726d..00f1bce85 100644 --- a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.h +++ b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.h @@ -70,6 +70,7 @@ private: private slots: void notificationClosed(uint id); void notificationClicked(uint id); + void notificationReplied(uint id, const QString &text); }; using Notification = std::shared_ptr;