2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Handle improved protocol secrets.

This commit is contained in:
John Preston
2018-06-25 20:22:03 +01:00
parent 8c2f11de7d
commit 22441ef80c
6 changed files with 50 additions and 50 deletions

View File

@@ -738,8 +738,7 @@ ProxyData ProxyBox::collectData() {
} else if ((result.type == Type::Http || result.type == Type::Socks5)
&& !result.password.isEmpty() && result.user.isEmpty()) {
_user->showError();
} else if (result.type == Type::Mtproto
&& result.password.size() != 32) {
} else if (result.type == Type::Mtproto && !result.valid()) {
_secret->showError();
} else if (!result) {
_host->showError();
@@ -850,7 +849,7 @@ void ProxyBox::setupMtprotoCredentials(const ProxyData &data) {
st::connectionUserInputField,
langFactory(lng_connection_proxy_secret_ph),
(data.type == Type::Mtproto) ? data.password : QString());
_secret->setMaxLength(32);
_secret->setMaxLength(ProxyData::MaxMtprotoPasswordLength());
_secret->move(0, 0);
_secret->heightValue(
) | rpl::start_with_next([=, wrap = secretWrap.data()](int height) {
@@ -1107,7 +1106,7 @@ void ProxiesBoxController::refreshChecker(Item &item) {
item.checker->connectToServer(
item.data.host,
item.data.port,
MTP::ProtocolSecretFromPassword(item.data.password),
item.data.secretFromMtprotoPassword(),
dcId);
} else {
const auto options = mtproto->dcOptions()->lookup(