From b3d9b1f07c2717df7cebc93a48947146fdb0270c Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Thu, 9 Nov 2017 11:31:11 +0000 Subject: [PATCH] Bugfixes --- src/danog/MadelineProto/APIFactory.php | 2 +- src/danog/MadelineProto/MTProtoTools/UpdateHandler.php | 1 + tests/testing.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/danog/MadelineProto/APIFactory.php b/src/danog/MadelineProto/APIFactory.php index bd7a2c45..111d6464 100644 --- a/src/danog/MadelineProto/APIFactory.php +++ b/src/danog/MadelineProto/APIFactory.php @@ -131,7 +131,7 @@ class APIFactory $this->API->get_config([], ['datacenter' => $this->API->datacenter->curdc]); $aargs = isset($arguments[1]) && is_array($arguments[1]) ? $arguments[1] : []; $aargs['datacenter'] = $this->API->datacenter->curdc; - if ($name === 'get_updates' && isset($this->session) && !is_null($this->session) && time() - $this->serialized > 10) { + if ($name === 'get_updates' && isset($this->session) && !is_null($this->session) && time() - $this->serialized > 30) { $this->serialize($this->session); Logger::log(["Didn't serialize in a while, doing that now..."]); } diff --git a/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php b/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php index b966595e..6b5d2ff8 100644 --- a/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/UpdateHandler.php @@ -85,6 +85,7 @@ trait UpdateHandler if ($e->rpc !== 'RPC_CALL_FAIL') { throw $e; } + } catch (\danog\MadelineProto\Exception $e) { } $default_params = ['offset' => 0, 'limit' => null, 'timeout' => 0]; diff --git a/tests/testing.php b/tests/testing.php index 82edc9ac..d95d8d9c 100755 --- a/tests/testing.php +++ b/tests/testing.php @@ -42,7 +42,6 @@ try { } catch (\danog\MadelineProto\Exception $e) { var_dump($e->getMessage()); } - if (file_exists('.env')) { echo 'Loading .env...'.PHP_EOL; $dotenv = new Dotenv\Dotenv(getcwd()); @@ -89,6 +88,7 @@ $MadelineProto->session = 'session.madeline'; \danog\MadelineProto\Logger::log(['hey'], \danog\MadelineProto\Logger::WARNING); \danog\MadelineProto\Logger::log(['hey'], \danog\MadelineProto\Logger::ERROR); \danog\MadelineProto\Logger::log(['hey'], \danog\MadelineProto\Logger::FATAL_ERROR); +//$MadelineProto->phone->createGroupCall(['channel' => -1001333587884 $message = (getenv('TRAVIS_COMMIT') == '') ? 'I iz works always (io laborare sembre) (yo lavorar siempre) (mi labori ĉiam) (я всегда работать) (Ik werkuh altijd) (Ngimbonga ngaso sonke isikhathi ukusebenza)' : ('Travis ci tests in progress: commit '.getenv('TRAVIS_COMMIT').', job '.getenv('TRAVIS_JOB_NUMBER').', PHP version: '.getenv('TRAVIS_PHP_VERSION'));