updateProperties method

Future<bool> updateProperties({
  1. required String roomID,
  2. required Map<String, String> roomProperties,
  3. bool isForce = false,
  4. bool isDeleteAfterOwnerLeft = false,
  5. bool isUpdateOwner = false,
})

set/update room properties

@param isForce: Whether the operation is mandatory, that is, the property of the room whose owner is another user can be modified. @param isDeleteAfterOwnerLeft: Room attributes are automatically deleted after the owner leaves the room. @param isUpdateOwner: Whether to update the owner of the room attribute involved.

Implementation

Future<bool> updateProperties({
  required String roomID,
  required Map<String, String> roomProperties,
  bool isForce = false,
  bool isDeleteAfterOwnerLeft = false,
  bool isUpdateOwner = false,
}) async {
  if (null == ZegoUIKit().getPlugin(ZegoUIKitPluginType.signaling)) {
    ZegoLoggerService.logInfo(
      'updateProperties, signaling is null',
      tag: 'audio room',
      subTag: 'controller.room',
    );

    return false;
  }

  ZegoLoggerService.logInfo(
    'updateProperties, '
    'roomID:$roomID, '
    'roomProperties:$roomProperties, '
    'isForce:$isForce, '
    'isDeleteAfterOwnerLeft:$isDeleteAfterOwnerLeft, '
    'isUpdateOwner:$isUpdateOwner, ',
    tag: 'audio room',
    subTag: 'controller.room',
  );

  return ZegoUIKit()
      .getSignalingPlugin()
      .updateRoomProperties(
        roomID: roomID,
        roomProperties: roomProperties,
        isForce: isForce,
        isDeleteAfterOwnerLeft: isDeleteAfterOwnerLeft,
        isUpdateOwner: isUpdateOwner,
      )
      .then((result) {
    if (null != result.error) {
      ZegoLoggerService.logInfo(
        'updateProperties, error:$result',
        tag: 'audio room',
        subTag: 'controller.room',
      );

      return false;
    }

    return true;
  });
}