Apply fixes from StyleCI

This commit is contained in:
Daniil Gentili 2017-06-01 20:21:36 +00:00 committed by StyleCI Bot
parent a8dc0027f1
commit 77923b231d
2 changed files with 4 additions and 2 deletions

View File

@ -81,7 +81,9 @@ while (true) {
switch ($update['update']['_']) {
case 'updateNewEncryptedMessage':
$i = 0;
while (true) { $MadelineProto->messages->sendEncrypted(['peer' => $update['update']['message']['chat_id'], 'message' => ['_' => 'decryptedMessage', 'ttl' => 0, 'message' => $i++]]); }
while (true) {
$MadelineProto->messages->sendEncrypted(['peer' => $update['update']['message']['chat_id'], 'message' => ['_' => 'decryptedMessage', 'ttl' => 0, 'message' => $i++]]);
}
}
}
echo 'Wrote '.\danog\MadelineProto\Serialization::serialize('bot.madeline', $MadelineProto).' bytes'.PHP_EOL;

View File

@ -57,7 +57,7 @@ trait MessageHandler
$auth_key_id = substr($message['message']['bytes'], 0, 8);
$old = false;
if ($auth_key_id !== $this->secret_chats[$message['message']['chat_id']]['key']['fingerprint']) {
//var_dump($auth_key_id, $this->secret_chats[$message['message']['chat_id']]['key']['fingerprint']);
//var_dump($auth_key_id, $this->secret_chats[$message['message']['chat_id']]['key']['fingerprint']);
if (isset($this->secret_chats[$message['message']['chat_id']]['old_key']['fingerprint'])) {
if ($auth_key_id !== $this->secret_chats[$message['message']['chat_id']]['old_key']['fingerprint']) {
throw new \danog\MadelineProto\SecurityException('Key fingerprint mismatch');