mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Added Up arrow shortcut to edit scheduled messages.
This commit is contained in:
@@ -527,4 +527,19 @@ int32 ScheduledMessages::countListHash(const List &list) const {
|
||||
return HashFinalize(hash);
|
||||
}
|
||||
|
||||
HistoryItem *ScheduledMessages::lastSentMessage(not_null<History*> history) {
|
||||
const auto i = _data.find(history);
|
||||
if (i == end(_data)) {
|
||||
return nullptr;
|
||||
}
|
||||
auto &list = i->second;
|
||||
|
||||
sort(list);
|
||||
const auto items = ranges::view::reverse(list.items);
|
||||
const auto it = ranges::find_if(
|
||||
items,
|
||||
&HistoryItem::canBeEditedFromHistory);
|
||||
return (it == end(items)) ? nullptr : (*it).get();
|
||||
}
|
||||
|
||||
} // namespace Data
|
||||
|
@@ -32,6 +32,7 @@ public:
|
||||
[[nodiscard]] HistoryItem *lookupItem(PeerId peer, MsgId msg) const;
|
||||
[[nodiscard]] HistoryItem *lookupItem(FullMsgId itemId) const;
|
||||
[[nodiscard]] int count(not_null<History*> history) const;
|
||||
[[nodiscard]] HistoryItem *lastSentMessage(not_null<History*> history);
|
||||
|
||||
void checkEntitiesAndUpdate(const MTPDmessage &data);
|
||||
void apply(const MTPDupdateNewScheduledMessage &update);
|
||||
|
Reference in New Issue
Block a user