Inherits from NSObject
Conforms to BuddyVariable
Declared in SFSBuddyVariable.h
SFSBuddyVariable.m

Overview

BuddyVariables are custom values attached to any Buddy in a BuddyList. They work with the same principle of the User/Room Variables.

The only difference is the logic by which they get propagated to other Users. While RoomVariables are broadcast to all clients in the same Room, BuddyVariables are updated to all Users who have the BuddyVariable owner in their BuddyLists.

BuddyVariables support basic data types and nested complex objects:

  • Null
  • Bool
  • Int
  • Double
  • String
  • SFSObject
  • SFSArray

Also there is a special convention that allows certain Variables to be “offline” Buddy Variables. All variable names starting with a dollar sign ($) will set the BuddyVariable as persistent and make them available at any time whether the owner is online or not.

See SFSBuddy, , [ISFSEvents onBuddyVariablesUpdate:]

Tasks

Properties

isOffline

Return true if this is an offline Buddy Variable

@property (readonly) BOOL isOffline

Discussion

Return true if this is an offline Buddy Variable

By convention any Buddy 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.

Declared In

SFSBuddyVariable.h

name

The Variable name

@property (nonatomic, retain) NSString *name

Discussion

The Variable name

Declared In

SFSBuddyVariable.h

type

The Variable Type

@property (nonatomic, retain) NSString *type

Discussion

The Variable Type

See Also

Declared In

SFSBuddyVariable.h

Class Methods

variableWithName:value:type:

the name of the variable

+ (id)variableWithName:(NSString *)name value:(id)value type:(NSInteger)type

Parameters

name

the name of the variable

value

the variable value ( can be Boolean, int, Number, String, SFSObject, SFSArray )

type

it’s usually not necessary to pass this parameter as the variable value is auto-detected (optional: pass -1 or use variableWithName:value:)

Declared In

SFSBuddyVariable.h

Instance Methods

getBoolValue

The Variable value as BOOL

- (BOOL)getBoolValue

Discussion

The Variable value as BOOL

Declared In

SFSBuddyVariable.h

getDoubleValue

The Variable value as Number

- (NSNumber *)getDoubleValue

Discussion

The Variable value as Number

Declared In

SFSBuddyVariable.h

getIntValue

The Variable value as NSInteger

- (NSInteger)getIntValue

Discussion

The Variable value as NSInteger

Declared In

SFSBuddyVariable.h

getSFSArrayValue

The Variable value as SFSArray

- (id<ISFSArray>)getSFSArrayValue

Discussion

The Variable value as SFSArray

Declared In

SFSBuddyVariable.h

getSFSObjectValue

The Variable value as SFSObject

- (id<ISFSObject>)getSFSObjectValue

Discussion

The Variable value as SFSObject

See Also

Declared In

SFSBuddyVariable.h

getStringValue

The Variable value as NSString

- (NSString *)getStringValue

Discussion

The Variable value as NSString

Declared In

SFSBuddyVariable.h

getValue

The Variable value

- (id)getValue

Discussion

The Variable value

Declared In

SFSBuddyVariable.h

isNull

Checks if the variable value is null

- (BOOL)isNull

Discussion

Checks if the variable value is null

Declared In

SFSBuddyVariable.h