Merge branch 'master' into searchProvider

pull/224/head
Klaus 2022-10-26 20:45:23 +02:00 committed by GitHub
commit a21102fa80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
44 changed files with 424 additions and 776 deletions

View File

@ -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

View File

@ -12,12 +12,7 @@ jobs:
strategy:
matrix:
php-versions: ['7.4', '8']
nextcloud-versions: ['stable22', 'stable23', 'stable24']
include:
- php-versions: '7.3'
nextcloud-versions: 'stable22'
- php-versions: '7.3'
nextcloud-versions: 'stable23'
nextcloud-versions: ['stable23', 'stable24', 'stable25']
name: php${{ matrix.php-versions }} on ${{ matrix.nextcloud-versions }} unit tests
env:
CI: true
@ -39,7 +34,7 @@ jobs:
path: nextcloud/apps/bbb
- name: Update test stub
working-directory: nextcloud/apps/bbb
run: composer update friendsofphp/php-cs-fixer christophwurst/nextcloud -W
run: composer update friendsofphp/php-cs-fixer nextcloud/ocp -W
- name: Install dependencies
working-directory: nextcloud/apps/bbb
run: composer install

View File

@ -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
@ -21,7 +21,7 @@ jobs:
- name: Install dependencies
run: composer i
- name: Install dependencies
run: composer require --dev christophwurst/nextcloud:${{ matrix.ocp-version }}
run: composer require --dev nextcloud/ocp:${{ matrix.ocp-version }}
- name: Run coding standards check
run: composer run psalm

1
.gitignore vendored
View File

@ -9,3 +9,4 @@ node_modules/
/archives/
.phpunit.result.cache
.vscode/settings.json
.php-cs-fixer.cache

View File

@ -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.*
]]></description>
<version>2.3.1</version>
<version>2.4.0-alpha</version>
<licence>agpl</licence>
<author mail="klaus@jsxc.org">Klaus Herberth</author>
<namespace>BigBlueButton</namespace>
@ -43,7 +43,7 @@ Developer wanted! If you have time it would be awesome if you could help to enha
<lib>curl</lib>
<lib>mbstring</lib>
<lib>SimpleXML</lib>
<nextcloud min-version="22" max-version="24"/>
<nextcloud min-version="23" max-version="25"/>
</dependencies>
<commands>
<command>OCA\BigBlueButton\Command\ClearAvatarCache</command>

View File

