diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2025-09-11 13:19:21 +0200 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2025-09-11 13:19:21 +0200 |
commit | b1b101fd98c8b4354a4e0c73e867d817466de30e (patch) | |
tree | 763e6d3dab13a2af8c324f7f879c5874dced76f2 /src/Events/PresenceEvent.php | |
parent | db014ebf9f8f84a1a0d0972298e70bf29e57c37e (diff) |
sync, rooms, events, etc
Diffstat (limited to 'src/Events/PresenceEvent.php')
-rw-r--r-- | src/Events/PresenceEvent.php | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/Events/PresenceEvent.php b/src/Events/PresenceEvent.php new file mode 100644 index 0000000..e3a54b3 --- /dev/null +++ b/src/Events/PresenceEvent.php @@ -0,0 +1,40 @@ +<?php + +namespace App\Events; + +use App\Types\EventType; +use App\Types\PresenceState; + +class PresenceEvent extends Event +{ + public function __construct( + private string $sender, + private string $avatarUrl = "mxc://localhost/wefuiwegh8742w", + private int $lastActiveAgo = 1234, + private bool $currentlyActive = false, + private PresenceState $presence = PresenceState::ONLINE, + private string $statusMessage = "", + ) + { + parent::__construct(EventType::PRESENCE); + } + + public function fromJson(string $json): static + { + } + + public function toJsonEncodeable(): array + { + return [ + "type" => $this->type, + "sender" => $this->sender, + "content" => [ + "avatar_url" => $this->avatarUrl, + "currently_active" => $this->currentlyActive, + "last_active_ago" => $this->lastActiveAgo, + "presence" => $this->presence, + "status_msg" => $this->statusMessage, + ], + ]; + } +} |