diff --git a/src/danog/MadelineProto/API.php b/src/danog/MadelineProto/API.php index d2914df3..64bc84c7 100644 --- a/src/danog/MadelineProto/API.php +++ b/src/danog/MadelineProto/API.php @@ -32,7 +32,6 @@ class API extends APIFactory \danog\MadelineProto\Logger::log('Getting future salts...'); $this->future_salts = $this->get_future_salts([3]); - \danog\MadelineProto\Logger::log('MadelineProto is ready!'); restore_error_handler(); } diff --git a/src/danog/MadelineProto/Connection.php b/src/danog/MadelineProto/Connection.php index ba72928f..2005e527 100644 --- a/src/danog/MadelineProto/Connection.php +++ b/src/danog/MadelineProto/Connection.php @@ -33,7 +33,6 @@ class Connection extends Tools public $authorization = null; public $waiting_code = false; - public $incoming_messages = []; public $outgoing_messages = []; public $new_incoming = []; diff --git a/src/danog/MadelineProto/MTProto.php b/src/danog/MadelineProto/MTProto.php index 8a430123..56033a8d 100644 --- a/src/danog/MadelineProto/MTProto.php +++ b/src/danog/MadelineProto/MTProto.php @@ -51,7 +51,6 @@ class MTProto extends MTProtoTools } $this->ipv6 = strlen($google) > 0; - // Detect device model $device_model = 'Web server'; try { @@ -59,7 +58,6 @@ class MTProto extends MTProtoTools } catch (Exception $e) { } - // Detect system version $system_version = phpversion(); try { diff --git a/src/danog/MadelineProto/MTProtoTools/AuthKeyHandler.php b/src/danog/MadelineProto/MTProtoTools/AuthKeyHandler.php index 8c16e0f4..2cfe5887 100644 --- a/src/danog/MadelineProto/MTProtoTools/AuthKeyHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/AuthKeyHandler.php @@ -243,7 +243,6 @@ class AuthKeyHandler extends AckHandler \danog\MadelineProto\Logger::log(sprintf('Server-client time delta = %.1f s', $this->datacenter->time_delta)); - /* * *********************************************************************** * Define some needed numbers for BigInteger @@ -264,7 +263,6 @@ class AuthKeyHandler extends AckHandler throw new \danog\MadelineProto\Exception("dh_prime isn't a safe 2048-bit prime (dh_prime isn't a prime)."); } - /* * *********************************************************************** * Check validity of dh_prime @@ -407,7 +405,6 @@ class AuthKeyHandler extends AckHandler $new_nonce_hash2 = substr(sha1($new_nonce.chr(2).$auth_key_aux_hash, true), -16); $new_nonce_hash3 = substr(sha1($new_nonce.chr(3).$auth_key_aux_hash, true), -16); - /* * *********************************************************************** * Check if the client's nonce and the server's nonce are the same diff --git a/src/danog/MadelineProto/MTProtoTools/CallHandler.php b/src/danog/MadelineProto/MTProtoTools/CallHandler.php index 86964c4d..bb31d4d2 100644 --- a/src/danog/MadelineProto/MTProtoTools/CallHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/CallHandler.php @@ -51,7 +51,6 @@ class CallHandler extends AuthKeyHandler \danog\MadelineProto\Logger::log('Received request to switch to DC '.$dc); $this->switch_dc($dc); throw new \danog\MadelineProto\Exception('I had to switch to datacenter '.$dc); - break; case 401: switch ($server_answer['error_message']) { diff --git a/src/danog/MadelineProto/MTProtoTools/MessageHandler.php b/src/danog/MadelineProto/MTProtoTools/MessageHandler.php index 4d38dd44..d524fb78 100644 --- a/src/danog/MadelineProto/MTProtoTools/MessageHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/MessageHandler.php @@ -89,10 +89,10 @@ class MessageHandler extends Crypt $message_id = \danog\PHP\Struct::unpack('check_message_id($message_id, false); - $seq_no = \danog\PHP\Struct::unpack(' strlen($decrypted_data)) { throw new \danog\MadelineProto\Exception('message_data_length is too big'); diff --git a/src/danog/MadelineProto/PrimeModule.php b/src/danog/MadelineProto/PrimeModule.php index c931874a..9d51affa 100644 --- a/src/danog/MadelineProto/PrimeModule.php +++ b/src/danog/MadelineProto/PrimeModule.php @@ -127,7 +127,6 @@ class PrimeModule extends Tools return $res; } - throw new Exception("Couldn't calculate pq!"); } } diff --git a/src/danog/MadelineProto/TL/TL.php b/src/danog/MadelineProto/TL/TL.php index 52ff61aa..a95147e8 100644 --- a/src/danog/MadelineProto/TL/TL.php +++ b/src/danog/MadelineProto/TL/TL.php @@ -61,7 +61,7 @@ class TL extends \danog\MadelineProto\Tools public function deserialize_bool($data) { - $id = \danog\PHP\Struct::unpack('constructors->find_by_id($id); if ($tl_elem === false) { throw new Exception('Could not extract boolean'); @@ -240,13 +240,13 @@ class TL extends \danog\MadelineProto\Tools case 'Bool': return $this->deserialize_bool(fread($bytes_io, 4)); case 'int': - return \danog\PHP\Struct::unpack(' 254) { throw new Exception('Length is too big'); } if ($l == 254) { - $long_len = \danog\PHP\Struct::unpack('string2bin('\x00')) [0]; + $long_len = \danog\PHP\Struct::unpack('string2bin('\x00'))[0]; $x = fread($bytes_io, $long_len); $resto = $this->posmod(-$long_len, 4); if ($resto > 0) { @@ -281,7 +281,7 @@ class TL extends \danog\MadelineProto\Tools case 'true': return true; case 'Vector t': - $id = \danog\PHP\Struct::unpack('constructors->find_by_id($id); if ($constructorData === false) { throw new Exception('Could not extract type: '.$type['type'].' with id '.$id); @@ -296,7 +296,7 @@ class TL extends \danog\MadelineProto\Tools throw new Exception('Invalid vector constructor: '.$constructorData['predicate']); } case 'vector': - $count = \danog\PHP\Struct::unpack('deserialize($bytes_io, ['type' => $type['subtype']]); @@ -313,7 +313,7 @@ class TL extends \danog\MadelineProto\Tools } else { $constructorData = $this->constructors->find_by_predicate($type['type']); if ($constructorData === false) { - $id = \danog\PHP\Struct::unpack('constructors->find_by_id($id); if ($constructorData === false) { throw new Exception('Could not extract type: '.$type['type'].' with id '.$id); diff --git a/testing.php b/testing.php index 2166d2d1..af1a781f 100755 --- a/testing.php +++ b/testing.php @@ -13,7 +13,6 @@ If not, see . require_once 'vendor/autoload.php'; - if (file_exists('number.php') && !file_exists('session.madeline')) { include_once 'number.php'; $MadelineProto = new \danog\MadelineProto\API();