Secret chat abstraction improvements

This commit is contained in:
Daniil Gentili 2018-07-19 17:03:08 +02:00
parent 28b53ae8cf
commit 6fcd5247b1

View File

@ -410,8 +410,12 @@ trait TL
if ($method === 'messages.sendMessage' && isset($arguments['peer']['_']) && $arguments['peer']['_'] === 'inputEncryptedChat') {
$method = 'messages.sendEncrypted';
$arguments = ['peer' => $arguments['peer'], 'message' => $arguments];
if (!isset($arguments['message']['_'])) {
$arguments['message']['_'] = 'decryptedMessage';
}
if (!isset($arguments['message']['ttl'])) {
$arguments['message']['ttl'] = 0;
}
if (isset($arguments['message']['reply_to_msg_id'])) {
$arguments['message']['reply_to_random_id'] = $arguments['message']['reply_to_msg_id'];
}