From 1c41e01f0d9e359b58b1e57e594cff4f24eaccfe Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 14 Jul 2025 09:54:04 +0400 Subject: [PATCH] Update API scheme to layer 209. --- Telegram/SourceFiles/data/data_stories.cpp | 15 ++++++++++----- Telegram/SourceFiles/mtproto/scheme/api.tl | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Telegram/SourceFiles/data/data_stories.cpp b/Telegram/SourceFiles/data/data_stories.cpp index 1aac110c4d..4c9f11d787 100644 --- a/Telegram/SourceFiles/data/data_stories.cpp +++ b/Telegram/SourceFiles/data/data_stories.cpp @@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "base/unixtime.h" #include "apiwrap.h" #include "core/application.h" +#include "data/components/top_peers.h" #include "data/data_changes.h" #include "data/data_channel.h" #include "data/data_document.h" @@ -421,10 +422,7 @@ void Stories::parseAndApply(const MTPPeerStories &stories) { }; if (result.peer->isSelf() || (result.peer->isChannel() && result.peer->asChannel()->amIn()) - || (result.peer->isUser() - && (result.peer->asUser()->isBot() - || result.peer->asUser()->isContact())) - || result.peer->isServiceUser()) { + || result.peer->isUser()) { const auto hidden = result.peer->hasStoriesHidden(); using List = StorySourcesList; add(hidden ? List::Hidden : List::NotHidden); @@ -1187,7 +1185,11 @@ void Stories::toggleHidden( bool hidden, std::shared_ptr show) { const auto peer = _owner->peer(peerId); - const auto justRemove = peer->isServiceUser() && hidden; + const auto byHints = peer->isUser() + && !peer->asUser()->isBot() + && !peer->asUser()->isContact() + && !peer->asUser()->isServiceUser(); + const auto justRemove = (byHints || peer->isServiceUser()) && hidden; if (peer->hasStoriesHidden() != hidden) { if (!justRemove) { peer->setStoriesHidden(hidden); @@ -1196,6 +1198,9 @@ void Stories::toggleHidden( peer->input, MTP_bool(hidden) )).send(); + if (byHints) { + peer->session().topPeers().remove(peer); + } } const auto name = peer->shortName(); diff --git a/Telegram/SourceFiles/mtproto/scheme/api.tl b/Telegram/SourceFiles/mtproto/scheme/api.tl index 39b5af7c5b..c6e4c22b2c 100644 --- a/Telegram/SourceFiles/mtproto/scheme/api.tl +++ b/Telegram/SourceFiles/mtproto/scheme/api.tl @@ -2720,4 +2720,4 @@ smsjobs.finishJob#4f1ebf24 flags:# job_id:string error:flags.0?string = Bool; fragment.getCollectibleInfo#be1e85ba collectible:InputCollectible = fragment.CollectibleInfo; -// LAYER 208 +// LAYER 209