diff options
| author | Daniel Weipert <git@mail.dweipert.de> | 2025-09-25 13:38:24 +0200 |
|---|---|---|
| committer | Daniel Weipert <git@mail.dweipert.de> | 2025-09-25 13:38:24 +0200 |
| commit | b19a8f63ad727a3633885d3f2b81edf8181a53b9 (patch) | |
| tree | 6b5fd70224a125a16010a291e5fd0df834e9436f /matrix-specification/Requests/ClientSyncGetRequest.php | |
| parent | b08047ba485f86038f33175162943c0a9878ab1a (diff) | |
matrix-specification split work in progress
Diffstat (limited to 'matrix-specification/Requests/ClientSyncGetRequest.php')
| -rw-r--r-- | matrix-specification/Requests/ClientSyncGetRequest.php | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/matrix-specification/Requests/ClientSyncGetRequest.php b/matrix-specification/Requests/ClientSyncGetRequest.php index 2921fcf..2ab7d9e 100644 --- a/matrix-specification/Requests/ClientSyncGetRequest.php +++ b/matrix-specification/Requests/ClientSyncGetRequest.php @@ -2,7 +2,37 @@ namespace Matrix\Requests; -class ClientSyncGetRequest +use Matrix\Enums\PresenceState; + +class ClientSyncGetRequest implements RequiresAuthentication { - # TODO + public function __construct( + private ?string $filter = null, + private ?bool $fullState = null, + private ?PresenceState $setPresence = null, + private ?string $since = null, + private ?int $timeout = null, + private ?bool $useStateAfter = null, + ) + {} + + public function setDefaults(): void + { + $this->fullState ??= false; + $this->setPresence ??= PresenceState::ONLINE; + $this->timeout ??= 0; + $this->useStateAfter ??= false; + } + + public function getQueryParameters(): array + { + return array_filter([ + "filter" => $this->filter, + "full_state" => $this->fullState, + "set_presence" => $this->setPresence, + "since" => $this->since, + "timeout" => $this->timeout, + "use_state_after" => $this->useStateAfter, + ], "is_null"); + } } |
