summaryrefslogtreecommitdiff
path: root/matrix-specification/Events/PresenceEvent.php
diff options
context:
space:
mode:
Diffstat (limited to 'matrix-specification/Events/PresenceEvent.php')
-rw-r--r--matrix-specification/Events/PresenceEvent.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/matrix-specification/Events/PresenceEvent.php b/matrix-specification/Events/PresenceEvent.php
index f71d4bd..c8c2023 100644
--- a/matrix-specification/Events/PresenceEvent.php
+++ b/matrix-specification/Events/PresenceEvent.php
@@ -10,22 +10,22 @@ class PresenceEvent extends SenderEvent
public function __construct(
string $sender,
PresenceState $presence,
- string $avatarUrl = "",
- bool $currentlyActive = false,
- string $displayName = "",
- int $lastActiveAgo = 0,
- string $statusMessage = "",
+ ?string $avatarUrl = null,
+ ?bool $currentlyActive = null,
+ ?string $displayName = null,
+ ?int $lastActiveAgo = null,
+ ?string $statusMessage = null,
)
{
parent::__construct(
- [
+ array_filter([
"avatar_url" => $avatarUrl,
"currently_active" => $currentlyActive,
"display_name" => $displayName,
"last_active_ago" => $lastActiveAgo,
"presence" => $presence,
"status_msg" => $statusMessage,
- ],
+ ], "is_null"),
$sender,
EventType::PRESENCE
);