mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Accept also base64 (non-url) secrets.
This commit is contained in:
@@ -153,9 +153,13 @@ void AddProxyFromClipboard(
|
||||
const auto type = isSocks
|
||||
? ProxyData::Type::Socks5
|
||||
: ProxyData::Type::Mtproto;
|
||||
const auto fields = url_parse_params(
|
||||
auto fields = url_parse_params(
|
||||
match->captured(1),
|
||||
qthelp::UrlParamNameTransform::ToLower);
|
||||
if (type == ProxyData::Type::Mtproto) {
|
||||
auto &secret = fields[u"secret"_q];
|
||||
secret.replace('+', '-').replace('/', '_');
|
||||
}
|
||||
const auto proxy = ProxyDataFromFields(type, fields);
|
||||
if (!proxy) {
|
||||
const auto status = proxy.status();
|
||||
|
||||
@@ -388,6 +388,8 @@ bool ApplyMtprotoProxy(
|
||||
auto params = url_parse_params(
|
||||
match->captured(1),
|
||||
qthelp::UrlParamNameTransform::ToLower);
|
||||
auto &secret = params[u"secret"_q];
|
||||
secret.replace('+', '-').replace('/', '_');
|
||||
ProxiesBoxController::ShowApplyConfirmation(
|
||||
controller,
|
||||
MTP::ProxyData::Type::Mtproto,
|
||||
|
||||
Reference in New Issue
Block a user