mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix MentionClickHandler in non-context handler activations.
This commit is contained in:
parent
2f92830f6a
commit
03c1f15961
2 changed files with 9 additions and 3 deletions
|
@ -188,9 +188,15 @@ void MentionClickHandler::onClick(ClickContext context) const {
|
||||||
const auto button = context.button;
|
const auto button = context.button;
|
||||||
if (button == Qt::LeftButton || button == Qt::MiddleButton) {
|
if (button == Qt::LeftButton || button == Qt::MiddleButton) {
|
||||||
const auto my = context.other.value<ClickHandlerContext>();
|
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;
|
using Info = Window::SessionNavigation::PeerByLinkInfo;
|
||||||
controller->showPeerByLink(Info{
|
use->showPeerByLink(Info{
|
||||||
.usernameOrId = _tag.mid(1),
|
.usernameOrId = _tag.mid(1),
|
||||||
.resolveType = Window::ResolveType::Mention,
|
.resolveType = Window::ResolveType::Mention,
|
||||||
});
|
});
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 7aedf7703fdf24c11375b7e67c2a6d9e16b0008b
|
Subproject commit b90d7ee27a85904c49e0f495c11b722b23db8fd2
|
Loading…
Add table
Reference in a new issue