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

Update API scheme on layer 203.

This commit is contained in:
John Preston
2025-04-29 09:37:41 +04:00
parent 833341dea7
commit 3e538b732a
2 changed files with 13 additions and 7 deletions

View File

@@ -301,12 +301,16 @@ void ApiWrap::topPromotionDone(const MTPhelp_PromoData &proxy) {
}, [&](const MTPDhelp_promoData &data) {
_session->data().processChats(data.vchats());
_session->data().processUsers(data.vusers());
const auto peerId = peerFromMTP(data.vpeer());
const auto history = _session->data().history(peerId);
_session->data().setTopPromoted(
history,
data.vpsa_type().value_or_empty(),
data.vpsa_message().value_or_empty());
if (const auto peer = data.vpeer()) {
const auto peerId = peerFromMTP(*peer);
const auto history = _session->data().history(peerId);
_session->data().setTopPromoted(
history,
data.vpsa_type().value_or_empty(),
data.vpsa_message().value_or_empty());
} else {
_session->data().setTopPromoted(nullptr, QString(), QString());
}
});
}