Liblinphone  5.4.0
Public Types | Public Member Functions | List of all members
linphone::ChatMessage Class Reference

A ChatMessage represents an instant message that can be send or received through a ChatRoom. More...

#include <chat_message.hh>

Inheritance diagram for linphone::ChatMessage:

Public Types

enum  Direction {
  Direction::Incoming = 0,
  Direction::Outgoing = 1
}
 Direction is used to indicate if a message is outgoing or incoming. More...
 
enum  State {
  State::Idle = 0,
  State::InProgress = 1,
  State::Delivered = 2,
  State::NotDelivered = 3,
  State::FileTransferError = 4,
  State::FileTransferDone = 5,
  State::DeliveredToUser = 6,
  State::Displayed = 7,
  State::FileTransferInProgress = 8,
  State::PendingDelivery = 9,
  State::FileTransferCancelling = 10
}
 State is used to notify if messages have been successfully delivered or not. More...
 

Public Member Functions

LINPHONECXX_PUBLIC ChatMessage (void *ptr, bool takeRef=true)
 
LINPHONECXX_PUBLIC _LinphoneChatMessage * cPtr ()
 
LINPHONECXX_PUBLIC void addListener (const std::shared_ptr< ChatMessageListener > &listener)
 Add an application listener to the ChatMessage instance. More...
 
LINPHONECXX_PUBLIC void removeListener (const std::shared_ptr< ChatMessageListener > &listener)
 Remove a previously added listener from the ChatMessage instance. More...
 
LINPHONECXX_PUBLIC std::string getAppdata () const
 Linphone message has an app-specific field that can store a text. More...
 
LINPHONECXX_PUBLIC void setAppdata (const std::string &data)
 Linphone message has an app-specific field that can store a text. More...
 
LINPHONECXX_PUBLIC std::string getCallId () const
 Gets the SIP call-id accociated with the message. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::ChatRoomgetChatRoom () const
 Returns the chatroom this message belongs to. More...
 
LINPHONECXX_PUBLIC std::string getContentType () const
 Gets the content type of a chat message. More...
 
LINPHONECXX_PUBLIC void setContentType (const std::string &contentType)
 Sets the content type of a chat message. More...
 
LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::Content > > getContents () const
 Returns the list of contents in the message. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::CoregetCore () const
 Returns back pointer to Core object. More...
 
LINPHONECXX_PUBLIC time_t getEphemeralExpireTime () const
 Returns the real time at which an ephemeral message expires and will be deleted. More...
 
LINPHONECXX_PUBLIC long getEphemeralLifetime () const
 Returns lifetime of an ephemeral message. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< const linphone::ErrorInfogetErrorInfo () const
 Gets full details about delivery error of a chat message. More...
 
LINPHONECXX_PUBLIC std::string getExternalBodyUrl () const
 Messages can carry external body as defined by rfc2017. More...
 
LINPHONECXX_PUBLIC void setExternalBodyUrl (const std::string &externalBodyUrl)
 Messages can carry external body as defined by rfc2017. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::ContentgetFileTransferInformation () const
 Gets the file transfer information (used by callbacks to recover informations during a rcs file transfer) More...
 
LINPHONECXX_PUBLIC std::string getForwardInfo () const
 Gets the forward info if available as a string. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< const linphone::AddressgetFromAddress () const
 Gets origin of the message. More...
 
LINPHONECXX_PUBLIC bool isEphemeral () const
 Returns wether the chat message is an ephemeral message or not. More...
 
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED bool isFileTransfer () const
 Return whether or not a chat message is a file transfer. More...
 
LINPHONECXX_PUBLIC bool isFileTransferInProgress () const
 Gets whether or not a file is currently being downloaded or uploaded. More...
 
LINPHONECXX_PUBLIC bool isForward ()
 Returns wether the chat message is a forward message or not. More...
 
LINPHONECXX_PUBLIC bool isOutgoing () const
 Returns wehther the message has been sent or received. More...
 
LINPHONECXX_PUBLIC bool isRead () const
 Returns wether the message has been read or not. More...
 
LINPHONECXX_PUBLIC bool isReply ()
 Returns wether the chat message is a reply message or not. More...
 
LINPHONECXX_PUBLIC bool isSecured () const
 Gets if the message was end-to-end encrypted when transferred. More...
 
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED bool isText () const
 Return whether or not a chat message is a text. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< const linphone::AddressgetLocalAddress () const
 Returns the local address the message was sent or received with. More...
 
