Compare commits

...

1 Commits

Author SHA1 Message Date
23rd
97d01151aa Attempted to fix opening primary window from tdesktop_target. 2025-08-22 16:21:10 +03:00

View File

@@ -657,7 +657,11 @@ bool ResolveUsernameOrPhone(
startToken = params.value(u"startapp"_q); startToken = params.value(u"startapp"_q);
} }
} }
controller->window().activate(); const auto historyInNewWindow =
(params.value(u"tdesktop_target"_q) == u"blank"_q);
if (!historyInNewWindow) {
controller->window().activate();
}
controller->showPeerByLink(Window::PeerByLinkInfo{ controller->showPeerByLink(Window::PeerByLinkInfo{
.usernameOrId = domain, .usernameOrId = domain,
.phone = phone, .phone = phone,
@@ -708,8 +712,7 @@ bool ResolveUsernameOrPhone(
: std::nullopt), : std::nullopt),
.clickFromMessageId = myContext.itemId, .clickFromMessageId = myContext.itemId,
.clickFromBotWebviewContext = myContext.botWebviewContext, .clickFromBotWebviewContext = myContext.botWebviewContext,
.historyInNewWindow = .historyInNewWindow = historyInNewWindow,
(params.value(u"tdesktop_target"_q) == u"blank"_q),
}); });
return true; return true;
} }
@@ -1917,6 +1920,8 @@ bool InternalPassportLink(const QString &url) {
bool StartUrlRequiresActivate(const QString &url) { bool StartUrlRequiresActivate(const QString &url) {
return Core::App().passcodeLocked() return Core::App().passcodeLocked()
? true ? true
: url.contains(u"tdesktop_target"_q)
? false
: !InternalPassportLink(url); : !InternalPassportLink(url);
} }