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

Remove MTP::MainInstance() global access point.

This commit is contained in:
John Preston
2020-06-11 20:09:46 +04:00
parent 7f09da9e32
commit 0ad7dcaef9
84 changed files with 823 additions and 1362 deletions

View File

@@ -26,6 +26,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "core/application.h"
#include "storage/localstorage.h"
#include "data/data_session.h"
#include "main/main_account.h"
#include "main/main_session.h"
#include "mtproto/facade.h"
#include "layout.h"
@@ -55,8 +56,10 @@ void SetupConnectionType(
return;
}
#ifndef TDESKTOP_DISABLE_NETWORK_PROXY
const auto connectionType = [] {
const auto transport = MTP::dctransport();
const auto connectionType = [=] {
const auto transport = account->mtp()
? account->mtp()->dctransport()
: QString();
if (Global::ProxySettings() != MTP::ProxyData::Settings::Enabled) {
return transport.isEmpty()
? tr::lng_connection_auto_connecting(tr::now)