LINPHONECXX_PUBLIC std::string getMessageId () const
 Get the message identifier. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< const linphone::ChatMessageReactiongetOwnReaction () const
 Returns our own reaction for a given chat message, if any. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< const linphone::AddressgetPeerAddress () const
 Returns the peer (remote) address of the message. More...
 
LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::ChatMessageReaction > > getReactions () const
 Gets the list of reactions received for this chat message. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::ChatMessagegetReplyMessage ()
 Returns the ChatMessage this message is a reply to. More...
 
LINPHONECXX_PUBLIC std::string getReplyMessageId ()
 Returns the ID of the message this is a reply to. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< const linphone::AddressgetReplyMessageSenderAddress ()
 Returns the address of the sender of the message this is a reply to. More...
 
LINPHONECXX_PUBLIC State getState () const
 Gets the state of the message. More...
 
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED std::string getTextContent () const
 Gets the text content if available as a string. More...
 
LINPHONECXX_PUBLIC time_t getTime () const
 Gets the time the message was sent. More...
 
LINPHONECXX_PUBLIC std::shared_ptr< const linphone::AddressgetToAddress () const
 Gets destination of the message. More...
 
LINPHONECXX_PUBLIC bool getToBeStored () const
 Gets if a chat message is to be stored. More...
 
LINPHONECXX_PUBLIC void setToBeStored (bool toBeStored)
 Sets if a chat message is to be stored. More...
 
LINPHONECXX_PUBLIC std::string getUtf8Text () const
 Gets text part of this message. More...
 
LINPHONECXX_PUBLIC int setUtf8Text (const std::string &text)
 Sets a text to be sent, given as a string of UTF-8 characters. More...
 
LINPHONECXX_PUBLIC void addContent (const std::shared_ptr< linphone::Content > &content)
 Adds a content to the ChatMessage. More...
 
LINPHONECXX_PUBLIC void addCustomHeader (const std::string &headerName, const std::string &headerValue)
 Adds custom headers to the message. More...
 
LINPHONECXX_PUBLIC void addFileContent (const std::shared_ptr< linphone::Content > &content)
 Adds a file content to the ChatMessage. More...
 
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED void addTextContent (const std::string &text)
 Creates a Content of type PlainText with the given text as body. More...
 
LINPHONECXX_PUBLIC void addUtf8TextContent (const std::string &text)
 Creates a Content of type text/plain with the provided string, and attach it to the message. More...
 
LINPHONECXX_PUBLIC void cancelFileTransfer ()
 Cancels an ongoing file transfer attached to this message (upload or download).
 
LINPHONECXX_PUBLIC std::shared_ptr< linphone::ChatMessageReactioncreateReaction (const std::string &utf8Reaction)
 Creates a emoji reaction for the given chat mesage. More...
 
LINPHONECXX_PUBLIC bool downloadContent (const std::shared_ptr< linphone::Content > &content)
 Starts the download of the Content referenced in the ChatMessage from remote server. More...
 
LINPHONECXX_PUBLIC bool downloadContents ()
 Starts the download of all the Content objects representing file transfers included in the message (Content::isFileTransfer() method returns true). More...
 
LINPHONECXX_PUBLIC std::string getCustomHeader (const std::string &headerName) const
 Retrieves a custom header value given its name. More...
 
LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::ParticipantImdnState > > getParticipantsByImdnState (State state) const
 Gets the list of participants for which the imdn state has reached the specified state and the time at which they did. More...
 
LINPHONECXX_PUBLIC bool hasConferenceInvitationContent () const
 Returns wether the chat message has a conference invitation content or not. More...
 
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED bool hasTextContent () const
 Returns wether the chat message has a text content or not. More...
 
LINPHONECXX_PUBLIC void markAsRead ()
 Marks the message as read. More...
 
LINPHONECXX_PUBLIC linphone::Status putChar (uint32_t character)
 Fulfills a chat message character by character and send the character immediately as real-time text (RFC4103 / T.140) or as Baudot tones. More...
 
LINPHONECXX_PUBLIC void removeContent (const std::shared_ptr< linphone::Content > &content)
 Removes a content from the ChatMessage. More...
 
LINPHONECXX_PUBLIC void removeCustomHeader (const std::string &headerName)
 Removes a custom header from the message. More...
 
LINPHONECXX_PUBLIC void send ()
 Sends a chat message.
 

Detailed Description

A ChatMessage represents an instant message that can be send or received through a ChatRoom.

