Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Listener/RestrictStartingCalls.php')
-rw-r--r--lib/Listener/RestrictStartingCalls.php12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/Listener/RestrictStartingCalls.php b/lib/Listener/RestrictStartingCalls.php
index ed041ef0c..59e95639c 100644
--- a/lib/Listener/RestrictStartingCalls.php
+++ b/lib/Listener/RestrictStartingCalls.php
@@ -42,18 +42,16 @@ class RestrictStartingCalls {
}
public static function register(IEventDispatcher $dispatcher): void {
- $dispatcher->addListener(Room::EVENT_BEFORE_SESSION_JOIN_CALL, static function (ModifyParticipantEvent $event) {
- /** @var self $listener */
- $listener = \OC::$server->get(self::class);
- $listener->checkStartCallPermissions($event);
- }, 1000);
+ $dispatcher->addListener(Room::EVENT_BEFORE_SESSION_JOIN_CALL, [self::class, 'checkStartCallPermissions'], 1000);
}
/**
* @param ModifyParticipantEvent $event
* @throws ForbiddenException
*/
- public function checkStartCallPermissions(ModifyParticipantEvent $event): void {
+ public static function checkStartCallPermissions(ModifyParticipantEvent $event): void {
+ /** @var self $listener */
+ $listener = \OC::$server->get(self::class);
$room = $event->getRoom();
$participant = $event->getParticipant();
@@ -63,7 +61,7 @@ class RestrictStartingCalls {
return;
}
- if (!$participant->canStartCall($this->config) && !$this->participantService->hasActiveSessionsInCall($room)) {
+ if (!$participant->canStartCall($listener->config) && !$listener->participantService->hasActiveSessionsInCall($room)) {
throw new ForbiddenException('Can not start a call');
}
}