diff options
Diffstat (limited to 'matrix-specification/Events/ClientEventWithoutRoomId.php')
| -rw-r--r-- | matrix-specification/Events/ClientEventWithoutRoomId.php | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/matrix-specification/Events/ClientEventWithoutRoomId.php b/matrix-specification/Events/ClientEventWithoutRoomId.php index 0410d5b..f10d125 100644 --- a/matrix-specification/Events/ClientEventWithoutRoomId.php +++ b/matrix-specification/Events/ClientEventWithoutRoomId.php @@ -4,31 +4,33 @@ namespace Matrix\Events; use Matrix\Enums\EventType; -class ClientEventWithoutRoomId extends SenderEvent +class ClientEventWithoutRoomId extends ClientEvent { public function __construct( array $content, - protected string $eventId, - protected int $originServerTimestamp, + string $eventId, + int $originServerTimestamp, string $sender, - protected string $stateKey, EventType $type, - protected ?UnsignedData $unsigned = null, + ?UnsignedData $unsigned = null, ) { - parent::__construct($content, $sender, $type); + parent::__construct( + $content, + $eventId, + $originServerTimestamp, + "", + $sender, + $type, + $unsigned, + ); } public function jsonSerialize(): array { - return [ - "content" => $this->content ?: new \stdClass, - "event_id" => $this->eventId, - "origin_server_ts" => $this->originServerTimestamp, - "sender" => $this->sender, - "state_key" => $this->stateKey, - "type" => $this->type, - "unsigned" => $this->unsigned ?? new \stdClass, - ]; + $clientEvent = parent::jsonSerialize(); + unset($clientEvent["room_id"]); + + return $clientEvent; } } |