To create a ChatMessage, use ChatRoom::createEmptyMessage(), then either add text using addUtf8TextContent() or a Content with file informations using addFileContent(). A valid Content for file transfer must contain a type and subtype, the name of the file and it's size. Finally call send() to send it. To send files through a ChatMessage, you need to have configured a file transfer server URL with Core::setFileTransferServer(). On the receiving side, either use downloadContent() to download received files or enable auto-download in the Core using Core::setMaxSizeForAutoDownloadIncomingFiles(), -1 disabling the feature and 0 always downloading files no matter it's size. Keep in mind a ChatMessage created by a ChatRoom::Backend::Basic ChatRoom can only contain one Content, either text or file.

Member Enumeration Documentation

◆ Direction

Direction is used to indicate if a message is outgoing or incoming.

Enumerator
Incoming 

Incoming message.

Outgoing 

Outgoing message.

◆ State

State is used to notify if messages have been successfully delivered or not.

Enumerator
Idle 

Initial state.

InProgress 

Delivery in progress.

Delivered 

Message successfully delivered and acknowledged by the server.

NotDelivered 

Message was not delivered.

FileTransferError 

Message was received and acknowledged but cannot get file from server.

FileTransferDone 

File transfer has been completed successfully.

DeliveredToUser 

Message successfully delivered an acknowledged by the remote user.

Displayed 

Message successfully displayed to the remote user.

FileTransferInProgress 

File transfer is in progress.

PendingDelivery 

Message is pending delivery.

FileTransferCancelling 

The user cancelled the file transfer.

Member Function Documentation

◆ addContent()

LINPHONECXX_PUBLIC void linphone::ChatMessage::addContent ( const std::shared_ptr< linphone::Content > &  content)

Adds a content to the ChatMessage.

Parameters
contentthe Content object to add.

◆ addCustomHeader()

LINPHONECXX_PUBLIC void linphone::ChatMessage::addCustomHeader ( const std::string &  headerName,
const std::string &  headerValue 
)

Adds custom headers to the message.

Parameters
headerNamename of the header
headerValueheader value

◆ addFileContent()

LINPHONECXX_PUBLIC void linphone::ChatMessage::addFileContent ( const std::shared_ptr< linphone::Content > &  content)

Adds a file content to the ChatMessage.

Parameters
contentthe Content object to add.

◆ addListener()

LINPHONECXX_PUBLIC void linphone::ChatMessage::addListener ( const std::shared_ptr< ChatMessageListener > &  listener)

Add an application listener to the ChatMessage instance.

Parameters
listenerthe application listener

◆ addTextContent()

LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED void linphone::ChatMessage::addTextContent ( const std::string &  text)

Creates a Content of type PlainText with the given text as body.

Parameters
textThe text in System Locale to add to the message.
Deprecated:
01/07/2020. Use addUtf8TextContent() instead.

◆ addUtf8TextContent()

LINPHONECXX_PUBLIC void linphone::ChatMessage::addUtf8TextContent ( const std::string &  text)

Creates a Content of type text/plain with the provided string, and attach it to the message.

Parameters
textThe text to add to the message.

◆ createReaction()

LINPHONECXX_PUBLIC std::shared_ptr<linphone::ChatMessageReaction> linphone::ChatMessage::createReaction ( const std::string &  utf8Reaction)

Creates a emoji reaction for the given chat mesage.

To send it, use ChatMessageReaction::send().

Parameters
utf8Reactionthe emoji character(s) as UTF-8.
Returns
a ChatMessageReaction object.

◆ downloadContent()

LINPHONECXX_PUBLIC bool linphone::ChatMessage::downloadContent ( const std::shared_ptr< linphone::Content > &  content)

Starts the download of the Content referenced in the ChatMessage from remote server.

Parameters
contentthe Content object to download (must have the Content::isFileTransfer() method return true).
Returns
false if there is an error, true otherwise.

◆ downloadContents()

LINPHONECXX_PUBLIC bool linphone::ChatMessage::downloadContents ( )

Starts the download of all the Content objects representing file transfers included in the message (Content::isFileTransfer() method returns true).

Returns
false if there is an error, true otherwise.

◆ getAppdata()

LINPHONECXX_PUBLIC std::string linphone::ChatMessage::getAppdata ( ) const

Linphone message has an app-specific field that can store a text.

The application might want to use it for keeping data over restarts, like thumbnail image path.

Returns
the application-specific data or nullptr if none has been stored.

◆ getCallId()

LINPHONECXX_PUBLIC std::string linphone::ChatMessage::getCallId ( ) const

