Package org.linphone.core

# Interface ChatRoom

public interface ChatRoom
A chat room is the place where `ChatMessage` are exchanged.
To create (or find) a `ChatRoom`, you first need a `ChatRoomParams`
object. A chat room is uniquely identified by it's local and remote SIP
addresses, meaning you can only have one chat room between two accounts (unless
the backend is `ChatRoom.Backend.FlexisipChat`). Then you can call `Core.searchChatRoom(org.linphone.core.ChatRoomParams, org.linphone.core.Address, org.linphone.core.Address, org.linphone.core.Address[])`
or `Core.createChatRoom(org.linphone.core.ConferenceParams, org.linphone.core.Address[])`.
Be careful as a `ChatRoom.Backend.FlexisipChat` backend `ChatRoom` will be
created asynchronously, so make sure you add a `ChatRoomListener` to the
returned object to be notified when it will be in state `ChatRoom.State.Created`.
All chat rooms are loaded from database when the `Core` starts, and you
can get them using `Core.getChatRooms()`. This method doesn't return empty
chat rooms nor ones for which the local address doesn't match an existing
`Account` identity, unless you specify otherwise in the [misc] section of
your configuration file by setting hide_empty_chat_rooms=0 and/or
hide_chat_rooms_from_removed_proxies=0.

## Nested Class Summary

Nested Classes
Modifier and Type
Interface
Description
`static enum`
`ChatRoom.Backend`
`static enum`
`ChatRoom.Capabilities`
`static enum`
`ChatRoom.EncryptionBackend`
`static enum`
`ChatRoom.EphemeralMode`
`static enum`
`ChatRoom.HistoryFilter`
`static enum`
`ChatRoom.SecurityLevel`
`static enum`
`ChatRoom.State`

## Method Summary

Modifier and Type
Method
Description
`int`
`activateEphemeral(int lifetime, int notReadLifetime)`
Activate the ephemeral message feature in the chat room with a specified
timeout.
`void`
`addListener(ChatRoomListener listener)`
`void`
`addParticipant(Address addr)`
Adds a participant to a chat room.
`boolean`
`addParticipants(Address[] addresses)`
Adds several participants to a chat room at once.
`void`
`allowCpim()`
Allow cpim on a basic chat room .
`void`
`allowMultipart()`
Allow multipart on a basic chat room .
`boolean`
`canHandleParticipants()`
Tells whether a chat room is able to handle participants.
`int`
`close()`
Terminates a chat room and instruct the server to remove all participants.
`void`
`compose()`
Deprecated.
`void`
`composeTextMessage()`
Notifies the destination of the chat message being composed that the user is
typing a message.
`void`
`composeVoiceMessage()`
Notifies the destination of the chat message being composed that the user is
recording a new voice message.
`ChatMessage`
`createEmptyMessage()`
Creates an empty message attached to the given chat room.
`ChatMessage`
`createFileTransferMessage(Content initialContent)`
Creates a message attached to the given chat room with a particular content.
`ChatMessage`
`createForwardMessage(ChatMessage message)`
Creates a forward message attached to the given chat room with a particular
message.
`ChatMessage`
`createMessage(String message)`
Deprecated.
`ChatMessage`
`createMessageFromUtf8(String message)`
Creates a message attached to the given chat room with a plain text content
filled with the given message.
`ChatMessage`
`createReplacesMessage(ChatMessage message)`
Creates a replaces message that will edit the original message.
`ChatMessage`
`createReplyMessage(ChatMessage message)`
Creates a reply message attached to the given chat room with a particular
message.
`ChatMessage`
`createVoiceRecordingMessage(Recorder recorder)`
Creates a chat message with a voice recording attached to the given chat room.
`int`
`deactivateEphemeral()`
Disable the ephemeral message feature in the chat room.
`void`
`deleteHistory()`
Delete all messages from the history.
`void`
`deleteMessage(ChatMessage message)`
Delete a message from the chat room history.
`boolean`
`ephemeralSupportedByAllParticipants()`
Check if all participants support ephemeral messages.
`EventLog`
`findEventLog(String messageId)`
Gets the event log sent or received in this chat room that matches a chat
message with the given message_id.
`ChatMessage`
`findMessage(String messageId)`
Gets the chat message sent or received in this chat room that matches the
message_id.
`Participant`
`findParticipant(Address address)`
Finds a participant of a chat room from its address.
`Account`
`getAccount()`
Returns the local account to which this chat room is related.
`Call`
`getCall()`
Gets the current call associated to this chatroom if any To commit a message,
use `ChatMessage.send()`
`int`
`getCapabilities()`
Gets the capabilities of a chat room.
`int`
`getChar()`
When realtime text is enabled in a `Call` (see
invalid reference

    CallParams#realtimeTextEnabled

), LinphoneCoreIsComposingReceivedCb is called everytime a Real-Time Text
character is received from peer.
`Address[]`
`getComposingAddresses()`
Gets the list of participants that are currently composing.
`ComposingParticipant[]`
`getComposingParticipants()`
Gets the list of participants that are currently composing.
`Address`
`getConferenceAddress()`
Gets the conference address of the chat room.
`ConferenceInfo`
`getConferenceInfo()`
Gets the conference information associated to the chatroom.
`Core`
`getCore()`
Returns back pointer to `Core` object.
`long`
`getCreationTime()`
Returns the creation time for the chat room.
`ChatRoomParams`
`getCurrentParams()`
Deprecated.
`Content[]`
`getDocumentContents()`
Gets all contents for which content-type starts with either text/ or
application/.
`Content[]`
`getDocumentContentsRange(int begin, int end)`
Gets the partial list of contents for which content-type starts with either
text/ or application/.
`int`
`getDocumentContentsSize()`
Gets the number of document contents (see `getDocumentContents()`).
`long`
`getEphemeralLifetime()`
Gets lifetime (in seconds) for all new ephemeral messages in the chat room.
`ChatRoom.EphemeralMode`
`getEphemeralMode()`
Gets the ephemeral mode of the chat room.
`long`
`getEphemeralNotReadLifetime()`
Gets not-read lifetime (in seconds) for all new ephemeral messages in the chat
room.
`ChatMessage[]`
`getHistory(int nbMessage)`
Deprecated.
`EventLog[]`
`getHistory(int nbMessage, int filters)`
Gets nb_message most recent events from chat_room chat room, sorted from oldest
to most recent.
`EventLog[]`
`getHistoryEvents(int nbEvents)`
Gets nb_events most recent events from chat_room chat room, sorted from oldest
to most recent.
`int`
`getHistoryEventsSize()`
Gets the number of events in a chat room.
`EventLog[]`
`getHistoryMessageEvents(int nbEvents)`
Gets nb_events most recent chat message events from chat_room chat room, sorted
from oldest to most recent.
`ChatMessage[]`
`getHistoryRange(int begin, int end)`
Deprecated.
`EventLog[]`
`getHistoryRange(int begin, int end, int filters)`
Gets the partial list of events in the given range, sorted from oldest to most
recent.
`EventLog[]`
`getHistoryRangeBetween(EventLog firstEvent, EventLog lastEvent, int filters)`
Gets the partial list of messages between two given `EventLog`, sorted
from oldest to most recent.
`EventLog[]`
`getHistoryRangeEvents(int begin, int end)`
Gets the partial list of events in the given range, sorted from oldest to most
recent.
`EventLog[]`
`getHistoryRangeMessageEvents(int begin, int end)`
Gets the partial list of chat message events in the given range, sorted from
oldest to most recent.
`EventLog[]`
`getHistoryRangeNear(int before, int after, EventLog event, int filters)`
Gets the partial list of messages in the given range near the `EventLog`
provided, sorted from oldest to most recent.
`int`
`getHistorySize()`
Deprecated.
`int`
`getHistorySize(int filters)`
Gets the number of messages in a chat room.
`String`
`getIdentifier()`
Returns the chat room identifier.
`ChatMessage`
`getLastMessageInHistory()`
Gets the last chat message sent or received in this chat room.
`long`
`getLastUpdateTime()`
Returns the last updated time for the chat room.
`Address`
`getLocalAddress()`
Get the local address associated to this chat room.
`Participant`
`getMe()`
Gets the participant representing myself in the chat room.
`Content[]`
`getMediaContents()`
Gets all contents for which content-type starts with either video/, audio/
(except for voice messages) or image/.
`Content[]`
`getMediaContentsRange(int begin, int end)`
Gets the partial list of contents for which content-type starts with either
video/, audio/ (except for voice messages) or image/.
`int`
`getMediaContentsSize()`
Gets the number of media contents (see `getMediaContents()`).
`boolean`
`getMuted()`
Gets if a chat room has been flagged as muted (not by default).
`long`
`getNativePointer()`
Gets the native pointer used by this class to make native method calls.
`int`
`getNbParticipants()`
Gets the number of participants in the chat room (that is without ourselves).
`ConferenceParams`
`getParams()`
Returns current parameters associated with the chat room.
`Participant[]`
`getParticipants()`
Gets the list of participants of a chat room.
`Address`
`getPeerAddress()`
Get the peer address associated to this chat room.
`String`
`getRemoteComposingContentType()`
Returns the content-type (if set) of what the remote is currently composing.
`ChatRoom.SecurityLevel`
`getSecurityLevel()`
Gets the security level of a chat room.
`ChatRoom.State`
`getState()`
Gets the state of the chat room.
`String`
`getSubject()`
Gets the subject of a chat room.
`String`
`getSubjectUtf8()`
Gets the subject of a chat room (as an UTF8 string)
`ChatMessage[]`
`getUnreadHistory()`
Gets all unread messages for this chat room, sorted from oldest to most recent.
`int`
`getUnreadMessagesCount()`
Gets the number of unread messages in the chatroom.
`Object`
`getUserData()`
Gets the object stored in this object user's data
`boolean`
`hasBeenLeft()`
Deprecated.
`boolean`
`hasCapability(int mask)`
Checks if a chat room has given capabilities.
`boolean`
`isEmpty()`
Returns whether or not a `ChatRoom` has at least one `ChatMessage`
or not.
`boolean`
`isEphemeralEnabled()`
Returns whether or not the ephemeral message feature is enabled in the chat
room.
`boolean`
`isReadOnly()`
Returns whether or not a message can be sent using this chat room.
`boolean`
`isRemoteComposing()`
Tells whether the remote is currently composing a message.
`void`
`leave()`
Leaves a chat room.
`void`
`markAsRead()`
Mark all messages of the conversation as read.
`void`
`nominateAdminAndLeave(Address newAdmin)`
Nominates a new admin and then leaves a chat room.
`void`
`notifyParticipantDeviceRegistration(Address participantDevice)`
Notifies the chatroom that a participant device has just registered.
`void`
`receiveChatMessage(ChatMessage message)`
Used to receive a chat message when using async mechanism with IM
enchat_roomyption engine.
`void`
`removeListener(ChatRoomListener listener)`
`void`
`removeParticipant(Participant participant)`
Removes a participant of a chat room.
`void`
`removeParticipants(Participant[] participants)`
Removes several participants of a chat room at once.
`void`
`retractMessage(ChatMessage message)`
Deletes the content of a previously sent message for both sender and receivers.
`EventLog`
`searchChatMessageByText(String text, EventLog from, SearchDirection direction)`
Searches chat messages by text.
`void`
`setConferenceAddress(Address conferenceAddress)`
Sets the conference address of a group chat room.
`void`
`setEphemeralEnabled(boolean enable)`
Deprecated.
`void`
`setEphemeralLifetime(long time)`
Deprecated.
`void`
`setEphemeralMode(ChatRoom.EphemeralMode mode)`
Sets the ephemeral mode of the chat room.
`void`
`setEphemeralNotReadLifetime(long time)`
Deprecated.
`void`
`setMuted(boolean muted)`
Sets if a chat room should be considered as muted or not.
`void`
`setParticipantAdminStatus(Participant participant, boolean isAdmin)`
Changes the admin status of a participant of a chat room (you need to be an
admin yourself to do this).
`void`
`setParticipantDevices(Address participantAddress, ParticipantDeviceIdentity[] deviceIdentities)`
Sets the list of participant devices in the form of SIP URIs with GRUUs for a
given participant.
`void`
`setSubject(String subject)`
Sets the subject of a chat room.
`void`
`setSubjectUtf8(String subject)`
Sets the subject of a chat room (utf-8 string).
`void`
`setUserData(Object data)`
Sets the object to store in this object user's data
`String`
`stateToString(ChatRoom.State state)`
Converts a `ChatRoom.State` enum to a string.
`void`
`stopComposing()`
Notifies the destination of the chat message that the user is no longer
composing.
`String`
`toString()`

## Method Details

### getAccount

Account getAccount()
Returns the local account to which this chat room is related.

Returns:
  the related `Account` object if any, null otherwise.

### getCall

Call getCall()
Gets the current call associated to this chatroom if any To commit a message,
use `ChatMessage.send()`

Returns:
  `Call` or null.

### getCapabilities

int getCapabilities()
Gets the capabilities of a chat room.

Returns:
  The capabilities of the chat room (as a
  LinphoneChatRoomCapabilitiesMask)

### getChar

int getChar()
When realtime text is enabled in a `Call` (see
invalid reference

    CallParams#realtimeTextEnabled

), LinphoneCoreIsComposingReceivedCb is called everytime a Real-Time Text
character is received from peer.
`getChar()` pops a character previously received from the receive queue,
and returns it. When a new line character is received, a `ChatMessage` is
automatically created with received characters and notified to the application
through the `CoreListener` or `ChatRoomListener` interfaces.

Returns:
  RFC 4103/T.140 char

### getComposingAddresses

Address[] getComposingAddresses()
Gets the list of participants that are currently composing.

Returns:
  List of addresses that are in the is_composing state. A list of `Address`
  objects.

### getComposingParticipants

ComposingParticipant[] getComposingParticipants()
Gets the list of participants that are currently composing.

Returns:
  List of `ComposingParticipant` that are in the is_composing
  state. A list of `ComposingParticipant` objects.

### getConferenceAddress

Address getConferenceAddress()
Gets the conference address of the chat room.

Returns:
  The conference address of the chat room or null if this type of chat
  room is not conference based.

### setConferenceAddress

void setConferenceAddress(Address conferenceAddress)
Sets the conference address of a group chat room.
This function needs to be called from the
LinphoneChatRoomCbsConferenceAddressGenerationCb callback and only there. This
function is meaningful only for server implementation of chatroom, and shall
not by used by client applications.

Parameters:
  `conferenceAddress` - The conference `Address` to be used by the group
  chat room

### getConferenceInfo

ConferenceInfo getConferenceInfo()
Gets the conference information associated to the chatroom.

Returns:
  the `ConferenceInfo`.

### getCore

Core getCore()
Returns back pointer to `Core` object.

Returns:
  the `Core` object this chat room is attached to.

### getCreationTime

long getCreationTime()
Returns the creation time for the chat room.

