mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix new format of direct post links in channels.
This commit is contained in:
parent
476a864be2
commit
e3d79d46f7
1 changed files with 3 additions and 2 deletions
|
@ -876,7 +876,7 @@ QString TryConvertUrlToLocal(QString url) {
|
||||||
|
|
||||||
using namespace qthelp;
|
using namespace qthelp;
|
||||||
auto matchOptions = RegExOption::CaseInsensitive;
|
auto matchOptions = RegExOption::CaseInsensitive;
|
||||||
auto subdomainMatch = regex_match(qsl("^(https?://)?([a-zA-Z0-9\\_]+)\\.t\\.me/?(\\?.+)?"), url, matchOptions);
|
auto subdomainMatch = regex_match(qsl("^(https?://)?([a-zA-Z0-9\\_]+)\\.t\\.me(/\\d+)?/?(\\?.+)?"), url, matchOptions);
|
||||||
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") {
|
||||||
|
@ -884,7 +884,8 @@ QString TryConvertUrlToLocal(QString url) {
|
||||||
subdomainMatch->captured(1)
|
subdomainMatch->captured(1)
|
||||||
+ "t.me/"
|
+ "t.me/"
|
||||||
+ name
|
+ name
|
||||||
+ subdomainMatch->captured(3));
|
+ subdomainMatch->captured(3)
|
||||||
|
+ subdomainMatch->captured(4));
|
||||||
return result.startsWith("tg://resolve?domain=")
|
return result.startsWith("tg://resolve?domain=")
|
||||||
? result
|
? result
|
||||||
: url;
|
: url;
|
||||||
|
|
Loading…
Add table
Reference in a new issue