Liblinphone: linphone::ChatMessage Class Reference

Liblinphone 5.3.0

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

An chat message is the object that is sent or received through a ChatRoom. More...

`#include <chat_message.hh>`

Inheritance diagram for linphone::ChatMessage:

## Public Types
enum class | Direction { Incoming = 0 , Outgoing = 1 }
| Direction is used to indicate if a message is outgoing or incoming. More...
enum class | State { Idle = 0 , InProgress = 1 , Delivered = 2 , NotDelivered = 3 , FileTransferError = 4 , FileTransferDone = 5 , DeliveredToUser = 6 , Displayed = 7 , FileTransferInProgress = 8 }
| 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.
LINPHONECXX_PUBLIC void | removeListener (const std::shared_ptr< ChatMessageListener > &listener)
| Remove a previously added listener from the ChatMessage instance.
LINPHONECXX_PUBLIC std::string | getAppdata () const
| Linphone message has an app-specific field that can store a text.
LINPHONECXX_PUBLIC void | setAppdata (const std::string &data)
| Linphone message has an app-specific field that can store a text.
LINPHONECXX_PUBLIC std::string | getCallId () const
| Gets the callId accociated with the message.
LINPHONECXX_PUBLIC std::shared_ptr< linphone::ChatRoom > | getChatRoom () const
| Returns the chatroom this message belongs to.
LINPHONECXX_PUBLIC std::string | getContentType () const
| Get the content type of a chat message.
LINPHONECXX_PUBLIC void | setContentType (const std::string &contentType)
| Set the content type of a chat message.
LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::Content > > | getContents () const
| Returns the list of contents in the message.
LINPHONECXX_PUBLIC std::shared_ptr< linphone::Core > | getCore () const
| Returns back pointer to Core object.
LINPHONECXX_PUBLIC time_t | getEphemeralExpireTime () const
| Returns the real time at which an ephemeral message expires and will be deleted.
LINPHONECXX_PUBLIC long | getEphemeralLifetime () const
| Returns lifetime of an ephemeral message.
LINPHONECXX_PUBLIC std::shared_ptr< const linphone::ErrorInfo > | getErrorInfo () const
| Get full details about delivery error of a chat message.
LINPHONECXX_PUBLIC std::string | getExternalBodyUrl () const
| Linphone message can carry external body as defined by rfc2017.
LINPHONECXX_PUBLIC void | setExternalBodyUrl (const std::string &externalBodyUrl)
| Linphone message can carry external body as defined by rfc2017.
LINPHONECXX_PUBLIC std::shared_ptr< linphone::Content > | getFileTransferInformation () const
| Get the file_transfer_information (used by call backs to recover informations during a rcs file transfer).
LINPHONECXX_PUBLIC std::string | getForwardInfo () const
| Gets the forward info if available as a string.
LINPHONECXX_PUBLIC std::shared_ptr< const linphone::Address > | getFromAddress () const
| Get origin of the message.
LINPHONECXX_PUBLIC bool | isEphemeral () const
| Returns wether the chat message is an ephemeral message or not.
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED bool | isFileTransfer () const
| Return whether or not a chat message is a file transfer.
LINPHONECXX_PUBLIC bool | isFileTransferInProgress () const
| Gets whether or not a file is currently being downloaded or uploaded.
LINPHONECXX_PUBLIC bool | isForward ()
| Returns wether the chat message is a forward message or not.
LINPHONECXX_PUBLIC bool | isOutgoing () const
| Returns wehther the message has been sent or received.
LINPHONECXX_PUBLIC bool | isRead () const
| Returns wether the message has been read or not.
LINPHONECXX_PUBLIC bool | isReply ()
| Returns wether the chat message is a reply message or not.
LINPHONECXX_PUBLIC bool | isSecured () const
| Get if the message was encrypted when transfered.
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED bool | isText () const
| Return whether or not a chat message is a text.
LINPHONECXX_PUBLIC std::shared_ptr< const linphone::Address > | getLocalAddress () const
| Returns the local address the message was sent or received with.
LINPHONECXX_PUBLIC std::string | getMessageId () const
| Get the message identifier.
LINPHONECXX_PUBLIC std::shared_ptr< const linphone::ChatMessageReaction > | getOwnReaction () const
| Returns our own reaction for a given chat message, if any.
LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::ChatMessageReaction > > | getReactions () const
| Gets the list of reactions received for this chat message.
LINPHONECXX_PUBLIC std::shared_ptr< linphone::ChatMessage > | getReplyMessage ()
| Returns the ChatMessage this message is a reply to.
LINPHONECXX_PUBLIC std::string | getReplyMessageId ()
| Returns the ID of the message this is a reply to.
LINPHONECXX_PUBLIC std::shared_ptr< const linphone::Address > | getReplyMessageSenderAddress ()
| Returns the address of the sender of the message this is a reply to.
LINPHONECXX_PUBLIC State | getState () const
| Get the state of the message.
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED std::string | getTextContent () const
| Gets the text content if available as a string.
LINPHONECXX_PUBLIC time_t | getTime () const
| Get the time the message was sent.
LINPHONECXX_PUBLIC std::shared_ptr< const linphone::Address > | getToAddress () const
| Get destination of the message.
LINPHONECXX_PUBLIC bool | getToBeStored () const
| Get if a chat message is to be stored.
LINPHONECXX_PUBLIC void | setToBeStored (bool toBeStored)
| Set if a chat message is to be stored.
LINPHONECXX_PUBLIC std::string | getUtf8Text () const
| Get text part of this message.
LINPHONECXX_PUBLIC int | setUtf8Text (const std::string &text)
| Set a chat message text to be sent by linphone_chat_room_send_message.
LINPHONECXX_PUBLIC void | addContent (const std::shared_ptr< linphone::Content > &content)
| Adds a content to the ChatMessage.
LINPHONECXX_PUBLIC void | addCustomHeader (const std::string &headerName, const std::string &headerValue)
| Add custom headers to the message.
LINPHONECXX_PUBLIC void | addFileContent (const std::shared_ptr< linphone::Content > &content)
| Adds a file content to the ChatMessage.
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED void | addTextContent (const std::string &text)
| Creates a Content of type PlainText with the given text as body.
LINPHONECXX_PUBLIC void | addUtf8TextContent (const std::string &text)
| Creates a Content of type PlainText with the given text as body.
LINPHONECXX_PUBLIC void | cancelFileTransfer ()
| Cancel an ongoing file transfer attached to this message.
LINPHONECXX_PUBLIC std::shared_ptr< linphone::ChatMessageReaction > | createReaction (const std::string &utf8Reaction)
| Creates a emoji reaction for the given chat mesage.
LINPHONECXX_PUBLIC bool | downloadContent (const std::shared_ptr< linphone::Content > &content)
| Start the download of the Content referenced in the ChatMessage from remote server.
LINPHONECXX_PUBLIC std::string | getCustomHeader (const std::string &headerName) const
| Retrieve a custom header value given its name.
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.
LINPHONECXX_PUBLIC bool | hasConferenceInvitationContent () const
| Returns wether the chat message has a conference invitation content or not.
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED bool | hasTextContent () const
| Returns wether the chat message has a text content or not.
LINPHONECXX_PUBLIC linphone::Status | putChar (uint32_t character)
| Fulfill a chat message char by char.
LINPHONECXX_PUBLIC void | removeContent (const std::shared_ptr< linphone::Content > &content)
| Removes a content from the ChatMessage.
LINPHONECXX_PUBLIC void | removeCustomHeader (const std::string &headerName)
| Removes a custom header from the message.
LINPHONECXX_PUBLIC void | send ()
| Send a chat message.

