Inherits from NSObject
Conforms to NSCoding
NSCopying
Declared in QBChatDialog.h

Overview

QBChatDialog class interface. This class represents chat dialog model from server.

Tasks

Properties

ID

@property (nonatomic, copy, readonly, nullable) NSString *ID
Discussion

Chat dialog ID.

Declared In

QBChatDialog.h

createdAt

@property (nonatomic, strong, nullable) NSDate *createdAt
Discussion

Chat dialog creation date.

Declared In

QBChatDialog.h

data

@property (nonatomic, copy, nullable) NSDictionary<NSString*id> *data
Discussion

The dictionary with custom data.

Declared In

QBChatDialog.h

lastMessageDate

@property (nonatomic, strong, nullable) NSDate *lastMessageDate
Discussion

Date of last message in current chat dialog.

Declared In

QBChatDialog.h

lastMessageText

@property (nonatomic, copy, nullable) NSString *lastMessageText
Discussion

Last message text for current chat dialog.

Declared In

QBChatDialog.h

lastMessageUserID

@property (nonatomic, assign) NSUInteger lastMessageUserID
Discussion

Sender user ID of last message in current chat dialog.

Declared In

QBChatDialog.h

name

@property (nonatomic, copy, nullable) NSString *name
Discussion

Group chat dialog name.

Note: If chat type is private, name will be nil.

Declared In

QBChatDialog.h

occupantIDs

@property (nonatomic, copy, nullable) NSArray<NSNumber*> *occupantIDs
Discussion

Array of user ids in chat.

Note: For private chat dialog count is 2.

Declared In

QBChatDialog.h

onBlockedMessage

@property (nonatomic, copy, nullable) QBChatCompletionBlock onBlockedMessage
Discussion

Called whenever sent message was blocked on server.

Declared In

QBChatDialog.h

onJoinOccupant

@property (nonatomic, copy, nullable) QBChatDialogUserBlock onJoinOccupant
Discussion

Called whenever occupant has joined to the current Group or Public group chat dialog.

Declared In

QBChatDialog.h

onLeaveOccupant

@property (nonatomic, copy, nullable) QBChatDialogUserBlock onLeaveOccupant
Discussion

Called whenever occupant has left the current Group or Public group chat dialog.

Declared In

QBChatDialog.h

onUpdateOccupant

@property (nonatomic, copy, nullable) QBChatDialogUserBlock onUpdateOccupant
Discussion

Called whenever occupant has updated his presence status in the current Group or Public group chat dialog.

Declared In

QBChatDialog.h

onUserIsTyping

@property (nonatomic, copy, nullable) QBChatDialogUserBlock onUserIsTyping
Discussion

Called whenever user is typing in current chat dialog.

Declared In

QBChatDialog.h

onUserStoppedTyping

@property (nonatomic, copy, nullable) QBChatDialogUserBlock onUserStoppedTyping
Discussion

Called whenever user has stopped typing in current chat dialog.

Declared In

QBChatDialog.h

photo

@property (nonatomic, copy, nullable) NSString *photo
Discussion

Group chat photo.

Can contain a link to a file in Content module, Custom Objects module or just a web link.

Declared In

QBChatDialog.h

pullOccupantsIDs

@property (strong, nonatomic, nullable) NSArray<NSString*> *pullOccupantsIDs
Discussion

Occupants ids to pull.

Use this method to delete occupants from the chat dialog.

Declared In

QBChatDialog.h

pushOccupantsIDs

@property (strong, nonatomic, nullable) NSArray<NSString*> *pushOccupantsIDs
Discussion

Occupants ids to push.

Use this method to add occupants to the dialog.

Declared In

QBChatDialog.h

recipientID

@property (nonatomic, readonly) NSInteger recipientID
Discussion

Recipient ID for private chat dialog.

Note: ID of a recipient if type = QBChatDialogTypePrivate. -1 otherwise. Will always return -1 if QBSession currentUser is nil.

Will be retrieved from ‘[QBSession currentSession].currentUser’ by subtracting currentUser.ID from occupantsIDs.

Declared In

QBChatDialog.h

roomJID

@property (nonatomic, copy, readonly, nullable) NSString *roomJID
Discussion

