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

Handle ttl_period locally.

This commit is contained in:
John Preston
2021-02-02 20:38:30 +04:00
parent 046a3906c4
commit 6a6e355af4
13 changed files with 282 additions and 69 deletions

View File

@@ -1331,14 +1331,7 @@ void Updates::applyUpdates(
item->id,
ApiWrap::RequestMessageDataCallback());
}
item->updateSentContent({
sent.text,
Api::EntitiesFromMTP(&session(), list.value_or_empty())
}, d.vmedia());
item->contributeToSlowmode(d.vdate().v);
if (!wasAlready) {
item->indexAsNewItem();
}
item->applySentMessage(sent.text, d, wasAlready);
}
}
@@ -1829,7 +1822,14 @@ void Updates::feedUpdate(const MTPUpdate &update) {
case mtpc_updatePeerHistoryTTL: {
const auto &d = update.c_updatePeerHistoryTTL();
// #TODO ttl
const auto peerId = peerFromMTP(d.vpeer());
if (const auto peer = session().data().peerLoaded(peerId)) {
if (const auto ttl = d.vttl()) {
peer->applyMessagesTTL(*ttl);
} else {
peer->setMessagesTTL(0, 0, false);
}
}
} break;
case mtpc_updateNewEncryptedMessage: {