Allow to customize check/load way in autoupdate.

This commit is contained in:
John Preston 2018-05-28 08:10:30 +03:00
parent 59a1e13955
commit d257b2ee17
3 changed files with 1152 additions and 754 deletions

File diff suppressed because it is too large Load Diff

View File

@ -7,6 +7,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
namespace MTP {
class Instance;
} // namespace MTP
namespace Core {
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
@ -37,6 +41,8 @@ public:
void stop();
void test();
void setMtproto(const QPointer<MTP::Instance> &mtproto);
State state() const;
int already() const;
int size() const;

View File

@ -26,6 +26,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "lang/lang_translator.h"
#include "lang/lang_cloud_manager.h"
#include "lang/lang_hardcoded.h"
#include "core/update_checker.h"
#include "observer_peer.h"
#include "storage/file_upload.h"
#include "mainwidget.h"
@ -462,7 +463,10 @@ void Messenger::startMtp() {
_private->storedAuthSession.reset();
}
_langCloudManager = std::make_unique<Lang::CloudManager>(langpack(), mtp());
_langCloudManager = std::make_unique<Lang::CloudManager>(
langpack(),
mtp());
Core::UpdateChecker().setMtproto(mtp());
}
void Messenger::destroyMtpKeys(MTP::AuthKeysList &&keys) {