From bd11271621bd3759cfd194ed0119c0dc28155fd0 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Thu, 5 Mar 2026 14:57:28 +0100 Subject: update --- matrix-specification/Events/Room/AvatarEvent.php | 37 ++++++++++++++ .../Events/Room/CanonicalAliasEvent.php | 39 +++++++++++++++ matrix-specification/Events/Room/CreateEvent.php | 54 ++++++++++++++++++++ .../Events/Room/GuestAccessEvent.php | 35 +++++++++++++ .../Events/Room/HistoryVisibilityEvent.php | 35 +++++++++++++ .../Events/Room/JoinRulesEvent.php | 40 +++++++++++++++ matrix-specification/Events/Room/MemberEvent.php | 47 ++++++++++++++++++ matrix-specification/Events/Room/NameEvent.php | 34 +++++++++++++ .../Events/Room/PinnedEventsEvent.php | 37 ++++++++++++++ .../Events/Room/PowerLevelsEvent.php | 57 ++++++++++++++++++++++ matrix-specification/Events/Room/TopicEvent.php | 37 ++++++++++++++ 11 files changed, 452 insertions(+) create mode 100644 matrix-specification/Events/Room/AvatarEvent.php create mode 100644 matrix-specification/Events/Room/CanonicalAliasEvent.php create mode 100644 matrix-specification/Events/Room/CreateEvent.php create mode 100644 matrix-specification/Events/Room/GuestAccessEvent.php create mode 100644 matrix-specification/Events/Room/HistoryVisibilityEvent.php create mode 100644 matrix-specification/Events/Room/JoinRulesEvent.php create mode 100644 matrix-specification/Events/Room/MemberEvent.php create mode 100644 matrix-specification/Events/Room/NameEvent.php create mode 100644 matrix-specification/Events/Room/PinnedEventsEvent.php create mode 100644 matrix-specification/Events/Room/PowerLevelsEvent.php create mode 100644 matrix-specification/Events/Room/TopicEvent.php (limited to 'matrix-specification/Events/Room') diff --git a/matrix-specification/Events/Room/AvatarEvent.php b/matrix-specification/Events/Room/AvatarEvent.php new file mode 100644 index 0000000..c9e18f2 --- /dev/null +++ b/matrix-specification/Events/Room/AvatarEvent.php @@ -0,0 +1,37 @@ + $info, + "url" => $url, + ], fn ($value) => ! is_null($value)), + $eventId, + $originServerTimestamp, + $roomId, + $sender, + $stateKey, + EventType::ROOM_AVATAR, + $unsigned, + ); + } +} diff --git a/matrix-specification/Events/Room/CanonicalAliasEvent.php b/matrix-specification/Events/Room/CanonicalAliasEvent.php new file mode 100644 index 0000000..63de661 --- /dev/null +++ b/matrix-specification/Events/Room/CanonicalAliasEvent.php @@ -0,0 +1,39 @@ + $alias, + "alt_aliases" => $altAliases, + ], fn ($value) => ! is_null($value)), + $eventId, + $originServerTimestamp, + $roomId, + $sender, + $stateKey, + EventType::ROOM_CANONICAL_ALIAS, + $unsigned, + ); + } +} diff --git a/matrix-specification/Events/Room/CreateEvent.php b/matrix-specification/Events/Room/CreateEvent.php new file mode 100644 index 0000000..eccda10 --- /dev/null +++ b/matrix-specification/Events/Room/CreateEvent.php @@ -0,0 +1,54 @@ + $additionalCreators, + "creator" => intval($roomVersion) <= 10 ? $creator : $sender, + "m.federate" => $federate, + "predecessor" => $predecessor, + "room_version" => $roomVersion, + "type" => $roomType, + ], fn ($value) => ! is_null($value)), + $eventId, + $originServerTimestamp, + $roomId, + $sender, + $stateKey, + EventType::ROOM_CREATE, + $unsigned, + ); + } +} diff --git a/matrix-specification/Events/Room/GuestAccessEvent.php b/matrix-specification/Events/Room/GuestAccessEvent.php new file mode 100644 index 0000000..a0eeddb --- /dev/null +++ b/matrix-specification/Events/Room/GuestAccessEvent.php @@ -0,0 +1,35 @@ + $guestAccess, + ], + $eventId, + $originServerTimestamp, + $roomId, + $sender, + $stateKey, + EventType::ROOM_GUEST_ACCESS, + $unsigned, + ); + } +} diff --git a/matrix-specification/Events/Room/HistoryVisibilityEvent.php b/matrix-specification/Events/Room/HistoryVisibilityEvent.php new file mode 100644 index 0000000..76672bf --- /dev/null +++ b/matrix-specification/Events/Room/HistoryVisibilityEvent.php @@ -0,0 +1,35 @@ + $historyVisibility, + ], + $eventId, + $originServerTimestamp, + $roomId, + $sender, + $stateKey, + EventType::ROOM_HISTORY_VISIBILITY, + $unsigned, + ); + } +} 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 @@ + $allow, + "join_rule" => $joinRule, + ], fn ($value) => ! is_null($value)), + $eventId, + $originServerTimestamp, + $roomId, + $sender, + $stateKey, + EventType::ROOM_JOIN_RULES, + $unsigned, + ); + } +} diff --git a/matrix-specification/Events/Room/MemberEvent.php b/matrix-specification/Events/Room/MemberEvent.php new file mode 100644 index 0000000..0f27289 --- /dev/null +++ b/matrix-specification/Events/Room/MemberEvent.php @@ -0,0 +1,47 @@ + $avatarUrl, + "displayname" => $displayName, + "is_direct" => $isDirect, + "join_authorised_via_users_server" => $joinAuthorisedViaUsersServer, + "membership" => $membership, + "reason" => $reason, + "third_party_invite" => $thirdPartyInvite, + ], fn ($value) => ! is_null($value)), + $eventId, + $originServerTimestamp, + $roomId, + $sender, + $stateKey, + EventType::ROOM_MEMBER, + $unsigned, + ); + } +} diff --git a/matrix-specification/Events/Room/NameEvent.php b/matrix-specification/Events/Room/NameEvent.php new file mode 100644 index 0000000..187b36a --- /dev/null +++ b/matrix-specification/Events/Room/NameEvent.php @@ -0,0 +1,34 @@ + $name, + ], + $eventId, + $originServerTimestamp, + $roomId, + $sender, + $stateKey, + EventType::ROOM_NAME, + $unsigned, + ); + } +} diff --git a/matrix-specification/Events/Room/PinnedEventsEvent.php b/matrix-specification/Events/Room/PinnedEventsEvent.php new file mode 100644 index 0000000..c0a98b0 --- /dev/null +++ b/matrix-specification/Events/Room/PinnedEventsEvent.php @@ -0,0 +1,37 @@ + $pinned, + ], + $eventId, + $originServerTimestamp, + $roomId, + $sender, + $stateKey, + EventType::ROOM_CANONICAL_ALIAS, + $unsigned, + ); + } +} diff --git a/matrix-specification/Events/Room/PowerLevelsEvent.php b/matrix-specification/Events/Room/PowerLevelsEvent.php new file mode 100644 index 0000000..8b609f3 --- /dev/null +++ b/matrix-specification/Events/Room/PowerLevelsEvent.php @@ -0,0 +1,57 @@ + $events This is a mapping from event type to power level required. + * @param ?array $notifications This is a mapping from key to power level for that notifications key. + * @param ?array $events This is a mapping from user_id to power level for that user. + */ + public function __construct( + string $eventId, + int $originServerTimestamp, + string $roomId, + string $sender, + ?int $ban = 50, + ?array $events = null, + ?int $eventsDefault = 0, + ?int $invite = 0, + ?int $kick = 50, + ?array $notifications = null, # TODO: https://spec.matrix.org/v1.17/client-server-api/#mroompower_levels_notifications + ?int $redact = 50, + ?int $stateDefault = 50, + ?array $users = null, + ?int $usersDefault = 0, + string $stateKey = "", + ?UnsignedData $unsigned = null, + ) + { + parent::__construct( + array_filter([ + "ban" => $ban, + "events" => $events, + "events_default" => $eventsDefault, + "invite" => $invite, + "kick" => $kick, + "notifications" => $notifications, + "redact" => $redact, + "state_default" => $stateDefault, + "users" => $users, + "users_default" => $usersDefault, + ], fn ($value) => ! is_null($value)), + $eventId, + $originServerTimestamp, + $roomId, + $sender, + $stateKey, + EventType::ROOM_POWER_LEVELS, + $unsigned, + ); + } +} diff --git a/matrix-specification/Events/Room/TopicEvent.php b/matrix-specification/Events/Room/TopicEvent.php new file mode 100644 index 0000000..8e01a3b --- /dev/null +++ b/matrix-specification/Events/Room/TopicEvent.php @@ -0,0 +1,37 @@ + $topicContentBlock, + "topic" => $topic, + ], fn ($value) => ! is_null($value)), + $eventId, + $originServerTimestamp, + $roomId, + $sender, + $stateKey, + EventType::ROOM_TOPIC, + $unsigned, + ); + } +} -- cgit v1.2.3