SmartFoxServer 3 C++ Client API 3.1.0-beta
Client API for SmartFoxServer 3
Loading...
Searching...
No Matches
sfs3::requests::ChangeRoomPasswordStateRequest Class Reference

Changes the password of a Room. More...

#include <ChangeRoomPasswordStateRequest.h>

Inheritance diagram for sfs3::requests::ChangeRoomPasswordStateRequest:
[legend]

Public Member Functions

 ChangeRoomPasswordStateRequest (std::shared_ptr< entities::Room > room, std::string newPass)
 Creates a new ChangeRoomPasswordStateRequest.

Detailed Description

Changes the password of a Room.

It changes the password of the Room and, with it, the "password state" of the Room, that is, whether the Room is protected by a password or not.

On success a event::SFSEvent::ROOM_PASSWORD_STATE_CHANGE event reaches every user who subscribed the Group of the Room, the requester included. If the user is not the creator (owner) of the Room, a event::SFSEvent::ROOM_PASSWORD_STATE_CHANGE_ERROR event is fired instead. An administrator or a moderator does not have this limit.

If the Room was set up so that the password cannot be changed (see the permissions setting in RoomSettings), the request is dropped and no error is fired.

See also
event::SFSEvent::ROOM_PASSWORD_STATE_CHANGE
event::SFSEvent::ROOM_PASSWORD_STATE_CHANGE_ERROR
RoomSettings::permissions

Constructor & Destructor Documentation

◆ ChangeRoomPasswordStateRequest()

sfs3::requests::ChangeRoomPasswordStateRequest::ChangeRoomPasswordStateRequest ( std::shared_ptr< entities::Room > room,
std::string newPass )
inline

Creates a new ChangeRoomPasswordStateRequest.

Pass it to SmartFox::send for the request to be performed.

Parameters
roomThe Room whose password must change.
newPassThe new password of the Room. Pass an empty string to remove the password.
See also
SmartFox::send

The documentation for this class was generated from the following files:
  • requests/ChangeRoomPasswordStateRequest.h
  • requests/ChangeRoomPasswordStateRequest.cpp