From 875b9ece501de5937993c41a83c44f8ea59897d0 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Fri, 10 Apr 2026 22:38:59 +0200 Subject: register and login to Cinny client --- matrix-specification/Data/PushCondition.php | 56 ++++++++++++++++++++++ matrix-specification/Data/PushRule.php | 32 +++++++++++++ matrix-specification/Data/Ruleset.php | 33 +++++++++++++ matrix-specification/Enums/PushConditionKind.php | 17 +++++++ .../Responses/ClientRegisterPostResponse.php | 8 +++- 5 files changed, 144 insertions(+), 2 deletions(-) create mode 100644 matrix-specification/Data/PushCondition.php create mode 100644 matrix-specification/Data/PushRule.php create mode 100644 matrix-specification/Data/Ruleset.php create mode 100644 matrix-specification/Enums/PushConditionKind.php (limited to 'matrix-specification') diff --git a/matrix-specification/Data/PushCondition.php b/matrix-specification/Data/PushCondition.php new file mode 100644 index 0000000..ca94de9 --- /dev/null +++ b/matrix-specification/Data/PushCondition.php @@ -0,0 +1,56 @@ + $this->is, + "key" => $this->key, + "kind" => $this->kind, + "pattern" => $this->pattern, + "value" => $this->value, + ]; + } +} diff --git a/matrix-specification/Data/PushRule.php b/matrix-specification/Data/PushRule.php new file mode 100644 index 0000000..2217a78 --- /dev/null +++ b/matrix-specification/Data/PushRule.php @@ -0,0 +1,32 @@ + $actions + * @param PushCondition[] $conditions + */ + public function __construct( + private array $actions, + private bool $default, + private bool $enabled, + private string $ruleId, + private ?array $conditions = null, + private ?string $pattern = null, + ) + {} + + public function jsonSerialize(): array + { + return [ + "actions" => $this->actions, + "conditions" => $this->conditions, + "default" => $this->default, + "enabled" => $this->enabled, + "pattern" => $this->pattern, + "rule_id" => $this->ruleId, + ]; + } +} diff --git a/matrix-specification/Data/Ruleset.php b/matrix-specification/Data/Ruleset.php new file mode 100644 index 0000000..af75579 --- /dev/null +++ b/matrix-specification/Data/Ruleset.php @@ -0,0 +1,33 @@ + $this->content, + "override" => $this->override, + "room" => $this->room, + "sender" => $this->sender, + "underride" => $this->underride, + ]; + } +} diff --git a/matrix-specification/Enums/PushConditionKind.php b/matrix-specification/Enums/PushConditionKind.php new file mode 100644 index 0000000..fe61c16 --- /dev/null +++ b/matrix-specification/Enums/PushConditionKind.php @@ -0,0 +1,17 @@ +value; + } +} diff --git a/matrix-specification/Responses/ClientRegisterPostResponse.php b/matrix-specification/Responses/ClientRegisterPostResponse.php index 6ed65ce..2b6dabe 100644 --- a/matrix-specification/Responses/ClientRegisterPostResponse.php +++ b/matrix-specification/Responses/ClientRegisterPostResponse.php @@ -17,12 +17,16 @@ class ClientRegisterPostResponse extends Response ) {} - public function validateRequired(ClientRegisterPostRequest $request): void + public function validateRequired(/*?ClientRegisterPostRequest $request*/): void { + /* if (is_null($request)) { + return; + } + $requestBody = $request->getBody(); if ($requestBody["inhibit_login"] === false) { # TODO: validate - } + } */ } public function getBody(): array -- cgit v1.2.3