Apply fixes from StyleCI

This commit is contained in:
Daniil Gentili 2017-12-23 01:35:39 +00:00 committed by StyleCI Bot
parent bd3bcb3767
commit ef8815f0a2

View File

@ -677,14 +677,18 @@ class MTProto
if (in_array($socket->protocol, ['http', 'https'])) { if (in_array($socket->protocol, ['http', 'https'])) {
$this->method_call('http_wait', ['max_wait' => 0, 'wait_after' => 0, 'max_delay' => 0], ['datacenter' => $id]); $this->method_call('http_wait', ['max_wait' => 0, 'wait_after' => 0, 'max_delay' => 0], ['datacenter' => $id]);
} }
} else if (!$cdn) $this->sync_authorization($id); } elseif (!$cdn) {
$this->sync_authorization($id);
}
} }
} finally { } finally {
$this->initing_authorization = false; $this->initing_authorization = false;
$this->updates_state['sync_loading'] = false; $this->updates_state['sync_loading'] = false;
} }
} }
public function sync_authorization($id) {
public function sync_authorization($id)
{
$socket = $this->datacenter->sockets[$id]; $socket = $this->datacenter->sockets[$id];
if ($this->authorized === self::LOGGED_IN && $socket->authorized === false) { if ($this->authorized === self::LOGGED_IN && $socket->authorized === false) {
foreach ($this->datacenter->sockets as $authorized_dc_id => $authorized_socket) { foreach ($this->datacenter->sockets as $authorized_dc_id => $authorized_socket) {
@ -701,6 +705,7 @@ class MTProto
} }
} }
} }
public function write_client_info($method, $arguments = [], $options = []) public function write_client_info($method, $arguments = [], $options = [])
{ {
\danog\MadelineProto\Logger::log([sprintf(\danog\MadelineProto\Lang::$current_lang['write_client_info'], $method)], Logger::NOTICE); \danog\MadelineProto\Logger::log([sprintf(\danog\MadelineProto\Lang::$current_lang['write_client_info'], $method)], Logger::NOTICE);