ChangeRoomPasswordStateRequest

Changes the password of a Room.


This request not only changes the password of a Room, but it also updates its password state, which indicates whether the Room is password protected or not.

If the operation is successful, the SFSEvent.ROOM_NAME_CHANGE event is dispatched to all the Users which subscribed the Group to which the target Room belongs including the requester User itself. If the User is not the creator (owner) of the Room, the SFSEvent.ROOM_PASSWORD_STATE_CHANGE_ERROR event is fired. An administrator or moderator can override this constrain (doesn't need to be the Room's owner).

If the Room is configured so that password change is not allowed (see the RoomSettings#permissions parameter), the request is ignored and no error is fired.

Constructor

new ChangeRoomPasswordStateRequest(room, newPassword)

Creates a new instance of the ChangeRoomPasswordStateRequest class.
Pass the instance to the SmartFox#send method to validate and execute the request.
Parameters:
NameTypeDescription
roomSFSRoomThe object representing the Room whose password should be changed.
newPasswordstringThe new password of the Room; an empty string can be passed to remove the Room's password.