Remove changelog stories on archive attempt.

This commit is contained in:
John Preston 2023-09-25 17:39:18 +04:00
parent 4df7761e9d
commit eaa491518e
1 changed files with 9 additions and 1 deletions

View File

@ -1170,8 +1170,11 @@ void Stories::toggleHidden(
bool hidden,
std::shared_ptr<Ui::Show> show) {
const auto peer = _owner->peer(peerId);
const auto justRemove = peer->isServiceUser() && hidden;
if (peer->hasStoriesHidden() != hidden) {
peer->setStoriesHidden(hidden);
if (!justRemove) {
peer->setStoriesHidden(hidden);
}
session().api().request(MTPstories_TogglePeerStoriesHidden(
peer->input,
MTP_bool(hidden)
@ -1192,6 +1195,11 @@ void Stories::toggleHidden(
}
});
if (justRemove) {
apply(peer, nullptr);
return;
}
const auto i = _all.find(peerId);
if (i == end(_all)) {
return;