data['payload'] = @unserialize($this->data['payload']); if (!is_array($this->data['payload'])) { $this->data['payload'] = [ ]; } } /** * Returns whether this message already is inside the log. */ public function isInLog(): bool { return $this->time < (TIME_NOW - CHAT_ARCHIVE_AFTER); } /** * Returns the message type object of this message. */ public function getMessageType(): ObjectType { return ObjectTypeCache::getInstance()->getObjectType($this->objectTypeID); } /** * Returns the chat room that contains this message. */ public function getRoom(): Room { return \chat\data\room\RoomCache::getInstance()->getRoom($this->roomID); } }