Allow opening tonsite:// from web apps.

This commit is contained in:
John Preston 2024-08-01 14:47:16 +02:00
parent 11c91c1a42
commit 0af3028cd6

View file

@ -1117,9 +1117,10 @@ Webview::ThemeParams WebViewInstance::botThemeParams() {
bool WebViewInstance::botHandleLocalUri(QString uri, bool keepOpen) {
const auto local = Core::TryConvertUrlToLocal(uri);
if (uri == local || Core::InternalPassportLink(local)) {
return local.startsWith(u"tg://"_q);
} else if (!local.startsWith(u"tg://"_q, Qt::CaseInsensitive)) {
if (Core::InternalPassportLink(local)) {
return true;
} else if (!local.startsWith(u"tg://"_q, Qt::CaseInsensitive)
&& !local.startsWith(u"tonsite://"_q, Qt::CaseInsensitive)) {
return false;
}
const auto bot = _bot;