Destroy old _bk connections

This commit is contained in:
Daniil Gentili 2019-05-13 14:15:53 +00:00
parent fd14f8c6b6
commit d8e85de823
4 changed files with 4 additions and 4 deletions

2
docs

@ -1 +1 @@
Subproject commit e8e22ca165ac1bc8a7435d5d55b3e94b1883d9d8
Subproject commit 0fcff8e5a31af300511949c4dbafc7be6c0d4dd7

View File

@ -64,7 +64,7 @@ class DataCenter
$this->dclist = $dclist;
$this->settings = $settings;
foreach ($this->sockets as $key => $socket) {
if ($socket instanceof Connection) {
if ($socket instanceof Connection && !strpos($key, '_bk')) {
$this->API->logger->logger(sprintf(\danog\MadelineProto\Lang::$current_lang['dc_con_stop'], $key), \danog\MadelineProto\Logger::VERBOSE);
$socket->old = true;
$socket->disconnect();

View File

@ -336,7 +336,7 @@ class MTProto implements TLCallback
}
foreach ($this->full_chats as $id => $full) {
$this->full_chats[$id] = ['full' => $full['full'], 'last_update' => $full['last_update']];
if (isset($full['full'], $full['last_update'])) $this->full_chats[$id] = ['full' => $full['full'], 'last_update' => $full['last_update']];
}
foreach ($this->secret_chats as $key => &$chat) {
if (!is_array($chat)) {

View File

@ -66,7 +66,7 @@ class Magic
throw new \danog\MadelineProto\Exception(hex2bin(\danog\MadelineProto\Lang::$current_lang['v_error']), 0, null, 'MadelineProto', 1);
}
if (class_exists('\\danog\\MadelineProto\\VoIP')) {
if (!defined('\\danog\\MadelineProto\\VoIP::PHP_LIBTGVOIP_VERSION') || !in_array(\danog\MadelineProto\VoIP::PHP_LIBTGVOIP_VERSION, ['1.2.0'])) {
if (!defined('\\danog\\MadelineProto\\VoIP::PHP_LIBTGVOIP_VERSION') || !in_array(\danog\MadelineProto\VoIP::PHP_LIBTGVOIP_VERSION, ['1.3.0'])) {
throw new \danog\MadelineProto\Exception(hex2bin(\danog\MadelineProto\Lang::$current_lang['v_tgerror']), 0, null, 'MadelineProto', 1);
}
}