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

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.

Detailed Description

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).

See also
event::SFSEvent::BUDDY_MESSAGE
requests::PrivateMessageRequest

Constructor & Destructor Documentation

◆ BuddyMessageRequest()

sfs3::requests::buddy::BuddyMessageRequest::BuddyMessageRequest ( std::string message,
const entities::Buddy & targetBuddy,
const entities::SFSObject * params = nullptr )
inline

Creates a new BuddyMessageRequest.

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

Parameters
messageThe message to be sent to the buddy.
targetBuddyThe buddy the message is addressed to; he must be online, or the request is rejected before it leaves the client.
paramsAdditional 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.
See also
SmartFox::send
entities::SFSObject

The documentation for this class was generated from the following file:
  • requests/buddylist/BuddyMessageRequest.h