public interface ChatRoom
ChatMessage
are exchanged. ChatRoom
, you first need a ChatRoomParams
ChatRoomBackend.FlexisipChat
). Then you can call Core.searchChatRoom(org.linphone.core.ChatRoomParams, org.linphone.core.Address, org.linphone.core.Address, org.linphone.core.Address[])
Core.createChatRoom(org.linphone.core.ChatRoomParams, org.linphone.core.Address, java.lang.String, org.linphone.core.Address[])
.ChatRoomBackend.FlexisipChat
backend ChatRoom
ChatRoom.State.Created
Core
starts, and youCore.getChatRooms()
. This method doesn't return emptyProxyConfig
identity, unless you specify otherwise in the [misc]Modifier and Type | Interface | Description |
---|---|---|
static class |
ChatRoom.State |
Modifier and Type | Method | Description |
---|---|---|
void |
addListener(ChatRoomListener listener) |
|
void |
addParticipant(Address addr) |
Add a participant to a chat room.
|
boolean |
addParticipants(Address[] addresses) |
Add 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.
|
void |
compose() |
Notifies the destination of the chat message being composed that the user is
typing a new 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(java.lang.String message) |
Deprecated.
01/07/2020. Use
createMessageFromUtf8(java.lang.String) instead. |
ChatMessage |
createMessageFromUtf8(java.lang.String message) |
Creates a message attached to the given chat room with a plain text content
filled with the given 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.
|
void |
deleteHistory() |
Delete all messages from the history.
|
void |
deleteMessage(ChatMessage message) |
Delete a message from the chat room history.
|
boolean |
ephemeralSupportedByAllParticipants() |
Uses linphone spec to check if all participants support ephemeral messages.
|
ChatMessage |
findMessage(java.lang.String messageId) |
Gets the chat message sent or received in this chat room that matches the
message_id. |
Participant |
findParticipant(Address address) |
Find a participant of a chat room from its address.
|
Call |
getCall() |
Gets the current call associated to this chatroom if any To commit a message,
use ChatMessage.send() |
int |
getCapabilities() |
Get the capabilities of a chat room.
|
int |
getChar() |
When realtime text is enabled
CallParams#realtimeTextEnabled ,LinphoneCoreIsComposingReceivedCb is call everytime a char is received from peer. |
Address[] |
getComposingAddresses() |
Gets the list of participants that are currently composing.
|
Address |
getConferenceAddress() |
Get the conference address of the chat room.
|
Core |
getCore() |
Returns back pointer to
Core object. |
long |
getCreationTime() |
Return the creation time for the chat room.
|
ChatRoomParams |
getCurrentParams() |
Returns current parameters associated with the chat room.
|
long |
getEphemeralLifetime() |
Get lifetime (in seconds) for all new ephemeral messages in the chat room.
|
ChatRoomEphemeralMode |
getEphemeralMode() |
Get the ephemeral mode of the chat room.
|
ChatMessage[] |
getHistory(int nbMessage) |
Gets nb_message most recent messages 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) |
Gets the partial list of messages in the given range, 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. |
int |
getHistorySize() |
Gets the number of messages in a chat room.
|
ChatMessage |
getLastMessageInHistory() |
Gets the last chat message sent or received in this chat room.
|
long |
getLastUpdateTime() |
Return the last updated time for the chat room.
|
Address |
getLocalAddress() |
Get the local address associated to this chat room.
|
Participant |
getMe() |
Get the participant representing myself in the chat room.
|
long |
getNativePointer() |
Gets the native pointer used by this class to make native method calls.
|
int |
getNbParticipants() |
Get the number of participants in the chat room (that is without ourselves).
|
Participant[] |
getParticipants() |
Get the list of participants of a chat room.
|
Address |
getPeerAddress() |
Get the peer address associated to this chat room.
|
ChatRoomSecurityLevel |
getSecurityLevel() |
Get the security level of a chat room.
|
ChatRoom.State |
getState() |
Get the state of the chat room.
|
java.lang.String |
getSubject() |
Get the subject of a chat room.
|
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.
|
java.lang.Object |
getUserData() |
Gets the object stored in this object user's data
|
boolean |
hasBeenLeft() |
Deprecated.
16/03/2022 use
isReadOnly() instead. |
boolean |
hasCapability(int mask) |
Check if a chat room has given capabilities.
|
boolean |
isEmpty() |
|
boolean |
isEphemeralEnabled() |
Returns whether or not the ephemeral message feature is enabled in the chat
room. |
boolean |
isReadOnly() |
Return 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() |
Leave a chat room.
|
boolean |
limeAvailable() |
Returns wether lime is available for given peer or not.
|
void |
markAsRead() |
Mark all messages of the conversation as read.
|
void |
notifyParticipantDeviceRegistration(Address participantDevice) |
Notify 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) |
Remove a participant of a chat room.
|
void |
removeParticipants(Participant[] participants) |
Remove several participants of a chat room at once.
|
void |
setConferenceAddress(Address conferenceAddress) |
Set the conference address of a group chat room.
|
void |
setEphemeralEnabled(boolean enable) |
Enable or disable the ephemeral message feature in the chat room.
|
void |
setEphemeralLifetime(long time) |
Set lifetime (in seconds) for all new ephemeral messages in the chat room.
|
void |
setEphemeralMode(ChatRoomEphemeralMode mode) |
Set the ephemeral mode of the chat room.
|
void |
setParticipantAdminStatus(Participant participant,
boolean isAdmin) |
Change 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) |
Set the list of participant devices in the form of SIP URIs with GRUUs for a
given participant. |
void |
setSubject(java.lang.String subject) |
Set the subject of a chat room.
|
void |
setUserData(java.lang.Object data) |
Sets the object to store in this object user's data
|
java.lang.String |
stateToString(ChatRoom.State state) |
Converts a
ChatRoom.State enum to a string. |
java.lang.String |
toString() |
@Nullable Call getCall()
ChatMessage.send()
Call
or null. int getCapabilities()
int getChar()
CallParams#realtimeTextEnabled
,ChatMessage
is received with@NonNull Address[] getComposingAddresses()
@Nullable Address getConferenceAddress()
void setConferenceAddress(@Nullable Address conferenceAddress)
conferenceAddress
- The conference Address
to be used by the grouplong getCreationTime()
@NonNull ChatRoomParams getCurrentParams()
ChatRoomParams
ChatRoomParams
parameters. boolean isEphemeralEnabled()
void setEphemeralEnabled(boolean enable)
setEphemeralLifetime(long)
. The timerenable
- true if the ephemeral message feature is enabled, falselong getEphemeralLifetime()
#ephemeralEnabled
void setEphemeralLifetime(long time)
#ephemeralEnabled
time
- The ephemeral lifetime, default is 0 (disabled) ChatRoomEphemeralMode getEphemeralMode()
#ephemeralEnabled
ChatRoomEphemeralMode
void setEphemeralMode(ChatRoomEphemeralMode mode)
#ephemeralEnabled
mode
- The ephemeral mode ChatRoomEphemeralMode
ChatRoomEphemeralMode
#enableEphemeral
int getHistoryEventsSize()
int getHistorySize()
boolean isEmpty()
ChatMessage
, false otherwise. boolean isReadOnly()
boolean isRemoteComposing()
@Nullable ChatMessage getLastMessageInHistory()
ChatMessage
or null if no message. long getLastUpdateTime()
@NonNull Address getLocalAddress()
@Nullable Participant getMe()
int getNbParticipants()
@NonNull Participant[] getParticipants()
@NonNull Address getPeerAddress()
ChatRoomSecurityLevel getSecurityLevel()
ChatRoomSecurityLevel
of the chat room ChatRoom.State getState()
ChatRoom.State
of the chat room @Nullable java.lang.String getSubject()
void setSubject(@Nullable java.lang.String subject)
subject
- The new subject to set for the chat room @NonNull ChatMessage[] getUnreadHistory()
int getUnreadMessagesCount()
void addParticipant(@NonNull Address addr)
canHandleParticipants()
to know if this chat room handles participants. addr
- The address of the participant to add to the chat room boolean addParticipants(@NonNull Address[] addresses)
canHandleParticipants()
to know if this chat room handles participants. addresses
- The participants to add. void allowCpim()
void allowMultipart()
boolean canHandleParticipants()
void compose()
@NonNull ChatMessage createEmptyMessage()
ChatMessage
@NonNull ChatMessage createFileTransferMessage(@NonNull Content initialContent)
ChatMessage.send()
to initiate the transfer initialContent
- Content
initial content. ChatMessage
@NonNull ChatMessage createForwardMessage(@NonNull ChatMessage message)
message
- ChatMessage
message to be forwarded. ChatMessage
@Deprecated @NonNull ChatMessage createMessage(@Nullable java.lang.String message)
createMessageFromUtf8(java.lang.String)
instead. message
- text message, null if absent. ChatMessage
@NonNull ChatMessage createMessageFromUtf8(@Nullable java.lang.String message)
message
- text message in UTF8, null if absent. ChatMessage
@NonNull ChatMessage createReplyMessage(@NonNull ChatMessage message)
message
- ChatMessage
message to reply to. ChatMessage
@NonNull ChatMessage createVoiceRecordingMessage(@NonNull Recorder recorder)
recorder
- the Recorder
object used to record the voice message. ChatMessage
void deleteHistory()
void deleteMessage(@NonNull ChatMessage message)
message
- The ChatMessage
object to remove. boolean ephemeralSupportedByAllParticipants()
#ephemeralEnabled
@Nullable ChatMessage findMessage(@NonNull java.lang.String messageId)
messageId
- The id of the message to find ChatMessage
if found or null. @Nullable Participant findParticipant(@NonNull Address address)
address
- The Address
to search in the list of participants of the@NonNull ChatMessage[] getHistory(int nbMessage)
nbMessage
- Number of message to retrieve. 0 means everything. @NonNull EventLog[] getHistoryEvents(int nbEvents)
nbEvents
- Number of events to retrieve. 0 means everything. @NonNull EventLog[] getHistoryMessageEvents(int nbEvents)
nbEvents
- Number of events to retrieve. 0 means everything. @NonNull ChatMessage[] getHistoryRange(int begin, int end)
begin
- The first message of the range to be retrieved. History mostend
- The last message of the range to be retrieved. History oldestgetHistorySize()
to retrieve@NonNull EventLog[] getHistoryRangeEvents(int begin, int end)
begin
- The first event of the range to be retrieved. History most recentend
- The last event of the range to be retrieved. History oldest event@NonNull EventLog[] getHistoryRangeMessageEvents(int begin, int end)
begin
- The first event of the range to be retrieved. History most recentend
- The last event of the range to be retrieved. History oldest event@Deprecated boolean hasBeenLeft()
isReadOnly()
instead. boolean hasCapability(int mask)
mask
- a LinphoneChatRoomCapabilitiesMask mask void leave()
boolean limeAvailable()
void markAsRead()
void notifyParticipantDeviceRegistration(@NonNull Address participantDevice)
participantDevice
- list of the participant devices to be used by thevoid receiveChatMessage(@NonNull ChatMessage message)
message
- ChatMessage
object void removeParticipant(@NonNull Participant participant)
participant
- The participant to remove from the chat room void removeParticipants(@NonNull Participant[] participants)
participants
- The participants to remove. void setParticipantAdminStatus(@NonNull Participant participant, boolean isAdmin)
participant
- The Participant for which to change the admin status isAdmin
- A boolean value telling whether the participant should now be anvoid setParticipantDevices(@NonNull Address participantAddress, @NonNull ParticipantDeviceIdentity[] deviceIdentities)
participantAddress
- The participant address deviceIdentities
- List of the participant devices to be used by the group@NonNull java.lang.String stateToString(ChatRoom.State state)
state
- a ChatRoom.State
to convert to string ChatRoom.State
void addListener(ChatRoomListener listener)
void removeListener(ChatRoomListener listener)
void setUserData(java.lang.Object data)
data
- the object to storejava.lang.Object getUserData()
long getNativePointer()
java.lang.String toString()
toString
in class java.lang.Object