BuddyMessageRequest

Sends a message to a Buddy in the Buddy List of the User.


Messages sent to Buddies using this request are similar to the standard private messages (see the PrivateMessageRequest class), but they are specifically designed for the Buddy List System: they don't require a target Room, nor they require that involved Users are joined in a Room. Additionally, messages to Buddies are subject to specific validation, such as making sure that the recipient is in the sender's Buddy List and that the sender is not blocked by the recipient.

If the operation is successful, a SFSBuddyEvent.BUDDY_MESSAGE event is fired by both the sender and recipient clients.

This request can be sent if the Buddy List System is already initialized (see the InitBuddyListRequest class description).

Constructor

new BuddyMessageRequest(message, targetBuddy, parametersopt)

Creates a new instance of the BuddyMessageRequest class.
Pass the instance to the SmartFox#send method to validate and execute the request.
Parameters:
NameTypeAttributesDefaultDescription
messagestringThe message to be sent to the recipient Buddy.
targetBuddySFSBuddyThe object representing the message recipient Buddy.
parametersSFSObject<optional>
nullAn object containing additional custom parameters to be sent to the message recipient.