Fix jump to original from story repost.

This commit is contained in:
John Preston 2024-04-02 23:09:26 +04:00
parent 1061fb6c85
commit 1e0002aa74
3 changed files with 9 additions and 1 deletions

View File

@ -933,6 +933,13 @@ void Controller::show(
peer->updateFull(); peer->updateFull();
} }
void Controller::jumpTo(
not_null<Data::Story*> story,
Data::StoriesContext context) {
show(story, std::move(context));
_delegate->storiesRedisplay(story);
}
bool Controller::changeShown(Data::Story *story) { bool Controller::changeShown(Data::Story *story) {
const auto id = story ? story->fullId() : FullStoryId(); const auto id = story ? story->fullId() : FullStoryId();
const auto session = story ? &story->session() : nullptr; const auto session = story ? &story->session() : nullptr;

View File

@ -141,6 +141,7 @@ public:
-> HistoryView::Reactions::CachedIconFactory &; -> HistoryView::Reactions::CachedIconFactory &;
void show(not_null<Data::Story*> story, Data::StoriesContext context); void show(not_null<Data::Story*> story, Data::StoriesContext context);
void jumpTo(not_null<Data::Story*> story, Data::StoriesContext context);
void ready(); void ready();
void updateVideoPlayback(const Player::TrackState &state); void updateVideoPlayback(const Player::TrackState &state);

View File

@ -178,7 +178,7 @@ RepostClickHandler RepostView::lookupHandler(QPoint position) {
const auto of = owner->stories().lookup({ peer->id, id }); const auto of = owner->stories().lookup({ peer->id, id });
if (of) { if (of) {
using namespace Data; using namespace Data;
_controller->show(*of, { StoriesContextSingle() }); _controller->jumpTo(*of, { StoriesContextSingle() });
} else { } else {
_controller->uiShow()->show(PrepareShortInfoBox(peer)); _controller->uiShow()->show(PrepareShortInfoBox(peer));
} }