mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
MTP global state moved to MTP::Instance class.
Now there will be ability to start multiple mtproto instances.
This commit is contained in:
@@ -82,7 +82,9 @@ MainWidget::MainWidget(QWidget *parent) : TWidget(parent)
|
||||
, _playerPanel(this, Media::Player::Panel::Layout::Full)
|
||||
, _mediaType(this, st::defaultDropdownMenu)
|
||||
, _api(new ApiWrap(this)) {
|
||||
MTP::setGlobalDoneHandler(rpcDone(&MainWidget::updateReceived));
|
||||
Messenger::Instance().mtp()->setUpdatesHandler(rpcDone(&MainWidget::updateReceived));
|
||||
Messenger::Instance().mtp()->setGlobalFailHandler(rpcFail(&MainWidget::updateFail));
|
||||
|
||||
_ptsWaiter.setRequesting(true);
|
||||
updateScrollColors();
|
||||
|
||||
@@ -174,8 +176,6 @@ MainWidget::MainWidget(QWidget *parent) : TWidget(parent)
|
||||
|
||||
orderWidgets();
|
||||
|
||||
MTP::setGlobalFailHandler(rpcFail(&MainWidget::updateFail));
|
||||
|
||||
_mediaType->hide();
|
||||
_mediaType->setOrigin(Ui::PanelAnimation::Origin::TopRight);
|
||||
_topBar->mediaTypeButton()->installEventFilter(_mediaType);
|
||||
@@ -4279,7 +4279,7 @@ MainWidget::~MainWidget() {
|
||||
_hider = nullptr;
|
||||
delete hider;
|
||||
}
|
||||
MTP::clearGlobalHandlers();
|
||||
Messenger::Instance().mtp()->clearGlobalHandlers();
|
||||
|
||||
if (App::wnd()) App::wnd()->noMain(this);
|
||||
}
|
||||
|
Reference in New Issue
Block a user