|
SmartFoxServer 3 C++ Client API 3.1.0-beta
Client API for SmartFoxServer 3
|
Sends a message to a buddy in the current user's buddies list. More...
#include <BuddyMessageRequest.h>
Public Member Functions | |
| BuddyMessageRequest (std::string message, const entities::Buddy &targetBuddy, const entities::SFSObject *params=nullptr) | |
| Creates a new BuddyMessageRequest. | |
Sends a message to a buddy in the current user's buddies list.
Messages sent to buddies using the BuddyMessageRequest request are similar to the standard private messages (see the PrivateMessageRequest request) but are specifically designed for the Buddy List system: they don't require any Room parameter, nor they require that users joined a Room. Additionally, buddy messages are subject to specific validation, such as making sure that the recipient is in the sender's buddies list and the sender is not blocked by the recipient.
If the operation is successful, a event::SFSEvent::BUDDY_MESSAGE event is dispatched in both the sender and recipient clients.
NOTE: this request can be sent if the Buddy List system was previously initialized only (see the InitBuddyListRequest request description).
|
inline |
Creates a new BuddyMessageRequest.
Pass it to SmartFox::send for the request to be performed.
| message | The message to be sent to the buddy. |
| targetBuddy | The buddy the message is addressed to; he must be online, or the request is rejected before it leaves the client. |
| params | Additional custom parameters (e.g. the message color, an emoticon id, etc); nullptr if none. Only borrowed: it is copied into the request before SmartFox::send returns. |