Apply date edition in service messages.

This commit is contained in:
John Preston 2021-02-23 20:46:35 +04:00
parent 4875f0b003
commit 2054b73c3c
3 changed files with 10 additions and 0 deletions

View File

@ -195,6 +195,14 @@ TimeId HistoryItem::NewMessageDate(TimeId scheduled) {
return scheduled ? scheduled : base::unixtime::now();
}
void HistoryItem::applyServiceDateEdition(const MTPDmessageService &data) {
const auto date = data.vdate().v;
if (_date == date) {
return;
}
_date = date;
}
void HistoryItem::finishEdition(int oldKeyboardTop) {
_history->owner().requestItemViewRefresh(this);
invalidateChatListEntry();

View File

@ -416,6 +416,7 @@ protected:
virtual void markMediaAsReadHook() {
}
void applyServiceDateEdition(const MTPDmessageService &data);
void finishEdition(int oldKeyboardTop);
void finishEditionToEmpty();

View File

@ -1045,6 +1045,7 @@ void HistoryService::applyEdition(const MTPDmessageService &message) {
UpdateComponents(0);
createFromMtp(message);
applyServiceDateEdition(message);
if (message.vaction().type() == mtpc_messageActionHistoryClear) {
removeMedia();