SFS2X Objective-C API
1.7.13
iOS / macOS / tvOS
|
#import <SFSBuddyVariable.h>
Inherits BaseVariable, and <BuddyVariable>.
Class Methods | |
(id) | + variableWithName:value:type: |
(id) | + variableWithName:value: |
(id< BuddyVariable >) | + fromSFSArray: |
Properties | |
BOOL | isOffline |
![]() | |
NSString * | name |
NSString * | type |
Additional Inherited Members | |
![]() | |
(id) | - initWithName:value:type: |
(id) | - getValue |
(BOOL) | - getBoolValue |
(NSInteger) | - getIntValue |
(NSNumber *) | - getDoubleValue |
(NSString *) | - getStringValue |
(id< ISFSObject >) | - getSFSObjectValue |
(id< ISFSArray >) | - getSFSArrayValue |
(BOOL) | - isNull |
(id< ISFSArray >) | - toSFSArray |
![]() | |
NSString * | _name |
NSString * | _type |
id | _value |
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:
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.
+ (id) variableWithName: | (NSString *) | name | |
value: | (id) | value | |
name | the name of the variable |
value | the variable value ( can be BOOL, Integer, Double, String, SFSObject, SFSArray ) |
Reimplemented from BaseVariable.
+ (id) variableWithName: | (NSString *) | name | |
value: | (id) | value | |
type: | (NSInteger) | type | |
name | the name of the variable |
value | the variable value ( can be BOOL, Integer, Double, String, SFSObject, SFSArray ) |
type | (optional -1) it's usually not necessary to pass this parameter as the variable value is auto-detected |
Reimplemented from BaseVariable.
|
readatomicassign |
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.