diff options
Diffstat (limited to 'matrix-specification/Data/Room/JoinedRoom.php')
| -rw-r--r-- | matrix-specification/Data/Room/JoinedRoom.php | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/matrix-specification/Data/Room/JoinedRoom.php b/matrix-specification/Data/Room/JoinedRoom.php new file mode 100644 index 0000000..89f64b9 --- /dev/null +++ b/matrix-specification/Data/Room/JoinedRoom.php @@ -0,0 +1,37 @@ +<?php + +namespace Matrix\Data\Room; + +use Matrix\Data\AccountData; + +class JoinedRoom implements \JsonSerializable +{ + /** + * @param array<string, ThreadNotificationCounts> + */ + public function __construct( + private ?AccountData $accountData = null, + private ?Ephemeral $ephemeral = null, + private ?State $state = null, + private ?State $stateAfter = null, + private ?RoomSummary $summary = null, + private ?Timeline $timeline = null, + private ?UnreadNotificationCounts $unreadNotifications = null, + private ?array $unreadThreadNotifications = null, + ) + {} + + public function jsonSerialize(): array + { + return array_filter([ + "account_data" => $this->inviteState, + "ephemeral" => $this->ephemeral, + "state" => $this->state, + "state_after" => $this->stateAfter, + "summary" => $this->summary, + "timeline" => $this->timeline, + "unread_notifications" => $this->unreadNotifications, + "unreadThreadNotifications" => $this->unreadThreadNotifications, + ], "is_null"); + } +} |
