Fix MentionClickHandler in non-context handler activations.

This commit is contained in:
John Preston 2022-06-23 09:47:54 +04:00
parent 2f92830f6a
commit 03c1f15961
2 changed files with 9 additions and 3 deletions

View file

@ -188,9 +188,15 @@ void MentionClickHandler::onClick(ClickContext context) const {
const auto button = context.button;
if (button == Qt::LeftButton || button == Qt::MiddleButton) {
const auto my = context.other.value<ClickHandlerContext>();
if (const auto controller = my.sessionWindow.get()) {
const auto controller = my.sessionWindow.get();
const auto use = controller
? controller
: Core::App().activeWindow()
? Core::App().activeWindow()->sessionController()
: nullptr;
if (use) {
using Info = Window::SessionNavigation::PeerByLinkInfo;
controller->showPeerByLink(Info{
use->showPeerByLink(Info{
.usernameOrId = _tag.mid(1),
.resolveType = Window::ResolveType::Mention,
});

@ -1 +1 @@
Subproject commit 7aedf7703fdf24c11375b7e67c2a6d9e16b0008b
Subproject commit b90d7ee27a85904c49e0f495c11b722b23db8fd2