Skip to content

Commit

Permalink
Fixed: responses decryption
Browse files Browse the repository at this point in the history
  • Loading branch information
capcom6 committed Jan 17, 2024
1 parent 24e27ee commit 4a1cfa2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@ public function Send(Message $message): MessageState {
throw new \RuntimeException('Invalid response');
}

return MessageState::FromObject($response);
$state = MessageState::FromObject($response);

if (isset($this->encryptor)) {
$state = $state->Decrypt($this->encryptor);
}

return $state;
}

public function GetState(string $id): MessageState {
Expand Down
2 changes: 2 additions & 0 deletions src/Domain/MessageState.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ public function Decrypt(Encryptor $encryptor): self {
$this->recipients
);

$this->isEncrypted = false;

return $this;
}

Expand Down

0 comments on commit 4a1cfa2

Please sign in to comment.