diff options
Diffstat (limited to 'matrix-specification/Events/ClientEvent.php')
-rw-r--r-- | matrix-specification/Events/ClientEvent.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/matrix-specification/Events/ClientEvent.php b/matrix-specification/Events/ClientEvent.php new file mode 100644 index 0000000..be1e354 --- /dev/null +++ b/matrix-specification/Events/ClientEvent.php @@ -0,0 +1,32 @@ +<?php + +namespace Matrix\Events; + +use Matrix\Enums\EventType; + +class ClientEvent extends ClientEventWithoutRoomId +{ + public function __construct( + array $content, + string $eventId, + int $originServerTimestamp, + protected string $roomId, + string $sender, + string $stateKey, + EventType $type, + ?UnsignedData $unsigned = null, + ) + { + parent::__construct($content, $eventId, $originServerTimestamp, $sender, $stateKey, $type); + } + + public function jsonSerialize(): array + { + $clientEvent = parent::jsonSerialize(); + $clientEvent += [ + "room_id" => $this->roomId, + ]; + + return $clientEvent; + } +} |