Liblinphone
5.4.0
|
A chat room is the place where ChatMessage are exchanged. More...
#include <chat_room.hh>
Public Member Functions | |
LINPHONECXX_PUBLIC | ChatRoom (void *ptr, bool takeRef=true) |
LINPHONECXX_PUBLIC _LinphoneChatRoom * | cPtr () |
LINPHONECXX_PUBLIC void | addListener (const std::shared_ptr< ChatRoomListener > &listener) |
Add an application listener to the ChatRoom instance. More... | |
LINPHONECXX_PUBLIC void | removeListener (const std::shared_ptr< ChatRoomListener > &listener) |
Remove a previously added listener from the ChatRoom instance. More... | |
LINPHONECXX_PUBLIC std::shared_ptr< linphone::Account > | getAccount () |
Returns the local account to which this chat room is related. More... | |
LINPHONECXX_PUBLIC std::shared_ptr< linphone::Call > | getCall () const |
Gets the current call associated to this chatroom if any To commit a message, use ChatMessage::send() More... | |
LINPHONECXX_PUBLIC unsigned int | getCapabilities () const |
Gets the capabilities of a chat room. More... | |
LINPHONECXX_PUBLIC uint32_t | getChar () |
When realtime text is enabled in a Call (see CallParams::realtimeTextEnabled()), LinphoneCoreIsComposingReceivedCb is called everytime a Real-Time Text character is received from peer. More... | |
LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::Address > > | getComposingAddresses () |
Gets the list of participants that are currently composing. More... | |
LINPHONECXX_PUBLIC std::shared_ptr< const linphone::Address > | getConferenceAddress () const |
Gets the conference address of the chat room. More... | |
LINPHONECXX_PUBLIC void | setConferenceAddress (const std::shared_ptr< linphone::Address > &conferenceAddress) |
Sets the conference address of a group chat room. More... | |
LINPHONECXX_PUBLIC std::shared_ptr< const linphone::ConferenceInfo > | getConferenceInfo () |
Gets the conference information associated to the chatroom. More... | |
LINPHONECXX_PUBLIC std::shared_ptr< linphone::Core > | getCore () const |
Returns back pointer to Core object. More... | |
LINPHONECXX_PUBLIC time_t | getCreationTime () const |
Returns the creation time for the chat room. More... | |
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED std::shared_ptr< const linphone::ChatRoomParams > | getCurrentParams () const |
Returns current parameters associated with the chat room. More... | |
LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::Content > > | getDocumentContents () |
Gets all contents for which content-type starts with either text/ or application/. More... | |
LINPHONECXX_PUBLIC bool | ephemeralEnabled () const |
Returns whether or not the ephemeral message feature is enabled in the chat room. More... | |
LINPHONECXX_PUBLIC void | enableEphemeral (bool enable) |
Enable or disable the ephemeral message feature in the chat room. More... | |
LINPHONECXX_PUBLIC long | getEphemeralLifetime () const |
Gets lifetime (in seconds) for all new ephemeral messages in the chat room. More... | |
LINPHONECXX_PUBLIC void | setEphemeralLifetime (long time) |
Sets lifetime (in seconds) for all new ephemeral messages in the chat room. More... | |
LINPHONECXX_PUBLIC EphemeralMode | getEphemeralMode () const |
Gets the ephemeral mode of the chat room. More... | |
LINPHONECXX_PUBLIC void | setEphemeralMode (EphemeralMode mode) |
Sets the ephemeral mode of the chat room. More... | |
LINPHONECXX_PUBLIC int | getHistoryEventsSize () |
Gets the number of events in a chat room. More... | |
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED int | getHistorySize () |
Gets the number of messages in a chat room. More... | |
LINPHONECXX_PUBLIC std::string | getIdentifier () const |
Returns the chat room identifier. More... | |
LINPHONECXX_PUBLIC bool | isEmpty () |
Returns whether or not a ChatRoom has at least one ChatMessage or not. More... | |
LINPHONECXX_PUBLIC bool | isReadOnly () const |
Returns whether or not a message can be sent using this chat room. More... | |
LINPHONECXX_PUBLIC bool | isRemoteComposing () const |
Tells whether the remote is currently composing a message. More... | |
LINPHONECXX_PUBLIC std::shared_ptr< linphone::ChatMessage > | getLastMessageInHistory () |
Gets the last chat message sent or received in this chat room. More... | |
LINPHONECXX_PUBLIC time_t | getLastUpdateTime () const |
Returns the last updated time for the chat room. More... | |
LINPHONECXX_PUBLIC std::shared_ptr< const linphone::Address > | getLocalAddress () |
Get the local address associated to this chat room. More... | |
LINPHONECXX_PUBLIC std::shared_ptr< linphone::Participant > | getMe () const |
Gets the participant representing myself in the chat room. More... | |
LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::Content > > | getMediaContents () |
Gets all contents for which content-type starts with either video/, audio/ or image/. More... | |
LINPHONECXX_PUBLIC bool | getMuted () const |
Gets if a chat room has been flagged as muted (not by default). More... | |
LINPHONECXX_PUBLIC void | setMuted (bool muted) |
Sets if a chat room should be considered as muted or not. More... | |
LINPHONECXX_PUBLIC int | getNbParticipants () const |
Gets the number of participants in the chat room (that is without ourselves). More... | |
LINPHONECXX_PUBLIC std::shared_ptr< const linphone::ConferenceParams > | getParams () const |
Returns current parameters associated with the chat room. More... | |
LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::Participant > > | getParticipants () const |
Gets the list of participants of a chat room. More... | |
LINPHONECXX_PUBLIC std::shared_ptr< const linphone::Address > | getPeerAddress () |
Get the peer address associated to this chat room. More... | |
LINPHONECXX_PUBLIC SecurityLevel | getSecurityLevel () |
Gets the security level of a chat room. More... | |
LINPHONECXX_PUBLIC State | getState () const |
Gets the state of the chat room. More... | |
LINPHONECXX_PUBLIC std::string | getSubject () const |
Gets the subject of a chat room. More... | |
LINPHONECXX_PUBLIC void | setSubject (const std::string &subject) |
Sets the subject of a chat room. More... | |
LINPHONECXX_PUBLIC std::string | getSubjectUtf8 () const |
Gets the subject of a chat room (as an UTF8 string) More... | |
LINPHONECXX_PUBLIC void | setSubjectUtf8 (const std::string &subject) |
Sets the subject of a chat room (utf-8 string). More... | |
LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::ChatMessage > > | getUnreadHistory () |
Gets all unread messages for this chat room, sorted from oldest to most recent. More... | |
LINPHONECXX_PUBLIC int | getUnreadMessagesCount () |
Gets the number of unread messages in the chatroom. More... | |
LINPHONECXX_PUBLIC void | addParticipant (const std::shared_ptr< linphone::Address > &addr) |
Adds a participant to a chat room. More... | |
LINPHONECXX_PUBLIC bool | addParticipants (const std::list< std::shared_ptr< linphone::Address >> &addresses) |
Adds several participants to a chat room at once. More... | |
LINPHONECXX_PUBLIC void | allowCpim () |
Allow cpim on a basic chat room . | |
LINPHONECXX_PUBLIC void | allowMultipart () |
Allow multipart on a basic chat room . | |
LINPHONECXX_PUBLIC bool | canHandleParticipants () const |
Tells whether a chat room is able to handle participants. More... | |
LINPHONECXX_PUBLIC void | compose () |
Notifies the destination of the chat message being composed that the user is typing a new message. | |
LINPHONECXX_PUBLIC std::shared_ptr< linphone::ChatMessage > | createEmptyMessage () |
Creates an empty message attached to the given chat room. More... | |
LINPHONECXX_PUBLIC std::shared_ptr< linphone::ChatMessage > | createFileTransferMessage (const std::shared_ptr< linphone::Content > &initialContent) |
Creates a message attached to the given chat room with a particular content. More... | |
LINPHONECXX_PUBLIC std::shared_ptr< linphone::ChatMessage > | createForwardMessage (const std::shared_ptr< linphone::ChatMessage > &message) |
Creates a forward message attached to the given chat room with a particular message. More... | |
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED std::shared_ptr< linphone::ChatMessage > | createMessage (const std::string &message) |
Creates a message attached to the given chat room with a plain text content filled with the given message. More... | |
LINPHONECXX_PUBLIC std::shared_ptr< linphone::ChatMessage > | createMessageFromUtf8 (const std::string &message) |
Creates a message attached to the given chat room with a plain text content filled with the given message. More... | |
LINPHONECXX_PUBLIC std::shared_ptr< linphone::ChatMessage > | createReplyMessage (const std::shared_ptr< linphone::ChatMessage > &message) |
Creates a reply message attached to the given chat room with a particular message. More... | |
LINPHONECXX_PUBLIC std::shared_ptr< linphone::ChatMessage > | createVoiceRecordingMessage (const std::shared_ptr< linphone::Recorder > &recorder) |
Creates a chat message with a voice recording attached to the given chat room. More... | |
LINPHONECXX_PUBLIC void | deleteHistory () |
Delete all messages from the history. | |
LINPHONECXX_PUBLIC void | deleteMessage (const std::shared_ptr< linphone::ChatMessage > &message) |
Delete a message from the chat room history. More... | |
LINPHONECXX_PUBLIC bool | ephemeralSupportedByAllParticipants () const |
Check if all participants support ephemeral messages. More... | |
LINPHONECXX_PUBLIC std::shared_ptr< linphone::EventLog > | findEventLog (const std::string &messageId) |
Gets the event log sent or received in this chat room that matches a chat message with the given message_id. More... | |
LINPHONECXX_PUBLIC std::shared_ptr< linphone::ChatMessage > | findMessage (const std::string &messageId) |
Gets the chat message sent or received in this chat room that matches the message_id. More... | |
LINPHONECXX_PUBLIC std::shared_ptr< linphone::Participant > | findParticipant (const std::shared_ptr< linphone::Address > &address) const |
Finds a participant of a chat room from its address. More... | |
LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::EventLog > > | getHistory (int nbMessage, unsigned int filters) |
Gets nb_message most recent events from chat_room chat room, sorted from oldest to most recent. More... | |
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED std::list< std::shared_ptr< linphone::ChatMessage > > | getHistory (int nbMessage) |
Gets nb_message most recent messages from chat_room chat room, sorted from oldest to most recent. More... | |
LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::EventLog > > | getHistoryEvents (int nbEvents) |
Gets nb_events most recent events from chat_room chat room, sorted from oldest to most recent. More... | |
LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::EventLog > > | getHistoryMessageEvents (int nbEvents) |
Gets nb_events most recent chat message events from chat_room chat room, sorted from oldest to most recent. More... | |
LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::EventLog > > | getHistoryRange (int begin, int end, unsigned int filters) |
Gets the partial list of events in the given range, sorted from oldest to most recent. More... | |
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED std::list< std::shared_ptr< linphone::ChatMessage > > | getHistoryRange (int begin, int end) |
Gets the partial list of messages in the given range, sorted from oldest to most recent. More... | |
LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::EventLog > > | getHistoryRangeBetween (const std::shared_ptr< linphone::EventLog > &firstEvent, const std::shared_ptr< linphone::EventLog > &lastEvent, unsigned int filters) |
Gets the partial list of messages between two given EventLog, sorted from oldest to most recent. More... | |
LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::EventLog > > | getHistoryRangeEvents (int begin, int end) |
Gets the partial list of events in the given range, sorted from oldest to most recent. More... | |
LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::EventLog > > | getHistoryRangeMessageEvents (int begin, int end) |
Gets the partial list of chat message events in the given range, sorted from oldest to most recent. More... | |
LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::EventLog > > | getHistoryRangeNear (unsigned int before, unsigned int after, const std::shared_ptr< linphone::EventLog > &event, unsigned int filters) |
Gets the partial list of messages in the given range near the EventLog provided, sorted from oldest to most recent. More... | |
LINPHONECXX_PUBLIC int | getHistorySize (unsigned int filters) |
Gets the number of messages in a chat room. More... | |
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED bool | hasBeenLeft () const |
Returns whether or not the chat room has been left. More... | |
LINPHONECXX_PUBLIC bool | hasCapability (int mask) const |
Checks if a chat room has given capabilities. More... | |
LINPHONECXX_PUBLIC void | leave () |
Leaves a chat room. | |
LINPHONECXX_PUBLIC void | markAsRead () |
Mark all messages of the conversation as read. | |
LINPHONECXX_PUBLIC void | notifyParticipantDeviceRegistration (const std::shared_ptr< const linphone::Address > &participantDevice) |
Notifies the chatroom that a participant device has just registered. More... | |
LINPHONECXX_PUBLIC void | receiveChatMessage (const std::shared_ptr< linphone::ChatMessage > &message) |
Used to receive a chat message when using async mechanism with IM enchat_roomyption engine. More... | |
LINPHONECXX_PUBLIC void | removeParticipant (const std::shared_ptr< linphone::Participant > &participant) |
Removes a participant of a chat room. More... | |
LINPHONECXX_PUBLIC void | removeParticipants (const std::list< std::shared_ptr< linphone::Participant >> &participants) |
Removes several participants of a chat room at once. More... | |
LINPHONECXX_PUBLIC std::shared_ptr< linphone::EventLog > | searchChatMessageByText (const std::string &text, const std::shared_ptr< const linphone::EventLog > &from, linphone::SearchDirection direction) |
Searches chat messages by text. More... | |
LINPHONECXX_PUBLIC void | setParticipantAdminStatus (const std::shared_ptr< linphone::Participant > &participant, bool isAdmin) |
Changes the admin status of a participant of a chat room (you need to be an admin yourself to do this). More... | |
LINPHONECXX_PUBLIC void | setParticipantDevices (const std::shared_ptr< linphone::Address > &participantAddress, const std::list< std::shared_ptr< linphone::ParticipantDeviceIdentity >> &deviceIdentities) |
Sets the list of participant devices in the form of SIP URIs with GRUUs for a given participant. More... | |
Static Public Member Functions | |
static LINPHONECXX_PUBLIC std::string | stateToString (State state) |
Converts a State enum to a string. More... | |
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 Backend::FlexisipChat). Then you can call Core::searchChatRoom() or Core::createChatRoom(). Be careful as a 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 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.
|
strong |
Backend is used to indicate the backend implementation of a chat room.
Enumerator | |
---|---|
Basic | Basic (client-to-client) chat room. |
FlexisipChat | Server-based chat room. |
|
strong |
Capabilities is used to indicate the capabilities of a chat room.
Enumerator | |
---|---|
None | No capabilities. |
Basic | No server. |
RealTimeText | Supports RTT. |
Conference | Use server (supports group chat) |
Proxy | Special proxy chat room flag. |
Migratable | Chat room migratable from Basic to Conference. |
OneToOne | A communication between two participants (can be Basic or Conference) |
Encrypted | Chat room is encrypted. |
Ephemeral | Chat room can enable ephemeral messages. |
|
strong |
EncryptionBackend is used to indicate the encryption engine used by a chat room.
Enumerator | |
---|---|
None | No encryption. |
Lime | Lime x3dh encryption. |
|
strong |
EphemeralMode is used to the ephemeral message mode used by a chat room.
Enumerator | |
---|---|
DeviceManaged | Each device manages its own ephemeral settings. |
AdminManaged | Ephemeral settings are chatroom wide and only admins can change them. |
|
strong |
HistoryFilter is used to determine which filter to apply to history functions.
|
strong |
TODO move to encryption engine object when available SecurityLevel is used to indicate the encryption security level of a chat room.
Enumerator | |
---|---|
Unsafe | Security failure. |
ClearText | No encryption. |
Encrypted | Encrypted. |
Safe | Encrypted and verified. |
|
strong |
State is used to indicate the current state of a chat room.
LINPHONECXX_PUBLIC void linphone::ChatRoom::addListener | ( | const std::shared_ptr< ChatRoomListener > & | listener | ) |
Add an application listener to the ChatRoom instance.
listener | the application listener |
LINPHONECXX_PUBLIC void linphone::ChatRoom::addParticipant | ( | const std::shared_ptr< linphone::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.
addr | The address of the participant to add to the chat room |
LINPHONECXX_PUBLIC bool linphone::ChatRoom::addParticipants | ( | const std::list< std::shared_ptr< linphone::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.
addresses | The participants to add. |
LINPHONECXX_PUBLIC bool linphone::ChatRoom::canHandleParticipants | ( | ) | const |
Tells whether a chat room is able to handle participants.
LINPHONECXX_PUBLIC std::shared_ptr<linphone::ChatMessage> linphone::ChatRoom::createEmptyMessage | ( | ) |
Creates an empty message attached to the given chat room.
LINPHONECXX_PUBLIC std::shared_ptr<linphone::ChatMessage> linphone::ChatRoom::createFileTransferMessage | ( | const std::shared_ptr< linphone::Content > & | initialContent | ) |
Creates a message attached to the given chat room with a particular content.
Use ChatMessage::send() to initiate the transfer
initialContent | Content initial content. |
LINPHONECXX_PUBLIC std::shared_ptr<linphone::ChatMessage> linphone::ChatRoom::createForwardMessage | ( | const std::shared_ptr< linphone::ChatMessage > & | message | ) |
Creates a forward message attached to the given chat room with a particular message.
message | ChatMessage message to be forwarded. |
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED std::shared_ptr<linphone::ChatMessage> linphone::ChatRoom::createMessage | ( | const std::string & | message | ) |
Creates a message attached to the given chat room with a plain text content filled with the given message.
message | text message, nullptr if absent. |
LINPHONECXX_PUBLIC std::shared_ptr<linphone::ChatMessage> linphone::ChatRoom::createMessageFromUtf8 | ( | const std::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
message | text message in UTF8, nullptr if absent. |
LINPHONECXX_PUBLIC std::shared_ptr<linphone::ChatMessage> linphone::ChatRoom::createReplyMessage | ( | const std::shared_ptr< linphone::ChatMessage > & | message | ) |
Creates a reply message attached to the given chat room with a particular message.
message | ChatMessage message to reply to. |
LINPHONECXX_PUBLIC std::shared_ptr<linphone::ChatMessage> linphone::ChatRoom::createVoiceRecordingMessage | ( | const std::shared_ptr< linphone::Recorder > & | recorder | ) |
Creates a chat message with a voice recording attached to the given chat room.
recorder | the Recorder object used to record the voice message. |
LINPHONECXX_PUBLIC void linphone::ChatRoom::deleteMessage | ( | const std::shared_ptr< linphone::ChatMessage > & | message | ) |
Delete a message from the chat room history.
message | The ChatMessage object to remove. |
LINPHONECXX_PUBLIC void linphone::ChatRoom::enableEphemeral | ( | bool | enable | ) |
Enable or disable the ephemeral message feature in the chat room.
Works only for flexisip-based chat room. An ephemeral message will automatically disappear from the sender and recipient's chatrooms after a specified timeout configurable with setEphemeralLifetime(). The timer starts when the message has been displayed at the recipent, which means:
enable | true if the ephemeral message feature is enabled, false otherwise. |
LINPHONECXX_PUBLIC bool linphone::ChatRoom::ephemeralEnabled | ( | ) | const |
Returns whether or not the ephemeral message feature is enabled in the chat room.
LINPHONECXX_PUBLIC bool linphone::ChatRoom::ephemeralSupportedByAllParticipants | ( | ) | const |
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).
LINPHONECXX_PUBLIC std::shared_ptr<linphone::EventLog> linphone::ChatRoom::findEventLog | ( | const std::string & | messageId | ) |
Gets the event log sent or received in this chat room that matches a chat message with the given message_id.
messageId | The id of the message to find |
LINPHONECXX_PUBLIC std::shared_ptr<linphone::ChatMessage> linphone::ChatRoom::findMessage | ( | const std::string & | messageId | ) |
Gets the chat message sent or received in this chat room that matches the message_id.
messageId | The id of the message to find |
LINPHONECXX_PUBLIC std::shared_ptr<linphone::Participant> linphone::ChatRoom::findParticipant | ( | const std::shared_ptr< linphone::Address > & | address | ) | const |
Finds a participant of a chat room from its address.
address | The Address to search in the list of participants of the chat room |
LINPHONECXX_PUBLIC std::shared_ptr<linphone::Account> linphone::ChatRoom::getAccount | ( | ) |
Returns the local account to which this chat room is related.
LINPHONECXX_PUBLIC std::shared_ptr<linphone::Call> linphone::ChatRoom::getCall | ( | ) | const |
Gets the current call associated to this chatroom if any To commit a message, use ChatMessage::send()
LINPHONECXX_PUBLIC unsigned int linphone::ChatRoom::getCapabilities | ( | ) | const |
Gets the capabilities of a chat room.
LINPHONECXX_PUBLIC uint32_t linphone::ChatRoom::getChar | ( | ) |
When realtime text is enabled in a Call (see 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.
LINPHONECXX_PUBLIC std::list<std::shared_ptr<linphone::Address> > linphone::ChatRoom::getComposingAddresses | ( | ) |
Gets the list of participants that are currently composing.
LINPHONECXX_PUBLIC std::shared_ptr<const linphone::Address> linphone::ChatRoom::getConferenceAddress | ( | ) | const |
Gets the conference address of the chat room.
LINPHONECXX_PUBLIC std::shared_ptr<const linphone::ConferenceInfo> linphone::ChatRoom::getConferenceInfo | ( | ) |
Gets the conference information associated to the chatroom.
LINPHONECXX_PUBLIC std::shared_ptr<linphone::Core> linphone::ChatRoom::getCore | ( | ) | const |
LINPHONECXX_PUBLIC time_t linphone::ChatRoom::getCreationTime | ( | ) | const |
Returns the creation time for the chat room.
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED std::shared_ptr<const linphone::ChatRoomParams> linphone::ChatRoom::getCurrentParams | ( | ) | const |
Returns current parameters associated with the chat room.
This is typically the parameters passed during the ChatRoom creation process to linphone_core_chat_room_create_chat_room() or some default parameters if no ChatRoomParams was explicitely passed during ChatRoom creation.
LINPHONECXX_PUBLIC std::list<std::shared_ptr<linphone::Content> > linphone::ChatRoom::getDocumentContents | ( | ) |
Gets all contents for which content-type starts with either text/ or application/.
LINPHONECXX_PUBLIC long linphone::ChatRoom::getEphemeralLifetime | ( | ) | const |
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.
LINPHONECXX_PUBLIC EphemeralMode linphone::ChatRoom::getEphemeralMode | ( | ) | const |
Gets the ephemeral mode of the chat room.
LINPHONECXX_PUBLIC std::list<std::shared_ptr<linphone::EventLog> > linphone::ChatRoom::getHistory | ( | int | nbMessage, |
unsigned int | filters | ||
) |
Gets nb_message most recent events from chat_room chat room, sorted from oldest to most recent.
nbMessage | Number of events to retrieve. 0 means everything. |
filters | The LinphoneChatRoomHistoryFilterMask mask to filter the results with HistoryFilter |
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED std::list<std::shared_ptr<linphone::ChatMessage> > linphone::ChatRoom::getHistory | ( | int | nbMessage | ) |
Gets nb_message most recent messages from chat_room chat room, sorted from oldest to most recent.
nbMessage | Number of message to retrieve. 0 means everything. |
LINPHONECXX_PUBLIC std::list<std::shared_ptr<linphone::EventLog> > linphone::ChatRoom::getHistoryEvents | ( | int | nbEvents | ) |
Gets nb_events most recent events from chat_room chat room, sorted from oldest to most recent.
nbEvents | Number of events to retrieve. 0 means everything. |
LINPHONECXX_PUBLIC int linphone::ChatRoom::getHistoryEventsSize | ( | ) |
Gets the number of events in a chat room.
LINPHONECXX_PUBLIC std::list<std::shared_ptr<linphone::EventLog> > linphone::ChatRoom::getHistoryMessageEvents | ( | int | nbEvents | ) |
Gets nb_events most recent chat message events from chat_room chat room, sorted from oldest to most recent.
nbEvents | Number of events to retrieve. 0 means everything. |
LINPHONECXX_PUBLIC std::list<std::shared_ptr<linphone::EventLog> > linphone::ChatRoom::getHistoryRange | ( | int | begin, |
int | end, | ||
unsigned int | filters | ||
) |
Gets the partial list of events in the given range, sorted from oldest to most recent.
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 - 1 (use getHistorySize() to retrieve history size) |
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED std::list<std::shared_ptr<linphone::ChatMessage> > linphone::ChatRoom::getHistoryRange | ( | int | begin, |
int | end | ||
) |
Gets the partial list of messages in the given range, sorted from oldest to most recent.
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 - 1 (use getHistorySize() to retrieve history size) |
LINPHONECXX_PUBLIC std::list<std::shared_ptr<linphone::EventLog> > linphone::ChatRoom::getHistoryRangeBetween | ( | const std::shared_ptr< linphone::EventLog > & | firstEvent, |
const std::shared_ptr< linphone::EventLog > & | lastEvent, | ||
unsigned 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.
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 HistoryFilter |
LINPHONECXX_PUBLIC std::list<std::shared_ptr<linphone::EventLog> > linphone::ChatRoom::getHistoryRangeEvents | ( | int | begin, |
int | end | ||
) |
Gets the partial list of events in the given range, sorted from oldest to most recent.
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 - 1 |
LINPHONECXX_PUBLIC std::list<std::shared_ptr<linphone::EventLog> > linphone::ChatRoom::getHistoryRangeMessageEvents | ( | int | begin, |
int | end | ||
) |
Gets the partial list of chat message events in the given range, sorted from oldest to most recent.
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 - 1 |
LINPHONECXX_PUBLIC std::list<std::shared_ptr<linphone::EventLog> > linphone::ChatRoom::getHistoryRangeNear | ( | unsigned int | before, |
unsigned int | after, | ||
const std::shared_ptr< linphone::EventLog > & | event, | ||
unsigned 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.
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 HistoryFilter |
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED int linphone::ChatRoom::getHistorySize | ( | ) |
Gets the number of messages in a chat room.
LINPHONECXX_PUBLIC int linphone::ChatRoom::getHistorySize | ( | unsigned int | filters | ) |
Gets the number of messages in a chat room.
filters | The LinphoneChatRoomHistoryFilterMask mask to filter the result with HistoryFilter |
LINPHONECXX_PUBLIC std::string linphone::ChatRoom::getIdentifier | ( | ) | const |
Returns the chat room identifier.
LINPHONECXX_PUBLIC std::shared_ptr<linphone::ChatMessage> linphone::ChatRoom::getLastMessageInHistory | ( | ) |
Gets the last chat message sent or received in this chat room.
LINPHONECXX_PUBLIC time_t linphone::ChatRoom::getLastUpdateTime | ( | ) | const |
Returns the last updated time for the chat room.
LINPHONECXX_PUBLIC std::shared_ptr<const linphone::Address> linphone::ChatRoom::getLocalAddress | ( | ) |
Get the local address associated to this chat room.
LINPHONECXX_PUBLIC std::shared_ptr<linphone::Participant> linphone::ChatRoom::getMe | ( | ) | const |
Gets the participant representing myself in the chat room.
LINPHONECXX_PUBLIC std::list<std::shared_ptr<linphone::Content> > linphone::ChatRoom::getMediaContents | ( | ) |
Gets all contents for which content-type starts with either video/, audio/ or image/.
LINPHONECXX_PUBLIC bool linphone::ChatRoom::getMuted | ( | ) | const |
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.
LINPHONECXX_PUBLIC int linphone::ChatRoom::getNbParticipants | ( | ) | const |
Gets the number of participants in the chat room (that is without ourselves).
LINPHONECXX_PUBLIC std::shared_ptr<const linphone::ConferenceParams> linphone::ChatRoom::getParams | ( | ) | const |
Returns current parameters associated with the chat room.
This is typically the parameters passed during the ChatRoom creation process to linphone_core_chat_room_create_chat_room() or some default parameters if no ChatRoomParams was explicitely passed during ChatRoom creation.
LINPHONECXX_PUBLIC std::list<std::shared_ptr<linphone::Participant> > linphone::ChatRoom::getParticipants | ( | ) | const |
Gets the list of participants of a chat room.
LINPHONECXX_PUBLIC std::shared_ptr<const linphone::Address> linphone::ChatRoom::getPeerAddress | ( | ) |
Get the peer address associated to this chat room.
LINPHONECXX_PUBLIC SecurityLevel linphone::ChatRoom::getSecurityLevel | ( | ) |
Gets the security level of a chat room.
LINPHONECXX_PUBLIC State linphone::ChatRoom::getState | ( | ) | const |
Gets the state of the chat room.
LINPHONECXX_PUBLIC std::string linphone::ChatRoom::getSubject | ( | ) | const |
Gets the subject of a chat room.
LINPHONECXX_PUBLIC std::string linphone::ChatRoom::getSubjectUtf8 | ( | ) | const |
Gets the subject of a chat room (as an UTF8 string)
LINPHONECXX_PUBLIC std::list<std::shared_ptr<linphone::ChatMessage> > linphone::ChatRoom::getUnreadHistory | ( | ) |
Gets all unread messages for this chat room, sorted from oldest to most recent.
LINPHONECXX_PUBLIC int linphone::ChatRoom::getUnreadMessagesCount | ( | ) |
Gets the number of unread messages in the chatroom.
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED bool linphone::ChatRoom::hasBeenLeft | ( | ) | const |
Returns whether or not the chat room has been left.
LINPHONECXX_PUBLIC bool linphone::ChatRoom::hasCapability | ( | int | mask | ) | const |
Checks if a chat room has given capabilities.
mask | a LinphoneChatRoomCapabilitiesMask mask |
LINPHONECXX_PUBLIC bool linphone::ChatRoom::isEmpty | ( | ) |
Returns whether or not a ChatRoom has at least one ChatMessage or not.
LINPHONECXX_PUBLIC bool linphone::ChatRoom::isReadOnly | ( | ) | const |
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.
LINPHONECXX_PUBLIC bool linphone::ChatRoom::isRemoteComposing | ( | ) | const |
Tells whether the remote is currently composing a message.
LINPHONECXX_PUBLIC void linphone::ChatRoom::notifyParticipantDeviceRegistration | ( | const std::shared_ptr< const linphone::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.
participantDevice | list of the participant devices to be used by the group chat room |
LINPHONECXX_PUBLIC void linphone::ChatRoom::receiveChatMessage | ( | const std::shared_ptr< linphone::ChatMessage > & | message | ) |
Used to receive a chat message when using async mechanism with IM enchat_roomyption engine.
message | ChatMessage object |
LINPHONECXX_PUBLIC void linphone::ChatRoom::removeListener | ( | const std::shared_ptr< ChatRoomListener > & | listener | ) |
Remove a previously added listener from the ChatRoom instance.
listener | the application listener |
LINPHONECXX_PUBLIC void linphone::ChatRoom::removeParticipant | ( | const std::shared_ptr< linphone::Participant > & | participant | ) |
Removes a participant of a chat room.
participant | The participant to remove from the chat room |
LINPHONECXX_PUBLIC void linphone::ChatRoom::removeParticipants | ( | const std::list< std::shared_ptr< linphone::Participant >> & | participants | ) |
Removes several participants of a chat room at once.
participants | The participants to remove. |
LINPHONECXX_PUBLIC std::shared_ptr<linphone::EventLog> linphone::ChatRoom::searchChatMessageByText | ( | const std::string & | text, |
const std::shared_ptr< const linphone::EventLog > & | from, | ||
linphone::SearchDirection | direction | ||
) |
Searches chat messages by text.
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 |
LINPHONECXX_PUBLIC void linphone::ChatRoom::setConferenceAddress | ( | const std::shared_ptr< linphone::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.
conferenceAddress | The conference Address to be used by the group chat room |
LINPHONECXX_PUBLIC void linphone::ChatRoom::setEphemeralLifetime | ( | long | time | ) |
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.
time | The ephemeral lifetime, default is 0 (disabled) |
LINPHONECXX_PUBLIC void linphone::ChatRoom::setEphemeralMode | ( | EphemeralMode | mode | ) |
Sets the ephemeral mode of the chat room.
mode | The ephemeral mode EphemeralMode |
LINPHONECXX_PUBLIC void linphone::ChatRoom::setMuted | ( | bool | 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.
muted | true to flag it as muted, false to un-mute it. |
LINPHONECXX_PUBLIC void linphone::ChatRoom::setParticipantAdminStatus | ( | const std::shared_ptr< linphone::Participant > & | participant, |
bool | isAdmin | ||
) |
Changes the admin status of a participant of a chat room (you need to be an admin yourself to do this).
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 |
LINPHONECXX_PUBLIC void linphone::ChatRoom::setParticipantDevices | ( | const std::shared_ptr< linphone::Address > & | participantAddress, |
const std::list< std::shared_ptr< linphone::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.
participantAddress | The participant address |
deviceIdentities | List of the participant devices to be used by the group chat room |
LINPHONECXX_PUBLIC void linphone::ChatRoom::setSubject | ( | const std::string & | subject | ) |
Sets the subject of a chat room.
subject | The new subject to set for the chat room |
LINPHONECXX_PUBLIC void linphone::ChatRoom::setSubjectUtf8 | ( | const std::string & | subject | ) |
Sets the subject of a chat room (utf-8 string).
subject | The new subject to set for the chat room |
|
static |