Packagecom.smartfoxserver.v2.entities.managers
Interfacepublic interface IBuddyManager
Implementors SFSBuddyManager

The IBuddyManager interface defines all the methods and properties exposed by the client-side manager of the SmartFoxServer Buddy List system.

In the SmartFoxServer 2X client API this interface is implemented by the SFSBuddyManager class. Read the class description for additional informations.

See also

SFSBuddyManager


Public Properties
 PropertyDefined By
  buddyList : Array
[read-only] Returns a list of Buddy objects representing all the buddies in the user's buddies list.
IBuddyManager
  buddyStates : Array
[read-only] Returns a list of strings representing the available custom buddy states.
IBuddyManager
  isInited : Boolean
[read-only] Indicates whether the client's Buddy List system is initialized or not.
IBuddyManager
  myNickName : String
[read-only] Returns the current user's nickname (if set).
IBuddyManager
  myOnlineState : Boolean
[read-only] Returns the current user's online/offline state.
IBuddyManager
  myState : String
[read-only] Returns the current user's custom state (if set).
IBuddyManager
  myVariables : Array
[read-only] Returns all the Buddy Variables associated with the current user.
IBuddyManager
  offlineBuddies : Array
[read-only] Returns a list of Buddy objects representing all the offline buddies in the user's buddies list.
IBuddyManager
  onlineBuddies : Array
[read-only] Returns a list of Buddy objects representing all the online buddies in the user's buddies list.
IBuddyManager
Public Methods
 MethodDefined By
  
containsBuddy(name:String):Boolean
Indicates whether a buddy exists in user's buddies list or not.
IBuddyManager
  
Retrieves a Buddy object from its id property.
IBuddyManager
  
getBuddyByName(name:String):Buddy
Retrieves a Buddy object from its name property.
IBuddyManager
  
getBuddyByNickName(nickName:String):Buddy
Retrieves a Buddy object from its nickName property (if set).
IBuddyManager
  
Retrieves a Buddy Variable from its name.
IBuddyManager
Property Detail
buddyListproperty
buddyList:Array  [read-only]

Returns a list of Buddy objects representing all the buddies in the user's buddies list. The list is null if the Buddy List system is not initialized.


Implementation
    public function get buddyList():Array

See also

buddyStatesproperty 
buddyStates:Array  [read-only]

Returns a list of strings representing the available custom buddy states. The custom states are received by the client upon initialization of the Buddy List system. They can be configured by means of the SmartFoxServer 2X Administration Tool.


Implementation
    public function get buddyStates():Array

See also

isInitedproperty 
isInited:Boolean  [read-only]

Indicates whether the client's Buddy List system is initialized or not. If not, an InitBuddyListRequest request should be sent to the server in order to retrieve the persistent Buddy List data.

No Buddy List related operations are allowed until the system is initialized.


Implementation
    public function get isInited():Boolean

See also

myNickNameproperty 
myNickName:String  [read-only]

Returns the current user's nickname (if set). If the nickname was never set before, null is returned.

As the nickname of a user in a buddy list is handled by means of a reserved Buddy Variable (see ReservedBuddyVariables class), it can be set using the SetBuddyVariablesRequest request.


Implementation
    public function get myNickName():String

See also

myOnlineStateproperty 
myOnlineState:Boolean  [read-only]

Returns the current user's online/offline state. If true, the user appears to be online in the buddies list of other users who have him as a buddy.

The online state of a user in a buddy list is handled by means of a reserved Buddy Variable (see ReservedBuddyVariables class); it can be changed using the dedicated GoOnlineRequest request.


Implementation
    public function get myOnlineState():Boolean

See also

myStateproperty 
myState:String  [read-only]

Returns the current user's custom state (if set). Examples of custom states are "Available", "Busy", "Be right back", etc. If the custom state was never set before, null is returned.

As the custom state of a user in a buddy list is handled by means of a reserved Buddy Variable (see ReservedBuddyVariables class), it can be set using the SetBuddyVariablesRequest request.


Implementation
    public function get myState():String

See also

myVariablesproperty 
myVariables:Array  [read-only]

Returns all the Buddy Variables associated with the current user.


Implementation
    public function get myVariables():Array

See also

offlineBuddiesproperty 
offlineBuddies:Array  [read-only]

Returns a list of Buddy objects representing all the offline buddies in the user's buddies list.


Implementation
    public function get offlineBuddies():Array

See also

onlineBuddiesproperty 
onlineBuddies:Array  [read-only]

Returns a list of Buddy objects representing all the online buddies in the user's buddies list.


Implementation
    public function get onlineBuddies():Array

See also

Method Detail
containsBuddy()method
public function containsBuddy(name:String):Boolean

Indicates whether a buddy exists in user's buddies list or not.

Parameters

name:String — The name of the buddy whose presence in the buddies list is to be tested.

Returns
Booleantrue if the specified buddy exists in the buddies list.

See also

getBuddyById()method 
public function getBuddyById(id:int):Buddy

Retrieves a Buddy object from its id property.

Parameters

id:int — The id of the buddy to be found.

Returns
Buddy — The Buddy object representing the buddy, or null if no buddy with the passed id exists in the buddies list.

See also

getBuddyByName()method 
public function getBuddyByName(name:String):Buddy

Retrieves a Buddy object from its name property.

Parameters

name:String — The name of the buddy to be found.

Returns
Buddy — The Buddy object representing the buddy, or null if no buddy with the passed name exists in the buddies list.

See also

getBuddyByNickName()method 
public function getBuddyByNickName(nickName:String):Buddy

Retrieves a Buddy object from its nickName property (if set).

Parameters

nickName:String — The nickName of the buddy to be found.

Returns
Buddy — The Buddy object representing the buddy, or null if no buddy with the passed nickName exists in the buddies list.

See also

getMyVariable()method 
public function getMyVariable(varName:String):BuddyVariable

Retrieves a Buddy Variable from its name.

Parameters

varName:String — The name of the Buddy Variable to be retrieved.

Returns
BuddyVariable — The BuddyVariable object representing the Buddy Variable, or null if no Buddy Variable with the passed name is associated with the current user.

See also