diff options
Diffstat (limited to 'matrix-specification/Events/Room/JoinRulesEvent.php')
| -rw-r--r-- | matrix-specification/Events/Room/JoinRulesEvent.php | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/matrix-specification/Events/Room/JoinRulesEvent.php b/matrix-specification/Events/Room/JoinRulesEvent.php new file mode 100644 index 0000000..337c9d2 --- /dev/null +++ b/matrix-specification/Events/Room/JoinRulesEvent.php @@ -0,0 +1,40 @@ +<?php + +namespace Matrix\Events\Room; + +use Matrix\Data\UnsignedData; +use Matrix\Enums\EventType; +use Matrix\Enums\RoomJoinRule; +use Matrix\Events\StateEvent; + +class JoinRulesEvent extends StateEvent +{ + /** + * @param ?AllowCondition[] $allow + */ + public function __construct( + string $eventId, + int $originServerTimestamp, + string $roomId, + string $sender, + RoomJoinRule $joinRule, + ?array $allow = null, + string $stateKey = "", + ?UnsignedData $unsigned = null, + ) + { + parent::__construct( + array_filter([ + "allow" => $allow, + "join_rule" => $joinRule, + ], fn ($value) => ! is_null($value)), + $eventId, + $originServerTimestamp, + $roomId, + $sender, + $stateKey, + EventType::ROOM_JOIN_RULES, + $unsigned, + ); + } +} |
