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

@@ -439,7 +439,7 @@ void ClearApplying() {
GlobalApplying = Applying();
}
SendMediaReady PrepareWallPaper(const QImage &image) {
SendMediaReady PrepareWallPaper(MTP::DcId dcId, const QImage &image) {
PreparedPhotoThumbs thumbnails;
QVector<MTPPhotoSize> sizes;
@@ -482,7 +482,7 @@ SendMediaReady PrepareWallPaper(const QImage &image) {
MTP_int(jpeg.size()),
MTP_vector<MTPPhotoSize>(sizes),
MTPVector<MTPVideoSize>(),
MTP_int(MTP::maindc()),
MTP_int(dcId),
MTP_vector<MTPDocumentAttribute>(attributes));
return SendMediaReady(
@@ -575,7 +575,7 @@ void ChatBackground::checkUploadWallPaper() {
return;
}
const auto ready = PrepareWallPaper(_original);
const auto ready = PrepareWallPaper(_session->mainDcId(), _original);
const auto documentId = ready.id;
_wallPaperUploadId = FullMsgId(0, _session->data().nextLocalMessageId());
_session->uploader().uploadMedia(_wallPaperUploadId, ready);