1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-30 09:58:59 +01:00

Small fix

This commit is contained in:
Daniil Gentili 2017-12-23 14:49:06 +00:00
parent 7b2798ddd9
commit 6cc990217f
2 changed files with 8 additions and 1 deletions

View File

@ -169,7 +169,10 @@ $users = [];
$secret_media['voice'] = ['peer' => $secret, 'file' => $inputEncryptedFileAudio, 'message' => ['_' => 'decryptedMessage', 'ttl' => 0, 'message' => '', 'media' => ['_' => 'decryptedMessageMediaDocument', 'thumb' => file_get_contents('tests/faust.preview.jpg'), 'thumb_w' => 90, 'thumb_h' => 90, 'mime_type' => mime_content_type('tests/mosconi.mp3'), 'caption' => 'test', 'key' => $inputEncryptedFileAudio['key'], 'iv' => $inputEncryptedFileAudio['iv'], 'file_name' => 'mosconi.mp3', 'size' => filesize('tests/mosconi.mp3'), 'attributes' => [['_' => 'documentAttributeAudio', 'voice' => true, 'duration' => 1, 'title' => 'AH NON LO SO IO', 'performer' => 'IL DIO GERMANO MOSCONI']]]]];
foreach ($secret_media as $type => $smessage) {
$type = $MadelineProto->messages->sendEncryptedFile($smessage);
try {
$type = $MadelineProto->messages->sendEncryptedFile($smessage);
} catch (\danog\MadelineProto\RPCErrorException $e) {
} catch (\danog\MadelineProto\Exception $e) {}
}
break;
case 'updateNewMessage':

View File

@ -324,6 +324,10 @@ class MTProto
$this->full_chats[$id] = ['full' => $full['full'], 'last_update' => $full['last_update']];
}
foreach ($this->secret_chats as $key => &$chat) {
if (!is_array($chat)) {
unset($this->secret_chats[$key]);
continue;
}
if ($chat['layer'] >= 73) {
$chat['mtproto'] = 2;
} else {