new RemoveBuddyRequest(buddyName)

Creates a new RemoveBuddyRequest instance. The instance must be passed to the SmartFox.send() method for the request to be executed.

In order to remove a buddy, the current user must be online in the Buddy List system. If the buddy is removed successfully, the operation is confirmed by a buddyRemove event; otherwise the buddyError event is fired.

NOTE: this request can be sent if the Buddy List system was previously initialized only (see the InitBuddyListRequest request description).

Example

This example sends a request to remove a buddy.

function someMethod()
{
	sfs.addEventListener(SFS2X.SFSBuddyEvent.BUDDY_REMOVE, onBuddyRemoved, this);
	sfs.addEventListener(SFS2X.SFSBuddyEvent.BUDDY_ERROR, onBuddyError, this);

	// Remove Jack from my buddies list
	sfs.send(new SFS2X.Requests.BuddyList.RemoveBuddyRequest("Jack"));
}

function onBuddyRemoved(evtParams)
{
	console.log("This buddy was removed: " + evtParams.buddy.name);
}

function onBuddyError(evtParams)
{
	console.log("The following error occurred while executing a buddy-related request: " + evtParams.errorMessage);
}

Parameter

Name Type Optional Description

buddyName

string

 

The name of the buddy to be removed from the user's buddy list.

See also
SmartFox#send
SFSBuddyEvent.BUDDY_REMOVE
SFSBuddyEvent.BUDDY_ERROR
AddBuddyRequest