2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-03 16:15:13 +00:00

Resolve unknown story on open.

This commit is contained in:
John Preston
2023-06-21 13:15:59 +04:00
parent 80bec508b6
commit 4e39144d0f
3 changed files with 12 additions and 2 deletions

View File

@@ -2522,9 +2522,15 @@ void SessionController::openPeerStory(
using namespace Media::View;
using namespace Data;
invalidate_weak_ptrs(&_storyOpenGuard);
auto &stories = session().data().stories();
if (const auto from = stories.lookup({ peer->id, storyId })) {
const auto from = stories.lookup({ peer->id, storyId });
if (from) {
window().openInMediaView(OpenRequest(this, *from, context));
} else if (from.error() == Data::NoStory::Unknown) {
stories.resolve({ peer->id, storyId }, crl::guard(&_storyOpenGuard, [=] {
openPeerStory(peer, storyId, context);
}));
}
}