userId !== null && $this->groupManager->isAdmin($this->userId) && $this->config->getUserValue($this->userId, 'firstrunwizard', 'apphint') !== self::APP_HINT_VERSION ) { $this->sendNotification('recognize', $this->userId); $this->sendNotification('groupfolders', $this->userId); $this->sendNotification('forms', $this->userId); $this->sendNotification('deck', $this->userId); $this->sendNotification('tasks', $this->userId); $this->sendNotification('whiteboard', $this->userId); $this->config->setUserValue($this->userId, 'firstrunwizard', 'apphint', self::APP_HINT_VERSION); } } protected function sendNotification(string $app, string $user): void { $notification = $this->generateNotification($app, $user); if ( $this->config->getUserValue($this->userId, 'firstrunwizard', 'apphint') !== self::APP_HINT_VERSION && $this->notificationManager->getCount($notification) === 0 && !$this->appManager->isEnabledForUser($app) ) { $notification->setDateTime(new \DateTime()); $this->notificationManager->notify($notification); } if ($this->notificationManager->getCount($notification) === 0) { return; } } public function dismissNotification(string $app) { $notification = $this->notificationManager->createNotification(); $notification->setApp('firstrunwizard') ->setSubject('apphint-' . $app) ->setObject('app', $app); $this->notificationManager->markProcessed($notification); } protected function generateNotification(string $app, string $user) { $notification = $this->notificationManager->createNotification(); $notification->setApp('firstrunwizard') ->setSubject('apphint-' . $app) ->setObject('app', $app) ->setUser($user); return $notification; } }