room = $room; } /** * @inheritDoc */ public function jsonSerialize() { $link = LinkHandler::getInstance()->getControllerLink( LogPage::class, [ 'messageid' => $this->messageID, 'object' => $this->room, ] ); if ($this->isDeleted) { $payload = false; $objectType = 'be.bastelstu.chat.messageType.tombstone'; } else { $payload = $this->getMessageType()->getProcessor()->getPayload($this->getDecoratedObject()); $objectType = $this->getMessageType()->objectType; } return [ 'messageID' => $this->messageID, 'userID' => $this->userID, 'username' => $this->username, 'time' => $this->time, 'payload' => $payload, 'objectType' => $objectType, 'link' => $link, 'isIgnored' => WCF::getUserProfileHandler()->isIgnoredUser($this->userID), 'isDeleted' => (bool)$this->isDeleted, ]; } }