Gets the SIP call-id accociated with the message.

Returns
the call-id

◆ getChatRoom()

LINPHONECXX_PUBLIC std::shared_ptr<linphone::ChatRoom> linphone::ChatMessage::getChatRoom ( ) const

Returns the chatroom this message belongs to.

Returns
the ChatRoom in which this message has been sent or received.

◆ getContents()

LINPHONECXX_PUBLIC std::list<std::shared_ptr<linphone::Content> > linphone::ChatMessage::getContents ( ) const

Returns the list of contents in the message.

Returns
The list of Content.

◆ getContentType()

LINPHONECXX_PUBLIC std::string linphone::ChatMessage::getContentType ( ) const

Gets the content type of a chat message.

Returns
The content type of the chat message

◆ getCore()

LINPHONECXX_PUBLIC std::shared_ptr<linphone::Core> linphone::ChatMessage::getCore ( ) const

Returns back pointer to Core object.

Returns
the Core object associated with this message.

◆ getCustomHeader()

LINPHONECXX_PUBLIC std::string linphone::ChatMessage::getCustomHeader ( const std::string &  headerName) const

Retrieves a custom header value given its name.

Parameters
headerNameheader name searched
Returns
the custom header value or nullptr if not found.

◆ getEphemeralExpireTime()

LINPHONECXX_PUBLIC time_t linphone::ChatMessage::getEphemeralExpireTime ( ) const

Returns the real time at which an ephemeral message expires and will be deleted.

See also
isEphemeral()
Returns
the time at which an ephemeral message expires. 0 means the message has not been read.

◆ getEphemeralLifetime()

LINPHONECXX_PUBLIC long linphone::ChatMessage::getEphemeralLifetime ( ) const

Returns lifetime of an ephemeral message.

The lifetime is the duration after which the ephemeral message will disappear once viewed.

See also
isEphemeral()
Returns
the lifetime of an ephemeral message, by default 0 (disabled).

◆ getErrorInfo()

LINPHONECXX_PUBLIC std::shared_ptr<const linphone::ErrorInfo> linphone::ChatMessage::getErrorInfo ( ) const

Gets full details about delivery error of a chat message.

Returns
a ErrorInfo describing the details.

◆ getExternalBodyUrl()

LINPHONECXX_PUBLIC std::string linphone::ChatMessage::getExternalBodyUrl ( ) const

Messages can carry external body as defined by rfc2017.

Returns
external body url or nullptr if not present.

◆ getFileTransferInformation()

LINPHONECXX_PUBLIC std::shared_ptr<linphone::Content> linphone::ChatMessage::getFileTransferInformation ( ) const

Gets the file transfer information (used by callbacks to recover informations during a rcs file transfer)

Returns
a pointer to the Content structure or nullptr if not present.

◆ getForwardInfo()

LINPHONECXX_PUBLIC std::string linphone::ChatMessage::getForwardInfo ( ) const

Gets the forward info if available as a string.

Returns
the original sender of the message if it has been forwarded, nullptr otherwise.

◆ getFromAddress()

LINPHONECXX_PUBLIC std::shared_ptr<const linphone::Address> linphone::ChatMessage::getFromAddress ( ) const

Gets origin of the message.

Returns
the Address of the sender.

◆ getLocalAddress()

LINPHONECXX_PUBLIC std::shared_ptr<const linphone::Address> linphone::ChatMessage::getLocalAddress ( ) const

Returns the local address the message was sent or received with.

Returns
the Address of the local address used to send/receive this message.

◆ getMessageId()

LINPHONECXX_PUBLIC std::string linphone::ChatMessage::getMessageId ( ) const

Get the message identifier.

It is used to identify a message so that it can be notified as delivered and/or displayed.

Returns
The message identifier.

◆ getOwnReaction()

LINPHONECXX_PUBLIC std::shared_ptr<const linphone::ChatMessageReaction> linphone::ChatMessage::getOwnReaction ( ) const

Returns our own reaction for a given chat message, if any.

Returns
Our own ChatMessageReaction for that message if any, nullptr otherwise.

◆ getParticipantsByImdnState()

LINPHONECXX_PUBLIC std::list<std::shared_ptr<linphone::ParticipantImdnState> > linphone::ChatMessage::getParticipantsByImdnState ( State  state) const

Gets the list of participants for which the imdn state has reached the specified state and the time at which they did.

Parameters
stateThe LinphoneChatMessageState the imdn have reached (only use LinphoneChatMessageStateDelivered, LinphoneChatMessageStateDeliveredToUser, LinphoneChatMessageStateDisplayed and LinphoneChatMessageStateNotDelivered)
Returns
The list of participants.

