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

Display a disclaimer about proxy sponsor.

This commit is contained in:
John Preston
2018-05-15 19:38:27 +03:00
parent d3f85b4c4e
commit 5a1d4d55c6
9 changed files with 67 additions and 3 deletions

View File

@@ -1601,13 +1601,21 @@ void Session::setProxyPromoted(PeerData *promoted) {
if (const auto history = App::historyLoaded(_proxyPromoted)) {
history->cacheProxyPromoted(false);
}
_proxyPromoted = promoted;
const auto old = std::exchange(_proxyPromoted, promoted);
if (_proxyPromoted) {
const auto history = App::history(_proxyPromoted);
history->cacheProxyPromoted(true);
if (!history->lastMessageKnown()) {
_session->api().requestDialogEntry(history);
}
Notify::peerUpdatedDelayed(
_proxyPromoted,
Notify::PeerUpdate::Flag::ChannelPromotedChanged);
}
if (old) {
Notify::peerUpdatedDelayed(
old,
Notify::PeerUpdate::Flag::ChannelPromotedChanged);
}
}
}