mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Apply date edition in service messages.
This commit is contained in:
parent
4875f0b003
commit
2054b73c3c
3 changed files with 10 additions and 0 deletions
|
@ -195,6 +195,14 @@ TimeId HistoryItem::NewMessageDate(TimeId scheduled) {
|
||||||
return scheduled ? scheduled : base::unixtime::now();
|
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) {
|
void HistoryItem::finishEdition(int oldKeyboardTop) {
|
||||||
_history->owner().requestItemViewRefresh(this);
|
_history->owner().requestItemViewRefresh(this);
|
||||||
invalidateChatListEntry();
|
invalidateChatListEntry();
|
||||||
|
|
|
@ -416,6 +416,7 @@ protected:
|
||||||
virtual void markMediaAsReadHook() {
|
virtual void markMediaAsReadHook() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void applyServiceDateEdition(const MTPDmessageService &data);
|
||||||
void finishEdition(int oldKeyboardTop);
|
void finishEdition(int oldKeyboardTop);
|
||||||
void finishEditionToEmpty();
|
void finishEditionToEmpty();
|
||||||
|
|
||||||
|
|
|
@ -1045,6 +1045,7 @@ void HistoryService::applyEdition(const MTPDmessageService &message) {
|
||||||
UpdateComponents(0);
|
UpdateComponents(0);
|
||||||
|
|
||||||
createFromMtp(message);
|
createFromMtp(message);
|
||||||
|
applyServiceDateEdition(message);
|
||||||
|
|
||||||
if (message.vaction().type() == mtpc_messageActionHistoryClear) {
|
if (message.vaction().type() == mtpc_messageActionHistoryClear) {
|
||||||
removeMedia();
|
removeMedia();
|
||||||
|
|
Loading…
Add table
Reference in a new issue