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

Skip old and currently-sending draft updates.

This commit is contained in:
John Preston
2018-06-08 23:06:26 +03:00
parent 427ceb9a9a
commit cd1c7c56d3
6 changed files with 52 additions and 12 deletions

View File

@@ -52,6 +52,9 @@ void applyPeerCloudDraft(PeerId peerId, const MTPDdraftMessage &draft) {
? TextUtilities::EntitiesFromMTP(draft.ventities.v)
: EntitiesInText())
};
if (history->skipCloudDraft(textWithTags.text, draft.vdate.v)) {
return;
}
auto replyTo = draft.has_reply_to_msg_id() ? draft.vreply_to_msg_id.v : MsgId(0);
auto cloudDraft = std::make_unique<Draft>(textWithTags, replyTo, MessageCursor(QFIXED_MAX, QFIXED_MAX, QFIXED_MAX), draft.is_no_webpage());
cloudDraft->date = draft.vdate.v;