2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Update API scheme on layer 148: Drafts in topics.

This commit is contained in:
John Preston
2022-10-17 20:29:48 +04:00
parent 791addd0ee
commit 89d0a71591
60 changed files with 861 additions and 541 deletions

View File

@@ -2443,12 +2443,14 @@ void Updates::feedUpdate(const MTPUpdate &update) {
case mtpc_updateDraftMessage: {
const auto &data = update.c_updateDraftMessage();
const auto peerId = peerFromMTP(data.vpeer());
const auto topicRootId = data.vtop_msg_id().value_or_empty();
data.vdraft().match([&](const MTPDdraftMessage &data) {
Data::ApplyPeerCloudDraft(&session(), peerId, data);
Data::ApplyPeerCloudDraft(&session(), peerId, topicRootId, data);
}, [&](const MTPDdraftMessageEmpty &data) {
Data::ClearPeerCloudDraft(
&session(),
peerId,
topicRootId,
data.vdate().value_or_empty());
});
} break;