Merge branch 'master' of https://github.com/danog/MadelineProto
This commit is contained in:
commit
fa1183b25e
@ -6,7 +6,7 @@ Created by [Daniil Gentili](https://daniil.it), licensed under AGPLv3.
|
||||
|
||||
PHP implementation of MTProto, based on [telepy](https://github.com/griganton/telepy_old).
|
||||
|
||||
This project can run on PHP 7, PHP 5.6 and HHVM.
|
||||
This project can run on PHP 7, PHP 5.6 and HHVM, only 64 bit systems are supported ATM.
|
||||
|
||||
Also note that MadelineProto will perform better if a big math extension like gmp o bcmath is installed.
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -33,7 +33,6 @@ class Connection extends Tools
|
||||
public $authorization = null;
|
||||
public $waiting_code = false;
|
||||
|
||||
|
||||
public $incoming_messages = [];
|
||||
public $outgoing_messages = [];
|
||||
public $new_incoming = [];
|
||||
|
@ -49,6 +49,11 @@ class MTProto extends PrimeModule
|
||||
|
||||
public function __construct($settings = [])
|
||||
{
|
||||
// Detect 64 bit
|
||||
if (PHP_INT_SIZE < 8) {
|
||||
throw new Exception('MadelineProto supports only 64 bit systems ATM');
|
||||
}
|
||||
|
||||
// Detect ipv6
|
||||
$google = '';
|
||||
try {
|
||||
@ -57,7 +62,6 @@ class MTProto extends PrimeModule
|
||||
}
|
||||
$this->ipv6 = strlen($google) > 0;
|
||||
|
||||
|
||||
// Detect device model
|
||||
$device_model = 'Web server';
|
||||
try {
|
||||
@ -65,7 +69,6 @@ class MTProto extends PrimeModule
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
|
||||
|
||||
// Detect system version
|
||||
$system_version = phpversion();
|
||||
try {
|
||||
|
@ -243,7 +243,6 @@ trait AuthKeyHandler
|
||||
|
||||
\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 @@ trait AuthKeyHandler
|
||||
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 @@ trait AuthKeyHandler
|
||||
$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
|
||||
|
@ -51,7 +51,6 @@ trait CallHandler
|
||||
\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']) {
|
||||
|
@ -127,7 +127,6 @@ class PrimeModule extends Tools
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
throw new Exception("Couldn't calculate pq!");
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,6 @@ If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
require_once 'vendor/autoload.php';
|
||||
|
||||
|
||||
if (file_exists('number.php') && !file_exists('session.madeline')) {
|
||||
include_once 'number.php';
|
||||
$MadelineProto = new \danog\MadelineProto\API();
|
||||
|
Loading…
x
Reference in New Issue
Block a user