2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Show reaction notifications in groups.

This commit is contained in:
John Preston
2022-01-28 18:47:04 +03:00
parent 54e7dfe986
commit 1dd7cc956b
5 changed files with 58 additions and 42 deletions

View File

@@ -78,8 +78,12 @@ Manager::Manager(System *system)
Manager::QueuedNotification::QueuedNotification(NotificationFields &&fields)
: history(fields.item->history())
, peer(history->peer)
, reaction(fields.reaction)
, author(reaction.isEmpty() ? fields.item->notificationHeader() : QString())
, reaction(fields.reactionEmoji)
, author(!fields.reactionFrom
? fields.item->notificationHeader()
: (fields.reactionFrom != peer)
? fields.reactionFrom->name
: QString())
, item((fields.forwardedCount < 2) ? fields.item.get() : nullptr)
, forwardedCount(fields.forwardedCount)
, fromScheduled(reaction.isEmpty() && (fields.item->out() || peer->isSelf())
@@ -814,10 +818,13 @@ void Notification::updateNotifyDisplay() {
p.setPen(st::dialogsTextFg);
p.setFont(st::dialogsTextFont);
const auto text = !_reaction.isEmpty()
? Manager::ComposeReactionNotification(
? (!_author.isEmpty()
? Ui::Text::PlainLink(_author).append(' ')
: TextWithEntities()
).append(Manager::ComposeReactionNotification(
_item,
_reaction,
options.hideMessageText)
options.hideMessageText))
: _item
? _item->toPreview({
.hideSender = reminder,