Returns:
  the time at which the chat room was created

### getCurrentParams

@Deprecated ChatRoomParams getCurrentParams()
Deprecated.
Returns current parameters associated with the chat room.
This is typically the parameters passed during the `ChatRoom` creation
process to `Core.createChatRoom(org.linphone.core.ConferenceParams, org.linphone.core.Address[])` or some default parameters if no `ChatRoomParams`
was explicitely passed during `ChatRoom` creation.

Returns:
  the current `ChatRoomParams` parameters.
  deprecated: 17/07/2025. Use `getParams()` instead.

### getDocumentContents

Content[] getDocumentContents()
Gets all contents for which content-type starts with either text/ or
application/.

Returns:
  A list of contents considered as "document". A list of `Content`
  objects.

### getDocumentContentsSize

int getDocumentContentsSize()
Gets the number of document contents (see `getDocumentContents()`).

Returns:
  the number of document contents for that `ChatRoom`.

### isEphemeralEnabled

boolean isEphemeralEnabled()
Returns whether or not the ephemeral message feature is enabled in the chat
room.

Returns:
  true if ephemeral is enabled, false otherwise.

### setEphemeralEnabled

@Deprecated void setEphemeralEnabled(boolean enable)
Deprecated.
Enable or disable the ephemeral message feature in the chat room.
Works only for flexisip-based chat room. see: `activateEphemeral(int, int)`

Parameters:
  `enable` - true if the ephemeral message feature is enabled, false
  otherwise.
  deprecated: 20/02/2026. Use `activateEphemeral(int, int)` or `deactivateEphemeral()`
  instead.

### getEphemeralLifetime

long getEphemeralLifetime()
Gets lifetime (in seconds) for all new ephemeral messages in the chat room.
After the message is read, it will be deleted after "time" seconds. see:
linphone_chat_room_activate_ephemeral()

Returns:
  the ephemeral lifetime (in seconds)

### setEphemeralLifetime

@Deprecated void setEphemeralLifetime(long time)
Deprecated.
Sets lifetime (in seconds) for all new ephemeral messages in the chat room.
After the message is read, it will be deleted after "time" seconds. see: `activateEphemeral(int, int)`

Parameters:
  `time` - The ephemeral lifetime, default is 0 (disabled)
  warning: A value of "time" equal to 0 disables ephemeral messages
  deprecated: 20/02/2026. Use `activateEphemeral(int, int)` or `deactivateEphemeral()`
  instead.

### getEphemeralMode

ChatRoom.EphemeralMode getEphemeralMode()
Gets the ephemeral mode of the chat room.
see: linphone_chat_room_activate_ephemeral()

Returns:
  the ephemeral mode `ChatRoom.EphemeralMode`

### setEphemeralMode

void setEphemeralMode(ChatRoom.EphemeralMode mode)
Sets the ephemeral mode of the chat room.
see: linphone_chat_room_activate_ephemeral()

Parameters:
  `mode` - The ephemeral mode `ChatRoom.EphemeralMode`
  warning: This function only changes the mode of ephemeral messages `ChatRoom.EphemeralMode`
  . It is required to manually enable ephemeral messages after setting the mode
  by calling
  invalid reference

      #enableEphemeral

### getEphemeralNotReadLifetime

long getEphemeralNotReadLifetime()
Gets not-read lifetime (in seconds) for all new ephemeral messages in the chat
room.
If the message is not read, it will be deleted after "time" seconds. see:
linphone_chat_room_activate_ephemeral()

Returns:
  the ephemeral not-read lifetime (in seconds)

### setEphemeralNotReadLifetime

@Deprecated void setEphemeralNotReadLifetime(long time)
Deprecated.
Sets not-read lifetime (in seconds) for all new ephemeral messages in the chat
room.
If the message is not read, it will be deleted after "time" seconds. see:
linphone_chat_room_activate_ephemeral()

Parameters:
  `time` - The ephemeral not-read lifetime, default is 0 (disabled)
  warning: A value of "time" equal to 0 disables the ephemeral not-read
  countdowns
  deprecated: 20/02/2026 use `activateEphemeral(int, int)` instead.

### getHistoryEventsSize

int getHistoryEventsSize()
Gets the number of events in a chat room.

Returns:
  the number of events.

### getHistorySize

@Deprecated int getHistorySize()
Deprecated.
Gets the number of messages in a chat room.

Returns:
  the number of messages.
  deprecated: 30/07/2024. Use `getHistorySize()` instead.

### getIdentifier

String getIdentifier()
Returns the chat room identifier.
warning: This method returns a null pointer if the ChatRoom is in the
Instantiated state

Returns:
  the conference identifier.

### isEmpty

boolean isEmpty()
Returns whether or not a `ChatRoom` has at least one `ChatMessage`
or not.

Returns:
  true if there are no `ChatMessage`, false otherwise.

### isReadOnly

boolean isReadOnly()
Returns whether or not a message can be sent using this chat room.
A chat room may be read only until it's created, or when it's a group you have
left.

Returns:
  true if a chat message can't be sent in it, false otherwise.

### isRemoteComposing

boolean isRemoteComposing()
Tells whether the remote is currently composing a message.

Returns:
  true if the remote is currently composing a message, false otherwise.

### getLastMessageInHistory

ChatMessage getLastMessageInHistory()
Gets the last chat message sent or received in this chat room.

Returns:
  the latest `ChatMessage` or null if no message.

### getLastUpdateTime

long getLastUpdateTime()
Returns the last updated time for the chat room.

Returns:
  the last updated time

### getLocalAddress

Address getLocalAddress()
Get the local address associated to this chat room.
warning: This method returns a guessed address based on the me participant if
the ChatRoom is in the Instantiated state

Returns:
  The local address.

### getMe

Participant getMe()
Gets the participant representing myself in the chat room.

Returns:
  The participant representing myself in the conference or null if me is
  not set.

### getMediaContents

Content[] getMediaContents()
Gets all contents for which content-type starts with either video/, audio/
(except for voice messages) or image/.

Returns:
  A list of contents considered as "media". A list of `Content`
  objects.

### getMediaContentsSize

int getMediaContentsSize()
Gets the number of media contents (see `getMediaContents()`).

Returns:
  the number of media contents for that `ChatRoom`.

### getMuted

boolean getMuted()
Gets if a chat room has been flagged as muted (not by default).
A muted chat room isn't used to compute unread messages total count.

Returns:
  true if the chat room is muted, false otherwise.

### setMuted

void setMuted(boolean muted)
Sets if a chat room should be considered as muted or not.
A muted chat room isn't used to compute unread messages total count.

Parameters:
  `muted` - true to flag it as muted, false to un-mute it.

### getNbParticipants

int getNbParticipants()
Gets the number of participants in the chat room (that is without ourselves).

Returns:
  The number of participants in the chat room

### getParams

ConferenceParams getParams()
Returns current parameters associated with the chat room.
This is typically the parameters passed during the `ChatRoom` creation
process to `Core.createChatRoom(org.linphone.core.ConferenceParams, org.linphone.core.Address[])` or some default parameters if no `ChatRoomParams`
was explicitely passed during `ChatRoom` creation.

Returns:
  the current `ChatRoomParams` parameters.

### getParticipants

Participant[] getParticipants()
Gets the list of participants of a chat room.

Returns:
  A A list of `Participant` objects. of the participants

### getPeerAddress

Address getPeerAddress()
Get the peer address associated to this chat room.
warning: This method returns an invalid address if the ChatRoom is in the
Instantiated state

Returns:
  The peer address.

### getRemoteComposingContentType

String getRemoteComposingContentType()
Returns the content-type (if set) of what the remote is currently composing.

Returns:
  the content-type of what the remote is currently composing if set and
  if it's currently composing, null otherwise.

### getSecurityLevel

ChatRoom.SecurityLevel getSecurityLevel()
Gets the security level of a chat room.

Returns:
  The current `ChatRoom.SecurityLevel` of the chat room

### getState

ChatRoom.State getState()
Gets the state of the chat room.

Returns:
  The current `ChatRoom.State` of the chat room

### getSubject

String getSubject()
Gets the subject of a chat room.

Returns:
  The subject of the chat room.

### setSubject

void setSubject(String subject)
Sets the subject of a chat room.

Parameters:
  `subject` - The new subject to set for the chat room

### getSubjectUtf8

String getSubjectUtf8()
Gets the subject of a chat room (as an UTF8 string)

Returns:
  The subject of the chat room.

### setSubjectUtf8

void setSubjectUtf8(String subject)
Sets the subject of a chat room (utf-8 string).

Parameters:
  `subject` - The new subject to set for the chat room

### getUnreadHistory

ChatMessage[] getUnreadHistory()
Gets all unread messages for this chat room, sorted from oldest to most recent.

Returns:
  A list of unread chat messages. A list of `ChatMessage` objects.

### getUnreadMessagesCount

int getUnreadMessagesCount()
Gets the number of unread messages in the chatroom.

Returns:
  the number of unread messages.

### activateEphemeral

int activateEphemeral(int lifetime, int notReadLifetime)
Activate the ephemeral message feature in the chat room with a specified
timeout.
Works only for flexisip-based chat room. An ephemeral message will
automatically disappear from the sender and recipient's chatrooms after a set
period of time. The timer starts when the message has been displayed at the
recipient, which means:
-at recipient side when `markAsRead()` is called.
-at sender side, when the message enters the state
LinphoneChatMessageStateDisplayed (when receiving the displayed IMDN).
At least one from lifetime or notReadLifetime must be strictly positive.

Parameters:
  `lifetime` - The ephemeral lifetime strictly positive. To disable the
  feature, use `deactivateEphemeral()`.
  `notReadLifetime` - The ephemeral not read lifetime strictly positive.
Returns:
  0 if successful, -1 otherwise

### addParticipant

void addParticipant(Address addr)
Adds a participant to a chat room.
This may fail if this type of chat room does not handle participants. Use
`canHandleParticipants()` to know if this chat room handles participants.

Parameters:
  `addr` - The address of the participant to add to the chat room

### addParticipants

boolean addParticipants(Address[] addresses)
Adds several participants to a chat room at once.
This may fail if this type of chat room does not handle participants. Use
`canHandleParticipants()` to know if this chat room handles participants.

Parameters:
  `addresses` - The participants to add. A list of `Address` objects.
Returns:
  true if everything is OK, false otherwise

### allowCpim

void allowCpim()
Allow cpim on a basic chat room .

### allowMultipart

void allowMultipart()
Allow multipart on a basic chat room .

### canHandleParticipants

boolean canHandleParticipants()
Tells whether a chat room is able to handle participants.

Returns:
  true if the chat room can handle participants, false otherwise

### close

int close()
Terminates a chat room and instruct the server to remove all participants.

Returns:
  0 if the termination is successful, -1 otherwise.

### compose

@Deprecated void compose()
Deprecated.
Notifies the destination of the chat message being composed that the user is
typing a new message.
deprecated: 24/06/2025 use `composeTextMessage()` instead.

### composeTextMessage

void composeTextMessage()
Notifies the destination of the chat message being composed that the user is
typing a message.

### composeVoiceMessage

void composeVoiceMessage()
Notifies the destination of the chat message being composed that the user is
recording a new voice message.

### createEmptyMessage

ChatMessage createEmptyMessage()
Creates an empty message attached to the given chat room.

Returns:
  a new `ChatMessage`

### createFileTransferMessage

ChatMessage createFileTransferMessage(Content initialContent)
Creates a message attached to the given chat room with a particular content.
Use `ChatMessage.send()` to initiate the transfer

Parameters:
  `initialContent` - `Content` initial content.
Returns:
  a new `ChatMessage`

### createForwardMessage

ChatMessage createForwardMessage(ChatMessage message)
Creates a forward message attached to the given chat room with a particular
message.

Parameters:
  `message` - `ChatMessage` message to be forwarded.
Returns:
  a new `ChatMessage`

### createMessage

@Deprecated ChatMessage createMessage(String message)
Deprecated.
Creates a message attached to the given chat room with a plain text content
filled with the given message.

Parameters:
  `message` - text message, null if absent.
Returns:
  a new `ChatMessage`
  deprecated: 01/07/2020. Use `createMessageFromUtf8(java.lang.String)` instead.

### createMessageFromUtf8

ChatMessage createMessageFromUtf8(String message)
Creates a message attached to the given chat room with a plain text content
filled with the given message.
Introduced in 01/07/2020

Parameters:
  `message` - text message in UTF8, null if absent.
Returns:
  a new `ChatMessage`

### createReplacesMessage

ChatMessage createReplacesMessage(ChatMessage message)
Creates a replaces message that will edit the original message.

Parameters:
  `message` - `ChatMessage` message to edit.
Returns:
  a new `ChatMessage`

### createReplyMessage

ChatMessage createReplyMessage(ChatMessage message)
Creates a reply message attached to the given chat room with a particular
message.

Parameters:
  `message` - `ChatMessage` message to reply to.
Returns:
  a new `ChatMessage`

### createVoiceRecordingMessage

ChatMessage createVoiceRecordingMessage(Recorder recorder)
Creates a chat message with a voice recording attached to the given chat room.
warning: If the recorder isn't in Closed state, it will return an empty
message!

Parameters:
  `recorder` - the `Recorder` object used to record the voice message.
Returns:
  a new `ChatMessage`

### deactivateEphemeral

int deactivateEphemeral()
Disable the ephemeral message feature in the chat room.
See linphone_chat_room_activate_ephemeral() for more details.

Returns:
  0 if successful, -1 otherwise

### deleteHistory

void deleteHistory()
Delete all messages from the history.

### deleteMessage

void deleteMessage(ChatMessage message)
Delete a message from the chat room history.

Parameters:
  `message` - The `ChatMessage` object to remove.

### ephemeralSupportedByAllParticipants

boolean ephemeralSupportedByAllParticipants()
Check if all participants support ephemeral messages.
It doesn't prevent to send ephemeral messages in the room but those who don't
support it won't delete messages after lifetime has expired. The check is done
by verifying the participant's advertised capabilities (+org.linphone.specs
parameter). see: linphone_chat_room_activate_ephemeral()

Returns:
  true if all participants in the chat room support ephemeral messages,
  false otherwise

### findEventLog

EventLog findEventLog(String messageId)
Gets the event log sent or received in this chat room that matches a chat
message with the given message_id.

Parameters:
  `messageId` - The id of the message to find
Returns:
  the `EventLog` if found or null.

### findMessage

ChatMessage findMessage(String messageId)
Gets the chat message sent or received in this chat room that matches the
message_id.

Parameters:
  `messageId` - The id of the message to find
Returns:
  the `ChatMessage` if found or null.

### findParticipant

Participant findParticipant(Address address)
Finds a participant of a chat room from its address.

Parameters:
  `address` - The `Address` to search in the list of participants of the
  chat room
Returns:
  The participant if found, null otherwise.

### getDocumentContentsRange

