diff options
Diffstat (limited to 'src/Events/RoomMemberEvent.php')
| -rw-r--r-- | src/Events/RoomMemberEvent.php | 33 | 
1 files changed, 33 insertions, 0 deletions
diff --git a/src/Events/RoomMemberEvent.php b/src/Events/RoomMemberEvent.php new file mode 100644 index 0000000..02793ea --- /dev/null +++ b/src/Events/RoomMemberEvent.php @@ -0,0 +1,33 @@ +<?php + +namespace App\Events; + +use App\Types\EventType; + +class RoomMemberEvent extends Event +{ +  public function __construct( +    private string $sender, +    private string $stateKey, +    private string $membership, +  ) +  { +    parent::__construct(EventType::ROOM_MEMBER); +  } + +  public function fromJson(string $json): static +  { +  } + +  public function toJsonEncodeable(): array +  { +    return [ +      "type" => $this->type, +      "sender" => $this->sender, +      "state_key" => $this->stateKey, +      "content" => [ +        "membership" => $this->membership, +      ], +    ]; +  } +}  | 
