From c451471f783596ddecf9d52c2df6da256001acd0 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Mon, 1 Jul 2019 10:04:34 +0200 Subject: [PATCH] Setting alias --- src/danog/MadelineProto/Logger.php | 4 +++- .../MTProtoTools/PasswordCalculator.php | 1 + tests/testing.php | 12 ++++-------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/danog/MadelineProto/Logger.php b/src/danog/MadelineProto/Logger.php index a1609c05..7670884a 100644 --- a/src/danog/MadelineProto/Logger.php +++ b/src/danog/MadelineProto/Logger.php @@ -101,7 +101,9 @@ class Logger Exception::$rollbar = false; RPCErrorException::$rollbar = false; } - + if (!isset($settings['logger']['logger_param']) && isset($settings['logger']['param'])) { + $settings['logger']['logger_param'] = $settings['logger']['param']; + } if (php_sapi_name() !== 'cli') { if (isset($settings['logger']['logger_param']) && basename($settings['logger']['logger_param']) === 'MadelineProto.log') { $settings['logger']['logger_param'] = Magic::$script_cwd.'/MadelineProto.log'; diff --git a/src/danog/MadelineProto/MTProtoTools/PasswordCalculator.php b/src/danog/MadelineProto/MTProtoTools/PasswordCalculator.php index a1ed6da7..36c03727 100644 --- a/src/danog/MadelineProto/MTProtoTools/PasswordCalculator.php +++ b/src/danog/MadelineProto/MTProtoTools/PasswordCalculator.php @@ -213,6 +213,7 @@ class PasswordCalculator $gForHash = $this->current_algo['gForHash']; $p = $this->current_algo['p']; $pForHash = $this->current_algo['pForHash']; + $B = $this->srp_B; $BForHash = $this->srp_BForHash; $id = $this->srp_id; diff --git a/tests/testing.php b/tests/testing.php index f26365ca..7469075c 100755 --- a/tests/testing.php +++ b/tests/testing.php @@ -1,7 +1,5 @@ #!/usr/bin/env php accept_tos(); } } - //var_dump(count($MadelineProto->get_pwr_chat('@madelineproto')['participants'])); /* @@ -82,7 +78,7 @@ $message = (getenv('TRAVIS_COMMIT') == '') ? 'I iz works always (io laborare sem /* * Try making a phone call */ -if (!getenv('TRAVIS_COMMIT') && stripos(readline('Do you want to make a call? (y/n): '), 'y') !== false) { +if (!getenv('TRAVIS_COMMIT') && stripos($MadelineProto->readline('Do you want to make a call? (y/n): '), 'y') !== false) { $controller = $MadelineProto->request_call(getenv('TEST_SECRET_CHAT'))->play('input.raw')->then('input.raw')->playOnHold(['input.raw'])->setOutputFile('output.raw'); while ($controller->getCallState() < \danog\MadelineProto\VoIP::CALL_STATE_READY) { $MadelineProto->get_updates(); @@ -96,8 +92,8 @@ if (!getenv('TRAVIS_COMMIT') && stripos(readline('Do you want to make a call? (y /* * Try receiving a phone call */ -if (!getenv('TRAVIS_COMMIT') && stripos(readline('Do you want to handle incoming calls? (y/n): '), 'y') !== false) { - $howmany = readline('How many calls would you like me to handle? '); +if (!getenv('TRAVIS_COMMIT') && stripos($MadelineProto->readline('Do you want to handle incoming calls? (y/n): '), 'y') !== false) { + $howmany = $MadelineProto->readline('How many calls would you like me to handle? '); $offset = 0; while ($howmany > 0) { $updates = $MadelineProto->get_updates(['offset' => $offset, 'limit' => 50, 'timeout' => 0]); // Just like in the bot API, you can specify an offset, a limit and a timeout @@ -118,7 +114,7 @@ if (!getenv('TRAVIS_COMMIT') && stripos(readline('Do you want to handle incoming /* * Secret chat usage */ -if (!getenv('TRAVIS_COMMIT') && stripos(readline('Do you want to make the secret chat tests? (y/n): '), 'y') !== false) { +if (!getenv('TRAVIS_COMMIT') && stripos($MadelineProto->readline('Do you want to make the secret chat tests? (y/n): '), 'y') !== false) { /** * Request a secret chat. */