Content[] getDocumentContentsRange(int begin, int end)
Gets the partial list of contents for which content-type starts with either
text/ or application/.

Parameters:
  `begin` - The first content of the range to be retrieved. Most recent
  content has index 0.
  `end` - The last content of the range to be retrieved. Oldest content has
  index of size (use `getDocumentContentsSize()` to retrieve size)
Returns:
  A list of contents considered as "document". A list of `Content`
  objects.

### getHistory

EventLog[] getHistory(int nbMessage, int filters)
Gets nb_message most recent events from chat_room chat room, sorted from oldest
to most recent.

Parameters:
  `nbMessage` - Number of events to retrieve. 0 means everything.
  `filters` - The LinphoneChatRoomHistoryFilterMask mask to filter the results
  with `ChatRoom.HistoryFilter`
Returns:
  A list of A list of `EventLog` objects.

### getHistory

@Deprecated ChatMessage[] getHistory(int nbMessage)
Deprecated.
Gets nb_message most recent messages from chat_room chat room, sorted from
oldest to most recent.

Parameters:
  `nbMessage` - Number of message to retrieve. 0 means everything.
Returns:
  A list of A list of `ChatMessage` objects.
  deprecated: 30/07/2024. Use `getHistory(int, int)` instead.

### getHistoryEvents

EventLog[] getHistoryEvents(int nbEvents)
Gets nb_events most recent events from chat_room chat room, sorted from oldest
to most recent.

Parameters:
  `nbEvents` - Number of events to retrieve. 0 means everything.
Returns:
  The list of the most recent events. A list of `EventLog` objects.

### getHistoryMessageEvents

EventLog[] getHistoryMessageEvents(int nbEvents)
Gets nb_events most recent chat message events from chat_room chat room, sorted
from oldest to most recent.

Parameters:
  `nbEvents` - Number of events to retrieve. 0 means everything.
Returns:
  A list A list of `EventLog` objects.

### getHistoryRange

EventLog[] getHistoryRange(int begin, int end, int filters)
Gets the partial list of events in the given range, sorted from oldest to most
recent.

Parameters:
  `begin` - The first event of the range to be retrieved. History most recent
  message has index 0.
  `end` - The last event of the range to be retrieved. History oldest message
  has index of history size (use `getHistorySize()` to retrieve history
  size)
  `filters` - The LinphoneChatRoomHistoryFilterMask mask to filter the results
  with `ChatRoom.HistoryFilter`
Returns:
  A list of A list of `EventLog` objects.

### getHistoryRange

@Deprecated ChatMessage[] getHistoryRange(int begin, int end)
Deprecated.
Gets the partial list of messages in the given range, sorted from oldest to
most recent.

Parameters:
  `begin` - The first message of the range to be retrieved. History most
  recent message has index 0.
  `end` - The last message of the range to be retrieved. History oldest
  message has index of history size (use `getHistorySize()` to retrieve
  history size)
Returns:
  A list of chat messages. A list of `ChatMessage` objects.
  deprecated: 30/07/2024. Use `getHistoryRange(int, int, int)` instead.

### getHistoryRangeBetween

EventLog[] getHistoryRangeBetween(EventLog firstEvent, EventLog lastEvent, int filters)
Gets the partial list of messages between two given `EventLog`, sorted
from oldest to most recent.
If either first_event or last_event is null, then nothing is returned.

Parameters:
  `firstEvent` - The `EventLog` object corresponding to the event.
  `lastEvent` - The `EventLog` object corresponding to the event.
  `filters` - The LinphoneChatRoomHistoryFilterMask mask to filter the results
  with `ChatRoom.HistoryFilter`
Returns:
  A list of A list of `EventLog` objects. between the two
  provided events, if any.

### getHistoryRangeEvents

EventLog[] getHistoryRangeEvents(int begin, int end)
Gets the partial list of events in the given range, sorted from oldest to most
recent.

Parameters:
  `begin` - The first event of the range to be retrieved. History most recent
  event has index 0.
  `end` - The last event of the range to be retrieved. History oldest event
  has index of history size
Returns:
  The list of the found events. A list of `EventLog` objects.

### getHistoryRangeMessageEvents

EventLog[] getHistoryRangeMessageEvents(int begin, int end)
Gets the partial list of chat message events in the given range, sorted from
oldest to most recent.

Parameters:
  `begin` - The first event of the range to be retrieved. History most recent
  event has index 0.
  `end` - The last event of the range to be retrieved. History oldest event
  has index of history size
Returns:
  The list of chat message events. A list of `EventLog` objects.

### getHistoryRangeNear

EventLog[] getHistoryRangeNear(int before, int after, EventLog event, int filters)
Gets the partial list of messages in the given range near the `EventLog`
provided, sorted from oldest to most recent.
If before and after are both set to 0, the returned list is empty.

Parameters:
  `before` - The number of messages to retrieve before the event provided.
  `after` - The number of messages to retrieve after the event provided.
  `event` - The `EventLog` object corresponding to the event.
  `filters` - The LinphoneChatRoomHistoryFilterMask mask to filter the results
  with `ChatRoom.HistoryFilter`
