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

Added behavior to hide spoilers when switching sections.

This commit is contained in:
23rd
2021-12-29 18:26:25 +03:00
committed by John Preston
parent a381439e3e
commit 3aacae2cb2
11 changed files with 54 additions and 0 deletions

View File

@@ -1596,6 +1596,25 @@ void Session::unloadHeavyViewParts(
}
}
void Session::registerShownSpoiler(FullMsgId id) {
if (const auto item = message(id)) {
_shownSpoilers.emplace(item);
}
}
void Session::unregisterShownSpoiler(FullMsgId id) {
if (const auto item = message(id)) {
_shownSpoilers.remove(item);
}
}
void Session::hideShownSpoilers() {
for (const auto &item : _shownSpoilers) {
item->hideSpoilers();
}
_shownSpoilers = base::flat_set<not_null<HistoryItem*>>();
}
void Session::removeMegagroupParticipant(
not_null<ChannelData*> channel,
not_null<UserData*> user) {