Click or drag to resize


Dispatched when a private message is received by the current user.

Namespace:  Sfs2X.Core
Assembly:  SmartFox2X (in SmartFox2X.dll) Version: (1.7.11)
public static readonly string PRIVATE_MESSAGE

Field Value

Type: String
This event is caused by a PrivateMessageRequest request sent by any user in the Zone.

The same event is fired by the sender's client too, so that the user is aware that the message was delivered successfully to the recipient, and it can be displayed in the private chat area keeping the correct message ordering. In this case there is no default way to know who the message was originally sent to. As this information can be useful in scenarios where the sender is chatting privately with more than one user at the same time in separate windows or tabs (and we need to write his own message in the proper one), the data parameter can be used to store, for example, the id of the recipient user.

The Params object contains the following parameters:

sender(User) An object representing the user who sent the message.
message(string) The message sent by the user.
data(ISFSObject) An object containing custom parameters which might accompany the message.
See the PrivateMessageRequest example.
See Also