Skip to content

Commit

Permalink
Fix jump to original from story repost.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Apr 2, 2024
1 parent 1061fb6 commit 1e0002a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,13 @@ void Controller::show(
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) {
const auto id = story ? story->fullId() : FullStoryId();
const auto session = story ? &story->session() : nullptr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ class Controller final : public base::has_weak_ptr {
-> HistoryView::Reactions::CachedIconFactory &;

void show(not_null<Data::Story*> story, Data::StoriesContext context);
void jumpTo(not_null<Data::Story*> story, Data::StoriesContext context);
void ready();

void updateVideoPlayback(const Player::TrackState &state);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ RepostClickHandler RepostView::lookupHandler(QPoint position) {
const auto of = owner->stories().lookup({ peer->id, id });
if (of) {
using namespace Data;
_controller->show(*of, { StoriesContextSingle() });
_controller->jumpTo(*of, { StoriesContextSingle() });
} else {
_controller->uiShow()->show(PrepareShortInfoBox(peer));
}
Expand Down

0 comments on commit 1e0002a

Please sign in to comment.