void HistoryItem::markMediaRead() { _flags &= ~MTPDmessage::Flag::f_media_unread; if (mentionsMe()) { history()->updateChatListEntry(); history()->eraseFromUnreadMentions(id); } }
void HistoryMessage::addToUnreadMentions(UnreadMentionType type) { if (IsServerMsgId(id) && mentionsMe() && isMediaUnread()) { if (history()->addToUnreadMentions(id, type)) { Notify::peerUpdatedDelayed( history()->peer, Notify::PeerUpdate::Flag::UnreadMentionsChanged); } } }
void HistoryMessage::eraseFromUnreadMentions() { if (mentionsMe() && isMediaUnread()) { history()->eraseFromUnreadMentions(id); } }
bool HistoryItem::isUnreadMention() const { return mentionsMe() && (_flags & MTPDmessage::Flag::f_media_unread); }