|
SmartFoxServer 3 C++ Client API 3.1.0-beta
Client API for SmartFoxServer 3
|
Replies to an invitation received by the current user. More...
#include <InvitationReplyRequest.h>
Public Member Functions | |
| InvitationReplyRequest (const entities::Invitation &invitation, entities::InvitationReply invitationReply, std::shared_ptr< entities::SFSObject > params=nullptr) | |
| Creates a new InvitationReplyRequest. | |
Replies to an invitation received by the current user.
Users who receive an invitation sent by means of the InviteUsersRequest or the JoinRoomInvitationRequest request can either accept or refuse it using this request. The reply causes an event::SFSEvent::INVITATION_REPLY event to be dispatched to the inviter; if a reply is not sent, or it is sent after the invitation expiration, the system reacts as if the invitation was refused.
If an error occurs while the reply is delivered to the inviter (for example the invitation is already expired), an event::SFSEvent::INVITATION_REPLY_ERROR event is returned to the current user.
void onInvitation(const event::ApiEvent& evt) { const auto& e = static_cast<const event::Invitation&>(evt); sfs.send(requests::inv::InvitationReplyRequest(*e.invitation, entities::InvitationReply::ACCEPT)); }
|
inline |
Creates a new InvitationReplyRequest.
Pass it to SmartFox::send for the request to be performed.
| invitation | the invitation to reply to, as carried by the event::SFSEvent::INVITATION event |
| invitationReply | the answer to be sent to the inviter |
| params | the custom parameters to be returned to the inviter together with the reply (for example a message describing the reason of a refusal); optional |