diff --git a/src/EventHandler/Media.php b/src/EventHandler/Media.php index e88e565c5..426b777e4 100644 --- a/src/EventHandler/Media.php +++ b/src/EventHandler/Media.php @@ -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; } /** diff --git a/src/MTProtoTools/UpdateHandler.php b/src/MTProtoTools/UpdateHandler.php index 4fbe70ed0..b799b2232 100644 --- a/src/MTProtoTools/UpdateHandler.php +++ b/src/MTProtoTools/UpdateHandler.php @@ -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['_']); } diff --git a/src/SecretChats/SecretChatController.php b/src/SecretChats/SecretChatController.php index 73e94c590..d18b17e9c 100644 --- a/src/SecretChats/SecretChatController.php +++ b/src/SecretChats/SecretChatController.php @@ -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'];