2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Moved proxy global variables from facades to core settings.

This commit is contained in:
23rd
2021-06-11 01:49:08 +03:00
parent 707b36dc12
commit 6d08542afa
24 changed files with 497 additions and 184 deletions

View File

@@ -33,7 +33,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "main/main_domain.h"
#include "main/main_session.h"
#include "mtproto/facade.h"
#include "facades.h"
#include "app.h"
#include "styles/style_settings.h"
@@ -50,7 +49,7 @@ void SetupConnectionType(
not_null<Ui::VerticalLayout*> container) {
const auto connectionType = [=] {
const auto transport = account->mtp().dctransport();
if (Global::ProxySettings() != MTP::ProxyData::Settings::Enabled) {
if (!Core::App().settings().proxy().isEnabled()) {
return transport.isEmpty()
? tr::lng_connection_auto_connecting(tr::now)
: tr::lng_connection_auto(tr::now, lt_transport, transport);
@@ -64,7 +63,7 @@ void SetupConnectionType(
container,
tr::lng_settings_connection_type(),
rpl::merge(
base::ObservableViewer(Global::RefConnectionTypeChanged()),
Core::App().settings().proxy().connectionTypeChanges(),
// Handle language switch.
tr::lng_connection_auto_connecting() | rpl::to_empty
) | rpl::map(connectionType),