mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-28 08:22:31 +00:00
Remove MTP::MainInstance() global access point.
This commit is contained in:
@@ -13,6 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "export/output/export_output_abstract.h"
|
||||
#include "export/output/export_output_result.h"
|
||||
#include "export/output/export_output_stats.h"
|
||||
#include "mtproto/mtp_instance.h"
|
||||
|
||||
namespace Export {
|
||||
namespace {
|
||||
@@ -34,6 +35,7 @@ class ControllerObject {
|
||||
public:
|
||||
ControllerObject(
|
||||
crl::weak_on_queue<ControllerObject> weak,
|
||||
QPointer<MTP::Instance> mtproto,
|
||||
const MTPInputPeer &peer);
|
||||
|
||||
rpl::producer<State> state() const;
|
||||
@@ -131,8 +133,9 @@ private:
|
||||
|
||||
ControllerObject::ControllerObject(
|
||||
crl::weak_on_queue<ControllerObject> weak,
|
||||
QPointer<MTP::Instance> mtproto,
|
||||
const MTPInputPeer &peer)
|
||||
: _api(weak.runner())
|
||||
: _api(mtproto, weak.runner())
|
||||
, _state(PasswordCheckState{}) {
|
||||
_api.errors(
|
||||
) | rpl::start_with_next([=](RPCError &&error) {
|
||||
@@ -586,7 +589,10 @@ void ControllerObject::setFinishedState() {
|
||||
_stats.bytesCount() });
|
||||
}
|
||||
|
||||
Controller::Controller(const MTPInputPeer &peer) : _wrapped(peer) {
|
||||
Controller::Controller(
|
||||
QPointer<MTP::Instance> mtproto,
|
||||
const MTPInputPeer &peer)
|
||||
: _wrapped(std::move(mtproto), peer) {
|
||||
}
|
||||
|
||||
rpl::producer<State> Controller::state() const {
|
||||
|
||||
Reference in New Issue
Block a user