Class SFSBuddyEvent
The SFSBuddyEvent parent class provides a public property called params containing different values depending on the event type.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDispatched when a buddy is added successfully to the user's buddies list.static final StringDispatched when a buddy is blocked or unblocked by the current user.static final StringDispatched if an error occurs while executing a request related to the Buddy List system.static final StringDispatched if the Buddy List system is successfully initialized.static final StringDispatched when a message from a buddy is received by the current user.static final StringDispatched when a buddy in the current user's buddy list changes its online state.static final StringDispatched when a buddy is removed successfully from theuser's buddies list.static final StringDispatched when a buddy (in the current buddy list) updates one or more Buddy Variables. -
Constructor Summary
ConstructorsConstructorDescriptionSFSBuddyEvent(String type) SFSBuddyEvent(String type, Map<String, Object> args) Creates a new SFSBuddyEvent instance. -
Method Summary
-
Field Details
-
BUDDY_LIST_INIT
Dispatched if the Buddy List system is successfully initialized. This event is fired in response to the InitBuddyListRequest request, when successful.
After the Buddy List system initialization, the user returns to its previous custom state (if any - see IBuddyManager.myState property). The online/offline state, nickname and persistent Buddy Variables are all loaded in the system. In particular, the online state (see IBuddyManager.myOnlineState property) determines if the user appears online or not to other users.
The properties of the arguments object contained in the event object have the following values:
Property Type Description buddyList List<Buddy> A list of Buddy objects representing all the buddies in the current user's buddies list. myVariables List<BuddyVariable> A list of all the Buddy Variables associated with the current user. - See Also:
-
BUDDY_ADD
Dispatched when a buddy is added successfully to the user's buddies list. This event is fired in response to the AddBuddyRequest request.
The properties of the arguments object contained in the event object have the following values:
Property Type Description buddy Buddy The Buddy object corresponding to the buddy that was added. - See Also:
-
BUDDY_REMOVE
Dispatched when a buddy is removed successfully from theuser's buddies list. This event is fired in response to the RemoveBuddyRequest request.
The properties of the arguments object contained in the event object have the following values:
Property Type Description buddy Buddy The Buddy object corresponding to the buddy that was removed. - See Also:
-
BUDDY_BLOCK
Dispatched when a buddy is blocked or unblocked by the current user. This event is fired in response to the BlockBuddyRequest request.
The properties of the arguments object contained in the event object have the following values:
Property Type Description buddy Buddy The Buddy object corresponding to the buddy that was blocked/unblocked. - See Also:
-
BUDDY_ERROR
Dispatched if an error occurs while executing a request related to the Buddy List system. For example, this event is fired in response to a AddBuddyRequest request, the BlockBuddyRequest, in case they don't succeed.
The properties of the arguments object contained in the event object have the following values:
Property Type Description errorMessage String The message which describes the error. errorCode short The error code. - See Also:
-
BUDDY_ONLINE_STATE_CHANGE
Dispatched when a buddy in the current user's buddy list changes its online state. This event is fired in response to the GoOnlineRequest request.
NOTE: this event is dispatched to those who have the user as buddy, but also to the user itself. If the latter, the value of the buddy parameter is
null, the isItMe parameter should be used to check if the current user was the request sender.The properties of the arguments object contained in the event object have the following values:
Property Type Description buddy Buddy The Buddy the buddy who changed the online state. isItMe Boolean trueif the online state was changed by the current user- See Also:
-
BUDDY_VARIABLES_UPDATE
Dispatched when a buddy (in the current buddy list) updates one or more Buddy Variables. This event is fired in response to the SetBuddyVariablesRequest request.
The properties of the arguments object contained in the event object have the following values:
Property Type Description buddy Buddy The Buddy the buddy who updated the Variables. isItMe Boolean trueif the Buddy Variables were updated by the current user itselfchangedVars List<BuddyVariable> The list of Buddy Variable names that were created or changed. - See Also:
-
BUDDY_MESSAGE
Dispatched when a message from a buddy is received by the current user. This event is fired in response to the BuddyMessageRequest request.
The properties of the arguments object contained in the event object have the following values:
Property Type Description buddy Buddy The Buddy that sent the message. isItMe Boolean trueif the message sender is the current user.message String The message text data ISFSObject Extra custom parameters, may be null - See Also:
-
-
Constructor Details
-
SFSBuddyEvent
Creates a new SFSBuddyEvent instance.- Parameters:
type- The type of event.args- An object containing the parameters of the event.
-
SFSBuddyEvent
-