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
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2021-11-19 13:24:37 +0300
committerJoas Schilling <coding@schilljs.com>2022-05-03 10:38:35 +0300
commit3e98f22568711a033ffff208241932db909e24e8 (patch)
treee977250cbb3c9bc19b78fb1cf233c6c0055aeb4e /lib
parent88d32ad044a785bcfc6c01795f55bb2602974259 (diff)
Allow to enable SIP without individual pin requirement
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Controller/RoomController.php4
-rw-r--r--lib/Room.php2
-rw-r--r--lib/Service/ParticipantService.php4
-rw-r--r--lib/Webinary.php1
4 files changed, 6 insertions, 5 deletions
diff --git a/lib/Controller/RoomController.php b/lib/Controller/RoomController.php
index 94e56b157..ec1cb189c 100644
--- a/lib/Controller/RoomController.php
+++ b/lib/Controller/RoomController.php
@@ -476,7 +476,7 @@ class RoomController extends AEnvironmentAwareController {
if ($this->talkConfig->isSIPConfigured()) {
$roomData['sipEnabled'] = $room->getSIPEnabled();
- if ($room->getSIPEnabled() === Webinary::SIP_ENABLED) {
+ if ($room->getSIPEnabled() !== Webinary::SIP_DISABLED) {
// Generate a PIN if the attendee is a user and doesn't have one.
$this->participantService->generatePinForParticipant($room, $currentParticipant);
@@ -973,7 +973,7 @@ class RoomController extends AEnvironmentAwareController {
'attendeePin' => '',
];
if ($this->talkConfig->isSIPConfigured()
- && $this->room->getSIPEnabled() === Webinary::SIP_ENABLED
+ && $this->room->getSIPEnabled() !== Webinary::SIP_DISABLED
&& ($this->participant->hasModeratorPermissions(false)
|| $this->participant->getAttendee()->getId() === $participant->getAttendee()->getId())) {
// Generate a PIN if the attendee is a user and doesn't have one.
diff --git a/lib/Room.php b/lib/Room.php
index 923821324..16ec5cb33 100644
--- a/lib/Room.php
+++ b/lib/Room.php
@@ -974,7 +974,7 @@ class Room {
return false;
}
- if (!in_array($newSipEnabled, [Webinary::SIP_ENABLED, Webinary::SIP_DISABLED], true)) {
+ if (!in_array($newSipEnabled, [Webinary::SIP_ENABLED_NO_PIN, Webinary::SIP_ENABLED, Webinary::SIP_DISABLED], true)) {
return false;
}
diff --git a/lib/Service/ParticipantService.php b/lib/Service/ParticipantService.php
index 045a5f769..acca0a19e 100644
--- a/lib/Service/ParticipantService.php
+++ b/lib/Service/ParticipantService.php
@@ -640,7 +640,7 @@ class ParticipantService {
$attendee->setActorType(Attendee::ACTOR_EMAILS);
$attendee->setActorId($email);
- if ($room->getSIPEnabled() === Webinary::SIP_ENABLED
+ if ($room->getSIPEnabled() !== Webinary::SIP_DISABLED
&& $this->talkConfig->isSIPConfigured()) {
$attendee->setPin($this->generatePin());
}
@@ -658,7 +658,7 @@ class ParticipantService {
public function generatePinForParticipant(Room $room, Participant $participant): void {
$attendee = $participant->getAttendee();
- if ($room->getSIPEnabled() === Webinary::SIP_ENABLED
+ if ($room->getSIPEnabled() !== Webinary::SIP_DISABLED
&& $this->talkConfig->isSIPConfigured()
&& ($attendee->getActorType() === Attendee::ACTOR_USERS || $attendee->getActorType() === Attendee::ACTOR_EMAILS)
&& !$attendee->getPin()) {
diff --git a/lib/Webinary.php b/lib/Webinary.php
index fecbe44fa..51deab6e0 100644
--- a/lib/Webinary.php
+++ b/lib/Webinary.php
@@ -29,4 +29,5 @@ class Webinary {
public const SIP_DISABLED = 0;
public const SIP_ENABLED = 1;
+ public const SIP_ENABLED_NO_PIN = 2;
}