From e6157986b8b85b90576d2c8665c2559dc8043027 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Thu, 12 Jul 2018 21:03:30 +0200 Subject: [PATCH] TL schema path bugfix --- docs | 2 +- src/danog/MadelineProto/MTProto.php | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs b/docs index 3bda7431..1c204d1d 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 3bda743116ca82782fd4f47ac4a5fd96970b231a +Subproject commit 1c204d1dbdaea25559ac9a89d51c8850e005b772 diff --git a/src/danog/MadelineProto/MTProto.php b/src/danog/MadelineProto/MTProto.php index 45b24d40..36c6812a 100644 --- a/src/danog/MadelineProto/MTProto.php +++ b/src/danog/MadelineProto/MTProto.php @@ -212,6 +212,13 @@ class MTProto } //$this->wrapper = $backtrace[2]['object']; } + + + if (isset($this->settings['tl_schema']['src']['botAPI']) && $this->settings['tl_schema']['src']['botAPI'] !== __DIR__.'/TL_botAPI.tl') { + $settings = $this->settings; + unset($settings['tl_schema']); + $this->__construct($settings); + } if (!isset($this->v) || $this->v !== self::V) { $this->logger->logger(\danog\MadelineProto\Lang::$current_lang['serialization_ofd'], Logger::WARNING); foreach ($this->datacenter->sockets as $dc_id => $socket) { @@ -219,7 +226,6 @@ class MTProto $socket->authorized = true; } } - //$this->authorized === self::LOGGED_IN; } $settings = $this->settings; if (isset($settings['updates']['callback'][0]) && $settings['updates']['callback'][0] === $this) { $settings['updates']['callback'] = 'get_updates_update_handler';