2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Support drafts in monoforum sublists.

This commit is contained in:
John Preston
2025-05-20 20:32:24 +04:00
parent b2c01991a6
commit f65556acb7
30 changed files with 488 additions and 208 deletions

View File

@@ -2687,13 +2687,22 @@ void Updates::feedUpdate(const MTPUpdate &update) {
const auto &data = update.c_updateDraftMessage();
const auto peerId = peerFromMTP(data.vpeer());
const auto topicRootId = data.vtop_msg_id().value_or_empty();
const auto monoforumPeerId = data.vsaved_peer_id()
? peerFromMTP(*data.vsaved_peer_id())
: PeerId();
data.vdraft().match([&](const MTPDdraftMessage &data) {
Data::ApplyPeerCloudDraft(&session(), peerId, topicRootId, data);
Data::ApplyPeerCloudDraft(
&session(),
peerId,
topicRootId,
monoforumPeerId,
data);
}, [&](const MTPDdraftMessageEmpty &data) {
Data::ClearPeerCloudDraft(
&session(),
peerId,
topicRootId,
monoforumPeerId,
data.vdate().value_or_empty());
});
} break;