## Detailed Description

An chat message is the object that is sent 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

enum class linphone::ChatMessage::Direction
| strong

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

Enumerator
Incoming | Incoming message.
Outgoing | Outgoing message.

## ◆ State

enum class linphone::ChatMessage::State
| strong

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.

## Member Function Documentation

## ◆ addContent()

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

Adds a content to the ChatMessage.

Parameters

  content | the Content object to add.

## ◆ addCustomHeader()

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

Add custom headers to the message.

Parameters

  headerName | name of the header
  headerValue | header value

## ◆ addFileContent()

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

Adds a file content to the ChatMessage.

Parameters

  content | the 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

  listener | the 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

  text | The 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 PlainText with the given text as body.

Introduced in 01/07/2020

Parameters

  text | The text in UTF8 to add to the message.

## ◆ cancelFileTransfer()

LINPHONECXX_PUBLIC void linphone::ChatMessage::cancelFileTransfer | ( |  | ) |

Cancel an ongoing file transfer attached to this message.

(upload or download)

## ◆ 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

  utf8Reaction | the emoji character(s) as UTF-8.

Returns
  a ChatMessageReaction object.

## ◆ downloadContent()

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

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

Parameters

  content | the Content object to download (must have the Content::isFileTransfer() method return 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 callId 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

Get 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

Retrieve a custom header value given its name.

Parameters

  headerName | header 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

Get full details about delivery error of a chat message.

Returns
  a ErrorInfo describing the details.

## ◆ getExternalBodyUrl()

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

Linphone message 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

Get the file_transfer_information (used by call backs 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

Get 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

  state | The State the imdn have reached (only use LinphoneChatMessageStateDelivered, LinphoneChatMessageStateDeliveredToUser, LinphoneChatMessageStateDisplayed and LinphoneChatMessageStateNotDelivered)

Returns
  The list of participants.

## ◆ 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

Get 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

Get 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

Get destination of the message.

Returns
  the Address of the recipient.

## ◆ getToBeStored()

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

Get 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

Get text part of this message.

Introduced in 01/07/2020

Returns
  The text in UTF8 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

Get if the message was encrypted when transfered.

Returns
  true if the message was encrypted when transfered, 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.

## ◆ putChar()

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

Fulfill a chat message char by char.

Message linked to a Real Time Text Call send char in realtime following RFC 4103/T.140 To commit a message, use linphone_chat_room_send_message

Parameters

  character | T.140 char

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

  content | the Content object to remove.

## ◆ removeCustomHeader()

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

Removes a custom header from the message.

Parameters

  headerName | name 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

  listener | the 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

  data | the data to store into the message.

## ◆ setContentType()

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

Set 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

  contentType | The new content type of the chat message

## ◆ setExternalBodyUrl()

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

Linphone message can carry external body as defined by rfc2017.

Parameters

  externalBodyUrl | ex: access-type=URL; URL="http://www.foo.com/file"

## ◆ setToBeStored()

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

Set 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

  toBeStored | Whether or not the chat message is to be stored

## ◆ setUtf8Text()

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

Set a chat message text to be sent by linphone_chat_room_send_message.

Introduced in 01/07/2020

Parameters

  text | The text in UTF8 to set.

Returns
  0 if succeed.

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

- chat_message.hh