MLIMRoom Class Reference

Inherits from MLIMRuntimeObject : NSObject
Declared in MLIMRoom.h

Overview

The representation of a room.

Other Methods

  roomId

The room id.

@property (nonatomic, readonly) NSString *roomId

Declared In

MLIMRoom.h

  name

The room name

@property (nullable, nonatomic) NSString *name

Declared In

MLIMRoom.h

  members

The id list of room member.

@property (nullable, nonatomic, readonly) NSArray<NSString*> *members

Declared In

MLIMRoom.h

  createTs

The timestamp of room creation.

@property (nonatomic, readonly) NSTimeInterval createTs

Declared In

MLIMRoom.h

  attributes

The custom attributes

@property (nullable, nonatomic, strong) NSDictionary<NSString*id> *attributes

Declared In

MLIMRoom.h

+ roomWithId:

Creates a MLIMRoom object with room id.

+ (instancetype)roomWithId:(NSString *)rid

Parameters

rid

The room id.

Return Value

A MLIMRoom object.

Declared In

MLIMRoom.h

+ createWithName:members:block:

Creates a room.

+ (void)createWithName:(NSString *)name members:(nullable NSArray *)members block:(void ( ^ ) ( MLIMRoom *room , NSError *error ))block

Parameters

name

The room name.

members

The members to join in the room.

block

A block to be executed after creation complete.

Declared In

MLIMRoom.h

– fetchWithBlock:

Fetch the room’s info. Info will be filled in room’s properties.

- (void)fetchWithBlock:(nullable MLIMBooleanResultBlock)block

Parameters

block

A block to be execute after request completion.

Declared In

MLIMRoom.h

– addMembers:block:

Add members to the room.

- (void)addMembers:(NSArray<NSString*> *)newMembers block:(MLIMBooleanResultBlock)block

Parameters

newMembers

The new member userIds to join in the room.

block

A block to be executed after opertion complete

Declared In

MLIMRoom.h

– addAMember:block:

Add one member to the room.

- (void)addAMember:(NSString *)memId block:(MLIMBooleanResultBlock)block

Parameters

memId

Id of the new member.

block

A block to be executed after member add completion.

Declared In

MLIMRoom.h

– removeMembers:block:

Remove members from the room.

- (void)removeMembers:(NSArray<NSString*> *)members block:(MLIMBooleanResultBlock)block

Parameters

members

The member userIds to remove.

block

A block to be executed after operation complete

Declared In

MLIMRoom.h

– removeAMember:block:

Remove a member from the room.

- (void)removeAMember:(NSString *)memId block:(MLIMBooleanResultBlock)block

Parameters

memId

id of the member to remove

block

A block to be executed after member remove completion.

Declared In

MLIMRoom.h

– overwriteMembers:block:

Replace all group members with newMembers.

- (void)overwriteMembers:(NSArray *)newMembers block:(MLIMBooleanResultBlock)block

Parameters

newMembers

New members for the room.

block

A block to be executed after member replace completion.

Declared In

MLIMRoom.h

– deleteWithBlock:

Delete the room.

- (void)deleteWithBlock:(MLIMBooleanResultBlock)block

Parameters

block

A block to be execute after room delete completion.

Declared In

MLIMRoom.h

Group Attributes

– updateAttributes:completion:

Update user attributes. The attributes keys must be a string, the values can be any json serializable type.

- (void)updateAttributes:(NSDictionary<NSString*,id> *)attrs completion:(void ( ^ ) ( BOOL success , NSError *_Nullable error ))block

Parameters

attrs

the custom user attributes

block

A block to return the result.

Declared In

MLIMRoom.h

– updateName:block:

Update name of the room.

- (void)updateName:(NSString *)name block:(MLIMBooleanResultBlock)block

Parameters

name

The new room name.

block

A block to be execute after operation complete.

Declared In

MLIMRoom.h

– replaceAttributes:completion:

Replace whole attributes with the new one. The attributes keys must be a string, the values can be any json serializable type.

- (void)replaceAttributes:(NSDictionary<NSString*,id> *)attrs completion:(void ( ^ ) ( BOOL success , NSError *_Nullable error ))block

Parameters

attrs

the custom user attributes

block

A block to return the result.

Declared In

MLIMRoom.h

– fetchAttributesWithCompletion:

Fetch the attributes.

- (void)fetchAttributesWithCompletion:(void ( ^ ) ( NSDictionary *_Nullable attrs , NSError *_Nullable error ))block

Parameters

block

A block to return the result.

Declared In

MLIMRoom.h

– getAttributeForKey:completion:

Get one attribute with key.

- (void)getAttributeForKey:(NSString *)key completion:(void ( ^ ) ( id _Nullable value , NSError *_Nullable error ))block

Parameters

key

attribute name

block

A block to return the result.

Declared In

MLIMRoom.h

– deleteAttributesWithCompletion:

Delete the whole attributes.

- (void)deleteAttributesWithCompletion:(void ( ^ ) ( BOOL success , NSError *_Nullable error ))block

Parameters

block

A block to return the result.

Declared In

MLIMRoom.h