Commit 441cebb8 authored by jonaslm's avatar jonaslm
Browse files

Added support for lock settings when creating meetings

parent 8b58303e
......@@ -118,6 +118,41 @@ class CreateMeetingParameters extends MetaParameters
*/
private $muteOnStart;
/**
* @var bool
*/
private $lockSettingsDisableCam = true;
/**
* @var bool
*/
private $lockSettingsDisableMic = true;
/**
* @var bool
*/
private $lockSettingsDisablePrivateChat = true;
/**
* @var bool
*/
private $lockSettingsDisablePublicChat = true;
/**
* @var bool
*/
private $lockSettingsDisableNote = true;
/**
* @var bool
*/
private $lockSettingsLockedLayout = true;
/**
* @var bool
*/
private $lockSettingsLockedOnJoin = true;
/**
* @var array
*/
......@@ -531,6 +566,139 @@ class CreateMeetingParameters extends MetaParameters
return $this;
}
/**
* @return bool
*/
public function isLockSettingsDisableCam()
{
return $this->lockSettingsDisableCam;
}
/**
* @param bool $lockSettingsDisableCam
* @return CreateMeetingParameters
*/
public function setLockSettingsDisableCam($lockSettingsDisableCam)
{
$this->lockSettingsDisableCam = $lockSettingsDisableCam;
return $this;
}
/**
* @return bool
*/
public function isLockSettingsDisableMic()
{
return $this->lockSettingsDisableMic;
}
/**
* @param bool $lockSettingsDisableMic
* @return CreateMeetingParameters
*/
public function setLockSettingsDisableMic($lockSettingsDisableMic)
{
$this->lockSettingsDisableMic = $lockSettingsDisableMic;
return $this;
}
/**
* @return bool
*/
public function isLockSettingsDisablePrivateChat()
{
return $this->lockSettingsDisablePrivateChat;
}
/**
* @param bool $lockSettingsDisablePrivateChat
* @return CreateMeetingParameters
*/
public function setLockSettingsDisablePrivateChat($lockSettingsDisablePrivateChat)
{
$this->lockSettingsDisablePrivateChat = $lockSettingsDisablePrivateChat;
return $this;
}
/**
* @return bool
*/
public function isLockSettingsDisablePublicChat()
{
return $this->lockSettingsDisablePublicChat;
}
/**
* @param bool $lockSettingsDisablePublicChat
* @return CreateMeetingParameters
*/
public function setLockSettingsDisablePublicChat($lockSettingsDisablePublicChat)
{
$this->lockSettingsDisablePublicChat = $lockSettingsDisablePublicChat;
return $this;
}
/**
* @return bool
*/
public function isLockSettingsDisableNote()
{
return $this->lockSettingsDisableNote;
}
/**
* @param bool $lockSettingsDisableNote
* @return CreateMeetingParameters
*/
public function setLockSettingsDisableNote($lockSettingsDisableNote)
{
$this->lockSettingsDisableNote = $lockSettingsDisableNote;
return $this;
}
/**
* @return bool
*/
public function isLockSettingsLockedLayout()
{
return $this->lockSettingsLockedLayout;
}
/**
* @param bool $lockSettingsLockedLayout
* @return CreateMeetingParameters
*/
public function setLockSettingsLockedLayout($lockSettingsLockedLayout)
{
$this->lockSettingsLockedLayout = $lockSettingsLockedLayout;
return $this;
}
/**
* @return bool
*/
public function isLockSettingsLockedOnJoin()
{
return $this->lockSettingsLockedOnJoin;
}
/**
* @param bool $lockedOnJoin
* @return CreateMeetingParameters
*/
public function setLockSettingsLockedOnJoin($lockedOnJoin)
{
$this->lockedOnJoin = $lockedOnJoin;
return $this;
}
/**
* @param $endCallbackUrl
* @return CreateMeetingParameters
......@@ -681,25 +849,32 @@ class CreateMeetingParameters extends MetaParameters
public function getHTTPQuery()
{
$queries = [
'name' => $this->meetingName,
'meetingID' => $this->meetingId,
'attendeePW' => $this->attendeePassword,
'moderatorPW' => $this->moderatorPassword,
'dialNumber' => $this->dialNumber,
'voiceBridge' => $this->voiceBridge,
'webVoice' => $this->webVoice,
'logoutURL' => $this->logoutUrl,
'record' => $this->record ? 'true' : 'false',
'duration' => $this->duration,
'maxParticipants' => $this->maxParticipants,
'autoStartRecording' => $this->autoStartRecording ? 'true' : 'false',
'allowStartStopRecording' => $this->allowStartStopRecording ? 'true' : 'false',
'welcome' => trim($this->welcomeMessage),
'moderatorOnlyMessage' => trim($this->moderatorOnlyMessage),
'webcamsOnlyForModerator' => $this->webcamsOnlyForModerator ? 'true' : 'false',
'logo' => $this->logo,
'copyright' => $this->copyright,
'muteOnStart' => $this->muteOnStart,
'name' => $this->meetingName,
'meetingID' => $this->meetingId,
'attendeePW' => $this->attendeePassword,
'moderatorPW' => $this->moderatorPassword,
'dialNumber' => $this->dialNumber,
'voiceBridge' => $this->voiceBridge,
'webVoice' => $this->webVoice,
'logoutURL' => $this->logoutUrl,
'record' => $this->record ? 'true' : 'false',
'duration' => $this->duration,
'maxParticipants' => $this->maxParticipants,
'autoStartRecording' => $this->autoStartRecording ? 'true' : 'false',
'allowStartStopRecording' => $this->allowStartStopRecording ? 'true' : 'false',
'welcome' => trim($this->welcomeMessage),
'moderatorOnlyMessage' => trim($this->moderatorOnlyMessage),
'webcamsOnlyForModerator' => $this->webcamsOnlyForModerator ? 'true' : 'false',
'logo' => $this->logo,
'copyright' => $this->copyright,
'muteOnStart' => $this->muteOnStart,
'lockSettingsDisableCam' => $this->isLockSettingsDisableCam() ? 'true' : 'false',
'lockSettingsDisableMic' => $this->isLockSettingsDisableMic() ? 'true' : 'false',
'lockSettingsDisablePrivateChat' => $this->isLockSettingsDisablePrivateChat() ? 'true' : 'false',
'lockSettingsDisablePublicChat' => $this->isLockSettingsDisablePublicChat() ? 'true' : 'false',
'lockSettingsDisableNote' => $this->isLockSettingsDisableNote() ? 'true' : 'false',
'lockSettingsLockedLayout' => $this->isLockSettingsLockedLayout() ? 'true' : 'false',
'lockSettingsLockOnJoin' => $this->isLockSettingsLockedOnJoin() ? 'true' : 'false',
];
// Add breakout rooms parameters only if the meeting is a breakout room
......
......@@ -50,6 +50,13 @@ class CreateMeetingParametersTest extends TestCase
$this->assertEquals($params['logo'], $createMeetingParams->getLogo());
$this->assertEquals($params['copyright'], $createMeetingParams->getCopyright());
$this->assertEquals($params['muteOnStart'], $createMeetingParams->isMuteOnStart());
$this->assertEquals($params['lockSettingsDisableCam'], $createMeetingParams->isLockSettingsDisableCam());
$this->assertEquals($params['lockSettingsDisableMic'], $createMeetingParams->isLockSettingsDisableMic());
$this->assertEquals($params['lockSettingsDisablePrivateChat'], $createMeetingParams->isLockSettingsDisablePrivateChat());
$this->assertEquals($params['lockSettingsDisablePublicChat'], $createMeetingParams->isLockSettingsDisablePublicChat());
$this->assertEquals($params['lockSettingsDisableNote'], $createMeetingParams->isLockSettingsDisableNote());
$this->assertEquals($params['lockSettingsLockedLayout'], $createMeetingParams->isLockSettingsLockedLayout());
$this->assertEquals($params['lockSettingsLockedOnJoin'], $createMeetingParams->isLockSettingsLockedOnJoin());
$this->assertEquals($params['meta_presenter'], $createMeetingParams->getMeta('presenter'));
$this->assertEquals($params['meta_endCallbackUrl'], $createMeetingParams->getMeta('endCallbackUrl'));
......
......@@ -67,27 +67,34 @@ class TestCase extends \PHPUnit\Framework\TestCase
protected function generateCreateParams()
{
return [
'meetingName' => $this->faker->name,
'meetingId' => $this->faker->uuid,
'attendeePassword' => $this->faker->password,
'moderatorPassword' => $this->faker->password,
'autoStartRecording' => $this->faker->boolean(50),
'dialNumber' => $this->faker->phoneNumber,
'voiceBridge' => $this->faker->randomNumber(5),
'webVoice' => $this->faker->word,
'logoutUrl' => $this->faker->url,
'maxParticipants' => $this->faker->numberBetween(2, 100),
'record' => $this->faker->boolean(50),
'duration' => $this->faker->numberBetween(0, 6000),
'welcomeMessage' => $this->faker->sentence,
'allowStartStopRecording' => $this->faker->boolean(50),
'moderatorOnlyMessage' => $this->faker->sentence,
'webcamsOnlyForModerator' => $this->faker->boolean(50),
'logo' => $this->faker->imageUrl(330, 70),
'copyright' => $this->faker->text,
'muteOnStart' => $this->faker->boolean(50),
'meta_presenter' => $this->faker->name,
'meta_endCallbackUrl' => $this->faker->url
'meetingName' => $this->faker->name,
'meetingId' => $this->faker->uuid,
'attendeePassword' => $this->faker->password,
'moderatorPassword' => $this->faker->password,
'autoStartRecording' => $this->faker->boolean(50),
'dialNumber' => $this->faker->phoneNumber,
'voiceBridge' => $this->faker->randomNumber(5),
'webVoice' => $this->faker->word,
'logoutUrl' => $this->faker->url,
'maxParticipants' => $this->faker->numberBetween(2, 100),
'record' => $this->faker->boolean(50),
'duration' => $this->faker->numberBetween(0, 6000),
'welcomeMessage' => $this->faker->sentence,
'allowStartStopRecording' => $this->faker->boolean(50),
'moderatorOnlyMessage' => $this->faker->sentence,
'webcamsOnlyForModerator' => $this->faker->boolean(50),
'logo' => $this->faker->imageUrl(330, 70),
'copyright' => $this->faker->text,
'muteOnStart' => $this->faker->boolean(50),
'lockSettingsDisableCam' => $this->faker->boolean(50),
'lockSettingsDisableMic' => $this->faker->boolean(50),
'lockSettingsDisablePrivateChat' => $this->faker->boolean(50),
'lockSettingsDisablePublicChat' => $this->faker->boolean(50),
'lockSettingsDisableNote' => $this->faker->boolean(50),
'lockSettingsLockedLayout' => $this->faker->boolean(50),
'lockSettingsLockedOnJoin' => $this->faker->boolean(50),
'meta_presenter' => $this->faker->name,
'meta_endCallbackUrl' => $this->faker->url
];
}
......@@ -120,7 +127,11 @@ class TestCase extends \PHPUnit\Framework\TestCase
->setDuration($params['duration'])->setWelcomeMessage($params['welcomeMessage'])->setAutoStartRecording($params['autoStartRecording'])
->setAllowStartStopRecording($params['allowStartStopRecording'])->setModeratorOnlyMessage($params['moderatorOnlyMessage'])
->setWebcamsOnlyForModerator($params['webcamsOnlyForModerator'])->setLogo($params['logo'])->setCopyright($params['copyright'])
->setEndCallbackUrl($params['meta_endCallbackUrl'])->setMuteOnStart($params['muteOnStart'])->addMeta('presenter', $params['meta_presenter']);
->setEndCallbackUrl($params['meta_endCallbackUrl'])->setMuteOnStart($params['muteOnStart'])->setLockSettingsDisableCam($params['lockSettingsDisableCam'])
->setLockSettingsDisableMic($params['lockSettingsDisableMic'])->setLockSettingsDisablePrivateChat($params['lockSettingsDisablePrivateChat'])
->setLockSettingsDisablePublicChat($params['lockSettingsDisablePublicChat'])->setLockSettingsDisableNote($params['lockSettingsDisableNote'])
->setLockSettingsLockedLayout($params['lockSettingsLockedLayout'])->setLockSettingsLockedOnJoin($params['lockSettingsLockedOnJoin'])
->addMeta('presenter', $params['meta_presenter']);
}
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment