diff --git a/src/danog/MadelineProto/API.php b/src/danog/MadelineProto/API.php index e92357a9..a5095f7e 100644 --- a/src/danog/MadelineProto/API.php +++ b/src/danog/MadelineProto/API.php @@ -21,8 +21,8 @@ class API extends Tools set_error_handler(['\danog\MadelineProto\Exception', 'ExceptionErrorHandler']); $this->session = new MTProto($params); $ping_res = $this->ping(3); - if(isset($ping["_"]) && $ping["_"] == "pong") { - $this->log->log("Pong: ".$ping["ping_id"]); + if (isset($ping['_']) && $ping['_'] == 'pong') { + $this->log->log('Pong: '.$ping['ping_id']); } $future_salts = $this->get_future_salts(3); } diff --git a/src/danog/MadelineProto/MTProto.php b/src/danog/MadelineProto/MTProto.php index b055f13f..de2d5436 100644 --- a/src/danog/MadelineProto/MTProto.php +++ b/src/danog/MadelineProto/MTProto.php @@ -142,11 +142,11 @@ Slv8kg9qv1m6XHVQY3PnEw+QQtqSIXklHwIDAQAB ) ), ]); - $this->log->log("Current dc is ".$nearestDc["this_dc"].", nearest dc is ".$nearestDc["nearest_dc"]." in ".$nearestDc["country"]."."); - - if ($nearestDc["nearest_dc"] != $nearestDc["this_dc"]) { - $this->log->log("Switching to dc ".$nearestDc["nearest_dc"]."..."); - $this->connection->dc_connect($nearestDc["nearest_dc"]); + $this->log->log('Current dc is '.$nearestDc['this_dc'].', nearest dc is '.$nearestDc['nearest_dc'].' in '.$nearestDc['country'].'.'); + + if ($nearestDc['nearest_dc'] != $nearestDc['this_dc']) { + $this->log->log('Switching to dc '.$nearestDc['nearest_dc'].'...'); + $this->connection->dc_connect($nearestDc['nearest_dc']); } } diff --git a/src/danog/MadelineProto/TL/TL.php b/src/danog/MadelineProto/TL/TL.php index 644babcb..c0d7c01d 100644 --- a/src/danog/MadelineProto/TL/TL.php +++ b/src/danog/MadelineProto/TL/TL.php @@ -159,10 +159,11 @@ class TL case '!X': return $value; case 'Vector t': - $concat = \danog\PHP\Struct::pack('constructor_type["vector"]->id); + $concat = \danog\PHP\Struct::pack('constructor_type['vector']->id); foreach ($value as $curv) { $concat .= $this->serialize_param($subtype, null, $curv); } + return $concat; default: throw new Exception("Couldn't serialize param with type ".$type_);