mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Remove changelog stories on archive attempt.
This commit is contained in:
parent
4df7761e9d
commit
eaa491518e
1 changed files with 9 additions and 1 deletions
|
@ -1170,8 +1170,11 @@ void Stories::toggleHidden(
|
||||||
bool hidden,
|
bool hidden,
|
||||||
std::shared_ptr<Ui::Show> show) {
|
std::shared_ptr<Ui::Show> show) {
|
||||||
const auto peer = _owner->peer(peerId);
|
const auto peer = _owner->peer(peerId);
|
||||||
|
const auto justRemove = peer->isServiceUser() && hidden;
|
||||||
if (peer->hasStoriesHidden() != hidden) {
|
if (peer->hasStoriesHidden() != hidden) {
|
||||||
peer->setStoriesHidden(hidden);
|
if (!justRemove) {
|
||||||
|
peer->setStoriesHidden(hidden);
|
||||||
|
}
|
||||||
session().api().request(MTPstories_TogglePeerStoriesHidden(
|
session().api().request(MTPstories_TogglePeerStoriesHidden(
|
||||||
peer->input,
|
peer->input,
|
||||||
MTP_bool(hidden)
|
MTP_bool(hidden)
|
||||||
|
@ -1192,6 +1195,11 @@ void Stories::toggleHidden(
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (justRemove) {
|
||||||
|
apply(peer, nullptr);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const auto i = _all.find(peerId);
|
const auto i = _all.find(peerId);
|
||||||
if (i == end(_all)) {
|
if (i == end(_all)) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue