mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-19 07:37:11 +02:00
Support different invite link syntax.
This commit is contained in:
parent
0b4d0b83c2
commit
0cd8453b00
1 changed files with 2 additions and 2 deletions
|
@ -521,8 +521,8 @@ QString TryConvertUrlToLocal(QString url) {
|
|||
auto telegramMeMatch = regex_match(qsl("^(https?://)?(www\\.)?(telegram\\.(me|dog)|t\\.me)/(.+)$"), url, matchOptions);
|
||||
if (telegramMeMatch) {
|
||||
auto query = telegramMeMatch->capturedRef(5);
|
||||
if (auto joinChatMatch = regex_match(qsl("^joinchat/([a-zA-Z0-9\\.\\_\\-]+)(\\?|$)"), query, matchOptions)) {
|
||||
return qsl("tg://join?invite=") + url_encode(joinChatMatch->captured(1));
|
||||
if (auto joinChatMatch = regex_match(qsl("^(joinchat/|\\+|\\%20)([a-zA-Z0-9\\.\\_\\-]+)(\\?|$)"), query, matchOptions)) {
|
||||
return qsl("tg://join?invite=") + url_encode(joinChatMatch->captured(2));
|
||||
} else if (auto stickerSetMatch = regex_match(qsl("^addstickers/([a-zA-Z0-9\\.\\_]+)(\\?|$)"), query, matchOptions)) {
|
||||
return qsl("tg://addstickers?set=") + url_encode(stickerSetMatch->captured(1));
|
||||
} else if (auto themeMatch = regex_match(qsl("^addtheme/([a-zA-Z0-9\\.\\_]+)(\\?|$)"), query, matchOptions)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue