Package org.linphone.core

# Interface ChatMessageListener

All Known Implementing Classes:
  `ChatMessageListenerStub`

public interface ChatMessageListener
An object to handle the callbacks for the handling a `ChatMessage`
objects.

## Method Summary

Modifier and Type
Method
Description
`void`
`onEphemeralMessageDeleted(ChatMessage message)`
Call back used to notify ephemeral message is deleted.
`void`
`onEphemeralMessageTimerStarted(ChatMessage message)`
Callback used to notify an ephemeral message that its lifespan before
disappearing has started to decrease.
`void`
`onFileTransferProgressIndication(ChatMessage message, Content content, int offset, int total)`
File transfer progress indication callback prototype.
`void`
`onFileTransferRecv(ChatMessage message, Content content, Buffer buffer)`
File transfer receive callback prototype.
`Buffer`
`onFileTransferSend(ChatMessage message, Content content, int offset, int size)`
Deprecated.
17/08/2020 Use LinphoneChatMessageCbsFileTransferSendChunkCb
instead.
`void`
`onFileTransferSendChunk(ChatMessage message, Content content, int offset, int size, Buffer buffer)`
File transfer send callback prototype.
`void`
`onFileTransferTerminated(ChatMessage message, Content content)`
File transfer terminated callback prototype.
`void`
`onMsgStateChanged(ChatMessage message, ChatMessage.State state)`
Call back used to notify message delivery status.
`void`
`onNewMessageReaction(ChatMessage message, ChatMessageReaction reaction)`
Callback used to notify a reaction has been received or sent for a given
message.
`void`
`onParticipantImdnStateChanged(ChatMessage message, ParticipantImdnState state)`
Call back used to notify participant IMDN state.
`void`
`onReactionRemoved(ChatMessage message, Address address)`
Callback used to notify a reaction has been removed from a given message.

## Method Details

### onMsgStateChanged

void onMsgStateChanged(@NonNull ChatMessage message, ChatMessage.State state)
Call back used to notify message delivery status.

Parameters:
  `message` - `ChatMessage` object
  `state` - `ChatMessage#State`

### onNewMessageReaction

void onNewMessageReaction(@NonNull ChatMessage message, @NonNull ChatMessageReaction reaction)
Callback used to notify a reaction has been received or sent for a given
message.

Parameters:
  `message` - LinphoneChatMessage object
  `reaction` - the LinphoneChatMessageReaction reaction that was sent or
  received

### onReactionRemoved

void onReactionRemoved(@NonNull ChatMessage message, @NonNull Address address)
Callback used to notify a reaction has been removed from a given message.

Parameters:
  `message` - LinphoneChatMessage object
  `address` - the LinphoneAddress of the person that removed it's reaction

### onFileTransferTerminated

void onFileTransferTerminated(@NonNull ChatMessage message, @NonNull Content content)
File transfer terminated callback prototype.

Parameters:
  `message` - `ChatMessage` message from which the body is received.
  `content` - `Content` incoming content information

### onFileTransferRecv

void onFileTransferRecv(@NonNull ChatMessage message, @NonNull Content content, @NonNull Buffer buffer)
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.

Parameters:
  `message` - `ChatMessage` message from which the body is received.
  `content` - `Content` incoming content information
  `buffer` - `Buffer` holding the received data. Empty buffer means end
  of file.

### onFileTransferSend

Buffer onFileTransferSend(@NonNull ChatMessage message, @NonNull Content content, int offset, int size)
Deprecated.
17/08/2020 Use LinphoneChatMessageCbsFileTransferSendChunkCb
instead.
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.

Parameters:
  `message` - `ChatMessage` message from which the body is received.
  `content` - `Content` 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
Returns:
  A `Buffer` object holding the data written by the application. An
  empty buffer means end of file.
  warning: The returned value isn't used, hence the deprecation!

### onFileTransferSendChunk

void onFileTransferSendChunk(@NonNull ChatMessage message, @NonNull Content content, int offset, int size, @NonNull Buffer buffer)
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.

Parameters:
  `message` - `ChatMessage` message from which the body is received.
  `content` - `Content` 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 `Buffer` to be filled. Leave it empty when end of file
  has been reached.

### onFileTransferProgressIndication

void onFileTransferProgressIndication(@NonNull ChatMessage message, @NonNull Content content, int offset, int total)
File transfer progress indication callback prototype.

Parameters:
  `message` - `ChatMessage` message from which the body is received.
  `content` - `Content` 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.

### onParticipantImdnStateChanged

void onParticipantImdnStateChanged(@NonNull ChatMessage message, @NonNull ParticipantImdnState state)
Call back used to notify participant IMDN state.

Parameters:
  `message` - `ChatMessage` object
  `state` - `ParticipantImdnState`

### onEphemeralMessageTimerStarted

void onEphemeralMessageTimerStarted(@NonNull ChatMessage message)
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.

Parameters:
  `message` - LinphoneChatMessage object

### onEphemeralMessageDeleted

void onEphemeralMessageDeleted(@NonNull ChatMessage message)
Call back used to notify ephemeral message is deleted.

Parameters:
  `message` - LinphoneChatMessage object