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

Replies to an invitation received by the current user. More...

#include <InvitationReplyRequest.h>

Inheritance diagram for sfs3::requests::inv::InvitationReplyRequest:
[legend]

Public Member Functions

 InvitationReplyRequest (const entities::Invitation &invitation, entities::InvitationReply invitationReply, std::shared_ptr< entities::SFSObject > params=nullptr)
 Creates a new InvitationReplyRequest.

Detailed Description

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));
}
See also
event::SFSEvent::INVITATION_REPLY
event::SFSEvent::INVITATION_REPLY_ERROR
InviteUsersRequest

Constructor & Destructor Documentation

◆ InvitationReplyRequest()

sfs3::requests::inv::InvitationReplyRequest::InvitationReplyRequest ( const entities::Invitation & invitation,
entities::InvitationReply invitationReply,
std::shared_ptr< entities::SFSObject > params = nullptr )
inline

Creates a new InvitationReplyRequest.

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

Parameters
invitationthe invitation to reply to, as carried by the event::SFSEvent::INVITATION event
invitationReplythe answer to be sent to the inviter
paramsthe custom parameters to be returned to the inviter together with the reply (for example a message describing the reason of a refusal); optional
See also
SmartFox::send
entities::InvitationReply

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