2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-05 09:05:14 +00:00

Extract mtproto key generation code.

This commit is contained in:
John Preston
2019-11-13 17:12:04 +03:00
parent 70dbd9e5b4
commit 08bfe6f1c1
40 changed files with 1667 additions and 1297 deletions

View File

@@ -329,7 +329,7 @@ void Sandbox::singleInstanceChecked() {
_lastCrashDump,
[=] { launchApplication(); });
window->proxyChanges(
) | rpl::start_with_next([=](ProxyData &&proxy) {
) | rpl::start_with_next([=](MTP::ProxyData &&proxy) {
_sandboxProxy = std::move(proxy);
refreshGlobalProxy();
}, window->lifetime());
@@ -443,15 +443,15 @@ void Sandbox::refreshGlobalProxy() {
#ifndef TDESKTOP_DISABLE_NETWORK_PROXY
const auto proxy = !Global::started()
? _sandboxProxy
: (Global::ProxySettings() == ProxyData::Settings::Enabled)
: (Global::ProxySettings() == MTP::ProxyData::Settings::Enabled)
? Global::SelectedProxy()
: ProxyData();
if (proxy.type == ProxyData::Type::Socks5
|| proxy.type == ProxyData::Type::Http) {
: MTP::ProxyData();
if (proxy.type == MTP::ProxyData::Type::Socks5
|| proxy.type == MTP::ProxyData::Type::Http) {
QNetworkProxy::setApplicationProxy(
ToNetworkProxy(ToDirectIpProxy(proxy)));
MTP::ToNetworkProxy(MTP::ToDirectIpProxy(proxy)));
} else if (!Global::started()
|| Global::ProxySettings() == ProxyData::Settings::System) {
|| Global::ProxySettings() == MTP::ProxyData::Settings::System) {
QNetworkProxyFactory::setUseSystemConfiguration(true);
} else {
QNetworkProxy::setApplicationProxy(QNetworkProxy::NoProxy);
@@ -555,7 +555,7 @@ rpl::producer<> Sandbox::widgetUpdateRequests() const {
return _widgetUpdateRequests.events();
}
ProxyData Sandbox::sandboxProxy() const {
MTP::ProxyData Sandbox::sandboxProxy() const {
return _sandboxProxy;
}