MXChat Class Reference

Inherits from NSObject
Declared in MXChat.h

Overview

The MXChat class provides interfaces for basic information about chats as well as some lightweight operations.

  chatId

The id of this chat.

@property (nonatomic, strong, readonly) NSString *chatId

Declared In

MXChat.h

  topic

Topic of this chat.

@property (nonatomic, strong, readonly, nullable) NSString *topic

Declared In

MXChat.h

  isIndividualChat

A boolean value indicating whether this chat is an individual one.

@property (nonatomic, assign, readonly) BOOL isIndividualChat

Declared In

MXChat.h

  accepted

A boolean value indicating whether this chat has been accpeted.

@property (nonatomic, assign, readonly, getter=isAccepted) BOOL accepted

Declared In

MXChat.h

  tags

The tags of this chat.

@property (nonatomic, strong, readonly, nullable) NSDictionary<NSString*NSString*> *tags

Declared In

MXChat.h

  owner

The owner of the chat.

@property (nonatomic, assign, readonly) MXUserItem *owner

Declared In

MXChat.h

  createdTime

When the chat was created.

@property (nonatomic, strong, readonly) NSDate *createdTime

Declared In

MXChat.h

  lastFeedTime

When the last feed was posted.

@property (nonatomic, strong, readonly) NSDate *lastFeedTime

Declared In

MXChat.h

  unreadFeedsCount

The count of unread feeds in this chat.

@property (nonatomic, assign, readonly) UInt64 unreadFeedsCount

Declared In

MXChat.h

  uncompleteTodosCount

The count of uncomplete todos in this chat.

@property (nonatomic, assign, readonly) UInt64 uncompleteTodosCount

Declared In

MXChat.h

  assignToMeTodosCount

The count of todos that are assigned to the current user.

@property (nonatomic, assign, readonly) UInt64 assignToMeTodosCount

Declared In

MXChat.h

  todosCount

The count of all todos in this chat.

@property (nonatomic, assign, readonly) UInt64 todosCount

Declared In

MXChat.h

  lastFeedContent

The content of the last feed.

@property (nonatomic, strong, readonly, nullable) NSString *lastFeedContent

Declared In

MXChat.h

  lastFeedUser

The user who create the last feed.

@property (nonatomic, strong, readonly, nullable) MXUserItem *lastFeedUser

Declared In

MXChat.h

  category

The category of this chat.

@property (nonatomic, strong, readonly, nullable) MXChatCategory *category

Declared In

MXChat.h

  isMute

A boolean value indicating whether this chat is muted by the user.

@property (nonatomic, assign, readonly) BOOL isMute

Declared In

MXChat.h

  signFilesCount

Total sign files count.

@property (nonatomic, assign, readonly) UInt64 signFilesCount

Declared In

MXChat.h

  myTurnSignFilesCount

The count of sign files that are your turn to sign.

@property (nonatomic, readonly) UInt64 myTurnSignFilesCount

Declared In

MXChat.h

– accessTypeForUser:

Get access type of a user in this chat.

- (MXChatMemberAccessType)accessTypeForUser:(MXUserItem *)user

Parameters

user

The user whose access type is going to be get.

Return Value

Access type of the specified user.

Declared In

MXChat.h

– updateTopic:withCompletionHandler:

Update topic of this chat.

- (void)updateTopic:(NSString *)topic withCompletionHandler:(void ( ^ _Nullable ) ( NSError *_Nullable errorOrNil ))completionHandler

Parameters

topic

New topic to be set.

completionHandler

A block to be executed when the action completes.

Discussion

A user with viewer access type or if this chat is a individual chat, it has no permission for updating topic. An error with code MXChatSDKErrorNoPermission will occurred if you do so.

Declared In

MXChat.h

– updateCategory:withCompletionHandler:

Update category of this chat by specifying a new category.

- (void)updateCategory:(MXChatCategory *)category withCompletionHandler:(void ( ^ _Nullable ) ( NSError *_Nullable errorOrNil ))completionHandler

Parameters

category

The new category that the chat will be assigned to.

completionHandler

A block to be executed when the action completes.

Discussion

A user with viewer access type has no permission for updating category. An error MXChatSDKErrorNoPermission will occurred if you do so.

Declared In

MXChat.h

– updateTags:withCompletionHandler:

Update tags represented by a dictionary for this chat.

- (void)updateTags:(nullable NSDictionary<NSString*,NSString*> *)tags withCompletionHandler:(void ( ^ _Nullable ) ( NSError *_Nullable errorOrNil ))completionHandler

Parameters

tags

A dictionary representing tags that are going to be set.

completionHandler

A block object to be executed when the action completes

Discussion

You can use this interface to set custom tags for chats so that these tags can be fetched even if you have ever unlinked.

Declared In

MXChat.h

– updateCoverWithImagePath:withCompletionHandler:

Update cover of this chat by specifying an image’s file path.

- (void)updateCoverWithImagePath:(nullable NSString *)imagePath withCompletionHandler:(void ( ^ _Nullable ) ( NSError *_Nullable errorOrNil ))completionHandler

Parameters

imagePath

The file path of a image that will be used as cover

completionHandler

A block object to be executed when the action completes

Discussion

A user with viewer access type has no permission for updating cover. An error with code MXChatSDKErrorNoPermission will occurred if you do so.

Declared In

MXChat.h

– fetchCoverWithCompletionHandler:

Fetch cover of this chat

- (void)fetchCoverWithCompletionHandler:(void ( ^ _Nullable ) ( NSError *_Nullable errorOrNil , NSString *_Nullable localPathOrNil ))completionHandler

Parameters

completionHandler

A block object to be executed when the action completes

Declared In

MXChat.h

– markAsReadWithCompletionHandler:

Mark this chat as read to clear unread feed count.

- (void)markAsReadWithCompletionHandler:(void ( ^ _Nullable ) ( NSError *_Nullable errorOrNil ))completionHandler

Parameters

completionHandler

A block object to be executed when the action completes

Declared In

MXChat.h

– mute:withCompletionHandler:

Mute or unmute this chat.

- (void)mute:(BOOL)mute withCompletionHandler:(void ( ^ _Nullable ) ( NSError *_Nullable errorOrNil ))completionHandler

Parameters

mute

Set YES if this will be muted, otherwise NO.

completionHandler

A block object to be executed when the action completes

Declared In

MXChat.h