1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-27 05:34:42 +01:00
This commit is contained in:
Daniil Gentili 2023-09-28 19:42:28 +02:00
parent 8794309dfb
commit fd27fd700b
3 changed files with 5 additions and 1 deletions

View File

@ -94,7 +94,7 @@ abstract class Media extends IpcCapable implements JsonSerializable
$this->ttl = $rawMedia['ttl_seconds'] ?? null;
$this->spoiler = $rawMedia['spoiler'] ?? false;
$this->key = $rawMedia['key'] ?? null;
$this->key = $rawMedia['iv'] ?? null;
$this->iv = $rawMedia['iv'] ?? null;
}
/**

View File

@ -827,6 +827,8 @@ trait UpdateHandler
$message['peer_id'] = $this->getInfo($to_id, API::INFO_TYPE_PEER);
$this->populateMessageFlags($message);
return [['_' => 'updateNewMessage', 'message' => $message, 'pts' => $updates['pts'], 'pts_count' => $updates['pts_count']]];
case 'updateNewOutgoingEncryptedMessage':
return [$updates];
default:
throw new ResponseException('Unrecognized update received: '.$updates['_']);
}

View File

@ -399,6 +399,8 @@ final class SecretChatController implements Stringable
$msg = $this->outgoing[$request['seq']];
if (!isset($msg['message']['date'])) {
$msg['message']['date'] = $response['date'];
$msg['message']['decrypted_message'] = $msg['message']['message'];
unset($msg['message']['message']);
if (isset($response['file']) && $response['file']['_'] !== 'encryptedFileEmpty') {
$msg['message']['file'] = $response['file'];
$msg['message']['decrypted_message']['media']['file'] = $response['file'];