Apply fixes from StyleCI
This commit is contained in:
parent
87f2ec50ac
commit
770c1c89d5
@ -216,8 +216,12 @@ class MTProto
|
||||
if (isset($settings['authorization']['rsa_key'])) {
|
||||
unset($settings['authorization']['rsa_key']);
|
||||
}
|
||||
if (!isset($this->full_chats)) $this->full_chats = [];
|
||||
if (!isset($this->secret_chats)) $this->secret_chats = [];
|
||||
if (!isset($this->full_chats)) {
|
||||
$this->full_chats = [];
|
||||
}
|
||||
if (!isset($this->secret_chats)) {
|
||||
$this->secret_chats = [];
|
||||
}
|
||||
|
||||
foreach ($this->full_chats as $id => $full) {
|
||||
$this->full_chats[$id] = ['full' => $full['full'], 'last_update' => $full['last_update']];
|
||||
|
@ -116,8 +116,13 @@ trait PeerHandler
|
||||
try {
|
||||
return isset($this->chats[$this->get_info($id)['bot_api_id']]);
|
||||
} catch (\danog\MadelineProto\RPCErrorException $e) {
|
||||
if ($e->rpc === 'CHAT_FORBIDDEN') return true;
|
||||
if ($e->rpc === 'CHANNEL_PRIVATE') return true;
|
||||
if ($e->rpc === 'CHAT_FORBIDDEN') {
|
||||
return true;
|
||||
}
|
||||
if ($e->rpc === 'CHANNEL_PRIVATE') {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -194,7 +199,6 @@ trait PeerHandler
|
||||
case 'chatForbidden':
|
||||
case 'channelForbidden':
|
||||
throw new \danog\MadelineProto\RPCErrorException('CHAT_FORBIDDEN');
|
||||
|
||||
default:
|
||||
throw new \danog\MadelineProto\Exception('Invalid constructor given '.var_export($id, true));
|
||||
break;
|
||||
@ -224,7 +228,9 @@ trait PeerHandler
|
||||
} catch (\danog\MadelineProto\Exception $e) {
|
||||
if ($e->getMessage() === 'This peer is not present in the internal peer database') {
|
||||
unset($this->chats[$id]);
|
||||
} else throw $e;
|
||||
} else {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!isset($this->settings['pwr']['requests']) || $this->settings['pwr']['requests'] === true && $recursive) {
|
||||
@ -489,7 +495,9 @@ trait PeerHandler
|
||||
}
|
||||
}
|
||||
|
||||
if ($gres['_'] === 'channels.channelParticipantsNotModified') continue;
|
||||
if ($gres['_'] === 'channels.channelParticipantsNotModified') {
|
||||
continue;
|
||||
}
|
||||
$count = $gres['count'];
|
||||
|
||||
while ($offset <= $count) {
|
||||
|
Loading…
Reference in New Issue
Block a user