mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Handle only username subdomains for t.me domain.
This commit is contained in:
parent
234c74a439
commit
9ef2f370ac
1 changed files with 8 additions and 1 deletions
|
@ -880,7 +880,14 @@ QString TryConvertUrlToLocal(QString url) {
|
||||||
if (subdomainMatch) {
|
if (subdomainMatch) {
|
||||||
const auto name = subdomainMatch->captured(2);
|
const auto name = subdomainMatch->captured(2);
|
||||||
if (name.size() > 1 && name != "www") {
|
if (name.size() > 1 && name != "www") {
|
||||||
url = subdomainMatch->captured(1) + "t.me/" + name + subdomainMatch->captured(3);
|
const auto result = TryConvertUrlToLocal(
|
||||||
|
subdomainMatch->captured(1)
|
||||||
|
+ "t.me/"
|
||||||
|
+ name
|
||||||
|
+ subdomainMatch->captured(3));
|
||||||
|
return result.startsWith("tg://resolve?domain=")
|
||||||
|
? result
|
||||||
|
: url;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
auto telegramMeMatch = regex_match(qsl("^(https?://)?(www\\.)?(telegram\\.(me|dog)|t\\.me)/(.+)$"), url, matchOptions);
|
auto telegramMeMatch = regex_match(qsl("^(https?://)?(www\\.)?(telegram\\.(me|dog)|t\\.me)/(.+)$"), url, matchOptions);
|
||||||
|
|
Loading…
Add table
Reference in a new issue