Room JID.

Note: If chat dialog is private, room JID will be nil.

Declared In

QBChatDialog.h

type

@property (nonatomic, readonly) QBChatDialogType type
Discussion

Chat dialog type.

See Also

Declared In

QBChatDialog.h

unreadMessagesCount

@property (nonatomic, assign) NSUInteger unreadMessagesCount
Discussion

Number of unread messages in current chat dialog.

Declared In

QBChatDialog.h

updatedAt

@property (nonatomic, strong, nullable) NSDate *updatedAt
Discussion

Chat dialog update date.

Declared In

QBChatDialog.h

userID

@property (nonatomic, assign) NSUInteger userID
Discussion

Chat dialog owner user ID.

Declared In

QBChatDialog.h

Class Methods

new

+ (id)new

Instance Methods

clearDialogOccupantsStatusBlock

- (void)clearDialogOccupantsStatusBlock
Discussion

Clears dialog occupants status blocks.

Call this method if you don’t want to recieve join/leave/update for this dialog.

Declared In

QBChatDialog.h

clearTypingStatusBlocks

- (void)clearTypingStatusBlocks
Discussion

Clears typing status blocks.

Call this method if you don’t want to recieve typing statuses for this dialog.

Declared In

QBChatDialog.h

init

- (id)init

initWithDialogID:type:

- (instancetype)initWithDialogID:(nullable NSString *)dialogID type:(QBChatDialogType)type
Discussion

Init with dialog ID and type.

Pass nil for dialogID if you are creating a new dialog.

Parameters

dialogID

dialog ID string

type

dialog type

Return Value

QBChatDialog instance.

See Also

Declared In

QBChatDialog.h

isJoined

- (BOOL)isJoined
Discussion

Join status of the room

Return Value

YES if user is joined to room, otherwise - no.

Declared In

QBChatDialog.h

joinWithCompletionBlock:

- (void)joinWithCompletionBlock:(nullable QBChatCompletionBlock)completion
Discussion

Join to room.

Parameters

completion

Completion block with failure error.

Declared In

QBChatDialog.h

leaveWithCompletionBlock:

- (void)leaveWithCompletionBlock:(nullable QBChatCompletionBlock)completion
Discussion

Leave joined room.

Parameters

completion

Completion block with failure error.

Declared In

QBChatDialog.h

requestOnlineUsersWithCompletionBlock:

- (void)requestOnlineUsersWithCompletionBlock:(nullable QBChatDialogRequestOnlineUsersCompletionBlock)completion
Discussion

Requests users who are joined to room.

Parameters

completion

Completion block with failure error and array of user ids.

Declared In

QBChatDialog.h

sendGroupChatMessageWithoutJoin:completion:

- (void)sendGroupChatMessageWithoutJoin:(QBChatMessage *)message completion:(nullable QBChatCompletionBlock)completion
Discussion

Send group chat message to room, without room join.

Note: Available only for ‘Enterprise’ clients.

Parameters

message

Chat message to send

completion

Completion block with failure error.

Declared In

QBChatDialog.h

sendMessage:completionBlock:

- (void)sendMessage:(QBChatMessage *)message completionBlock:(nullable QBChatCompletionBlock)completion
Discussion

Send chat message with completion block.

Parameters

message

Chat message to send.

completion

Completion block with failure error.

Declared In

QBChatDialog.h

sendUserIsTyping

- (void)sendUserIsTyping
Discussion

Send is typing message to occupants.

Declared In

QBChatDialog.h

sendUserIsTypingWithoutJoin

- (void)sendUserIsTypingWithoutJoin
Discussion

Send is typing message to occupants.

Note: Available only for ‘Enterprise’ clients.

Declared In

QBChatDialog.h

sendUserStoppedTyping

- (void)sendUserStoppedTyping
Discussion

Send stopped typing message to occupants.

Declared In

QBChatDialog.h

sendUserStoppedTypingWithoutJoin

- (void)sendUserStoppedTypingWithoutJoin
Discussion

Send stopped typing message to occupants.

Note: Available only for ‘Enterprise’ clients.

Declared In

QBChatDialog.h