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

Namespace: Sfs2X.Core
Assembly: SmartFox2X (in SmartFox2X.dll) Version: 1.7.3.0 (1.7.3)

Syntax

C#
public static readonly string PRIVATE_MESSAGE

Field Value

Type: String

Remarks

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:

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

Examples

See the PrivateMessageRequest example.

See Also