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

Unbans one or more users that were previously banned from a Room. More...

#include <UnbanUsersFromRoomRequest.h>

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

Public Member Functions

 UnbanUsersFromRoomRequest (std::vector< std::string > userNames, std::shared_ptr< entities::Room > theRoom, std::optional< std::string > message=std::nullopt)
 Creates a new UnbanUsersFromRoomRequest unbanning a group of users.

Detailed Description

Unbans one or more users that were previously banned from a Room.

To be able to unban a user the requester must be the Room's owner, or have Moderator or Administrator privileges. Up to 10 users can be unbanned with a single request.

Users are identified by name rather than by id: a banned user is not in the Room any more, so there is no User object to refer to.

The server does not acknowledge this request: there is no success or error event to listen for. An unban the server refuses (unknown Room, insufficient privileges, more than 10 users) is logged server-side and silently dropped.

See also
BanUsersFromRoomRequest

Constructor & Destructor Documentation

◆ UnbanUsersFromRoomRequest()

sfs3::requests::UnbanUsersFromRoomRequest::UnbanUsersFromRoomRequest ( std::vector< std::string > userNames,
std::shared_ptr< entities::Room > theRoom,
std::optional< std::string > message = std::nullopt )
inline

Creates a new UnbanUsersFromRoomRequest unbanning a group of users.

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

Parameters
userNamesThe names of the users to unban; at most 10. A single user is unbanned by passing a one-element list: { "Kermit" }.
theRoomThe Room the users were banned from.
messageAn optional message sent to the users before they are unbanned; if provided, the unban follows it with a short delay (2-3 seconds).
See also
SmartFox::send

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