Backward compatibility and bugfixes

This commit is contained in:
Daniil Gentili 2018-03-01 19:49:22 +00:00
parent 4f7c6c6936
commit b4efa8bf88
2 changed files with 8 additions and 4 deletions

View File

@ -69,7 +69,8 @@ class DataCenter
if (!isset($this->dclist[$test][$ipv6][$dc_number]['ip_address'])) { if (!isset($this->dclist[$test][$ipv6][$dc_number]['ip_address'])) {
unset($this->sockets[$dc_number]); unset($this->sockets[$dc_number]);
throw new \danog\MadelineProto\Exception("No info for DC $dc_number"); \danog\MadelineProto\Logger::log("No info for DC $dc_number", \danog\MadelineProto\Logger::ERROR);
return false;
} }
$address = $this->dclist[$test][$ipv6][$dc_number]['ip_address']; $address = $this->dclist[$test][$ipv6][$dc_number]['ip_address'];
$port = $this->dclist[$test][$ipv6][$dc_number]['port']; $port = $this->dclist[$test][$ipv6][$dc_number]['port'];

View File

@ -47,7 +47,7 @@ class MTProto
/* /*
const V = 71; const V = 71;
*/ */
const V = 91; const V = 92;
const NOT_LOGGED_IN = 0; const NOT_LOGGED_IN = 0;
const WAITING_CODE = 1; const WAITING_CODE = 1;
const WAITING_SIGNUP = -1; const WAITING_SIGNUP = -1;
@ -234,6 +234,9 @@ class MTProto
if (!isset($connection['proxy_extra'])) { if (!isset($connection['proxy_extra'])) {
$connection['proxy_extra'] = []; $connection['proxy_extra'] = [];
} }
if (!isset($connection['pfs'])) {
$connection['pfs'] = true;
}
} }
if (!isset($settings['authorization']['rsa_key'])) { if (!isset($settings['authorization']['rsa_key'])) {
unset($settings['authorization']['rsa_key']); unset($settings['authorization']['rsa_key']);
@ -620,14 +623,14 @@ class MTProto
$test = $this->config['test_mode'] ? 'test' : 'main'; $test = $this->config['test_mode'] ? 'test' : 'main';
$id = $dc['id']; $id = $dc['id'];
if (isset($dc['static'])) { if (isset($dc['static'])) {
// $id .= $dc['static'] ? '_static' : ''; //$id .= $dc['static'] ? '_static' : '';
} }
if (isset($dc['cdn'])) { if (isset($dc['cdn'])) {
$id .= $dc['cdn'] ? '_cdn' : ''; $id .= $dc['cdn'] ? '_cdn' : '';
} }
$id .= $dc['media_only'] ? '_media' : ''; $id .= $dc['media_only'] ? '_media' : '';
$ipv6 = $dc['ipv6'] ? 'ipv6' : 'ipv4'; $ipv6 = $dc['ipv6'] ? 'ipv6' : 'ipv4';
$id .= isset($this->settings['connection'][$test][$ipv6][$id]) && $this->settings['connection'][$test][$ipv6][$id]['ip_address'] != $dc['ip_address'] ? '_bk' : ''; //$id .= isset($this->settings['connection'][$test][$ipv6][$id]) && $this->settings['connection'][$test][$ipv6][$id]['ip_address'] != $dc['ip_address'] ? '_bk' : '';
if (is_numeric($id)) { if (is_numeric($id)) {
$id = (int) $id; $id = (int) $id;
} }