Files
nextcloud-spreed/lib/Listener/FeaturePolicyListener.php
Joas Schilling c8c21215af fix: Add Override atttribute
Signed-off-by: Joas Schilling <coding@schilljs.com>
2025-03-25 21:09:46 +01:00

32 lines
762 B
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\Talk\Listener;
use OCP\AppFramework\Http\FeaturePolicy;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
use OCP\Security\FeaturePolicy\AddFeaturePolicyEvent;
/**
* @template-implements IEventListener<Event>
*/
class FeaturePolicyListener implements IEventListener {
#[\Override]
public function handle(Event $event): void {
if (!($event instanceof AddFeaturePolicyEvent)) {
return;
}
$policy = new FeaturePolicy();
$policy->addAllowedCameraDomain('\'self\'');
$policy->addAllowedMicrophoneDomain('\'self\'');
$event->addPolicy($policy);
}
}