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

Make scheduled message ids determenistic.

Fixes #6686.
This commit is contained in:
John Preston
2022-03-11 11:04:46 +04:00
parent 1bc438ed01
commit 1833fac094
6 changed files with 10 additions and 7 deletions

View File

@@ -319,7 +319,7 @@ void ScheduledMessages::apply(
} else {
Assert(!list.itemById.contains(local->id));
Assert(!list.idByItem.contains(local));
local->setRealId(local->history()->nextNonHistoryEntryId());
local->setRealId(local->history()->scheduledMessageId(id));
list.idByItem.emplace(local, id);
list.itemById.emplace(id, local);
}
@@ -467,7 +467,7 @@ HistoryItem *ScheduledMessages::append(
}
const auto item = _session->data().addNewMessage(
history->nextNonHistoryEntryId(),
history->scheduledMessageId(id),
PrepareMessage(message),
MessageFlags(), // localFlags
NewMessageType::Existing);