Improve scheme comparison for hidden URLs in get_first_url.
This commit is contained in:
parent
d6b3a77899
commit
c287417b2c
@ -1825,7 +1825,8 @@ Slice get_first_url(const FormattedText &text) {
|
|||||||
break;
|
break;
|
||||||
case MessageEntity::Type::TextUrl: {
|
case MessageEntity::Type::TextUrl: {
|
||||||
Slice url = entity.argument;
|
Slice url = entity.argument;
|
||||||
if (begins_with(url, "ton:") || begins_with(url, "tg:") || begins_with(url, "ftp:")) {
|
string scheme = to_lower(url.substr(0, 4));
|
||||||
|
if (scheme == "ton:" || begins_with(scheme, "tg:") || scheme == "ftp:") {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
return url;
|
return url;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user