◆ getPeerAddress()

LINPHONECXX_PUBLIC std::shared_ptr<const linphone::Address> linphone::ChatMessage::getPeerAddress ( ) const

Returns the peer (remote) address of the message.

Returns
the Address of the peer address used to send/receive this message.

◆ getReactions()

LINPHONECXX_PUBLIC std::list<std::shared_ptr<linphone::ChatMessageReaction> > linphone::ChatMessage::getReactions ( ) const

Gets the list of reactions received for this chat message.

Warning: list is ordered by content of reaction message, not by received timestamp!

Returns
The sorted list of reaction if any.

◆ getReplyMessage()

LINPHONECXX_PUBLIC std::shared_ptr<linphone::ChatMessage> linphone::ChatMessage::getReplyMessage ( )

Returns the ChatMessage this message is a reply to.

Returns
the original message ChatMessage.

◆ getReplyMessageId()

LINPHONECXX_PUBLIC std::string linphone::ChatMessage::getReplyMessageId ( )

Returns the ID of the message this is a reply to.

Returns
the original message id.

◆ getReplyMessageSenderAddress()

LINPHONECXX_PUBLIC std::shared_ptr<const linphone::Address> linphone::ChatMessage::getReplyMessageSenderAddress ( )

Returns the address of the sender of the message this is a reply to.

Returns
the original message sender Address.

◆ getState()

LINPHONECXX_PUBLIC State linphone::ChatMessage::getState ( ) const

Gets the state of the message.

Returns
the current State of the message.

◆ getTextContent()

LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED std::string linphone::ChatMessage::getTextContent ( ) const

Gets the text content if available as a string.

Returns
the Content buffer if available in System Locale, null otherwise.
Deprecated:
01/07/2020. Use getUtf8Text() instead.

◆ getTime()

LINPHONECXX_PUBLIC time_t linphone::ChatMessage::getTime ( ) const

Gets the time the message was sent.

Returns
the timestamp of when the message was sent.

◆ getToAddress()

LINPHONECXX_PUBLIC std::shared_ptr<const linphone::Address> linphone::ChatMessage::getToAddress ( ) const

Gets destination of the message.

Returns
the Address of the recipient.

◆ getToBeStored()

LINPHONECXX_PUBLIC bool linphone::ChatMessage::getToBeStored ( ) const

Gets if a chat message is to be stored.

Returns
Whether or not the message is to be stored

◆ getUtf8Text()

LINPHONECXX_PUBLIC std::string linphone::ChatMessage::getUtf8Text ( ) const

Gets text part of this message.

Returns
The text as UTF8 characters or nullptr if no text.

◆ hasConferenceInvitationContent()

LINPHONECXX_PUBLIC bool linphone::ChatMessage::hasConferenceInvitationContent ( ) const

Returns wether the chat message has a conference invitation content or not.

Returns
true if it has one, false otherwise.

◆ hasTextContent()

LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED bool linphone::ChatMessage::hasTextContent ( ) const

Returns wether the chat message has a text content or not.

Returns
true if it has one, false otherwise.
Deprecated:
27/10/2020. Check if getContents() contains a Content for which it's content type is PlainText.

◆ isEphemeral()

LINPHONECXX_PUBLIC bool linphone::ChatMessage::isEphemeral ( ) const

Returns wether the chat message is an ephemeral message or not.

An ephemeral message will automatically disappear from the recipient's screen after the message has been viewed.

Returns
true if it is an ephemeral message, false otherwise

◆ isFileTransfer()

LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED bool linphone::ChatMessage::isFileTransfer ( ) const

Return whether or not a chat message is a file transfer.

Returns
Whether or not the message is a file transfer
Deprecated:
06/07/2020 check if getContents() contains a Content for which Content::isFileTransfer() returns true.

◆ isFileTransferInProgress()

LINPHONECXX_PUBLIC bool linphone::ChatMessage::isFileTransferInProgress ( ) const

Gets whether or not a file is currently being downloaded or uploaded.

Returns
true if download or upload is in progress, false otherwise

◆ isForward()

LINPHONECXX_PUBLIC bool linphone::ChatMessage::isForward ( )

Returns wether the chat message is a forward message or not.

Returns
true if it is a forward message, false otherwise

◆ isOutgoing()

LINPHONECXX_PUBLIC bool linphone::ChatMessage::isOutgoing ( ) const

