QNChatRepository
public class QNChatRepository
Represents a chat
-
Define wether a chat is a group or not
- oneToOne
- groupChat
Declaration
Swift
public enum ChatType
-
Delegate
Declaration
Swift
public weak var delegate: QNChatDelegate? { get set }
-
Expose chat type (1-1 or group)
Declaration
Swift
public var type: ChatType { get }
-
Chat identifier (remote user for 1-1 and UUID for group chats)
Declaration
Swift
public var identifier: String { get }
-
Group actions for group chats like invite a participant or expel one
Declaration
Swift
public private(set) var groupChatActions: QNGroupChatActions? { get }
-
Last message received
Declaration
Swift
public fileprivate(set) var lastMessage: QNChatMessage? { get set }
-
Count of unread messages
Declaration
Swift
public fileprivate(set) var unreadMessagesCount: Int { get set }
-
Title of chat
Declaration
Swift
public fileprivate(set) var title: String { get }
-
Chat is associated with a conference
Declaration
Swift
public var isConferenceChat: Bool { get }
-
Sends a new message to other participant
Declaration
Swift
public func send(message: String) -> QNChatMessage
Parameters
message
Body message to be sent
Return Value
A Message
-
Send participant action, like typing or active, to remote participant
Declaration
Swift
public func sendParticipantActionInChat(_ action: QNChatMessage.ParticipantAction)
Parameters
action
Current participant action
-
Send a file to Chat
Declaration
Swift
public func send(file: Data, named filename: String, pathToLocalFile: String?, completion: @escaping (QNChatMessage) -> Void)
Parameters
file
Data to send
filename
Name use to share it
Return Value
A Message where upload progress is received
-
Mark a message with a new status
Declaration
Swift
public func mark(message: QNChatMessage, as status: QNChatMessage.Status)
Parameters
message
Message to change status
status
New status
-
Fetch history related to this user, messages are received in delegate
Declaration
Swift
public func fetchMessagesFromStore(messageSearch: QNChatMessageSearch, completion: @escaping ([QNChatMessage]) -> Void)
Parameters
messageSearch
search criteria
completion
completion block with
QNChatMessageSearchResult
-
Send a mark with last message read
Declaration
Swift
public func markChatAsRead()
-
Archive chat
Declaration
Swift
public func archive(completion: @escaping () -> Void)
-
Delete chat
Declaration
Swift
public func delete(completion: @escaping () -> Void)