mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Resolve unknown story on open.
This commit is contained in:
parent
80bec508b6
commit
4e39144d0f
3 changed files with 12 additions and 2 deletions
|
@ -342,7 +342,9 @@ InnerWidget::InnerWidget(
|
|||
|
||||
_stories->clicks(
|
||||
) | rpl::start_with_next([=](uint64 id) {
|
||||
_controller->openPeerStories(PeerId(int64(id)), {});
|
||||
_controller->openPeerStories(
|
||||
PeerId(int64(id)),
|
||||
Data::StorySourcesList::NotHidden);
|
||||
}, lifetime());
|
||||
|
||||
_stories->showProfileRequests(
|
||||
|
|
|
@ -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);
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -717,6 +717,8 @@ private:
|
|||
using ReactionIconFactory = HistoryView::Reactions::CachedIconFactory;
|
||||
std::unique_ptr<ReactionIconFactory> _cachedReactionIconFactory;
|
||||
|
||||
base::has_weak_ptr _storyOpenGuard;
|
||||
|
||||
GiftPremiumValidator _giftPremiumValidator;
|
||||
|
||||
QString _premiumRef;
|
||||
|
|
Loading…
Add table
Reference in a new issue