config = $config; $this->userSession = $userSession; } /** * @inheritDoc */ #[\Override] #[ReturnTypeWillChange] public function jsonSerialize() { $user = $this->userSession->getUser(); if ($user === null) { return []; } $defaultTimezone = $this->config->getAppValue(Application::APP_ID, 'timezone', 'automatic'); $defaultShowTasks = $this->config->getAppValue(Application::APP_ID, 'showTasks', 'yes'); $timezone = $this->config->getUserValue($user->getUID(), Application::APP_ID, 'timezone', $defaultTimezone); $showTasks = $this->config->getUserValue($user->getUID(), Application::APP_ID, 'showTasks', $defaultShowTasks) === 'yes'; return [ 'timezone' => $timezone, 'show_tasks' => $showTasks, ]; } }