|
SmartFoxServer 3 C++ Client API 3.1.0-beta
Client API for SmartFoxServer 3
|
Sends a private chat message. More...
#include <PrivateMessageRequest.h>
Public Member Functions | |
| PrivateMessageRequest (std::string message, int32_t recipientId, const entities::SFSObject *params=nullptr) | |
| Creates a new PrivateMessageRequest. | |
Sends a private chat message.
The private message is dispatched to a specific User, in any server Room, or even in no Room at all. The message is delivered by means of the event::SFSEvent::PRIVATE_MESSAGE event. It is also returned to the sender: this allows showing the messages in the correct order in the application interface. It is also possible to send an optional object together with the message: it can contain custom parameters useful to transmit, for example, additional data, like text font or color etc.
sfs.send(requests::PrivateMessageRequest { "Hi there!", user->getId() });
|
inline |
Creates a new PrivateMessageRequest.
Pass it to SmartFox::send for the request to be performed.
| message | The message to be sent to the recipient user. |
| recipientId | The id of the user to which the message is to be sent. |
| params | Additional custom parameters to be sent to the message recipient (for example the color of the text, etc); nullptr if none. Only borrowed: it is copied into the request before SmartFox::send returns. |