ChatMessageDelegate

public protocol ChatMessageDelegate : AnyObject

Undocumented

  • onMsgStateChanged(message:state:) Default implementation

    Call back used to notify message delivery status.

    Default Implementation

    Declaration

    Swift

    func onMsgStateChanged(message: ChatMessage, state: ChatMessage.State)

    Parameters

    message

    LinphoneChatMessage object

    state

    LinphoneChatMessageState

  • File transfer receive callback prototype. This function is called by the core upon an incoming File transfer is started. This function may be call several time for the same file in case of large file.

    Default Implementation

    Declaration

    Swift

    func onFileTransferRecv(message: ChatMessage, content: Content, buffer: Buffer)

    Parameters

    message

    LinphoneChatMessage message from which the body is received.

    content

    LinphoneContent incoming content information

    buffer

    LinphoneBuffer holding the received data. Empty buffer means end of file.

  • File transfer send callback prototype. This function is called by the core when an outgoing file transfer is started. This function is called until size is set to 0.

    Warning

    The returned value isn’t used, hence the deprecation!
    • deprecated: 17/08/2020 Use LinphoneChatMessageCbsFileTransferSendChunkCb instead.

    Default Implementation

    Declaration

    Swift

    func onFileTransferSend(message: ChatMessage, content: Content, offset: Int, size: Int) -> Buffer?

    Parameters

    message

    LinphoneChatMessage message from which the body is received.

    content

    LinphoneContent outgoing content

    offset

    the offset in the file from where to get the data to be sent

    size

    the number of bytes expected by the framework

    Return Value

    A LinphoneBuffer object holding the data written by the application. An empty buffer means end of file.

  • File transfer send callback prototype. This function is called by the core when an outgoing file transfer is started. This function is called until size is set to 0.

    Default Implementation

    Declaration

    Swift

    func onFileTransferSendChunk(message: ChatMessage, content: Content, offset: Int, size: Int, buffer: Buffer)

    Parameters

    message

    LinphoneChatMessage message from which the body is received.

    content

    LinphoneContent outgoing content

    offset

    the offset in the file from where to get the data to be sent

    size

    the number of bytes expected by the framework

    buffer

    A LinphoneBuffer to be filled. Leave it empty when end of file has been reached.

  • File transfer progress indication callback prototype.

    Default Implementation

    Declaration

    Swift

    func onFileTransferProgressIndication(message: ChatMessage, content: Content, offset: Int, total: Int)

    Parameters

    message

    LinphoneChatMessage message from which the body is received.

    content

    LinphoneContent incoming content information

    offset

    The number of bytes sent/received since the beginning of the transfer.

    total

    The total number of bytes to be sent/received.

  • Call back used to notify participant IMDN state.

    Default Implementation

    Declaration

    Swift

    func onParticipantImdnStateChanged(message: ChatMessage, state: ParticipantImdnState)

    Parameters

    message

    LinphoneChatMessage object

    state

    LinphoneParticipantImdnState

  • Callback used to notify an ephemeral message that its lifespan before disappearing has started to decrease. This callback is called when the ephemeral message is read by the receiver.

    Default Implementation

    Declaration

    Swift

    func onEphemeralMessageTimerStarted(message: ChatMessage)

    Parameters

    message

    LinphoneChatMessage object

  • onEphemeralMessageDeleted(message:) Default implementation

    Call back used to notify ephemeral message is deleted.

    Default Implementation

    Declaration

    Swift

    func onEphemeralMessageDeleted(message: ChatMessage)

    Parameters

    message

    LinphoneChatMessage object