Returns:
  A list of A list of `EventLog` objects. near the event provided
  included.

### getHistorySize

int getHistorySize(int filters)
Gets the number of messages in a chat room.

Parameters:
  `filters` - The LinphoneChatRoomHistoryFilterMask mask to filter the result
  with `ChatRoom.HistoryFilter`
Returns:
  the number of messages.

### getMediaContentsRange

Content[] getMediaContentsRange(int begin, int end)
Gets the partial list of contents for which content-type starts with either
video/, audio/ (except for voice messages) or image/.

Parameters:
  `begin` - The first content of the range to be retrieved. Most recent
  content has index 0.
  `end` - The last content of the range to be retrieved. Oldest content has
  index of size (use `getMediaContentsSize()` to retrieve size)
Returns:
  A list of contents considered as "media". A list of `Content`
  objects.

### hasBeenLeft

@Deprecated boolean hasBeenLeft()
Deprecated.
Returns whether or not the chat room has been left.

Returns:
  true if the chat room has been left, false otherwise.
  deprecated: 16/03/2022 use `isReadOnly()` instead.

### hasCapability

boolean hasCapability(int mask)
Checks if a chat room has given capabilities.

Parameters:
  `mask` - a LinphoneChatRoomCapabilitiesMask mask
Returns:
  true if the mask matches, false otherwise

### leave

void leave()
Leaves a chat room.

### markAsRead

void markAsRead()
Mark all messages of the conversation as read.

### nominateAdminAndLeave

void nominateAdminAndLeave(Address newAdmin)
Nominates a new admin and then leaves a chat room.

Parameters:
  `newAdmin` - The `Address` of the new admin
  note: The local participant will not leave the chat room if the new admin
  cannot be nominated

### notifyParticipantDeviceRegistration

void notifyParticipantDeviceRegistration(Address participantDevice)
Notifies the chatroom that a participant device has just registered.
This function is meaningful only for server implementation of chatroom, and
shall not by used by client applications.

Parameters:
  `participantDevice` - list of the participant devices to be used by the
  group chat room

### receiveChatMessage

void receiveChatMessage(ChatMessage message)
Used to receive a chat message when using async mechanism with IM
enchat_roomyption engine.

Parameters:
  `message` - `ChatMessage` object

### removeParticipant

void removeParticipant(Participant participant)
Removes a participant of a chat room.

Parameters:
  `participant` - The participant to remove from the chat room

### removeParticipants

void removeParticipants(Participant[] participants)
Removes several participants of a chat room at once.

Parameters:
  `participants` - The participants to remove. A list of `Participant`
  objects.

### retractMessage

void retractMessage(ChatMessage message)
Deletes the content of a previously sent message for both sender and receivers.
Message will still appear in the conversation history but will be empty. You
can still delete it from history using `deleteMessage(org.linphone.core.ChatMessage)`.

Parameters:
  `message` - The `ChatMessage` object to delete.

### searchChatMessageByText

EventLog searchChatMessageByText(String text, EventLog from, SearchDirection direction)
Searches chat messages by text.

Parameters:
  `text` - The text to search in messages
  `from` - The `EventLog` object corresponding to the event where to
  start the search
  `direction` - The `SearchDirection` where to search,
  LinphoneSearchDirectionUp will search older messages while
  LinphoneSearchDirectionDown will search newer messages
Returns:
  the `EventLog` corresponding to the message if found or null.

### setParticipantAdminStatus

void setParticipantAdminStatus(Participant participant, boolean isAdmin)
Changes the admin status of a participant of a chat room (you need to be an
admin yourself to do this).

Parameters:
  `participant` - The Participant for which to change the admin status
  `isAdmin` - A boolean value telling whether the participant should now be an
  admin or not

### setParticipantDevices

void setParticipantDevices(Address participantAddress, ParticipantDeviceIdentity[] deviceIdentities)
Sets the list of participant devices in the form of SIP URIs with GRUUs for a
given participant.
This function is meaningful only for server implementation of chatroom, and
shall not by used by client applications.

Parameters:
  `participantAddress` - The participant address
  `deviceIdentities` - List of the participant devices to be used by the group
  chat room A list of `ParticipantDeviceIdentity` objects.

### stopComposing

void stopComposing()
Notifies the destination of the chat message that the user is no longer
composing.

### stateToString

String stateToString(ChatRoom.State state)
Converts a `ChatRoom.State` enum to a string.

Parameters:
  `state` - a `ChatRoom.State` to convert to string
Returns:
  the string representation of the `ChatRoom.State`

### addListener

void addListener(ChatRoomListener listener)

### removeListener

void removeListener(ChatRoomListener listener)

### setUserData

void setUserData(Object data)
Sets the object to store in this object user's data

Parameters:
  `data` - the object to store

### getUserData

Object getUserData()
Gets the object stored in this object user's data

Returns:
  the object store if any, null otherwise

### getNativePointer

long getNativePointer()
Gets the native pointer used by this class to make native method calls.

Returns:
  the nativer pointer, as long

### toString

String toString()

Overrides:
  `toString` in class `Object`