2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Allow to send scheduled messages instantly.

This commit is contained in:
John Preston
2019-08-09 18:58:58 +01:00
parent 956bb876f6
commit 694f771131
17 changed files with 256 additions and 51 deletions

View File

@@ -78,13 +78,14 @@ ScheduledMessages::~ScheduledMessages() {
}
MsgId ScheduledMessages::lookupId(not_null<HistoryItem*> item) const {
if (const auto i = _data.find(item->history()); i != end(_data)) {
const auto &list = i->second.idByItem;
if (const auto j = list.find(item); j != end(list)) {
return j->second;
}
}
return MsgId(0);
Expects(item->isScheduled());
const auto i = _data.find(item->history());
Assert(i != end(_data));
const auto &list = i->second;
const auto j = list.idByItem.find(item);
Assert(j != end(list.idByItem));
return j->second;
}
int ScheduledMessages::count(not_null<History*> history) const {