getContainer(); /* @var IEventDispatcher $dispatcher */ $dispatcher = $container->query(IEventDispatcher::class); $this->registerServiceListener($dispatcher); $container->registerMiddleWare(JoinMiddleware::class); $container->registerMiddleWare(HookMiddleware::class); $config = $container->query(IConfig::class); if ($config->getAppValue(self::ID, 'app.navigation') === 'true') { $name = $config->getAppValue(self::ID, 'app.navigation.name', 'BigBlueButton'); $this->registerAsNavigationEntry($name); } else { $this->registerAsPersonalSetting(); } } private function registerAsPersonalSetting() { /** @var ISettingsManager */ $settingsManager = $this->getContainer()->query(ISettingsManager::class); $settingsManager->registerSetting(ISettingsManager::KEY_PERSONAL_SETTINGS, \OCA\BigBlueButton\Settings\Personal::class); } private function registerAsNavigationEntry(string $name) { $server = $this->getContainer()->getServer(); $server->getNavigationManager()->add(function () use ($server, $name) { return [ 'id' => self::ID, 'order' => 80, 'href' => $server->getURLGenerator()->linkToRoute('bbb.page.index'), 'icon' => $server->getURLGenerator()->imagePath('bbb', 'app.svg'), 'name' => $name, ]; }); } private function registerServiceListener(IEventDispatcher $dispatcher) { $dispatcher->addServiceListener(RoomCreatedEvent::class, RoomListener::class); $dispatcher->addServiceListener(RoomDeletedEvent::class, RoomListener::class); $dispatcher->addServiceListener(RoomShareCreatedEvent::class, RoomShareListener::class); $dispatcher->addServiceListener(RoomShareDeletedEvent::class, RoomShareListener::class); $dispatcher->addServiceListener(MeetingStartedEvent::class, MeetingListener::class); $dispatcher->addServiceListener(MeetingEndedEvent::class, MeetingListener::class); $dispatcher->addServiceListener(RecordingReadyEvent::class, MeetingListener::class); $dispatcher->addServiceListener(UserDeletedEvent::class, UserDeletedListener::class); } }