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.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 and Description |
---|---|
static class |
ChatRoom.State |
Modifier and Type | Method and 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. |
void |
deleteHistory()
Delete all messages from the history.
|
void |
deleteMessage(ChatMessage message)
Delete a message from the chat room history.
|
void |
enableEphemeral(boolean enable)
Enable or disable the ephemeral message feature in the chat room.
|
boolean |
ephemeralEnabled()
Returns whether or not the ephemeral message feature is enabled in the chat
room. |
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 linphone_chat_room_send_message |
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. |
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.
|
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.
|
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()
Return whether or not the chat room has been left.
|
boolean |
hasCapability(int mask)
Check if a chat room has given capabilities.
|
boolean |
isEmpty()
|
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 |
setEphemeralLifetime(long time)
Set lifetime (in seconds) for all new ephemral messages in 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 |
toString() |
@Nullable Call getCall()
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 group@NonNull ChatRoomParams getCurrentParams()
ChatRoomParams
ChatRoomParams
parameters. boolean ephemeralEnabled()
void enableEphemeral(boolean enable)
enable
- true if the ephemeral message feature is enabled, falselong getEphemeralLifetime()
ephemeralEnabled()
void setEphemeralLifetime(long time)
ephemeralEnabled()
time
- The ephemral lifetime, default 24h, 86400s int getHistoryEventsSize()
int getHistorySize()
boolean isEmpty()
ChatMessage
, false otherwise. 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 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)
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
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 eventboolean hasBeenLeft()
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 groupvoid 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