mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-02 07:35:12 +00:00
Apply proxy settings in mtproto-key-destroyer.
This commit is contained in:
@@ -38,7 +38,6 @@ public:
|
||||
|
||||
void start(Config &&config);
|
||||
|
||||
void setCurrentProxy(const ProxyData &proxy, bool enabled);
|
||||
void resolveProxyDomain(const QString &host);
|
||||
void setGoodProxyDomain(const QString &host, const QString &ip);
|
||||
void suggestMainDcId(DcId mainDcId);
|
||||
@@ -274,28 +273,6 @@ void Instance::Private::start(Config &&config) {
|
||||
requestConfig();
|
||||
}
|
||||
|
||||
void Instance::Private::setCurrentProxy(
|
||||
const ProxyData &proxy,
|
||||
bool enabled) {
|
||||
const auto key = [&](const ProxyData &proxy) {
|
||||
if (proxy.type == ProxyData::Type::Mtproto) {
|
||||
return std::make_pair(proxy.host, proxy.port);
|
||||
}
|
||||
return std::make_pair(QString(), uint32(0));
|
||||
};
|
||||
const auto previousKey = key(Global::UseProxy()
|
||||
? Global::SelectedProxy()
|
||||
: ProxyData());
|
||||
Global::SetSelectedProxy(proxy);
|
||||
Global::SetUseProxy(enabled);
|
||||
Sandbox::refreshGlobalProxy();
|
||||
restart();
|
||||
if (previousKey != key(proxy)) {
|
||||
reInitConnection(mainDcId());
|
||||
}
|
||||
Global::RefConnectionTypeChanged().notify();
|
||||
}
|
||||
|
||||
void Instance::Private::resolveProxyDomain(const QString &host) {
|
||||
if (!_domainResolver) {
|
||||
_domainResolver = std::make_unique<DomainResolver>([=](
|
||||
@@ -1467,10 +1444,6 @@ Instance::Instance(not_null<DcOptions*> options, Mode mode, Config &&config)
|
||||
_private->start(std::move(config));
|
||||
}
|
||||
|
||||
void Instance::setCurrentProxy(const ProxyData &proxy, bool enabled) {
|
||||
_private->setCurrentProxy(proxy, enabled);
|
||||
}
|
||||
|
||||
void Instance::resolveProxyDomain(const QString &host) {
|
||||
_private->resolveProxyDomain(host);
|
||||
}
|
||||
|
Reference in New Issue
Block a user