2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Notify about published scheduled messages.

This commit is contained in:
John Preston
2019-08-28 17:24:12 +03:00
parent 3b76a908a4
commit 0a4f91a53d
21 changed files with 423 additions and 179 deletions

View File

@@ -304,7 +304,14 @@ public:
void init(Manager *manager);
void showNotification(PeerData *peer, MsgId msgId, const QString &title, const QString &subtitle, const QString &msg, bool hideNameAndPhoto, bool hideReplyButton);
void showNotification(
not_null<PeerData*> peer,
MsgId msgId,
const QString &title,
const QString &subtitle,
const QString &msg,
bool hideNameAndPhoto,
bool hideReplyButton);
void clearAll();
void clearFromHistory(History *history);
void clearNotification(PeerId peerId, MsgId msgId);
@@ -384,7 +391,14 @@ QString Manager::Private::escapeNotificationText(const QString &text) const {
return _markupSupported ? escapeHtml(text) : text;
}
void Manager::Private::showNotification(PeerData *peer, MsgId msgId, const QString &title, const QString &subtitle, const QString &msg, bool hideNameAndPhoto, bool hideReplyButton) {
void Manager::Private::showNotification(
not_null<PeerData*> peer,
MsgId msgId,
const QString &title,
const QString &subtitle,
const QString &msg,
bool hideNameAndPhoto,
bool hideReplyButton) {
auto titleText = escapeNotificationText(title);
auto subtitleText = escapeNotificationText(subtitle);
auto msgText = escapeNotificationText(msg);
@@ -537,8 +551,22 @@ bool Manager::hasActionsSupport() const {
Manager::~Manager() = default;
void Manager::doShowNativeNotification(PeerData *peer, MsgId msgId, const QString &title, const QString &subtitle, const QString &msg, bool hideNameAndPhoto, bool hideReplyButton) {
_private->showNotification(peer, msgId, title, subtitle, msg, hideNameAndPhoto, hideReplyButton);
void Manager::doShowNativeNotification(
not_null<PeerData*> peer,
MsgId msgId,
const QString &title,
const QString &subtitle,
const QString &msg,
bool hideNameAndPhoto,
bool hideReplyButton) {
_private->showNotification(
peer,
msgId,
title,
subtitle,
msg,
hideNameAndPhoto,
hideReplyButton);
}
void Manager::doClearAllFast() {

View File

@@ -36,7 +36,14 @@ public:
~Manager();
protected:
void doShowNativeNotification(PeerData *peer, MsgId msgId, const QString &title, const QString &subtitle, const QString &msg, bool hideNameAndPhoto, bool hideReplyButton) override;
void doShowNativeNotification(
not_null<PeerData*> peer,
MsgId msgId,
const QString &title,
const QString &subtitle,
const QString &msg,
bool hideNameAndPhoto,
bool hideReplyButton) override;
void doClearAllFast() override;
void doClearFromHistory(History *history) override;