2016-12-24 17:20:45 +01:00
|
|
|
<?php
|
2018-02-24 17:54:13 +01:00
|
|
|
|
Merge alpha into master (async, huge bugfixes and more) (#546)
* Implement async and lots of bugfixes
* Implement more async
* Implement async, implement bugfixes for the connection module, for the datacenter module, huge bugfixes, huge perfomance improvements, media DCs for https, advanced selecting, custom var_dump, totally rewritten IOLoop and response mechanism, promises, improvements to the TL parser, custom mb_substr
* Apply fixes from StyleCI
* Bugfixes
* Apply fixes from StyleCI
* Bugfixes, implement combined promises
* Apply fixes from StyleCI
* Support passing method arguments as callable
* Starting to write async upload logic
* Apply fixes from StyleCI
* Start implementing async file upload
* Apply fixes from StyleCI
* bugfix
* Apply fixes from StyleCI
* Start rewriting connection module
* Add PHP file docblocks for all classes
* Start working on new async stream API
* Finish writing stream API
* More stream API fixes
* Apply fixes from StyleCI
* Rewrite DataCenter and Connection modules
* Clean up stream API documentation
* Fixes
* Apply fixes from StyleCI
* Add referenced parameter to get length of buffer to read in getReadBuffer API
* Moved all MessageHandler code in the Connection module, added a PHP version warning in the phar
* Start fixing reads
* Fix all protocol stream wrappers
* Apply fixes from StyleCI
* Implement disconnection, and remove end function
* Working async RPC
* Implement async file upload
* Bugfix
* Method recall bugfixes
* Bugfixes
* Trait bugfixes
* Fix FIFO buffer
* Bugfixes and speedtests
* Async logging
* Implement websocket streams
* Implement loop API, signal API, clean closing and start changing layer
* Small magna, websocket and HTTP fixes
* Clean up loop API
* Improved stack traces, 2FA and async
* Login fixes
* Added instructions for manual verification
* Small fixes
* More app info improvements
* More app info improvements
* TL and 2FA fixes
* Update to layer 89
* More bugfixes
* Implement broken media reporting
* Remove debug comments
* PHP 7.2 backwards compatibility
* Bugfixes
* Async key generation
* Some simplifications
* Transport fixes
* Cleanup
* async API
* Performance fixes
* Fixes to async API
* Bugfixes
* Implement one-time async loop
* Authorization and logging fixes
* Update to layer 91
* 7to5 fix
* Null coalesce conversion
* Implement socks5 proxy
* Implement HTTP proxy
* Fixes to HTTP proxy
* MTProxy and socks5 fixes
* Disable PHP 5 conversion
* Proxies have higher priority
* Avoid error handling in vendor
* Override composer dependencies
* Fix travis build
* Final composer fixes
* Proxy logic fixes
* Fix get_updates update handling
* Do not use parallel file driver if not supported
* Refactor loader and implement HTTP fixes
* Suppress errors in loader
* HTTP and authorization fixes
* HTTP fixes
* Improved peer management
* Use HTTP protocol on altervista
* Small bugfixes
* Minor fixes
* Docufix
* Docufix
* Legacy fixes
* Fix message queue
* Avoid updating if using MTProxy
* Improve logs and examples
* Trim final newlines while converting parse mode
* Reimplement noResponse flag
* Async combined event handler and APIFactory fixes
* Actually return config
* Case-insensitive methods
* Bugfix
* Apply fixes from StyleCI (#545)
* MTProxy fixes
* PHP 5 warning
* Improved PHP 5 warning
* Use <br> along with newlines in web logs
* Update docs
2018-12-26 20:51:14 +01:00
|
|
|
/**
|
|
|
|
* Login module.
|
|
|
|
*
|
|
|
|
* This file is part of MadelineProto.
|
|
|
|
* MadelineProto is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
* MadelineProto is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
* See the GNU Affero General Public License for more details.
|
|
|
|
* You should have received a copy of the GNU General Public License along with MadelineProto.
|
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
* @author Daniil Gentili <daniil@daniil.it>
|
2019-05-31 12:18:10 +02:00
|
|
|
* @copyright 2016-2019 Daniil Gentili <daniil@daniil.it>
|
Merge alpha into master (async, huge bugfixes and more) (#546)
* Implement async and lots of bugfixes
* Implement more async
* Implement async, implement bugfixes for the connection module, for the datacenter module, huge bugfixes, huge perfomance improvements, media DCs for https, advanced selecting, custom var_dump, totally rewritten IOLoop and response mechanism, promises, improvements to the TL parser, custom mb_substr
* Apply fixes from StyleCI
* Bugfixes
* Apply fixes from StyleCI
* Bugfixes, implement combined promises
* Apply fixes from StyleCI
* Support passing method arguments as callable
* Starting to write async upload logic
* Apply fixes from StyleCI
* Start implementing async file upload
* Apply fixes from StyleCI
* bugfix
* Apply fixes from StyleCI
* Start rewriting connection module
* Add PHP file docblocks for all classes
* Start working on new async stream API
* Finish writing stream API
* More stream API fixes
* Apply fixes from StyleCI
* Rewrite DataCenter and Connection modules
* Clean up stream API documentation
* Fixes
* Apply fixes from StyleCI
* Add referenced parameter to get length of buffer to read in getReadBuffer API
* Moved all MessageHandler code in the Connection module, added a PHP version warning in the phar
* Start fixing reads
* Fix all protocol stream wrappers
* Apply fixes from StyleCI
* Implement disconnection, and remove end function
* Working async RPC
* Implement async file upload
* Bugfix
* Method recall bugfixes
* Bugfixes
* Trait bugfixes
* Fix FIFO buffer
* Bugfixes and speedtests
* Async logging
* Implement websocket streams
* Implement loop API, signal API, clean closing and start changing layer
* Small magna, websocket and HTTP fixes
* Clean up loop API
* Improved stack traces, 2FA and async
* Login fixes
* Added instructions for manual verification
* Small fixes
* More app info improvements
* More app info improvements
* TL and 2FA fixes
* Update to layer 89
* More bugfixes
* Implement broken media reporting
* Remove debug comments
* PHP 7.2 backwards compatibility
* Bugfixes
* Async key generation
* Some simplifications
* Transport fixes
* Cleanup
* async API
* Performance fixes
* Fixes to async API
* Bugfixes
* Implement one-time async loop
* Authorization and logging fixes
* Update to layer 91
* 7to5 fix
* Null coalesce conversion
* Implement socks5 proxy
* Implement HTTP proxy
* Fixes to HTTP proxy
* MTProxy and socks5 fixes
* Disable PHP 5 conversion
* Proxies have higher priority
* Avoid error handling in vendor
* Override composer dependencies
* Fix travis build
* Final composer fixes
* Proxy logic fixes
* Fix get_updates update handling
* Do not use parallel file driver if not supported
* Refactor loader and implement HTTP fixes
* Suppress errors in loader
* HTTP and authorization fixes
* HTTP fixes
* Improved peer management
* Use HTTP protocol on altervista
* Small bugfixes
* Minor fixes
* Docufix
* Docufix
* Legacy fixes
* Fix message queue
* Avoid updating if using MTProxy
* Improve logs and examples
* Trim final newlines while converting parse mode
* Reimplement noResponse flag
* Async combined event handler and APIFactory fixes
* Actually return config
* Case-insensitive methods
* Bugfix
* Apply fixes from StyleCI (#545)
* MTProxy fixes
* PHP 5 warning
* Improved PHP 5 warning
* Use <br> along with newlines in web logs
* Update docs
2018-12-26 20:51:14 +01:00
|
|
|
* @license https://opensource.org/licenses/AGPL-3.0 AGPLv3
|
|
|
|
*
|
|
|
|
* @link https://docs.madelineproto.xyz MadelineProto documentation
|
|
|
|
*/
|
2018-02-24 17:54:39 +01:00
|
|
|
|
2016-12-24 17:20:45 +01:00
|
|
|
namespace danog\MadelineProto\Wrappers;
|
|
|
|
|
2019-09-02 15:30:29 +02:00
|
|
|
use danog\MadelineProto\MTProto\PermAuthKey;
|
Merge alpha into master (async, huge bugfixes and more) (#546)
* Implement async and lots of bugfixes
* Implement more async
* Implement async, implement bugfixes for the connection module, for the datacenter module, huge bugfixes, huge perfomance improvements, media DCs for https, advanced selecting, custom var_dump, totally rewritten IOLoop and response mechanism, promises, improvements to the TL parser, custom mb_substr
* Apply fixes from StyleCI
* Bugfixes
* Apply fixes from StyleCI
* Bugfixes, implement combined promises
* Apply fixes from StyleCI
* Support passing method arguments as callable
* Starting to write async upload logic
* Apply fixes from StyleCI
* Start implementing async file upload
* Apply fixes from StyleCI
* bugfix
* Apply fixes from StyleCI
* Start rewriting connection module
* Add PHP file docblocks for all classes
* Start working on new async stream API
* Finish writing stream API
* More stream API fixes
* Apply fixes from StyleCI
* Rewrite DataCenter and Connection modules
* Clean up stream API documentation
* Fixes
* Apply fixes from StyleCI
* Add referenced parameter to get length of buffer to read in getReadBuffer API
* Moved all MessageHandler code in the Connection module, added a PHP version warning in the phar
* Start fixing reads
* Fix all protocol stream wrappers
* Apply fixes from StyleCI
* Implement disconnection, and remove end function
* Working async RPC
* Implement async file upload
* Bugfix
* Method recall bugfixes
* Bugfixes
* Trait bugfixes
* Fix FIFO buffer
* Bugfixes and speedtests
* Async logging
* Implement websocket streams
* Implement loop API, signal API, clean closing and start changing layer
* Small magna, websocket and HTTP fixes
* Clean up loop API
* Improved stack traces, 2FA and async
* Login fixes
* Added instructions for manual verification
* Small fixes
* More app info improvements
* More app info improvements
* TL and 2FA fixes
* Update to layer 89
* More bugfixes
* Implement broken media reporting
* Remove debug comments
* PHP 7.2 backwards compatibility
* Bugfixes
* Async key generation
* Some simplifications
* Transport fixes
* Cleanup
* async API
* Performance fixes
* Fixes to async API
* Bugfixes
* Implement one-time async loop
* Authorization and logging fixes
* Update to layer 91
* 7to5 fix
* Null coalesce conversion
* Implement socks5 proxy
* Implement HTTP proxy
* Fixes to HTTP proxy
* MTProxy and socks5 fixes
* Disable PHP 5 conversion
* Proxies have higher priority
* Avoid error handling in vendor
* Override composer dependencies
* Fix travis build
* Final composer fixes
* Proxy logic fixes
* Fix get_updates update handling
* Do not use parallel file driver if not supported
* Refactor loader and implement HTTP fixes
* Suppress errors in loader
* HTTP and authorization fixes
* HTTP fixes
* Improved peer management
* Use HTTP protocol on altervista
* Small bugfixes
* Minor fixes
* Docufix
* Docufix
* Legacy fixes
* Fix message queue
* Avoid updating if using MTProxy
* Improve logs and examples
* Trim final newlines while converting parse mode
* Reimplement noResponse flag
* Async combined event handler and APIFactory fixes
* Actually return config
* Case-insensitive methods
* Bugfix
* Apply fixes from StyleCI (#545)
* MTProxy fixes
* PHP 5 warning
* Improved PHP 5 warning
* Use <br> along with newlines in web logs
* Update docs
2018-12-26 20:51:14 +01:00
|
|
|
use danog\MadelineProto\MTProtoTools\PasswordCalculator;
|
|
|
|
|
2016-12-24 17:20:45 +01:00
|
|
|
/**
|
2016-12-24 17:21:15 +01:00
|
|
|
* Manages logging in and out.
|
2016-12-24 17:20:45 +01:00
|
|
|
*/
|
|
|
|
trait Login
|
|
|
|
{
|
2019-10-29 21:33:23 +01:00
|
|
|
public function logout()
|
2016-12-24 17:20:45 +01:00
|
|
|
{
|
2019-10-29 21:33:23 +01:00
|
|
|
yield $this->methodCallAsyncRead('auth.logOut', [], ['datacenter' => $this->datacenter->curdc]);
|
2019-06-14 12:00:21 +02:00
|
|
|
$this->resetSession();
|
2018-04-08 19:53:30 +02:00
|
|
|
$this->logger->logger(\danog\MadelineProto\Lang::$current_lang['logout_ok'], \danog\MadelineProto\Logger::NOTICE);
|
2019-06-01 22:04:37 +02:00
|
|
|
$this->startUpdateSystem();
|
2018-02-24 17:54:39 +01:00
|
|
|
|
2016-12-24 17:20:45 +01:00
|
|
|
return true;
|
|
|
|
}
|
2018-02-24 17:54:39 +01:00
|
|
|
|
2019-10-29 21:33:23 +01:00
|
|
|
public function botLogin($token)
|
2016-12-24 17:20:45 +01:00
|
|
|
{
|
2017-07-22 14:11:07 +02:00
|
|
|
if ($this->authorized === self::LOGGED_IN) {
|
2019-10-29 22:41:31 +01:00
|
|
|
$this->logger->logger(\danog\MadelineProto\Lang::$current_lang['already_loggedIn'], \danog\MadelineProto\Logger::NOTICE);
|
2019-10-29 21:33:23 +01:00
|
|
|
yield $this->logout();
|
2016-12-24 17:20:45 +01:00
|
|
|
}
|
2019-09-13 16:55:48 +02:00
|
|
|
$callbacks = [$this, $this->referenceDatabase];
|
2019-10-29 21:33:23 +01:00
|
|
|
$this->updateCallbacks($callbacks);
|
2019-09-13 16:55:48 +02:00
|
|
|
|
2018-04-08 19:53:30 +02:00
|
|
|
$this->logger->logger(\danog\MadelineProto\Lang::$current_lang['login_bot'], \danog\MadelineProto\Logger::NOTICE);
|
2019-10-29 21:33:23 +01:00
|
|
|
$this->authorization = yield $this->methodCallAsyncRead('auth.importBotAuthorization', ['bot_auth_token' => $token, 'api_id' => $this->settings['app_info']['api_id'], 'api_hash' => $this->settings['app_info']['api_hash']], ['datacenter' => $this->datacenter->curdc]);
|
2017-05-27 23:21:14 +02:00
|
|
|
$this->authorized = self::LOGGED_IN;
|
2018-02-18 14:18:18 +01:00
|
|
|
$this->authorized_dc = $this->datacenter->curdc;
|
2019-09-01 23:39:29 +02:00
|
|
|
$this->datacenter->getDataCenterConnection($this->datacenter->curdc)->authorized(true);
|
2017-05-18 12:12:33 +02:00
|
|
|
$this->updates = [];
|
|
|
|
$this->updates_key = 0;
|
2019-10-29 21:33:23 +01:00
|
|
|
yield $this->initAuthorization();
|
2019-06-01 22:04:37 +02:00
|
|
|
$this->startUpdateSystem();
|
|
|
|
|
2018-04-08 19:53:30 +02:00
|
|
|
$this->logger->logger(\danog\MadelineProto\Lang::$current_lang['login_ok'], \danog\MadelineProto\Logger::NOTICE);
|
2018-02-24 17:54:39 +01:00
|
|
|
|
2017-05-18 12:12:33 +02:00
|
|
|
return $this->authorization;
|
2016-12-24 17:20:45 +01:00
|
|
|
}
|
2018-02-24 17:54:39 +01:00
|
|
|
|
2019-10-29 21:33:23 +01:00
|
|
|
public function phoneLogin($number, $sms_type = 5)
|
2016-12-24 17:20:45 +01:00
|
|
|
{
|
2017-07-22 14:11:07 +02:00
|
|
|
if ($this->authorized === self::LOGGED_IN) {
|
2019-10-29 22:41:31 +01:00
|
|
|
$this->logger->logger(\danog\MadelineProto\Lang::$current_lang['already_loggedIn'], \danog\MadelineProto\Logger::NOTICE);
|
2019-10-29 21:33:23 +01:00
|
|
|
yield $this->logout();
|
2016-12-24 17:20:45 +01:00
|
|
|
}
|
2018-04-08 19:53:30 +02:00
|
|
|
$this->logger->logger(\danog\MadelineProto\Lang::$current_lang['login_code_sending'], \danog\MadelineProto\Logger::NOTICE);
|
2019-10-29 21:33:23 +01:00
|
|
|
$this->authorization = yield $this->methodCallAsyncRead('auth.sendCode', ['settings' => ['_' => 'codeSettings'], 'phone_number' => $number, 'sms_type' => $sms_type, 'api_id' => $this->settings['app_info']['api_id'], 'api_hash' => $this->settings['app_info']['api_hash'], 'lang_code' => $this->settings['app_info']['lang_code']], ['datacenter' => $this->datacenter->curdc]);
|
2018-02-18 14:18:18 +01:00
|
|
|
$this->authorized_dc = $this->datacenter->curdc;
|
2017-05-18 12:12:33 +02:00
|
|
|
$this->authorization['phone_number'] = $number;
|
2017-05-27 23:21:14 +02:00
|
|
|
//$this->authorization['_'] .= 'MP';
|
|
|
|
$this->authorized = self::WAITING_CODE;
|
2017-05-18 12:12:33 +02:00
|
|
|
$this->updates = [];
|
|
|
|
$this->updates_key = 0;
|
2018-04-08 19:53:30 +02:00
|
|
|
$this->logger->logger(\danog\MadelineProto\Lang::$current_lang['login_code_sent'], \danog\MadelineProto\Logger::NOTICE);
|
2018-02-24 17:54:39 +01:00
|
|
|
|
2017-05-18 12:12:33 +02:00
|
|
|
return $this->authorization;
|
2016-12-24 17:20:45 +01:00
|
|
|
}
|
2018-02-24 17:54:39 +01:00
|
|
|
|
2019-10-29 21:33:23 +01:00
|
|
|
public function completePhoneLogin($code)
|
2016-12-24 17:20:45 +01:00
|
|
|
{
|
2017-05-27 23:21:14 +02:00
|
|
|
if ($this->authorized !== self::WAITING_CODE) {
|
2017-10-01 18:37:24 +02:00
|
|
|
throw new \danog\MadelineProto\Exception(\danog\MadelineProto\Lang::$current_lang['login_code_uncalled']);
|
2016-12-24 17:20:45 +01:00
|
|
|
}
|
2017-05-27 23:21:14 +02:00
|
|
|
$this->authorized = self::NOT_LOGGED_IN;
|
2018-04-08 19:53:30 +02:00
|
|
|
$this->logger->logger(\danog\MadelineProto\Lang::$current_lang['login_user'], \danog\MadelineProto\Logger::NOTICE);
|
2018-02-24 17:54:39 +01:00
|
|
|
|
2017-01-27 20:04:42 +01:00
|
|
|
try {
|
2019-10-29 21:33:23 +01:00
|
|
|
$authorization = yield $this->methodCallAsyncRead('auth.signIn', ['phone_number' => $this->authorization['phone_number'], 'phone_code_hash' => $this->authorization['phone_code_hash'], 'phone_code' => (string) $code], ['datacenter' => $this->datacenter->curdc]);
|
2017-01-27 20:04:42 +01:00
|
|
|
} catch (\danog\MadelineProto\RPCErrorException $e) {
|
2017-04-23 12:15:47 +02:00
|
|
|
if ($e->rpc === 'SESSION_PASSWORD_NEEDED') {
|
2018-04-08 19:53:30 +02:00
|
|
|
$this->logger->logger(\danog\MadelineProto\Lang::$current_lang['login_2fa_enabled'], \danog\MadelineProto\Logger::NOTICE);
|
2019-10-29 21:33:23 +01:00
|
|
|
$this->authorization = yield $this->methodCallAsyncRead('account.getPassword', [], ['datacenter' => $this->datacenter->curdc]);
|
2019-06-04 14:55:58 +02:00
|
|
|
if (!isset($this->authorization['hint'])) {
|
|
|
|
$this->authorization['hint'] = '';
|
|
|
|
}
|
Merge alpha into master (async, huge bugfixes and more) (#546)
* Implement async and lots of bugfixes
* Implement more async
* Implement async, implement bugfixes for the connection module, for the datacenter module, huge bugfixes, huge perfomance improvements, media DCs for https, advanced selecting, custom var_dump, totally rewritten IOLoop and response mechanism, promises, improvements to the TL parser, custom mb_substr
* Apply fixes from StyleCI
* Bugfixes
* Apply fixes from StyleCI
* Bugfixes, implement combined promises
* Apply fixes from StyleCI
* Support passing method arguments as callable
* Starting to write async upload logic
* Apply fixes from StyleCI
* Start implementing async file upload
* Apply fixes from StyleCI
* bugfix
* Apply fixes from StyleCI
* Start rewriting connection module
* Add PHP file docblocks for all classes
* Start working on new async stream API
* Finish writing stream API
* More stream API fixes
* Apply fixes from StyleCI
* Rewrite DataCenter and Connection modules
* Clean up stream API documentation
* Fixes
* Apply fixes from StyleCI
* Add referenced parameter to get length of buffer to read in getReadBuffer API
* Moved all MessageHandler code in the Connection module, added a PHP version warning in the phar
* Start fixing reads
* Fix all protocol stream wrappers
* Apply fixes from StyleCI
* Implement disconnection, and remove end function
* Working async RPC
* Implement async file upload
* Bugfix
* Method recall bugfixes
* Bugfixes
* Trait bugfixes
* Fix FIFO buffer
* Bugfixes and speedtests
* Async logging
* Implement websocket streams
* Implement loop API, signal API, clean closing and start changing layer
* Small magna, websocket and HTTP fixes
* Clean up loop API
* Improved stack traces, 2FA and async
* Login fixes
* Added instructions for manual verification
* Small fixes
* More app info improvements
* More app info improvements
* TL and 2FA fixes
* Update to layer 89
* More bugfixes
* Implement broken media reporting
* Remove debug comments
* PHP 7.2 backwards compatibility
* Bugfixes
* Async key generation
* Some simplifications
* Transport fixes
* Cleanup
* async API
* Performance fixes
* Fixes to async API
* Bugfixes
* Implement one-time async loop
* Authorization and logging fixes
* Update to layer 91
* 7to5 fix
* Null coalesce conversion
* Implement socks5 proxy
* Implement HTTP proxy
* Fixes to HTTP proxy
* MTProxy and socks5 fixes
* Disable PHP 5 conversion
* Proxies have higher priority
* Avoid error handling in vendor
* Override composer dependencies
* Fix travis build
* Final composer fixes
* Proxy logic fixes
* Fix get_updates update handling
* Do not use parallel file driver if not supported
* Refactor loader and implement HTTP fixes
* Suppress errors in loader
* HTTP and authorization fixes
* HTTP fixes
* Improved peer management
* Use HTTP protocol on altervista
* Small bugfixes
* Minor fixes
* Docufix
* Docufix
* Legacy fixes
* Fix message queue
* Avoid updating if using MTProxy
* Improve logs and examples
* Trim final newlines while converting parse mode
* Reimplement noResponse flag
* Async combined event handler and APIFactory fixes
* Actually return config
* Case-insensitive methods
* Bugfix
* Apply fixes from StyleCI (#545)
* MTProxy fixes
* PHP 5 warning
* Improved PHP 5 warning
* Use <br> along with newlines in web logs
* Update docs
2018-12-26 20:51:14 +01:00
|
|
|
$this->authorized = self::WAITING_PASSWORD;
|
Documentation rework (#349)
* Documentation rework
* Apply fixes from StyleCI
* Documentation fixes
* Login as bot through web/cli API, allow using invite links in joinChannel, full invite links in importChatInvite and checkChatInvite, non-invite links in importChatInvite
* Apply fixes from StyleCI
* Logging fixes
* Build docs
* Add methods to modify start template, bugfix to logging and keyboard conversion
* Add TL documentator
* Document MTProto methods
* Documenting methods...
* 7% documented
* Bugfixes
* Update docs
* Update docs
* Simplify file management
* Implement automatic object conversion for media, and more awesome stuff
* Implement automatic object conversion for media, and more awesome stuff
* Implement event update handler and file upload/download callback
* Auto-detect mime type, duration, width and height of media
* Update docs
* Document new file functions
* Fix links
* Fix links
* Update bot.php to use event loop
* Implement webhook update handler and forking in main loop
* Build docs
* Better docs
* Fixes to secret chats
* Almost finished updating docs
* Bugfixes, implemented infinite loop for loop() method, almost finished docs
* Finish writing docs
* Add automatic documentation builder script
* Finished writing docs
2018-03-20 12:48:05 +01:00
|
|
|
|
2017-05-27 23:21:14 +02:00
|
|
|
return $this->authorization;
|
2017-01-27 20:04:42 +01:00
|
|
|
}
|
2017-04-23 12:15:47 +02:00
|
|
|
if ($e->rpc === 'PHONE_NUMBER_UNOCCUPIED') {
|
2018-04-08 19:53:30 +02:00
|
|
|
$this->logger->logger(\danog\MadelineProto\Lang::$current_lang['login_need_signup'], \danog\MadelineProto\Logger::NOTICE);
|
2017-05-27 23:21:14 +02:00
|
|
|
$this->authorized = self::WAITING_SIGNUP;
|
2017-05-18 12:12:33 +02:00
|
|
|
$this->authorization['phone_code'] = $code;
|
2018-02-24 17:54:39 +01:00
|
|
|
|
2017-02-21 19:04:37 +01:00
|
|
|
return ['_' => 'account.needSignup'];
|
|
|
|
}
|
2018-02-24 17:54:39 +01:00
|
|
|
|
2017-01-27 20:04:42 +01:00
|
|
|
throw $e;
|
|
|
|
}
|
2019-08-15 20:33:07 +02:00
|
|
|
if ($authorization['_'] === 'auth.authorizationSignUpRequired') {
|
|
|
|
$this->logger->logger(\danog\MadelineProto\Lang::$current_lang['login_need_signup'], \danog\MadelineProto\Logger::NOTICE);
|
|
|
|
$this->authorized = self::WAITING_SIGNUP;
|
|
|
|
$this->authorization['phone_code'] = $code;
|
|
|
|
|
|
|
|
$authorization['_'] = 'account.needSignup';
|
|
|
|
return $authorization;
|
|
|
|
}
|
2017-05-27 23:21:14 +02:00
|
|
|
$this->authorized = self::LOGGED_IN;
|
2017-05-18 12:12:33 +02:00
|
|
|
$this->authorization = $authorization;
|
2019-09-01 23:39:29 +02:00
|
|
|
$this->datacenter->getDataCenterConnection($this->datacenter->curdc)->authorized(true);
|
2019-10-29 21:33:23 +01:00
|
|
|
yield $this->initAuthorization();
|
|
|
|
yield $this->getPhoneConfig();
|
2019-06-01 22:04:37 +02:00
|
|
|
$this->startUpdateSystem();
|
2019-03-29 20:25:42 +01:00
|
|
|
|
2018-04-08 19:53:30 +02:00
|
|
|
$this->logger->logger(\danog\MadelineProto\Lang::$current_lang['login_ok'], \danog\MadelineProto\Logger::NOTICE);
|
2018-02-24 17:54:39 +01:00
|
|
|
|
2017-05-18 12:12:33 +02:00
|
|
|
return $this->authorization;
|
2017-01-27 20:04:42 +01:00
|
|
|
}
|
2018-02-24 17:54:39 +01:00
|
|
|
|
2019-10-29 21:33:23 +01:00
|
|
|
public function importAuthorization($authorization)
|
2017-07-22 14:11:07 +02:00
|
|
|
{
|
|
|
|
if ($this->authorized === self::LOGGED_IN) {
|
2019-10-29 22:41:31 +01:00
|
|
|
$this->logger->logger(\danog\MadelineProto\Lang::$current_lang['already_loggedIn'], \danog\MadelineProto\Logger::NOTICE);
|
2019-10-29 21:33:23 +01:00
|
|
|
yield $this->logout();
|
2017-07-22 14:11:07 +02:00
|
|
|
}
|
2018-04-08 19:53:30 +02:00
|
|
|
$this->logger->logger(\danog\MadelineProto\Lang::$current_lang['login_auth_key'], \danog\MadelineProto\Logger::NOTICE);
|
2017-07-22 14:11:07 +02:00
|
|
|
list($dc_id, $auth_key) = $authorization;
|
2019-09-01 23:39:29 +02:00
|
|
|
if (!\is_array($auth_key)) {
|
|
|
|
$auth_key = ['auth_key' => $auth_key];
|
2017-12-28 13:12:44 +01:00
|
|
|
}
|
2019-09-01 23:39:29 +02:00
|
|
|
$auth_key = new PermAuthKey($auth_key);
|
|
|
|
|
2018-02-18 14:18:18 +01:00
|
|
|
$this->authorized_dc = $dc_id;
|
2019-09-01 23:39:29 +02:00
|
|
|
$dataCenterConnection = $this->datacenter->getDataCenterConnection($dc_id);
|
|
|
|
$dataCenterConnection->resetSession();
|
|
|
|
$dataCenterConnection->setPermAuthKey($auth_key);
|
|
|
|
$dataCenterConnection->authorized(true);
|
2017-07-22 14:11:07 +02:00
|
|
|
$this->authorized = self::LOGGED_IN;
|
2019-10-29 21:33:23 +01:00
|
|
|
yield $this->initAuthorization();
|
|
|
|
yield $this->getPhoneConfig();
|
2018-02-24 17:54:39 +01:00
|
|
|
|
2019-10-29 21:33:23 +01:00
|
|
|
$res = yield $this->getSelf();
|
2019-06-01 22:04:37 +02:00
|
|
|
|
2019-09-13 16:55:48 +02:00
|
|
|
$callbacks = [$this, $this->referenceDatabase];
|
|
|
|
if (!($this->authorization['user']['bot'] ?? false)) {
|
|
|
|
$callbacks []= $this->minDatabase;
|
|
|
|
}
|
2019-10-29 21:33:23 +01:00
|
|
|
$this->updateCallbacks($callbacks);
|
2019-09-13 16:55:48 +02:00
|
|
|
|
2019-06-01 22:04:37 +02:00
|
|
|
$this->startUpdateSystem();
|
2019-06-04 14:55:58 +02:00
|
|
|
|
2019-06-01 22:04:37 +02:00
|
|
|
return $res;
|
2017-07-22 14:11:07 +02:00
|
|
|
}
|
2018-02-24 17:54:39 +01:00
|
|
|
|
2019-10-29 21:33:23 +01:00
|
|
|
public function exportAuthorization()
|
2017-07-22 14:11:07 +02:00
|
|
|
{
|
|
|
|
if ($this->authorized !== self::LOGGED_IN) {
|
2019-10-29 22:41:31 +01:00
|
|
|
throw new \danog\MadelineProto\Exception(\danog\MadelineProto\Lang::$current_lang['not_loggedIn']);
|
2017-07-22 14:11:07 +02:00
|
|
|
}
|
2019-10-29 21:33:23 +01:00
|
|
|
yield $this->getSelf();
|
2018-02-18 14:18:18 +01:00
|
|
|
$this->authorized_dc = $this->datacenter->curdc;
|
2018-02-24 17:54:39 +01:00
|
|
|
|
2019-09-01 23:39:29 +02:00
|
|
|
return [$this->datacenter->curdc, $this->datacenter->getDataCenterConnection($this->datacenter->curdc)->getPermAuthKey()->getAuthKey()];
|
2017-07-22 14:11:07 +02:00
|
|
|
}
|
2018-02-24 17:54:39 +01:00
|
|
|
|
2019-10-29 21:33:23 +01:00
|
|
|
public function completeSignup($first_name, $last_name)
|
2017-02-21 19:04:37 +01:00
|
|
|
{
|
2017-05-27 23:21:14 +02:00
|
|
|
if ($this->authorized !== self::WAITING_SIGNUP) {
|
2017-10-01 18:37:24 +02:00
|
|
|
throw new \danog\MadelineProto\Exception(\danog\MadelineProto\Lang::$current_lang['signup_uncalled']);
|
2017-02-21 19:04:37 +01:00
|
|
|
}
|
2017-05-27 23:21:14 +02:00
|
|
|
$this->authorized = self::NOT_LOGGED_IN;
|
2018-04-08 19:53:30 +02:00
|
|
|
$this->logger->logger(\danog\MadelineProto\Lang::$current_lang['signing_up'], \danog\MadelineProto\Logger::NOTICE);
|
2019-10-29 21:33:23 +01:00
|
|
|
$this->authorization = yield $this->methodCallAsyncRead('auth.signUp', ['phone_number' => $this->authorization['phone_number'], 'phone_code_hash' => $this->authorization['phone_code_hash'], 'phone_code' => $this->authorization['phone_code'], 'first_name' => $first_name, 'last_name' => $last_name], ['datacenter' => $this->datacenter->curdc]);
|
2017-05-27 23:21:14 +02:00
|
|
|
$this->authorized = self::LOGGED_IN;
|
2019-09-01 23:39:29 +02:00
|
|
|
$this->datacenter->getDataCenterConnection($this->datacenter->curdc)->authorized(true);
|
2019-10-29 21:33:23 +01:00
|
|
|
yield $this->initAuthorization();
|
|
|
|
yield $this->getPhoneConfig();
|
2019-03-29 20:25:42 +01:00
|
|
|
|
2018-04-08 19:53:30 +02:00
|
|
|
$this->logger->logger(\danog\MadelineProto\Lang::$current_lang['signup_ok'], \danog\MadelineProto\Logger::NOTICE);
|
2019-06-01 22:04:37 +02:00
|
|
|
$this->startUpdateSystem();
|
2018-02-24 17:54:39 +01:00
|
|
|
|
2017-05-18 12:12:33 +02:00
|
|
|
return $this->authorization;
|
2017-02-21 19:04:37 +01:00
|
|
|
}
|
2018-02-24 17:54:39 +01:00
|
|
|
|
2019-10-29 21:33:23 +01:00
|
|
|
public function complete2faLogin($password)
|
2017-01-27 20:04:42 +01:00
|
|
|
{
|
2017-05-27 23:21:14 +02:00
|
|
|
if ($this->authorized !== self::WAITING_PASSWORD) {
|
2017-10-01 18:37:24 +02:00
|
|
|
throw new \danog\MadelineProto\Exception(\danog\MadelineProto\Lang::$current_lang['2fa_uncalled']);
|
2017-01-27 20:04:42 +01:00
|
|
|
}
|
2017-05-27 23:21:14 +02:00
|
|
|
$this->authorized = self::NOT_LOGGED_IN;
|
2019-06-06 00:33:11 +02:00
|
|
|
$hasher = new PasswordCalculator($this->logger);
|
Merge alpha into master (async, huge bugfixes and more) (#546)
* Implement async and lots of bugfixes
* Implement more async
* Implement async, implement bugfixes for the connection module, for the datacenter module, huge bugfixes, huge perfomance improvements, media DCs for https, advanced selecting, custom var_dump, totally rewritten IOLoop and response mechanism, promises, improvements to the TL parser, custom mb_substr
* Apply fixes from StyleCI
* Bugfixes
* Apply fixes from StyleCI
* Bugfixes, implement combined promises
* Apply fixes from StyleCI
* Support passing method arguments as callable
* Starting to write async upload logic
* Apply fixes from StyleCI
* Start implementing async file upload
* Apply fixes from StyleCI
* bugfix
* Apply fixes from StyleCI
* Start rewriting connection module
* Add PHP file docblocks for all classes
* Start working on new async stream API
* Finish writing stream API
* More stream API fixes
* Apply fixes from StyleCI
* Rewrite DataCenter and Connection modules
* Clean up stream API documentation
* Fixes
* Apply fixes from StyleCI
* Add referenced parameter to get length of buffer to read in getReadBuffer API
* Moved all MessageHandler code in the Connection module, added a PHP version warning in the phar
* Start fixing reads
* Fix all protocol stream wrappers
* Apply fixes from StyleCI
* Implement disconnection, and remove end function
* Working async RPC
* Implement async file upload
* Bugfix
* Method recall bugfixes
* Bugfixes
* Trait bugfixes
* Fix FIFO buffer
* Bugfixes and speedtests
* Async logging
* Implement websocket streams
* Implement loop API, signal API, clean closing and start changing layer
* Small magna, websocket and HTTP fixes
* Clean up loop API
* Improved stack traces, 2FA and async
* Login fixes
* Added instructions for manual verification
* Small fixes
* More app info improvements
* More app info improvements
* TL and 2FA fixes
* Update to layer 89
* More bugfixes
* Implement broken media reporting
* Remove debug comments
* PHP 7.2 backwards compatibility
* Bugfixes
* Async key generation
* Some simplifications
* Transport fixes
* Cleanup
* async API
* Performance fixes
* Fixes to async API
* Bugfixes
* Implement one-time async loop
* Authorization and logging fixes
* Update to layer 91
* 7to5 fix
* Null coalesce conversion
* Implement socks5 proxy
* Implement HTTP proxy
* Fixes to HTTP proxy
* MTProxy and socks5 fixes
* Disable PHP 5 conversion
* Proxies have higher priority
* Avoid error handling in vendor
* Override composer dependencies
* Fix travis build
* Final composer fixes
* Proxy logic fixes
* Fix get_updates update handling
* Do not use parallel file driver if not supported
* Refactor loader and implement HTTP fixes
* Suppress errors in loader
* HTTP and authorization fixes
* HTTP fixes
* Improved peer management
* Use HTTP protocol on altervista
* Small bugfixes
* Minor fixes
* Docufix
* Docufix
* Legacy fixes
* Fix message queue
* Avoid updating if using MTProxy
* Improve logs and examples
* Trim final newlines while converting parse mode
* Reimplement noResponse flag
* Async combined event handler and APIFactory fixes
* Actually return config
* Case-insensitive methods
* Bugfix
* Apply fixes from StyleCI (#545)
* MTProxy fixes
* PHP 5 warning
* Improved PHP 5 warning
* Use <br> along with newlines in web logs
* Update docs
2018-12-26 20:51:14 +01:00
|
|
|
$hasher->addInfo($this->authorization);
|
2018-04-08 19:53:30 +02:00
|
|
|
$this->logger->logger(\danog\MadelineProto\Lang::$current_lang['login_user'], \danog\MadelineProto\Logger::NOTICE);
|
2019-10-29 21:33:23 +01:00
|
|
|
$this->authorization = yield $this->methodCallAsyncRead('auth.checkPassword', ['password' => $hasher->getCheckPassword($password)], ['datacenter' => $this->datacenter->curdc]);
|
2017-05-27 23:21:14 +02:00
|
|
|
$this->authorized = self::LOGGED_IN;
|
2019-09-01 23:39:29 +02:00
|
|
|
$this->datacenter->getDataCenterConnection($this->datacenter->curdc)->authorized(true);
|
2019-10-29 21:33:23 +01:00
|
|
|
yield $this->initAuthorization();
|
2018-04-08 19:53:30 +02:00
|
|
|
$this->logger->logger(\danog\MadelineProto\Lang::$current_lang['login_ok'], \danog\MadelineProto\Logger::NOTICE);
|
2019-10-29 21:33:23 +01:00
|
|
|
yield $this->getPhoneConfig();
|
2019-06-01 22:04:37 +02:00
|
|
|
$this->startUpdateSystem();
|
2018-02-24 17:54:39 +01:00
|
|
|
|
2017-05-18 12:12:33 +02:00
|
|
|
return $this->authorization;
|
2016-12-24 17:20:45 +01:00
|
|
|
}
|
Merge alpha into master (async, huge bugfixes and more) (#546)
* Implement async and lots of bugfixes
* Implement more async
* Implement async, implement bugfixes for the connection module, for the datacenter module, huge bugfixes, huge perfomance improvements, media DCs for https, advanced selecting, custom var_dump, totally rewritten IOLoop and response mechanism, promises, improvements to the TL parser, custom mb_substr
* Apply fixes from StyleCI
* Bugfixes
* Apply fixes from StyleCI
* Bugfixes, implement combined promises
* Apply fixes from StyleCI
* Support passing method arguments as callable
* Starting to write async upload logic
* Apply fixes from StyleCI
* Start implementing async file upload
* Apply fixes from StyleCI
* bugfix
* Apply fixes from StyleCI
* Start rewriting connection module
* Add PHP file docblocks for all classes
* Start working on new async stream API
* Finish writing stream API
* More stream API fixes
* Apply fixes from StyleCI
* Rewrite DataCenter and Connection modules
* Clean up stream API documentation
* Fixes
* Apply fixes from StyleCI
* Add referenced parameter to get length of buffer to read in getReadBuffer API
* Moved all MessageHandler code in the Connection module, added a PHP version warning in the phar
* Start fixing reads
* Fix all protocol stream wrappers
* Apply fixes from StyleCI
* Implement disconnection, and remove end function
* Working async RPC
* Implement async file upload
* Bugfix
* Method recall bugfixes
* Bugfixes
* Trait bugfixes
* Fix FIFO buffer
* Bugfixes and speedtests
* Async logging
* Implement websocket streams
* Implement loop API, signal API, clean closing and start changing layer
* Small magna, websocket and HTTP fixes
* Clean up loop API
* Improved stack traces, 2FA and async
* Login fixes
* Added instructions for manual verification
* Small fixes
* More app info improvements
* More app info improvements
* TL and 2FA fixes
* Update to layer 89
* More bugfixes
* Implement broken media reporting
* Remove debug comments
* PHP 7.2 backwards compatibility
* Bugfixes
* Async key generation
* Some simplifications
* Transport fixes
* Cleanup
* async API
* Performance fixes
* Fixes to async API
* Bugfixes
* Implement one-time async loop
* Authorization and logging fixes
* Update to layer 91
* 7to5 fix
* Null coalesce conversion
* Implement socks5 proxy
* Implement HTTP proxy
* Fixes to HTTP proxy
* MTProxy and socks5 fixes
* Disable PHP 5 conversion
* Proxies have higher priority
* Avoid error handling in vendor
* Override composer dependencies
* Fix travis build
* Final composer fixes
* Proxy logic fixes
* Fix get_updates update handling
* Do not use parallel file driver if not supported
* Refactor loader and implement HTTP fixes
* Suppress errors in loader
* HTTP and authorization fixes
* HTTP fixes
* Improved peer management
* Use HTTP protocol on altervista
* Small bugfixes
* Minor fixes
* Docufix
* Docufix
* Legacy fixes
* Fix message queue
* Avoid updating if using MTProxy
* Improve logs and examples
* Trim final newlines while converting parse mode
* Reimplement noResponse flag
* Async combined event handler and APIFactory fixes
* Actually return config
* Case-insensitive methods
* Bugfix
* Apply fixes from StyleCI (#545)
* MTProxy fixes
* PHP 5 warning
* Improved PHP 5 warning
* Use <br> along with newlines in web logs
* Update docs
2018-12-26 20:51:14 +01:00
|
|
|
|
2019-06-04 23:55:02 +02:00
|
|
|
/**
|
2019-09-01 23:39:29 +02:00
|
|
|
* Update the 2FA password.
|
2019-06-04 23:55:02 +02:00
|
|
|
*
|
2019-06-30 15:12:43 +02:00
|
|
|
* The params array can contain password, new_password, email and hint params.
|
2019-09-01 23:39:29 +02:00
|
|
|
*
|
2019-06-04 23:55:02 +02:00
|
|
|
* @param array $params The params
|
|
|
|
* @return void
|
|
|
|
*/
|
2019-10-29 21:33:23 +01:00
|
|
|
public function update2fa(array $params)
|
Merge alpha into master (async, huge bugfixes and more) (#546)
* Implement async and lots of bugfixes
* Implement more async
* Implement async, implement bugfixes for the connection module, for the datacenter module, huge bugfixes, huge perfomance improvements, media DCs for https, advanced selecting, custom var_dump, totally rewritten IOLoop and response mechanism, promises, improvements to the TL parser, custom mb_substr
* Apply fixes from StyleCI
* Bugfixes
* Apply fixes from StyleCI
* Bugfixes, implement combined promises
* Apply fixes from StyleCI
* Support passing method arguments as callable
* Starting to write async upload logic
* Apply fixes from StyleCI
* Start implementing async file upload
* Apply fixes from StyleCI
* bugfix
* Apply fixes from StyleCI
* Start rewriting connection module
* Add PHP file docblocks for all classes
* Start working on new async stream API
* Finish writing stream API
* More stream API fixes
* Apply fixes from StyleCI
* Rewrite DataCenter and Connection modules
* Clean up stream API documentation
* Fixes
* Apply fixes from StyleCI
* Add referenced parameter to get length of buffer to read in getReadBuffer API
* Moved all MessageHandler code in the Connection module, added a PHP version warning in the phar
* Start fixing reads
* Fix all protocol stream wrappers
* Apply fixes from StyleCI
* Implement disconnection, and remove end function
* Working async RPC
* Implement async file upload
* Bugfix
* Method recall bugfixes
* Bugfixes
* Trait bugfixes
* Fix FIFO buffer
* Bugfixes and speedtests
* Async logging
* Implement websocket streams
* Implement loop API, signal API, clean closing and start changing layer
* Small magna, websocket and HTTP fixes
* Clean up loop API
* Improved stack traces, 2FA and async
* Login fixes
* Added instructions for manual verification
* Small fixes
* More app info improvements
* More app info improvements
* TL and 2FA fixes
* Update to layer 89
* More bugfixes
* Implement broken media reporting
* Remove debug comments
* PHP 7.2 backwards compatibility
* Bugfixes
* Async key generation
* Some simplifications
* Transport fixes
* Cleanup
* async API
* Performance fixes
* Fixes to async API
* Bugfixes
* Implement one-time async loop
* Authorization and logging fixes
* Update to layer 91
* 7to5 fix
* Null coalesce conversion
* Implement socks5 proxy
* Implement HTTP proxy
* Fixes to HTTP proxy
* MTProxy and socks5 fixes
* Disable PHP 5 conversion
* Proxies have higher priority
* Avoid error handling in vendor
* Override composer dependencies
* Fix travis build
* Final composer fixes
* Proxy logic fixes
* Fix get_updates update handling
* Do not use parallel file driver if not supported
* Refactor loader and implement HTTP fixes
* Suppress errors in loader
* HTTP and authorization fixes
* HTTP fixes
* Improved peer management
* Use HTTP protocol on altervista
* Small bugfixes
* Minor fixes
* Docufix
* Docufix
* Legacy fixes
* Fix message queue
* Avoid updating if using MTProxy
* Improve logs and examples
* Trim final newlines while converting parse mode
* Reimplement noResponse flag
* Async combined event handler and APIFactory fixes
* Actually return config
* Case-insensitive methods
* Bugfix
* Apply fixes from StyleCI (#545)
* MTProxy fixes
* PHP 5 warning
* Improved PHP 5 warning
* Use <br> along with newlines in web logs
* Update docs
2018-12-26 20:51:14 +01:00
|
|
|
{
|
2019-06-06 00:33:11 +02:00
|
|
|
$hasher = new PasswordCalculator($this->logger);
|
2019-10-29 21:33:23 +01:00
|
|
|
$hasher->addInfo(yield $this->methodCallAsyncRead('account.getPassword', [], ['datacenter' => $this->datacenter->curdc]));
|
Merge alpha into master (async, huge bugfixes and more) (#546)
* Implement async and lots of bugfixes
* Implement more async
* Implement async, implement bugfixes for the connection module, for the datacenter module, huge bugfixes, huge perfomance improvements, media DCs for https, advanced selecting, custom var_dump, totally rewritten IOLoop and response mechanism, promises, improvements to the TL parser, custom mb_substr
* Apply fixes from StyleCI
* Bugfixes
* Apply fixes from StyleCI
* Bugfixes, implement combined promises
* Apply fixes from StyleCI
* Support passing method arguments as callable
* Starting to write async upload logic
* Apply fixes from StyleCI
* Start implementing async file upload
* Apply fixes from StyleCI
* bugfix
* Apply fixes from StyleCI
* Start rewriting connection module
* Add PHP file docblocks for all classes
* Start working on new async stream API
* Finish writing stream API
* More stream API fixes
* Apply fixes from StyleCI
* Rewrite DataCenter and Connection modules
* Clean up stream API documentation
* Fixes
* Apply fixes from StyleCI
* Add referenced parameter to get length of buffer to read in getReadBuffer API
* Moved all MessageHandler code in the Connection module, added a PHP version warning in the phar
* Start fixing reads
* Fix all protocol stream wrappers
* Apply fixes from StyleCI
* Implement disconnection, and remove end function
* Working async RPC
* Implement async file upload
* Bugfix
* Method recall bugfixes
* Bugfixes
* Trait bugfixes
* Fix FIFO buffer
* Bugfixes and speedtests
* Async logging
* Implement websocket streams
* Implement loop API, signal API, clean closing and start changing layer
* Small magna, websocket and HTTP fixes
* Clean up loop API
* Improved stack traces, 2FA and async
* Login fixes
* Added instructions for manual verification
* Small fixes
* More app info improvements
* More app info improvements
* TL and 2FA fixes
* Update to layer 89
* More bugfixes
* Implement broken media reporting
* Remove debug comments
* PHP 7.2 backwards compatibility
* Bugfixes
* Async key generation
* Some simplifications
* Transport fixes
* Cleanup
* async API
* Performance fixes
* Fixes to async API
* Bugfixes
* Implement one-time async loop
* Authorization and logging fixes
* Update to layer 91
* 7to5 fix
* Null coalesce conversion
* Implement socks5 proxy
* Implement HTTP proxy
* Fixes to HTTP proxy
* MTProxy and socks5 fixes
* Disable PHP 5 conversion
* Proxies have higher priority
* Avoid error handling in vendor
* Override composer dependencies
* Fix travis build
* Final composer fixes
* Proxy logic fixes
* Fix get_updates update handling
* Do not use parallel file driver if not supported
* Refactor loader and implement HTTP fixes
* Suppress errors in loader
* HTTP and authorization fixes
* HTTP fixes
* Improved peer management
* Use HTTP protocol on altervista
* Small bugfixes
* Minor fixes
* Docufix
* Docufix
* Legacy fixes
* Fix message queue
* Avoid updating if using MTProxy
* Improve logs and examples
* Trim final newlines while converting parse mode
* Reimplement noResponse flag
* Async combined event handler and APIFactory fixes
* Actually return config
* Case-insensitive methods
* Bugfix
* Apply fixes from StyleCI (#545)
* MTProxy fixes
* PHP 5 warning
* Improved PHP 5 warning
* Use <br> along with newlines in web logs
* Update docs
2018-12-26 20:51:14 +01:00
|
|
|
|
2019-10-29 21:33:23 +01:00
|
|
|
return yield $this->methodCallAsyncRead('account.updatePasswordSettings', $hasher->getPassword($params), ['datacenter' => $this->datacenter->curdc]);
|
Merge alpha into master (async, huge bugfixes and more) (#546)
* Implement async and lots of bugfixes
* Implement more async
* Implement async, implement bugfixes for the connection module, for the datacenter module, huge bugfixes, huge perfomance improvements, media DCs for https, advanced selecting, custom var_dump, totally rewritten IOLoop and response mechanism, promises, improvements to the TL parser, custom mb_substr
* Apply fixes from StyleCI
* Bugfixes
* Apply fixes from StyleCI
* Bugfixes, implement combined promises
* Apply fixes from StyleCI
* Support passing method arguments as callable
* Starting to write async upload logic
* Apply fixes from StyleCI
* Start implementing async file upload
* Apply fixes from StyleCI
* bugfix
* Apply fixes from StyleCI
* Start rewriting connection module
* Add PHP file docblocks for all classes
* Start working on new async stream API
* Finish writing stream API
* More stream API fixes
* Apply fixes from StyleCI
* Rewrite DataCenter and Connection modules
* Clean up stream API documentation
* Fixes
* Apply fixes from StyleCI
* Add referenced parameter to get length of buffer to read in getReadBuffer API
* Moved all MessageHandler code in the Connection module, added a PHP version warning in the phar
* Start fixing reads
* Fix all protocol stream wrappers
* Apply fixes from StyleCI
* Implement disconnection, and remove end function
* Working async RPC
* Implement async file upload
* Bugfix
* Method recall bugfixes
* Bugfixes
* Trait bugfixes
* Fix FIFO buffer
* Bugfixes and speedtests
* Async logging
* Implement websocket streams
* Implement loop API, signal API, clean closing and start changing layer
* Small magna, websocket and HTTP fixes
* Clean up loop API
* Improved stack traces, 2FA and async
* Login fixes
* Added instructions for manual verification
* Small fixes
* More app info improvements
* More app info improvements
* TL and 2FA fixes
* Update to layer 89
* More bugfixes
* Implement broken media reporting
* Remove debug comments
* PHP 7.2 backwards compatibility
* Bugfixes
* Async key generation
* Some simplifications
* Transport fixes
* Cleanup
* async API
* Performance fixes
* Fixes to async API
* Bugfixes
* Implement one-time async loop
* Authorization and logging fixes
* Update to layer 91
* 7to5 fix
* Null coalesce conversion
* Implement socks5 proxy
* Implement HTTP proxy
* Fixes to HTTP proxy
* MTProxy and socks5 fixes
* Disable PHP 5 conversion
* Proxies have higher priority
* Avoid error handling in vendor
* Override composer dependencies
* Fix travis build
* Final composer fixes
* Proxy logic fixes
* Fix get_updates update handling
* Do not use parallel file driver if not supported
* Refactor loader and implement HTTP fixes
* Suppress errors in loader
* HTTP and authorization fixes
* HTTP fixes
* Improved peer management
* Use HTTP protocol on altervista
* Small bugfixes
* Minor fixes
* Docufix
* Docufix
* Legacy fixes
* Fix message queue
* Avoid updating if using MTProxy
* Improve logs and examples
* Trim final newlines while converting parse mode
* Reimplement noResponse flag
* Async combined event handler and APIFactory fixes
* Actually return config
* Case-insensitive methods
* Bugfix
* Apply fixes from StyleCI (#545)
* MTProxy fixes
* PHP 5 warning
* Improved PHP 5 warning
* Use <br> along with newlines in web logs
* Update docs
2018-12-26 20:51:14 +01:00
|
|
|
}
|
2018-02-24 17:54:39 +01:00
|
|
|
}
|