Returns wehther the message has been sent or received.

Returns
true if message has been sent, false if it has been received.

◆ isRead()

LINPHONECXX_PUBLIC bool linphone::ChatMessage::isRead ( ) const

Returns wether the message has been read or not.

Returns
true if message has been marked as read, false otherwise.

◆ isReply()

LINPHONECXX_PUBLIC bool linphone::ChatMessage::isReply ( )

Returns wether the chat message is a reply message or not.

Returns
true if it is a reply message, false otherwise

◆ isSecured()

LINPHONECXX_PUBLIC bool linphone::ChatMessage::isSecured ( ) const

Gets if the message was end-to-end encrypted when transferred.

Returns
true if the message was end-to-end encrypted when transferred, false otherwise.

◆ isText()

LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED bool linphone::ChatMessage::isText ( ) const

Return whether or not a chat message is a text.

Returns
Whether or not the message is a text
Deprecated:
06/07/2020 check if getContents() contains a Content with a PlainText content type.

◆ markAsRead()

LINPHONECXX_PUBLIC void linphone::ChatMessage::markAsRead ( )

Marks the message as read.

Only triggers LinphoneChatRoomCbsChatRoomReadCb if it was the last unread message.

◆ putChar()

LINPHONECXX_PUBLIC linphone::Status linphone::ChatMessage::putChar ( uint32_t  character)

Fulfills a chat message character by character and send the character immediately as real-time text (RFC4103 / T.140) or as Baudot tones.

The method used to send the character depends on if real-time text is enabled or not. If it is, real-time text is of course used, otherwise Baudot will be used if it is enabled in the Core (see Core::enableBaudot()). If real-time text is used, the ChatRoom the message was created from must be a real-time text capable chat room: it must be obtained by placing or receiving a call with real-time text capabilities (see CallParams::enableRealtimeText() ), and getting the ChatRoom interface from the call with Call::getChatRoom(). When the message is terminated (ie a new line needs to be started), use send() in order to trigger the sending of the new line character and have the full message (comprising all characters sent so far) stored in local database.

Parameters
characterThe character to send (T.140 char for real-time text).
Returns
0 if succeed.

◆ removeContent()

LINPHONECXX_PUBLIC void linphone::ChatMessage::removeContent ( const std::shared_ptr< linphone::Content > &  content)

Removes a content from the ChatMessage.

Parameters
contentthe Content object to remove.

◆ removeCustomHeader()

LINPHONECXX_PUBLIC void linphone::ChatMessage::removeCustomHeader ( const std::string &  headerName)

Removes a custom header from the message.

Parameters
headerNamename of the header to remove

◆ removeListener()

LINPHONECXX_PUBLIC void linphone::ChatMessage::removeListener ( const std::shared_ptr< ChatMessageListener > &  listener)

Remove a previously added listener from the ChatMessage instance.

Parameters
listenerthe application listener

◆ setAppdata()

LINPHONECXX_PUBLIC void linphone::ChatMessage::setAppdata ( const std::string &  data)

Linphone message has an app-specific field that can store a text.

The application might want to use it for keeping data over restarts, like thumbnail image path. Invoking this function will attempt to update the message storage to reflect the change if it is enabled.

Parameters
datathe data to store into the message.

◆ setContentType()

LINPHONECXX_PUBLIC void linphone::ChatMessage::setContentType ( const std::string &  contentType)

Sets the content type of a chat message.

This content type must match a content that is text representable, such as text/plain, text/html or image/svg+xml.

Parameters
contentTypeThe new content type of the chat message

◆ setExternalBodyUrl()

LINPHONECXX_PUBLIC void linphone::ChatMessage::setExternalBodyUrl ( const std::string &  externalBodyUrl)

Messages can carry external body as defined by rfc2017.

Parameters
externalBodyUrlex: access-type=URL; URL="http://www.foo.com/file"

◆ setToBeStored()

LINPHONECXX_PUBLIC void linphone::ChatMessage::setToBeStored ( bool  toBeStored)

Sets if a chat message is to be stored.

This content type must match a content that is text representable, such as text/plain, text/html or image/svg+xml.

Parameters
toBeStoredWhether or not the chat message is to be stored

◆ setUtf8Text()

LINPHONECXX_PUBLIC int linphone::ChatMessage::setUtf8Text ( const std::string &  text)

Sets a text to be sent, given as a string of UTF-8 characters.

Parameters
textThe text in UTF8 to set.
Returns
0 if succeed.

The documentation for this class was generated from the following file: