editRoom method Null safety
Once a room has been created, you can still edit some (but not all) of its properties using the edit request. This allows you to modify the room description, secret, pin and whether it's private or not: you won't be able to modify other more static properties, like the room ID, the sampling rate, the extensions-related stuff and so on. If you're interested in changing the ACL, instead, check the allowed message.
roomId
: unique numeric ID of the room to edit
secret
: room secret, mandatory if configured
newDescription
: new pretty name of the room, optional
newSecret
: new password required to edit/destroy the room, optional
newPin
: new password required to join the room, optional
newIsPrivate
: true|false, whether the room should appear in a list request
permanent
: true|false, whether the room should be also removed from the config file, default=false
Implementation
Future<dynamic> editRoom(String roomId, {String? secret, String? newDescription, String? newSecret, String? newPin, bool? newIsPrivate, bool? permanent}) async {
var payload = {
"request": "edit",
"room": roomId,
"secret": secret,
"new_description": newDescription,
"new_secret": newSecret,
"new_pin": newPin,
"new_is_private": newIsPrivate,
"permanent": permanent
}..removeWhere((key, value) => value == null);
_handleRoomIdTypeDifference(payload);
JanusEvent response = JanusEvent.fromJson(await this.send(data: payload));
JanusError.throwErrorFromEvent(response);
return AudioRoomCreatedResponse.fromJson(response.plugindata?.data);
}