2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-05 17:06:03 +00:00

Preload stories in the sources lists.

This commit is contained in:
John Preston
2023-06-26 20:22:56 +04:00
parent 21543338d7
commit d567282430
13 changed files with 264 additions and 443 deletions

View File

@@ -2542,14 +2542,14 @@ void SessionController::openPeerStories(
auto &stories = session().data().stories();
if (const auto source = stories.source(peerId)) {
const auto j = source->ids.lower_bound(
StoryIdDates{ source->readTill + 1 });
openPeerStory(
source->user,
j != source->ids.end() ? j->id : source->ids.front().id,
(list
? StoriesContext{ *list }
: StoriesContext{ StoriesContextPeer() }));
if (const auto idDates = source->toOpen()) {
openPeerStory(
source->user,
idDates.id,
(list
? StoriesContext{ *list }
: StoriesContext{ StoriesContextPeer() }));
}
}
}