Apply fixes from StyleCI

This commit is contained in:
Daniil Gentili 2018-02-28 12:44:40 +00:00 committed by StyleCI Bot
parent 34592383ed
commit 72705f9ddb
2 changed files with 8 additions and 5 deletions

View File

@ -108,6 +108,7 @@ trait ResponseHandler
switch ($this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['content']['error_code']) { switch ($this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['content']['error_code']) {
case 48: case 48:
$this->datacenter->sockets[$datacenter]->temp_auth_key['server_salt'] = $this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['content']['new_server_salt']; $this->datacenter->sockets[$datacenter]->temp_auth_key['server_salt'] = $this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['content']['new_server_salt'];
throw new \danog\MadelineProto\Exception('Got bad message notification'); throw new \danog\MadelineProto\Exception('Got bad message notification');
case 16: case 16:
case 17: case 17:
@ -117,6 +118,7 @@ trait ResponseHandler
$this->reset_session(); $this->reset_session();
$this->datacenter->sockets[$datacenter]->temp_auth_key = null; $this->datacenter->sockets[$datacenter]->temp_auth_key = null;
$this->init_authorization(); $this->init_authorization();
throw new \danog\MadelineProto\Exception('Got bad message notification'); throw new \danog\MadelineProto\Exception('Got bad message notification');
} }
$this->datacenter->sockets[$datacenter]->outgoing_messages[$this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['content']['bad_msg_id']]['response'] = $current_msg_id; $this->datacenter->sockets[$datacenter]->outgoing_messages[$this->datacenter->sockets[$datacenter]->incoming_messages[$current_msg_id]['content']['bad_msg_id']]['response'] = $current_msg_id;

View File

@ -33,11 +33,12 @@ class TLConstructor
public function add($json_dict, $scheme_type) public function add($json_dict, $scheme_type)
{ {
if (isset($this->by_id[$json_dict['id']]) && (!isset($this->by_id[$json_dict['id']]['layer']) || $this->by_id[$json_dict['id']]['layer'] > $json_dict['layer'])) return false; if (isset($this->by_id[$json_dict['id']]) && (!isset($this->by_id[$json_dict['id']]['layer']) || $this->by_id[$json_dict['id']]['layer'] > $json_dict['layer'])) {
return false;
}
$predicate = (string) (($scheme_type === 'mtproto' && $json_dict['predicate'] === 'message' ? 'MT' : '').$json_dict['predicate']); $predicate = (string) (($scheme_type === 'mtproto' && $json_dict['predicate'] === 'message' ? 'MT' : '').$json_dict['predicate']);
$this->by_id[$json_dict['id']] = ['predicate' => $predicate, 'params' => $json_dict['params'], 'type' => ($scheme_type === 'mtproto' && $json_dict['type'] === 'Message' ? 'MT' : '').$json_dict['type']]; $this->by_id[$json_dict['id']] = ['predicate' => $predicate, 'params' => $json_dict['params'], 'type' => ($scheme_type === 'mtproto' && $json_dict['type'] === 'Message' ? 'MT' : '').$json_dict['type']];
if ($scheme_type === 'secret') { if ($scheme_type === 'secret') {
$this->by_id[$json_dict['id']]['layer'] = $json_dict['layer']; $this->by_id[$json_dict['id']]['layer'] = $json_dict['layer'];