2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Beta version 3.1.6: Detach FastReply from MarkAsRead.

This commit is contained in:
John Preston
2021-10-06 19:24:30 +04:00
parent 8b7cd4a0c7
commit 5cd0a3719e
8 changed files with 68 additions and 85 deletions

View File

@@ -405,7 +405,7 @@ public:
const QString &title,
const QString &subtitle,
const QString &msg,
bool hideReplyButton);
Window::Notifications::Manager::DisplayOptions options);
NotificationData(const NotificationData &other) = delete;
NotificationData &operator=(const NotificationData &other) = delete;
@@ -453,7 +453,7 @@ bool NotificationData::init(
const QString &title,
const QString &subtitle,
const QString &msg,
bool hideReplyButton) {
Window::Notifications::Manager::DisplayOptions options) {
try {
_dbusConnection = Gio::DBus::Connection::get_sync(
Gio::DBus::BusType::BUS_TYPE_SESSION);
@@ -524,13 +524,13 @@ bool NotificationData::init(
_actions.push_back("default");
_actions.push_back({});
if (!hideReplyButton) {
if (!options.hideMarkAsRead) {
_actions.push_back("mail-mark-read");
_actions.push_back(
tr::lng_context_mark_read(tr::now).toStdString());
}
if (capabilities.contains("inline-reply") && !hideReplyButton) {
if (capabilities.contains("inline-reply") && !options.hideReplyButton) {
_actions.push_back("inline-reply");
_actions.push_back(
tr::lng_notification_reply(tr::now).toStdString());
@@ -826,8 +826,7 @@ public:
const QString &title,
const QString &subtitle,
const QString &msg,
bool hideNameAndPhoto,
bool hideReplyButton);
DisplayOptions options);
void clearAll();
void clearFromHistory(not_null<History*> history);
void clearFromSession(not_null<Main::Session*> session);
@@ -883,8 +882,7 @@ void Manager::Private::showNotification(
const QString &title,
const QString &subtitle,
const QString &msg,
bool hideNameAndPhoto,
bool hideReplyButton) {
DisplayOptions options) {
if (!Supported()) {
return;
}
@@ -901,7 +899,7 @@ void Manager::Private::showNotification(
title,
subtitle,
msg,
hideReplyButton);
options);
if (!inited) {
return;
}
@@ -1020,8 +1018,7 @@ void Manager::doShowNativeNotification(
const QString &title,
const QString &subtitle,
const QString &msg,
bool hideNameAndPhoto,
bool hideReplyButton) {
DisplayOptions options) {
_private->showNotification(
peer,
userpicView,
@@ -1029,8 +1026,7 @@ void Manager::doShowNativeNotification(
title,
subtitle,
msg,
hideNameAndPhoto,
hideReplyButton);
options);
}
void Manager::doClearAllFast() {

View File

@@ -26,8 +26,7 @@ protected:
const QString &title,
const QString &subtitle,
const QString &msg,
bool hideNameAndPhoto,
bool hideReplyButton) override;
DisplayOptions options) override;
void doClearAllFast() override;
void doClearFromHistory(not_null<History*> history) override;
void doClearFromSession(not_null<Main::Session*> session) override;