mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Remove MTP::MainInstance() global access point.
This commit is contained in:
@@ -1376,7 +1376,9 @@ void ProxiesBoxController::setTryIPv6(bool enabled) {
|
||||
return;
|
||||
}
|
||||
Global::SetTryIPv6(enabled);
|
||||
MTP::restart();
|
||||
if (const auto mtproto = _account->mtp()) {
|
||||
mtproto->restart();
|
||||
}
|
||||
Global::RefConnectionTypeChanged().notify();
|
||||
saveDelayed();
|
||||
}
|
||||
@@ -1408,7 +1410,8 @@ void ProxiesBoxController::updateView(const Item &item) {
|
||||
if (!selected
|
||||
|| (Global::ProxySettings() != ProxyData::Settings::Enabled)) {
|
||||
return item.state;
|
||||
} else if (MTP::dcstate() == MTP::ConnectedState) {
|
||||
} else if (_account->mtp()
|
||||
&& _account->mtp()->dcstate() == MTP::ConnectedState) {
|
||||
return ItemState::Online;
|
||||
}
|
||||
return ItemState::Connecting;
|
||||
|
Reference in New Issue
Block a user