2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +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

@@ -926,7 +926,9 @@ void Session::startExport(const MTPInputPeer &singlePeer) {
_exportPanel->activatePanel();
return;
}
_export = std::make_unique<Export::Controller>(singlePeer);
_export = std::make_unique<Export::Controller>(
session().mtp().get(),
singlePeer);
_exportPanel = std::make_unique<Export::View::PanelController>(
&session(),
_export.get());
@@ -2484,7 +2486,7 @@ DocumentData *Session::documentFromWeb(
QByteArray(),
ImageWithLocation{ .location = thumbnailLocation },
ImageWithLocation{ .location = videoThumbnailLocation },
MTP::maindc(),
session().mainDcId(),
int32(0)); // data.vsize().v
result->setWebLocation(WebFileLocation(
data.vurl().v,
@@ -2506,7 +2508,7 @@ DocumentData *Session::documentFromWeb(
QByteArray(),
ImageWithLocation{ .location = thumbnailLocation },
ImageWithLocation{ .location = videoThumbnailLocation },
MTP::maindc(),
session().mainDcId(),
int32(0)); // data.vsize().v
result->setContentUrl(qs(data.vurl()));
return result;