@ -14,10 +14,10 @@
},
"require-dev": {
"phpunit/phpunit": "^8.5 || ^9.3",
"friendsofphp/php-cs-fixer": "^2.16",
"nextcloud/coding-standard": "^0.5.0",
"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": {

997
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -115,7 +115,7 @@ OC.L10N.register(
"admin" : "Administrator",
"Share" : "Teilen",
"Loading" : "Lade",
"You are not allowed to change this option, because this room is shared with you." : "Du kannst diese Einstellung nicht ändern, da dieser Raum mit dir geteilt wurde.",
"You are not allowed to change this option, because this room is shared with you." : "Du bist nicht berechtigt, diese Einstellung zu ändern, da dieser Raum mit dir geteilt wurde.",
"Max. rooms" : "Max. Räume",
"Max. participants" : "Max. Teilnehmer",
"Group …" : "Gruppe …",

View File

@ -113,7 +113,7 @@
"admin" : "Administrator",
"Share" : "Teilen",
"Loading" : "Lade",
"You are not allowed to change this option, because this room is shared with you." : "Du kannst diese Einstellung nicht ändern, da dieser Raum mit dir geteilt wurde.",
"You are not allowed to change this option, because this room is shared with you." : "Du bist nicht berechtigt, diese Einstellung zu ändern, da dieser Raum mit dir geteilt wurde.",
"Max. rooms" : "Max. Räume",
"Max. participants" : "Max. Teilnehmer",
"Group …" : "Gruppe …",

View File

@ -49,7 +49,7 @@ OC.L10N.register(
"Name, group …" : "Nom, groupe, ...",
"Group" : "Groupe",
"Searching" : "Recherche en cours",
"No matches" : "Pas de résultas",
"No matches" : "Pas de résultats",
"Public" : "Publique",
"Internal + Password protection for guests" : "Protection interne + mot de passe pour les invités",
"Internal + Waiting room for guests" : "Interne + Salle d'attente pour les invités",

View File

@ -47,7 +47,7 @@
"Name, group …" : "Nom, groupe, ...",
"Group" : "Groupe",
"Searching" : "Recherche en cours",
"No matches" : "Pas de résultas",
"No matches" : "Pas de résultats",
"Public" : "Publique",
"Internal + Password protection for guests" : "Protection interne + mot de passe pour les invités",
"Internal + Waiting room for guests" : "Interne + Salle d'attente pour les invités",

View File

@ -12,7 +12,6 @@ use OCP\EventDispatcher\IEventListener;
use OCP\IUserSession;
class MeetingListener implements IEventListener {
/** @var IActivityManager */
private $activityManager;

View File

@ -15,7 +15,6 @@ use OCP\IUserManager;
use OCP\L10N\IFactory;
class Provider implements IProvider {
/** @var string */
public const ROOM_CREATED = 'room_created';

View File

@ -10,7 +10,6 @@ use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
class RoomListener implements IEventListener {
/** @var IActivityManager */
private $activityManager;

View File

@ -14,7 +14,6 @@ use OCP\EventDispatcher\IEventListener;
use OCP\IGroupManager;
class RoomShareListener implements IEventListener {
/** @var IActivityManager */
private $activityManager;

View File

@ -17,19 +17,15 @@ use \OCA\BigBlueButton\Middleware\HookMiddleware;
use \OCA\BigBlueButton\Middleware\JoinMiddleware;
use \OCA\BigBlueButton\Search\Provider;
use \OCP\AppFramework\App;
use \OCP\AppFramework\QueryException;
use \OCP\AppFramework\Bootstrap\IBootContext;
use \OCP\AppFramework\Bootstrap\IBootstrap;
use \OCP\AppFramework\Bootstrap\IRegistrationContext;
use \OCP\EventDispatcher\IEventDispatcher;
use \OCP\IConfig;
use \OCP\Settings\IManager as ISettingsManager;
use \OCP\User\Events\UserDeletedEvent;
use \OCP\Util;
if ((@include_once __DIR__ . '/../../vendor/autoload.php') === false) {
throw new \Exception('Cannot include autoload. Did you run install dependencies using composer?');
}
use OCP\AppFramework\Bootstrap\IBootContext;
use OCP\AppFramework\Bootstrap\IBootstrap;
use OCP\AppFramework\Bootstrap\IRegistrationContext;
use OCP\INavigationManager;
use OCP\IURLGenerator;
use OCP\Util;
class Application extends App implements IBootstrap {
public const ID = 'bbb';
@ -37,79 +33,60 @@ class Application extends App implements IBootstrap {
public function __construct(array $urlParams = []) {
parent::__construct(self::ID, $urlParams);
}
$container = $this->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', 'BBB');
$this->registerAsNavigationEntry($name);
} else {
$this->registerAsPersonalSetting();
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?');
}
$context->registerEventListener(RoomCreatedEvent::class, RoomListener::class);
$context->registerEventListener(RoomDeletedEvent::class, RoomListener::class);
$context->registerEventListener(RoomShareCreatedEvent::class, RoomShareListener::class);
$context->registerEventListener(RoomShareDeletedEvent::class, RoomShareListener::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->registerSearchProvider(Provider::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 boot(IBootContext $context): void {}
public function register(IRegistrationContext $context): void {
$context->registerSearchProvider(Provider::class);
public function registerAdminPage(ISettingsManager $settingsManager, INavigationManager $navigationManager, IURLGenerator $urlGenerator, IConfig $config):void {
if ($config->getAppValue(self::ID, 'app.navigation') === 'true') {
$this->registerAsNavigationEntry($navigationManager, $urlGenerator, $config);
} else {
$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' => self::ORDER,
'href' => $server->getURLGenerator()->linkToRoute('bbb.page.index'),
'icon' => $server->getURLGenerator()->imagePath('bbb', 'app.svg'),
'order' => 80,
'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);
}
}

View File

@ -10,7 +10,6 @@ use OCP\BackgroundJob\IJobList;
use OCP\BackgroundJob\TimedJob;
class IsRunningJob extends TimedJob {
/** @var IJobList */
private $jobList;

View File

@ -9,7 +9,7 @@ class Presentation {
public function __construct(string $url, string $filename) {
$this->url = $url;
$this->filename = preg_replace('/[^\x20-\x7E]+/','#', $filename);
$this->filename = preg_replace('/[^\x20-\x7E]+/', '#', $filename);
}
public function getUrl(): string {

View File

@ -8,7 +8,6 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class ClearAvatarCache extends Command {
/**
* @var AvatarRepository
*/

View File

@ -6,7 +6,6 @@ use OCA\BigBlueButton\Db\Room;
use OCP\EventDispatcher\Event;
abstract class RoomEvent extends Event {
/** @var Room */
private $room;

View File

@ -6,7 +6,6 @@ use OCA\BigBlueButton\Db\RoomShare;
use OCP\EventDispatcher\Event;
abstract class RoomShareEvent extends Event {
/** @var RoomShare */
private $roomShare;

View File

@ -10,7 +10,6 @@ use OCP\EventDispatcher\IEventListener;
use OCP\User\Events\UserDeletedEvent;
class UserDeletedListener implements IEventListener {
/** @var IActivityManager */
private $activityManager;

View File

@ -10,7 +10,6 @@ use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
class Version000000Date20200416124731 extends SimpleMigrationStep {
/**
* @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`

View File

@ -10,7 +10,6 @@ use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
class Version000000Date20200613111242 extends SimpleMigrationStep {
/**
* @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`

View File

@ -10,7 +10,6 @@ use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
class Version000000Date20200617055735 extends SimpleMigrationStep {
/**
* @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`

View File

@ -13,7 +13,6 @@ use OCP\Migration\SimpleMigrationStep;
* Auto-generated migration step: Please modify to your needs!
*/
class Version000000Date20200826100844 extends SimpleMigrationStep {
/**
* @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`

View File

@ -13,7 +13,6 @@ use OCP\Migration\SimpleMigrationStep;
* Auto-generated migration step: Please modify to your needs!
*/
class Version000000Date20200829112301 extends SimpleMigrationStep {
/**
* @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`

View File

@ -13,7 +13,6 @@ use OCP\Migration\SimpleMigrationStep;
* Auto-generated migration step: Please modify to your needs!
*/
class Version000000Date20210122164501 extends SimpleMigrationStep {
/**
* @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`

View File

@ -13,7 +13,6 @@ use OCP\Migration\SimpleMigrationStep;
* Auto-generated migration step: Please modify to your needs!
*/
class Version000000Date20210419132000 extends SimpleMigrationStep {
/**
* @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`

View File

@ -13,8 +13,6 @@ use OCP\Migration\SimpleMigrationStep;
* Auto-generated migration step: Please modify to your needs!
*/
class Version000000Date20210729200144 extends SimpleMigrationStep {
/**
* @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`

View File

@ -13,8 +13,6 @@ use OCP\Migration\SimpleMigrationStep;
* Auto-generated migration step: Please modify to your needs!
*/
class Version000000Date20220316151400 extends SimpleMigrationStep {
/**
* @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`

View File

@ -13,8 +13,6 @@ use OCP\Migration\SimpleMigrationStep;
* Auto-generated migration step: Please modify to your needs!
*/
class Version000000Date20220728083700 extends SimpleMigrationStep {
/**
* @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`

View File

@ -13,7 +13,6 @@ use OCP\IGroupManager;
use OCP\IUserManager;
class Permission {
/** @var IUserManager */
private $userManager;

View File

@ -18,7 +18,6 @@ use OCP\Security\ISecureRandom;
use OCP\Search\ISearchQuery;
class RoomService {
/** @var RoomMapper */
private $mapper;
@ -63,9 +62,9 @@ class RoomService {
return $this->mapper->find($id);
// in order to be able to plug in different storage backends like files
// for instance it is a good idea to turn storage related exceptions
// into service related exceptions so controllers and service users
// have to deal with only one type of exception
// for instance it is a good idea to turn storage related exceptions
// into service related exceptions so controllers and service users
// have to deal with only one type of exception
} catch (Exception $e) {
$this->handleException($e);
}

View File

@ -14,7 +14,6 @@ use OCP\AppFramework\Db\MultipleObjectsReturnedException;
use OCP\EventDispatcher\IEventDispatcher;
class RoomShareService {
/** @var RoomShareMapper */
private $mapper;

View File

@ -7,7 +7,6 @@ use OCP\IConfig;
use OCP\Settings\ISettings;
class Admin implements ISettings {
/** @var IConfig */
private $config;

View File

@ -2,7 +2,7 @@
/** @var $_ array */
/** @var $l \OCP\IL10N */
style('core', 'guest');
?>
?>
<div class="update bbb">
<h2><?php p($_['room']) ?></h2>

View File

@ -3,7 +3,7 @@
/** @var $l \OCP\IL10N */
style('core', 'guest');
script('bbb', 'join');
?>
?>
<form method="get" action="?">
<fieldset class="warning bbb">
<h2><?php p($_['room']) ?></h2>

View File

@ -3,7 +3,7 @@
/** @var $l \OCP\IL10N */
style('core', 'guest');
script('bbb', 'waiting');
?>
?>
<div class="update bbb">
<h2><?php p($_['room']); ?></h2>

View File

@ -12,14 +12,6 @@
<code>addServiceListener</code>
</InvalidArgument>
</file>
<file src="lib/BigBlueButton/API.php">
<UndefinedClass occurrences="1">
<code>InsertDocumentParameters</code>
</UndefinedClass>
<UndefinedMethod occurrences="1">
<code>insertDocument</code>
</UndefinedMethod>
</file>
<file src="lib/CircleHelper.php">
<UndefinedClass occurrences="3">
<code>\OCA\Circles\Api\v1\Circles</code>

View File

@ -37,6 +37,7 @@
#bbb-root, #bbb-app {
width: 100%;
background-color: var(--color-main-background);
}
pre {

View File

@ -92,9 +92,6 @@ async function openDialog(fileId: number, filename: string) {
const row = $('<tr>');
const button = $('<button>');
if (!OC.debug) {
button.prop('disabled', room.running);
}
button.text(room.running ? t('bbb', 'Send to') : t('bbb', 'Start with'));
button.addClass(room.running ? 'success' : 'primary');
button.attr('type', 'button');

View File

@ -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"