From 32cb13b6a8dd67a535d83c6c9b0306051bda45fb Mon Sep 17 00:00:00 2001 From: Alexander Pankratov Date: Tue, 12 May 2020 19:00:54 +0300 Subject: [PATCH] unsetEvent handler fix --- src/Client.php | 4 +++- src/Logger.php | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Client.php b/src/Client.php index 2350d14..3800675 100644 --- a/src/Client.php +++ b/src/Client.php @@ -60,7 +60,9 @@ class Client Files::checkOrCreateSessionFolder($file); $settings = array_replace_recursive((array) Config::getInstance()->get('telegram'), $settings); $instance = new MadelineProto\API($file, $settings); - $instance->unsetEventHandler(); + if (self::isSessionLoggedIn($instance)) { + $instance->unsetEventHandler(); + } $instance->async(true); $this->instances[$session] = $instance; diff --git a/src/Logger.php b/src/Logger.php index d778779..9e27c4a 100644 --- a/src/Logger.php +++ b/src/Logger.php @@ -162,6 +162,7 @@ class Logger extends AbstractLogger 'file' => $exception->getFile(), 'line' => $exception->getLine(), 'code' => $exception->getCode(), + 'backtrace' => array_slice($exception->getTrace(), 0, 3), ]; } } \ No newline at end of file