From 06d5d8859a508bad12a08afd79f3953f529238ee Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Mon, 21 Feb 2022 01:35:36 +0300 Subject: [PATCH] Added extracting of session controller from context for custom urls. --- Telegram/SourceFiles/core/application.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/core/application.cpp b/Telegram/SourceFiles/core/application.cpp index ceb62c824..1732d5446 100644 --- a/Telegram/SourceFiles/core/application.cpp +++ b/Telegram/SourceFiles/core/application.cpp @@ -46,6 +46,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "lang/lang_instance.h" #include "mainwidget.h" #include "core/file_utilities.h" +#include "core/click_handler_types.h" // ClickHandlerContext. #include "core/crash_reports.h" #include "main/main_account.h" #include "main/main_domain.h" @@ -892,7 +893,10 @@ bool Application::openCustomUrl( return false; } const auto command = base::StringViewMid(urlTrimmed, protocol.size(), 8192); - const auto controller = _primaryWindow + const auto my = context.value(); + const auto controller = my.sessionWindow.get() + ? my.sessionWindow.get() + : _primaryWindow ? _primaryWindow->sessionController() : nullptr;