userId !== null && $this->groupManager->isAdmin($this->userId) && $this->userConfig->getValueInt($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->userConfig->setValueInt($this->userId, 'firstrunwizard', 'apphint', self::APP_HINT_VERSION); } } protected function sendNotification(string $app, string $user): void { $notification = $this->generateNotification($app, $user); if ( $this->userConfig->getValueInt($user, 'firstrunwizard', 'apphint') !== self::APP_HINT_VERSION && $this->notificationManager->getCount($notification) === 0 && !$this->appManager->isEnabledForUser($app) ) { $notification->setDateTime(new \DateTime()); $this->notificationManager->notify($notification); } } public function dismissNotification(string $app): void { $notification = $this->notificationManager->createNotification(); $notification->setApp('firstrunwizard') ->setSubject('apphint-' . $app) ->setObject('app', $app); $this->notificationManager->markProcessed($notification); } protected function generateNotification(string $app, string $user): INotification { $notification = $this->notificationManager->createNotification(); $notification->setApp('firstrunwizard') ->setSubject('apphint-' . $app) ->setObject('app', $app) ->setUser($user); return $notification; } }