SFSBuddy Class Reference
| Inherits from | NSObject |
| Conforms to | Buddy |
| Declared in | SFSBuddy.h SFSBuddy.m |
Overview
The SFSBuddy class represent a Buddy in the User’s Buddy List.
Each Buddy has several properties:
- name: the name of the Buddy, corresponds to the User name
- nickname: an optional nickname (default = null)
- isOnline: whether the Buddy is online in the Buddy system or not
- state: a string representing a “state message”, such as: Available, Busy…
- isBlocked: whether the Buddy is blocked in the User Buddy List
- isTemp: a temporary Buddy is not stored in the Buddy List, it will be removed at the end of the session (see below)
- variables: the Buddy variables which can be transient or persistent (see below)
Online State
Any user can decide if they want to be online/off-line as Buddy in the Buddy system. By default a User is online
every time he joins the Zone, but the User can also turn off this flag at runtime and disappear from other User’s buddy lists.
The Online State is persistent and based on a reserved Buddy Variable.
Blocked Buddies
Buddies that are blocked won’t be able to send any messages to the User, also they won’t be able to see if the Buddy is online/off-line.
Buddy State message
The state message represents a typical IM Buddy state such as Available, Busy etc…
By default the system already provides 3 default states: Available, Away, Occupied which can be changed or enriched at any time
The state message is based on a reserved Buddy Variable.
Temp Buddy
A temporary Buddy is added to the User List when another User adds me to his Buddy List.
This way we can see each others and exchange messages.
If I don’t add the User as Buddy in my list the User will remain temporary and it won’t be persisted.
Variables
Buddy Variables enable each Buddy to show/send updates for specific informations to each User that has the Buddy in the list.
For example one could send real-time updates on his last activity (ala Twitter) or post the title of the song he’s listening right now, scores,
rankings and whatnot.
Tasks
-
nameThe name of the Buddy
property -
variablesObtain a list of BuddyVariables. Please note that by convention any variable whose name starts with the dollar sign ($) will be regarded as persistent and stored locally by the server.
property -
idThe id of the Buddy The id corresponds to the current id of the User in the system
property -
isBlockedReturn true if the Buddy is blocked in the current Users' BuddyList
property -
isTempReturn true if the Buddy is temporary (not persistent)
property -
isOnlineReturn true if the User is online in the BuddyList system The value is stored in a reserved Buddy Variable
property -
nickNameAn optional Buddy nickname The value is stored in a reserved Buddy Variable
property -
stateThe current Buddy custom state (e.g. “Available”, “Busy”, etc…) The value is stored in a reserved Buddy Variable
property -
– containsVariable:Return true if a BuddyVariable with the provided name exists
-
– getOfflineVariablesReturn a list of offline Buddy Variables
-
– getOnlineVariablesReturn a list of non-persistent Buddy Variables
-
– getVariable:Get the BuddyVariable with the provided name. nil is returned if not BuddyVariable exists with that name
Properties
id
The id of the Buddy The id corresponds to the current id of the User in the system
@property (nonatomic, assign) NSInteger idDiscussion
The id of the Buddy The id corresponds to the current id of the User in the system
Declared In
SFSBuddy.hisBlocked
Return true if the Buddy is blocked in the current Users' BuddyList
@property (nonatomic, assign) BOOL isBlockedDiscussion
Return true if the Buddy is blocked in the current Users' BuddyList
See Also
Declared In
SFSBuddy.hisOnline
Return true if the User is online in the BuddyList system The value is stored in a reserved Buddy Variable
@property (readonly) BOOL isOnlineDiscussion
Return true if the User is online in the BuddyList system The value is stored in a reserved Buddy Variable
See Also
Declared In
SFSBuddy.hisTemp
Return true if the Buddy is temporary (not persistent)
@property (nonatomic, assign) BOOL isTempDiscussion
Return true if the Buddy is temporary (not persistent)
Declared In
SFSBuddy.hname
The name of the Buddy
@property (nonatomic, retain) NSString *nameDiscussion
The name of the Buddy
Declared In
SFSBuddy.hnickName
An optional Buddy nickname The value is stored in a reserved Buddy Variable
@property (readonly) NSString *nickNameDiscussion
An optional Buddy nickname The value is stored in a reserved Buddy Variable
See Also
Declared In
SFSBuddy.hstate
The current Buddy custom state (e.g. “Available”, “Busy”, etc…) The value is stored in a reserved Buddy Variable
@property (readonly) NSString *stateDiscussion
The current Buddy custom state (e.g. “Available”, “Busy”, etc…) The value is stored in a reserved Buddy Variable
See Also
Declared In
SFSBuddy.hvariables
Obtain a list of BuddyVariables. Please note that by convention any variable whose name starts with the dollar sign ($) will be regarded as persistent and stored locally by the server.
@property (nonatomic, retain) NSArray *variablesDiscussion
Obtain a list of BuddyVariables. Please note that by convention any variable whose name starts with the dollar sign ($) will be regarded as persistent and stored locally by the server.
These variables are also referred to as “offline variables” because they are available to other Users even when the Buddy is offline.
See Also
Declared In
SFSBuddy.hInstance Methods
containsVariable:
Return true if a BuddyVariable with the provided name exists
- (BOOL)containsVariable:(NSString *)varNameDiscussion
Return true if a BuddyVariable with the provided name exists
Declared In
SFSBuddy.hgetOfflineVariables
Return a list of offline Buddy Variables
- (NSArray *)getOfflineVariablesDiscussion
Return a list of offline Buddy Variables
Declared In
SFSBuddy.hgetOnlineVariables
Return a list of non-persistent Buddy Variables
- (NSArray *)getOnlineVariablesDiscussion
Return a list of non-persistent Buddy Variables
Declared In
SFSBuddy.hgetVariable:
Get the BuddyVariable with the provided name. nil is returned if not BuddyVariable exists with that name
- (id<BuddyVariable>)getVariable:(NSString *)varNameDiscussion
Get the BuddyVariable with the provided name. nil is returned if not BuddyVariable exists with that name
Declared In
SFSBuddy.h