Allow service messages to be unread mentions.

This commit is contained in:
John Preston 2017-08-25 15:48:10 +03:00
parent ee5c827f26
commit 4c604b34c1
4 changed files with 10 additions and 13 deletions

View file

@ -658,6 +658,15 @@ void HistoryItem::finishEditionToEmpty() {
}
}
void HistoryItem::markMediaRead() {
_flags &= ~MTPDmessage::Flag::f_media_unread;
if (mentionsMe()) {
history()->updateChatListEntry();
history()->eraseFromUnreadMentions(id);
}
}
void HistoryItem::clickHandlerActiveChanged(const ClickHandlerPtr &p, bool active) {
if (auto markup = Get<HistoryMessageReplyMarkup>()) {
if (markup->inlineKeyboard) {

View file

@ -577,10 +577,7 @@ public:
bool isMediaUnread() const {
return _flags & MTPDmessage::Flag::f_media_unread;
}
void markMediaRead() {
_flags &= ~MTPDmessage::Flag::f_media_unread;
markMediaAsReadHook();
}
void markMediaRead();
// Zero result means this message is not self-destructing right now.
virtual TimeMs getSelfDestructIn(TimeMs now) {

View file

@ -1233,13 +1233,6 @@ void HistoryMessage::applyEditionToEmpty() {
finishEditionToEmpty();
}
void HistoryMessage::markMediaAsReadHook() {
if (mentionsMe()) {
history()->updateChatListEntry();
history()->eraseFromUnreadMentions(id);
}
}
bool HistoryMessage::displayForwardedFrom() const {
if (auto forwarded = Get<HistoryMessageForwarded>()) {
return Has<HistoryMessageVia>()

View file

@ -166,8 +166,6 @@ private:
int performResizeGetHeight();
void applyEditionToEmpty();
void markMediaAsReadHook() override;
bool displayForwardedFrom() const;
void paintFromName(Painter &p, QRect &trect, bool selected) const;
void paintForwardedInfo(Painter &p, QRect &trect, bool selected) const;