mirror of https://github.com/sualko/cloud_bbb
feat: add option for all users to join a meeting muted (#173)
* feat: add option for all users to join a meeting muted * fix: creates new room with joinMuted set to false * fix: creates new column with default value false * fix: typo was corrected * fix: delete composer.phar fix #152pull/178/head
parent
e56cbc8209
commit
3c3a5f7fc0
|
@ -148,6 +148,7 @@ class API {
|
||||||
$createMeetingParams->setRecord($room->record);
|
$createMeetingParams->setRecord($room->record);
|
||||||
$createMeetingParams->setAllowStartStopRecording($room->record);
|
$createMeetingParams->setAllowStartStopRecording($room->record);
|
||||||
$createMeetingParams->setLogoutUrl($this->urlGenerator->getBaseUrl());
|
$createMeetingParams->setLogoutUrl($this->urlGenerator->getBaseUrl());
|
||||||
|
$createMeetingParams->setMuteOnStart($room->getJoinMuted());
|
||||||
|
|
||||||
$mac = $this->crypto->calculateHMAC($room->uid);
|
$mac = $this->crypto->calculateHMAC($room->uid);
|
||||||
|
|
||||||
|
|
|
@ -118,7 +118,8 @@ class RoomController extends Controller {
|
||||||
?string $moderatorToken,
|
?string $moderatorToken,
|
||||||
bool $listenOnly,
|
bool $listenOnly,
|
||||||
bool $mediaCheck,
|
bool $mediaCheck,
|
||||||
bool $cleanLayout
|
bool $cleanLayout,
|
||||||
|
bool $joinMuted
|
||||||
): DataResponse {
|
): DataResponse {
|
||||||
$room = $this->service->find($id);
|
$room = $this->service->find($id);
|
||||||
|
|
||||||
|
@ -141,8 +142,8 @@ class RoomController extends Controller {
|
||||||
return new DataResponse(['message' => 'Access type not allowed.'], Http::STATUS_BAD_REQUEST);
|
return new DataResponse(['message' => 'Access type not allowed.'], Http::STATUS_BAD_REQUEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->handleNotFound(function () use ($id, $name, $welcome, $maxParticipants, $record, $access, $everyoneIsModerator, $requireModerator, $moderatorToken, $listenOnly, $mediaCheck, $cleanLayout) {
|
return $this->handleNotFound(function () use ($id, $name, $welcome, $maxParticipants, $record, $access, $everyoneIsModerator, $requireModerator, $moderatorToken, $listenOnly, $mediaCheck, $cleanLayout, $joinMuted) {
|
||||||
return $this->service->update($id, $name, $welcome, $maxParticipants, $record, $access, $everyoneIsModerator, $requireModerator, $moderatorToken, $listenOnly, $mediaCheck, $cleanLayout);
|
return $this->service->update($id, $name, $welcome, $maxParticipants, $record, $access, $everyoneIsModerator, $requireModerator, $moderatorToken, $listenOnly, $mediaCheck, $cleanLayout, $joinMuted);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@ use OCP\AppFramework\Db\Entity;
|
||||||
* @method bool getListenOnly()
|
* @method bool getListenOnly()
|
||||||
* @method bool getMediaCheck()
|
* @method bool getMediaCheck()
|
||||||
* @method bool getCleanLayout()
|
* @method bool getCleanLayout()
|
||||||
|
* @method bool getJoinMuted()
|
||||||
* @method void setUid(string $uid)
|
* @method void setUid(string $uid)
|
||||||
* @method void setName(string $name)
|
* @method void setName(string $name)
|
||||||
* @method void setAttendeePassword(string $pw)
|
* @method void setAttendeePassword(string $pw)
|
||||||
|
@ -40,6 +41,7 @@ use OCP\AppFramework\Db\Entity;
|
||||||
* @method void setListenOnly(bool $listenOnly)
|
* @method void setListenOnly(bool $listenOnly)
|
||||||
* @method void setMediaCheck(bool $mediaCheck)
|
* @method void setMediaCheck(bool $mediaCheck)
|
||||||
* @method void setCleanLayout(bool $cleanLayout)
|
* @method void setCleanLayout(bool $cleanLayout)
|
||||||
|
* @method void setJoinMuted(bool $joinMuted)
|
||||||
*/
|
*/
|
||||||
class Room extends Entity implements JsonSerializable {
|
class Room extends Entity implements JsonSerializable {
|
||||||
public const ACCESS_PUBLIC = 'public';
|
public const ACCESS_PUBLIC = 'public';
|
||||||
|
@ -67,6 +69,7 @@ class Room extends Entity implements JsonSerializable {
|
||||||
public $listenOnly;
|
public $listenOnly;
|
||||||
public $mediaCheck;
|
public $mediaCheck;
|
||||||
public $cleanLayout;
|
public $cleanLayout;
|
||||||
|
public $joinMuted;
|
||||||
|
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
$this->addType('maxParticipants', 'integer');
|
$this->addType('maxParticipants', 'integer');
|
||||||
|
@ -77,6 +80,7 @@ class Room extends Entity implements JsonSerializable {
|
||||||
$this->addType('listenOnly', 'boolean');
|
$this->addType('listenOnly', 'boolean');
|
||||||
$this->addType('mediaCheck', 'boolean');
|
$this->addType('mediaCheck', 'boolean');
|
||||||
$this->addType('cleanLayout', 'boolean');
|
$this->addType('cleanLayout', 'boolean');
|
||||||
|
$this->addType('joinMuted', 'boolean');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function jsonSerialize(): array {
|
public function jsonSerialize(): array {
|
||||||
|
@ -97,6 +101,7 @@ class Room extends Entity implements JsonSerializable {
|
||||||
'listenOnly' => boolval($this->listenOnly),
|
'listenOnly' => boolval($this->listenOnly),
|
||||||
'mediaCheck' => boolval($this->mediaCheck),
|
'mediaCheck' => boolval($this->mediaCheck),
|
||||||
'cleanLayout' => boolval($this->cleanLayout),
|
'cleanLayout' => boolval($this->cleanLayout),
|
||||||
|
'joinMuted' => boolval($this->joinMuted),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace OCA\BigBlueButton\Migration;
|
||||||
|
|
||||||
|
use Closure;
|
||||||
|
use OCP\DB\ISchemaWrapper;
|
||||||
|
use OCP\Migration\IOutput;
|
||||||
|
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`
|
||||||
|
* @param array $options
|
||||||
|
* @return null|ISchemaWrapper
|
||||||
|
*/
|
||||||
|
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
|
||||||
|
$schema = $schemaClosure();
|
||||||
|
|
||||||
|
if ($schema->hasTable('bbb_rooms')) {
|
||||||
|
$table = $schema->getTable('bbb_rooms');
|
||||||
|
|
||||||
|
if (!$table->hasColumn('join_muted')) {
|
||||||
|
$table->addColumn('join_muted', 'boolean', [
|
||||||
|
'notnull' => false,
|
||||||
|
'default' => false
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $schema;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
|
@ -88,6 +88,7 @@ class RoomService {
|
||||||
$room->setListenOnly(true);
|
$room->setListenOnly(true);
|
||||||
$room->setMediaCheck(true);
|
$room->setMediaCheck(true);
|
||||||
$room->setCleanLayout(false);
|
$room->setCleanLayout(false);
|
||||||
|
$room->setJoinMuted(false);
|
||||||
|
|
||||||
if ($access === Room::ACCESS_PASSWORD) {
|
if ($access === Room::ACCESS_PASSWORD) {
|
||||||
$room->setPassword($this->humanReadableRandom(8));
|
$room->setPassword($this->humanReadableRandom(8));
|
||||||
|
@ -117,7 +118,8 @@ class RoomService {
|
||||||
?string $moderatorToken,
|
?string $moderatorToken,
|
||||||
bool $listenOnly,
|
bool $listenOnly,
|
||||||
bool $mediaCheck,
|
bool $mediaCheck,
|
||||||
bool $cleanLayout) {
|
bool $cleanLayout,
|
||||||
|
bool $joinMuted) {
|
||||||
try {
|
try {
|
||||||
$room = $this->mapper->find($id);
|
$room = $this->mapper->find($id);
|
||||||
|
|
||||||
|
@ -139,6 +141,7 @@ class RoomService {
|
||||||
$room->setListenOnly($listenOnly);
|
$room->setListenOnly($listenOnly);
|
||||||
$room->setMediaCheck($mediaCheck);
|
$room->setMediaCheck($mediaCheck);
|
||||||
$room->setCleanLayout($cleanLayout);
|
$room->setCleanLayout($cleanLayout);
|
||||||
|
$room->setJoinMuted($joinMuted);
|
||||||
|
|
||||||
return $this->mapper->update($room);
|
return $this->mapper->update($room);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
|
|
@ -42,6 +42,7 @@ export interface Room {
|
||||||
listenOnly: boolean,
|
listenOnly: boolean,
|
||||||
mediaCheck: boolean,
|
mediaCheck: boolean,
|
||||||
cleanLayout: boolean,
|
cleanLayout: boolean,
|
||||||
|
joinMuted: boolean,
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RoomShare {
|
export interface RoomShare {
|
||||||
|
|
|
@ -20,6 +20,7 @@ const descriptions: { [key: string]: string } = {
|
||||||
listenOnly: t('bbb', 'If disabled, a microphone is needed to join the conference.'),
|
listenOnly: t('bbb', 'If disabled, a microphone is needed to join the conference.'),
|
||||||
mediaCheck: t('bbb', 'If enabled, the user has not to perform an echo call and webcam preview on the first join (available since BBB server 2.3).'),
|
mediaCheck: t('bbb', 'If enabled, the user has not to perform an echo call and webcam preview on the first join (available since BBB server 2.3).'),
|
||||||
cleanLayout: t('bbb', 'If enabled, the user list, chat area and presentation are hidden by default.'),
|
cleanLayout: t('bbb', 'If enabled, the user list, chat area and presentation are hidden by default.'),
|
||||||
|
joinMuted: t('bbb', 'If enabled, all users will join the meeting muted.'),
|
||||||
};
|
};
|
||||||
|
|
||||||
const LOGO_QR = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOxAAADsQBlSsOGwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAGnSURBVFiF7de9TxRBHMbxzxG5BonRBOGsVRJfIvGFPwFKX0tjJGqsrfwvCC0YtbJSQyT4J0hB1BhtjZFCI4FoqTRCsbO43g24e+5Q3ZNsZm9+z8zzvZns7Rw9/a0jeIx1bNZ8rYe5WzuFt7CSILj9WsFwHtooADzA7XD/DG/CgDrUwHlcDZ/ncLfdtBoCn9cUGtN8yPiWd/QVikOhfZcQ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jq0Ii9+WPyWeFU3K4WHsm2o+7gNTwMX7SnbW0BScCZl0uGVe8AAAAASUVORK5CYII=';
|
||||||
|
@ -214,6 +215,17 @@ const EditRoomDialog: React.FC<Props> = ({ room, restriction, updateProperty, op
|
||||||
</div>
|
</div>
|
||||||
<p><em>{descriptions.cleanLayout}</em></p>
|
<p><em>{descriptions.cleanLayout}</em></p>
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<input id={`bbb-joinMuted-${room.id}`}
|
||||||
|
type="checkbox"
|
||||||
|
className="checkbox"
|
||||||
|
checked={room.joinMuted}
|
||||||
|
onChange={(event) => updateProperty('joinMuted', event.target.checked)} />
|
||||||
|
<label htmlFor={`bbb-joinMuted-${room.id}`}>{t('bbb', 'Join meeting muted')}</label>
|
||||||
|
</div>
|
||||||
|
<p><em>{descriptions.joinMuted}</em></p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue