summaryrefslogtreecommitdiff
path: root/matrix-specification/Events/ClientEventWithoutRoomId.php
blob: f10d12597ce9cff358a4f4a88219cff1ab30e73f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php

namespace Matrix\Events;

use Matrix\Enums\EventType;

class ClientEventWithoutRoomId extends ClientEvent
{
  public function __construct(
    array $content,
    string $eventId,
    int $originServerTimestamp,
    string $sender,
    EventType $type,
    ?UnsignedData $unsigned = null,
  )
  {
    parent::__construct(
      $content,
      $eventId,
      $originServerTimestamp,
      "",
      $sender,
      $type,
      $unsigned,
    );
  }

  public function jsonSerialize(): array
  {
    $clientEvent = parent::jsonSerialize();
    unset($clientEvent["room_id"]);

    return $clientEvent;
  }
}