Added handling of updates for rescheduled messages.
This commit is contained in:
parent
6559e83e83
commit
5a75dd2b6f
|
@ -414,6 +414,7 @@ HistoryItem *ScheduledMessages::append(
|
|||
}, data.vmedia());
|
||||
existing->updateReplyMarkup(data.vreply_markup());
|
||||
existing->updateForwardedInfo(data.vfwd_from());
|
||||
existing->updateDate(data.vdate().v);
|
||||
history->owner().requestItemTextRefresh(existing);
|
||||
}, [&](const auto &data) {});
|
||||
return existing;
|
||||
|
|
|
@ -708,6 +708,17 @@ MsgId HistoryItem::idOriginal() const {
|
|||
return id;
|
||||
}
|
||||
|
||||
void HistoryItem::updateDate(TimeId newDate) {
|
||||
if (canUpdateDate() && _date != newDate) {
|
||||
_date = newDate;
|
||||
_history->owner().requestItemViewRefresh(this);
|
||||
}
|
||||
}
|
||||
|
||||
bool HistoryItem::canUpdateDate() const {
|
||||
return isScheduled();
|
||||
}
|
||||
|
||||
void HistoryItem::sendFailed() {
|
||||
Expects(_clientFlags & MTPDmessage_ClientFlag::f_sending);
|
||||
Expects(!(_clientFlags & MTPDmessage_ClientFlag::f_failed));
|
||||
|
|
|
@ -328,6 +328,9 @@ public:
|
|||
[[nodiscard]] virtual std::unique_ptr<HistoryView::Element> createView(
|
||||
not_null<HistoryView::ElementDelegate*> delegate) = 0;
|
||||
|
||||
void updateDate(TimeId newDate);
|
||||
[[nodiscard]] bool canUpdateDate() const;
|
||||
|
||||
virtual ~HistoryItem();
|
||||
|
||||
MsgId id;
|
||||
|
|
Loading…
Reference in New Issue