diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ce3478e..2f0f35b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-versions: [7.2, 7.3, 7.4, 8.0] + php-versions: [7.3, 7.4, 8.0] name: php${{ matrix.php-versions }} lint steps: - name: Checkout diff --git a/.github/workflows/php-test.yml b/.github/workflows/php-test.yml index e28b913..e1849ed 100644 --- a/.github/workflows/php-test.yml +++ b/.github/workflows/php-test.yml @@ -12,10 +12,8 @@ jobs: strategy: matrix: php-versions: ['7.4', '8'] - nextcloud-versions: ['stable22', 'stable23', 'stable24'] + nextcloud-versions: ['stable23', 'stable24', 'stable25'] include: - - php-versions: '7.3' - nextcloud-versions: 'stable22' - php-versions: '7.3' nextcloud-versions: 'stable23' name: php${{ matrix.php-versions }} on ${{ matrix.nextcloud-versions }} unit tests diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 9505423..3220eaf 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -6,7 +6,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ocp-version: [ 'dev-stable24', 'dev-stable23', 'dev-stable22' ] + ocp-version: [ 'dev-stable25', 'dev-stable24', 'dev-stable23' ] name: Nextcloud ${{ matrix.ocp-version }} steps: - name: Checkout diff --git a/appinfo/app.php b/appinfo/app.php deleted file mode 100644 index 5d929ce..0000000 --- a/appinfo/app.php +++ /dev/null @@ -1,5 +0,0 @@ -query(\OCA\BigBlueButton\AppInfo\Application::class); diff --git a/appinfo/info.xml b/appinfo/info.xml index 199667f..78d1ab1 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -22,7 +22,7 @@ Developer wanted! If you have time it would be awesome if you could help to enha *This app integrates BigBlueButton and is not endorsed or certified by BigBlueButton Inc. BigBlueButton and the BigBlueButton Logo are trademarks of BigBlueButton Inc.* ]]> - 2.3.1 + 2.4.0-alpha agpl Klaus Herberth BigBlueButton @@ -43,7 +43,7 @@ Developer wanted! If you have time it would be awesome if you could help to enha curl mbstring SimpleXML - + OCA\BigBlueButton\Command\ClearAvatarCache diff --git a/composer.json b/composer.json index 1a5a73c..7ec05e8 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "friendsofphp/php-cs-fixer": "^3", "nextcloud/coding-standard": "^1.0.0", "phpstan/phpstan": "^0.12.29", - "christophwurst/nextcloud": "^22.0 || ^23.0 || ^24.0", + "nextcloud/ocp": "^23.0 || ^24.0 || ^25.0", "vimeo/psalm": "^4.5" }, "config": { diff --git a/composer.lock b/composer.lock index d71aad8..c9aa7b9 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c3cf83d2a7bace847b7ab01cc4a3f679", + "content-hash": "434f3b95fbfba97b03d130cd3fb92140", "packages": [ { "name": "littleredbutton/bigbluebutton-api-php", @@ -301,50 +301,6 @@ ], "time": "2021-03-30T17:13:30+00:00" }, - { - "name": "christophwurst/nextcloud", - "version": "v24.0.1", - "source": { - "type": "git", - "url": "https://github.com/ChristophWurst/nextcloud_composer.git", - "reference": "f032acdff1502a7323f95a6524d163290f43b446" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ChristophWurst/nextcloud_composer/zipball/f032acdff1502a7323f95a6524d163290f43b446", - "reference": "f032acdff1502a7323f95a6524d163290f43b446", - "shasum": "" - }, - "require": { - "php": "^7.4 || ~8.0 || ~8.1", - "psr/container": "^1.1.1", - "psr/event-dispatcher": "^1.0", - "psr/log": "^1.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "24.0.0-dev" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "AGPL-3.0-or-later" - ], - "authors": [ - { - "name": "Christoph Wurst", - "email": "christoph@winzerhof-wurst.at" - } - ], - "description": "Composer package containing Nextcloud's public API (classes, interfaces)", - "support": { - "issues": "https://github.com/ChristophWurst/nextcloud_composer/issues", - "source": "https://github.com/ChristophWurst/nextcloud_composer/tree/v24.0.1" - }, - "abandoned": "nextcloud/ocp", - "time": "2022-06-02T14:16:47+00:00" - }, { "name": "composer/package-versions-deprecated", "version": "1.11.99.5", @@ -1233,6 +1189,48 @@ }, "time": "2021-11-10T08:44:10+00:00" }, + { + "name": "nextcloud/ocp", + "version": "v24.0.1", + "source": { + "type": "git", + "url": "https://github.com/nextcloud-deps/ocp.git", + "reference": "f032acdff1502a7323f95a6524d163290f43b446" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/f032acdff1502a7323f95a6524d163290f43b446", + "reference": "f032acdff1502a7323f95a6524d163290f43b446", + "shasum": "" + }, + "require": { + "php": "^7.4 || ~8.0 || ~8.1", + "psr/container": "^1.1.1", + "psr/event-dispatcher": "^1.0", + "psr/log": "^1.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "24.0.0-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "AGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Christoph Wurst", + "email": "christoph@winzerhof-wurst.at" + } + ], + "description": "Composer package containing Nextcloud's public API (classes, interfaces)", + "support": { + "source": "https://github.com/nextcloud-deps/ocp/tree/v24.0.1" + }, + "time": "2022-06-02T14:16:47+00:00" + }, { "name": "nikic/php-parser", "version": "v4.15.1", diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 0b65fae..4c4a6dd 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -16,86 +16,73 @@ use \OCA\BigBlueButton\Listener\UserDeletedListener; use \OCA\BigBlueButton\Middleware\HookMiddleware; use \OCA\BigBlueButton\Middleware\JoinMiddleware; use \OCP\AppFramework\App; -use \OCP\AppFramework\QueryException; -use \OCP\EventDispatcher\IEventDispatcher; use \OCP\IConfig; use \OCP\Settings\IManager as ISettingsManager; use \OCP\User\Events\UserDeletedEvent; +use OCP\AppFramework\Bootstrap\IBootContext; +use OCP\AppFramework\Bootstrap\IBootstrap; +use OCP\AppFramework\Bootstrap\IRegistrationContext; +use OCP\INavigationManager; +use OCP\IURLGenerator; +use OCP\Util; -if ((@include_once __DIR__ . '/../../vendor/autoload.php') === false) { - throw new \Exception('Cannot include autoload. Did you run install dependencies using composer?'); -} - -class Application extends App { +class Application extends App implements IBootstrap { public const ID = 'bbb'; public function __construct(array $urlParams = []) { parent::__construct(self::ID, $urlParams); + } - $container = $this->getContainer(); + public function register(IRegistrationContext $context): void { + if ((@include_once __DIR__ . '/../../vendor/autoload.php') === false) { + throw new \Exception('Cannot include autoload. Did you run install dependencies using composer?'); + } - /* @var IEventDispatcher $dispatcher */ - $dispatcher = $container->query(IEventDispatcher::class); - $this->registerServiceListener($dispatcher); + $context->registerEventListener(RoomCreatedEvent::class, RoomListener::class); + $context->registerEventListener(RoomDeletedEvent::class, RoomListener::class); - $container->registerMiddleWare(JoinMiddleware::class); - $container->registerMiddleWare(HookMiddleware::class); + $context->registerEventListener(RoomShareCreatedEvent::class, RoomShareListener::class); + $context->registerEventListener(RoomShareDeletedEvent::class, RoomShareListener::class); - $config = $container->query(IConfig::class); + $context->registerEventListener(MeetingStartedEvent::class, MeetingListener::class); + $context->registerEventListener(MeetingEndedEvent::class, MeetingListener::class); + $context->registerEventListener(RecordingReadyEvent::class, MeetingListener::class); + $context->registerEventListener(UserDeletedEvent::class, UserDeletedListener::class); + + $context->registerMiddleware(JoinMiddleware::class); + $context->registerMiddleware(HookMiddleware::class); + } + + public function boot(IBootContext $context): void { + $context->injectFn([$this, 'registerAdminPage']); + + Util::addScript('bbb', 'filelist'); + } + + public function registerAdminPage(ISettingsManager $settingsManager, INavigationManager $navigationManager, IURLGenerator $urlGenerator, IConfig $config):void { if ($config->getAppValue(self::ID, 'app.navigation') === 'true') { - $name = $config->getAppValue(self::ID, 'app.navigation.name', 'BBB'); - - $this->registerAsNavigationEntry($name); + $this->registerAsNavigationEntry($navigationManager, $urlGenerator, $config); } else { - $this->registerAsPersonalSetting(); + $this->registerAsPersonalSetting($settingsManager); } } - private function registerAsPersonalSetting(): void { - try { - /** @var ISettingsManager */ - $settingsManager = $this->getContainer()->query(ISettingsManager::class); - } catch (QueryException $exception) { - // Workaround for Nextcloud 19 - $server = $this->getContainer()->getServer(); - - if (method_exists($server, 'getSettingsManager')) { - $settingsManager = $server->getSettingsManager(); - } else { - return; - } - } - - + private function registerAsPersonalSetting(ISettingsManager $settingsManager): void { $settingsManager->registerSetting(ISettingsManager::KEY_PERSONAL_SETTINGS, \OCA\BigBlueButton\Settings\Personal::class); } - private function registerAsNavigationEntry(string $name): void { - $server = $this->getContainer()->getServer(); + private function registerAsNavigationEntry(INavigationManager $navigationManager, IURLGenerator $urlGenerator, IConfig $config): void { + $name = $config->getAppValue(self::ID, 'app.navigation.name', 'BBB'); - $server->getNavigationManager()->add(function () use ($server, $name) { + $navigationManager->add(function () use ($urlGenerator, $name) { return [ 'id' => self::ID, 'order' => 80, - 'href' => $server->getURLGenerator()->linkToRoute('bbb.page.index'), - 'icon' => $server->getURLGenerator()->imagePath('bbb', 'app.svg'), + 'href' => $urlGenerator->linkToRoute('bbb.page.index'), + 'icon' => $urlGenerator->imagePath('bbb', 'app.svg'), 'name' => $name, ]; }); } - - private function registerServiceListener(IEventDispatcher $dispatcher): void { - $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); - } } diff --git a/ts/Manager/App.scss b/ts/Manager/App.scss index 7b1f295..38e8d9d 100644 --- a/ts/Manager/App.scss +++ b/ts/Manager/App.scss @@ -37,6 +37,7 @@ #bbb-root, #bbb-app { width: 100%; + background-color: var(--color-main-background); } pre { diff --git a/yarn.lock b/yarn.lock index 2590137..b770322 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2483,9 +2483,9 @@ camelcase@^5.3.1: integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== caniuse-lite@^1.0.30001317: - version "1.0.30001317" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001317.tgz#0548fb28fd5bc259a70b8c1ffdbe598037666a1b" - integrity sha512-xIZLh8gBm4dqNX0gkzrBeyI86J2eCjWzYAs40q88smG844YIrN4tVQl/RhquHvKEKImWWFIVh1Lxe5n1G/N+GQ== + version "1.0.30001425" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001425.tgz" + integrity sha512-/pzFv0OmNG6W0ym80P3NtapU0QEiDS3VuYAZMGoLLqiC7f6FJFe1MjpQDREGApeenD9wloeytmVDj+JLXPC6qw== caseless@~0.12.0: version "0.12.0"