QNChatMessage

public struct QNChatMessage : Codable

Identify a message from a chat

  • Participant actions related to message

    • typing: User is typing
    • paused: User stop typing
    • active: User enter the chat

    Declaration

    Swift

    public enum ParticipantAction

Enum

  • Message status

    • received: Server has received the message
    • displayed: Remote user read the message
    • waiting: Message is being delivered
    • sent: Message is sent
    • error: Message hasn’t been sent due to an error

    Declaration

    Swift

    public enum Status : String, Codable
  • Message body

    • text: A single text message
    • upload: File description and FileUpload instance
    • file: URL where file is hosted and file description
    See more

    Declaration

    Swift

    public enum Body : Codable

Properties

  • User who sent the message

    Declaration

    Swift

    public let from: String
  • Message content

    Declaration

    Swift

    public let body: Body
  • Message date

    Declaration

    Swift

    public let date: Date
  • Indicate if the message was sent by the local user (false) or was received (true)

    Declaration

    Swift

    public let incomingMessage: Bool
  • Current status for message

    Declaration

    Swift

    public var status: Status
  • Return text associated to message (file description or text message)

    Declaration

    Swift

    public let text: String
  • Indicate if message is a participant action

    Declaration

    Swift

    public var isParticipantAction: Bool { get }
  • Receive file updates

    Declaration

    Swift

    public func fileUploadUpdates(_ task: @escaping (QNChatFileUpload?) -> Void)

    Parameters

    task

    Task is called everytime FileUpload values changes