Liblinphone: Chatmessage

Liblinphone 5.3.0

Functions
Chatmessage

## Functions
LinphoneChatMessage * | linphone_chat_message_ref (LinphoneChatMessage *message)
| Acquire a reference to the chat message.
void | linphone_chat_message_unref (LinphoneChatMessage *message)
| Release reference to the chat message.
void * | linphone_chat_message_get_user_data (const LinphoneChatMessage *message)
| Retrieve the user pointer associated with the chat message.
void | linphone_chat_message_set_user_data (LinphoneChatMessage *message, void *user_data)
| Assign a user pointer to the chat message.
LinphoneCore * | linphone_chat_message_get_core (const LinphoneChatMessage *message)
| Returns back pointer to LinphoneCore object.
const char * | linphone_chat_message_get_external_body_url (const LinphoneChatMessage *message)
| Linphone message can carry external body as defined by rfc2017.
void | linphone_chat_message_set_external_body_url (LinphoneChatMessage *message, const char *external_body_url)
| Linphone message can carry external body as defined by rfc2017.
time_t | linphone_chat_message_get_time (const LinphoneChatMessage *message)
| Get the time the message was sent.
bool_t | linphone_chat_message_is_outgoing (const LinphoneChatMessage *message)
| Returns wehther the message has been sent or received.
const LinphoneAddress * | linphone_chat_message_get_from_address (const LinphoneChatMessage *message)
| Get origin of the message.
const LinphoneAddress * | linphone_chat_message_get_to_address (const LinphoneChatMessage *message)
| Get destination of the message.
const char * | linphone_chat_message_get_content_type (const LinphoneChatMessage *message)
| Get the content type of a chat message.
void | linphone_chat_message_set_content_type (LinphoneChatMessage *message, const char *content_type)
| Set the content type of a chat message.
const char * | linphone_chat_message_get_utf8_text (const LinphoneChatMessage *message)
| Get text part of this message.
int | linphone_chat_message_set_utf8_text (LinphoneChatMessage *message, const char *text)
| Set a chat message text to be sent by linphone_chat_room_send_message().
const char * | linphone_chat_message_get_message_id (const LinphoneChatMessage *message)
| Get the message identifier.
const char * | linphone_chat_message_get_appdata (const LinphoneChatMessage *message)
| Linphone message has an app-specific field that can store a text.
void | linphone_chat_message_set_appdata (LinphoneChatMessage *message, const char *data)
| Linphone message has an app-specific field that can store a text.
LinphoneChatRoom * | linphone_chat_message_get_chat_room (const LinphoneChatMessage *message)
| Returns the chatroom this message belongs to.
bool_t | linphone_chat_message_get_to_be_stored (const LinphoneChatMessage *message)
| Get if a chat message is to be stored.
void | linphone_chat_message_set_to_be_stored (LinphoneChatMessage *message, bool_t to_be_stored)
| Set if a chat message is to be stored.
unsigned int | linphone_chat_message_store (LinphoneChatMessage *message)
LinphoneChatMessageState | linphone_chat_message_get_state (const LinphoneChatMessage *message)
| Get the state of the message.
bool_t | linphone_chat_message_is_secured (const LinphoneChatMessage *message)
| Get if the message was encrypted when transfered.
LinphoneContent * | linphone_chat_message_get_file_transfer_information (const LinphoneChatMessage *message)
| Get the file_transfer_information (used by call backs to recover informations during a rcs file transfer).
bool_t | linphone_chat_message_download_content (LinphoneChatMessage *message, LinphoneContent *content)
| Start the download of the LinphoneContent referenced in the LinphoneChatMessage from remote server.
void | linphone_chat_message_cancel_file_transfer (LinphoneChatMessage *message)
| Cancel an ongoing file transfer attached to this message.
void | linphone_chat_message_send (LinphoneChatMessage *message)
| Send a chat message.
const LinphoneAddress * | linphone_chat_message_get_peer_address (const LinphoneChatMessage *message)
const LinphoneAddress * | linphone_chat_message_get_local_address (const LinphoneChatMessage *message)
| Returns the local address the message was sent or received with.
void | linphone_chat_message_add_custom_header (LinphoneChatMessage *message, const char *header_name, const char *header_value)
| Add custom headers to the message.
const char * | linphone_chat_message_get_custom_header (const LinphoneChatMessage *message, const char *header_name)
| Retrieve a custom header value given its name.
void | linphone_chat_message_remove_custom_header (LinphoneChatMessage *message, const char *header_name)
| Removes a custom header from the message.
bool_t | linphone_chat_message_is_read (const LinphoneChatMessage *message)
| Returns wether the message has been read or not.
LinphoneReason | linphone_chat_message_get_reason (const LinphoneChatMessage *message)
const LinphoneErrorInfo * | linphone_chat_message_get_error_info (const LinphoneChatMessage *message)
| Get full details about delivery error of a chat message.
bool_t | linphone_chat_message_is_forward (LinphoneChatMessage *message)
| Returns wether the chat message is a forward message or not.
const char * | linphone_chat_message_get_forward_info (const LinphoneChatMessage *message)
| Gets the forward info if available as a string.
bool_t | linphone_chat_message_is_reply (LinphoneChatMessage *message)
| Returns wether the chat message is a reply message or not.
const char * | linphone_chat_message_get_reply_message_id (LinphoneChatMessage *message)
| Returns the ID of the message this is a reply to.
const LinphoneAddress * | linphone_chat_message_get_reply_message_sender_address (LinphoneChatMessage *message)
| Returns the address of the sender of the message this is a reply to.
LinphoneChatMessage * | linphone_chat_message_get_reply_message (LinphoneChatMessage *message)
| Returns the LinphoneChatMessage this message is a reply to.
bool_t | linphone_chat_message_is_ephemeral (const LinphoneChatMessage *message)
| Returns wether the chat message is an ephemeral message or not.
long | linphone_chat_message_get_ephemeral_lifetime (const LinphoneChatMessage *message)
| Returns lifetime of an ephemeral message.
time_t | linphone_chat_message_get_ephemeral_expire_time (const LinphoneChatMessage *message)
| Returns the real time at which an ephemeral message expires and will be deleted.
LinphoneStatus | linphone_chat_message_put_char (LinphoneChatMessage *message, uint32_t character)
| Fulfill a chat message char by char.
void | linphone_chat_message_add_callbacks (LinphoneChatMessage *message, LinphoneChatMessageCbs *cbs)
| Add a listener in order to be notified of LinphoneChatMessage events.
void | linphone_chat_message_remove_callbacks (LinphoneChatMessage *message, LinphoneChatMessageCbs *cbs)
| Remove a listener from a LinphoneChatMessage.
LinphoneChatMessageCbs * | linphone_chat_message_get_current_callbacks (const LinphoneChatMessage *message)
| Gets the current LinphoneChatMessageCbs.
void | linphone_chat_message_add_file_content (LinphoneChatMessage *message, LinphoneContent *content)
| Adds a file content to the ChatMessage.
void | linphone_chat_message_add_utf8_text_content (LinphoneChatMessage *message, const char *text)
| Creates a LinphoneContent of type PlainText with the given text as body.
void | linphone_chat_message_add_content (LinphoneChatMessage *message, LinphoneContent *content)
| Adds a content to the ChatMessage.
void | linphone_chat_message_remove_content (LinphoneChatMessage *message, LinphoneContent *content)
| Removes a content from the ChatMessage.
const bctbx_list_t * | linphone_chat_message_get_contents (const LinphoneChatMessage *message)
| Returns the list of contents in the message.
bool_t | linphone_chat_message_is_file_transfer_in_progress (const LinphoneChatMessage *message)
| Gets whether or not a file is currently being downloaded or uploaded.
bctbx_list_t * | linphone_chat_message_get_participants_by_imdn_state (const LinphoneChatMessage *message, LinphoneChatMessageState state)
| Gets the list of participants for which the imdn state has reached the specified state and the time at which they did.
const char * | linphone_chat_message_get_call_id (const LinphoneChatMessage *message)
| Gets the callId accociated with the message.
bctbx_list_t * | linphone_chat_message_get_reactions (const LinphoneChatMessage *message)
| Gets the list of reactions received for this chat message.
const LinphoneChatMessageReaction * | linphone_chat_message_get_own_reaction (const LinphoneChatMessage *message)
| Returns our own reaction for a given chat message, if any.
bool_t | linphone_chat_message_has_conference_invitation_content (const LinphoneChatMessage *message)
| Returns wether the chat message has a conference invitation content or not.
LinphoneChatMessageReaction * | linphone_chat_message_create_reaction (LinphoneChatMessage *message, const char *utf8_reaction)
| Creates a emoji reaction for the given chat mesage.
bool_t | linphone_chat_message_has_text_content (const LinphoneChatMessage *message)
| Returns wether the chat message has a text content or not.
MS2_DEPRECATED const char * | linphone_chat_message_get_text (const LinphoneChatMessage *message)
| Get text part of this message.
MS2_DEPRECATED const char * | linphone_chat_message_get_file_transfer_filepath (const LinphoneChatMessage *message)
| Get the path to the file to read from or write to during the file transfer.
MS2_DEPRECATED void | linphone_chat_message_start_file_download (LinphoneChatMessage *message, LinphoneChatMessageStateChangedCb status_cb, void *user_data)
| Start the download of the file from remote server.
MS2_DEPRECATED bool_t | linphone_chat_message_download_file (LinphoneChatMessage *message)
| Start the download of the file referenced in a LinphoneChatMessage from remote server.
MS2_DEPRECATED void | linphone_chat_message_resend (LinphoneChatMessage *message)
| Resend a chat message if it is in the 'not delivered' state for whatever reason.
MS2_DEPRECATED void | linphone_chat_message_set_file_transfer_filepath (LinphoneChatMessage *message, const char *filepath)
| Set the path to the file to read from or write to during the file transfer.
MS2_DEPRECATED LinphoneChatMessageCbs * | linphone_chat_message_get_callbacks (const LinphoneChatMessage *message)
| Get the LinphoneChatMessageCbs object associated with the LinphoneChatMessage.
MS2_DEPRECATED int | linphone_chat_message_set_text (LinphoneChatMessage *message, const char *text)
| Set a chat message text to be sent by linphone_chat_room_send_message().
MS2_DEPRECATED const char * | linphone_chat_message_get_text_content (const LinphoneChatMessage *message)
| Gets the text content if available as a string.
MS2_DEPRECATED void | linphone_chat_message_add_text_content (LinphoneChatMessage *message, const char *text)
| Creates a LinphoneContent of type PlainText with the given text as body.
MS2_DEPRECATED bool_t | linphone_chat_message_is_file_transfer (const LinphoneChatMessage *message)
| Return whether or not a chat message is a file transfer.
MS2_DEPRECATED bool_t | linphone_chat_message_is_text (const LinphoneChatMessage *message)
| Return whether or not a chat message is a text.

## Detailed Description

## Function Documentation

## ◆ linphone_chat_message_add_callbacks()

void linphone_chat_message_add_callbacks | ( | LinphoneChatMessage * | message,
|  | LinphoneChatMessageCbs * | cbs )

Add a listener in order to be notified of LinphoneChatMessage events.

Parameters

  message | LinphoneChatMessage object to monitor.
  cbs | A LinphoneChatMessageCbs object holding the callbacks you need.

## ◆ linphone_chat_message_add_content()

void linphone_chat_message_add_content | ( | LinphoneChatMessage * | message,
|  | LinphoneContent * | content )

Adds a content to the ChatMessage.

Parameters

  message | LinphoneChatMessage object.
  content | the LinphoneContent object to add.

## ◆ linphone_chat_message_add_custom_header()

void linphone_chat_message_add_custom_header | ( | LinphoneChatMessage * | message,
|  | const char * | header_name,
|  | const char * | header_value )

Add custom headers to the message.

Parameters

  message | LinphoneChatMessage object.
  header_name | name of the header
  header_value | header value

## ◆ linphone_chat_message_add_file_content()

void linphone_chat_message_add_file_content | ( | LinphoneChatMessage * | message,
|  | LinphoneContent * | content )

Adds a file content to the ChatMessage.

Parameters

  message | LinphoneChatMessage object.
  content | the LinphoneContent object to add.

## ◆ linphone_chat_message_add_text_content()

MS2_DEPRECATED void linphone_chat_message_add_text_content | ( | LinphoneChatMessage * | message,
|  | const char * | text )

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

Parameters

  message | LinphoneChatMessage object.
  text | The text in System Locale to add to the message.

Deprecated
  01/07/2020. Use linphone_chat_message_add_utf8_text_content() instead.

## ◆ linphone_chat_message_add_utf8_text_content()

void linphone_chat_message_add_utf8_text_content | ( | LinphoneChatMessage * | message,
|  | const char * | text )

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

Introduced in 01/07/2020

Parameters

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

## ◆ linphone_chat_message_cancel_file_transfer()

void linphone_chat_message_cancel_file_transfer | ( | LinphoneChatMessage * | message | ) |

Cancel an ongoing file transfer attached to this message.

(upload or download)

Parameters

  message | LinphoneChatMessage object.

## ◆ linphone_chat_message_create_reaction()

LinphoneChatMessageReaction * linphone_chat_message_create_reaction | ( | LinphoneChatMessage * | message,
|  | const char * | utf8_reaction )

Creates a emoji reaction for the given chat mesage.

To send it, use linphone_chat_message_reaction_send().

Parameters

  message | the message you want to react on
  utf8_reaction | the emoji character(s) as UTF-8.

Returns
  a LinphoneChatMessageReaction object.

## ◆ linphone_chat_message_download_content()

bool_t linphone_chat_message_download_content | ( | LinphoneChatMessage * | message,
|  | LinphoneContent * | content )

Start the download of the LinphoneContent referenced in the LinphoneChatMessage from remote server.

Parameters

  message | LinphoneChatMessage object.
  content | the LinphoneContent object to download (must have the linphone_content_is_file_transfer() method return TRUE).

Returns
  FALSE if there is an error, TRUE otherwise.

## ◆ linphone_chat_message_download_file()

MS2_DEPRECATED bool_t linphone_chat_message_download_file | ( | LinphoneChatMessage * | message | ) |

Start the download of the file referenced in a LinphoneChatMessage from remote server.

Parameters

  message | LinphoneChatMessage object.

Deprecated
  12/07/2018 Use linphone_chat_message_download_content() instead

## ◆ linphone_chat_message_get_appdata()

const char * linphone_chat_message_get_appdata | ( | const LinphoneChatMessage * | message | ) |

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.

Parameters

  message | LinphoneChatMessage object.

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

## ◆ linphone_chat_message_get_call_id()

const char * linphone_chat_message_get_call_id | ( | const LinphoneChatMessage * | message | ) |

Gets the callId accociated with the message.

Parameters

  message | LinphoneChatMessage object.

Returns
  the call Id

## ◆ linphone_chat_message_get_callbacks()

MS2_DEPRECATED LinphoneChatMessageCbs * linphone_chat_message_get_callbacks | ( | const LinphoneChatMessage * | message | ) |

Get the LinphoneChatMessageCbs object associated with the LinphoneChatMessage.

Parameters

  message | LinphoneChatMessage object.

Returns
  The LinphoneChatMessageCbs object associated with the LinphoneChatMessage.

Deprecated
  19/02/2019

## ◆ linphone_chat_message_get_chat_room()

LinphoneChatRoom * linphone_chat_message_get_chat_room | ( | const LinphoneChatMessage * | message | ) |

Returns the chatroom this message belongs to.

Parameters

  message | LinphoneChatMessage object.

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

## ◆ linphone_chat_message_get_content_type()

const char * linphone_chat_message_get_content_type | ( | const LinphoneChatMessage * | message | ) |

Get the content type of a chat message.

Parameters

  message | LinphoneChatMessage object.

Returns
  The content type of the chat message

## ◆ linphone_chat_message_get_contents()

const bctbx_list_t * linphone_chat_message_get_contents | ( | const LinphoneChatMessage * | message | ) |

Returns the list of contents in the message.

Parameters

  message | LinphoneChatMessage object.

Returns
  The list of LinphoneContent.

## ◆ linphone_chat_message_get_core()

LinphoneCore * linphone_chat_message_get_core | ( | const LinphoneChatMessage * | message | ) |

Returns back pointer to LinphoneCore object.

Parameters

  message | LinphoneChatMessage object.

Returns
  the LinphoneCore object associated with this message.

## ◆ linphone_chat_message_get_current_callbacks()

LinphoneChatMessageCbs * linphone_chat_message_get_current_callbacks | ( | const LinphoneChatMessage * | message | ) |

Gets the current LinphoneChatMessageCbs.

This is meant only to be called from a callback to be able to get the user_data associated with the LinphoneChatMessageCbs that is calling the callback.

Parameters

  message | LinphoneChatMessage object

Returns
  The LinphoneChatMessageCbs that has called the last callback.

## ◆ linphone_chat_message_get_custom_header()

const char * linphone_chat_message_get_custom_header | ( | const LinphoneChatMessage * | message,
|  | const char * | header_name )

Retrieve a custom header value given its name.

Parameters

  message | LinphoneChatMessage object.
  header_name | header name searched

Returns
  the custom header value or NULL if not found.

## ◆ linphone_chat_message_get_ephemeral_expire_time()

time_t linphone_chat_message_get_ephemeral_expire_time | ( | const LinphoneChatMessage * | message | ) |

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

See also
  linphone_chat_message_is_ephemeral()

Parameters

  message | LinphoneChatMessage object.

Returns
  the time at which an ephemeral message expires. 0 means the message has not been read.

## ◆ linphone_chat_message_get_ephemeral_lifetime()

long linphone_chat_message_get_ephemeral_lifetime | ( | const LinphoneChatMessage * | message | ) |

Returns lifetime of an ephemeral message.

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

See also
  linphone_chat_message_is_ephemeral()

Parameters

  message | LinphoneChatMessage object.

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

## ◆ linphone_chat_message_get_error_info()

const LinphoneErrorInfo * linphone_chat_message_get_error_info | ( | const LinphoneChatMessage * | message | ) |

Get full details about delivery error of a chat message.

Parameters

  message | LinphoneChatMessage object.

Returns
  a LinphoneErrorInfo describing the details.

## ◆ linphone_chat_message_get_external_body_url()

const char * linphone_chat_message_get_external_body_url | ( | const LinphoneChatMessage * | message | ) |

Linphone message can carry external body as defined by rfc2017.

Parameters

  message | LinphoneChatMessage object.

Returns
  external body url or NULL if not present.

## ◆ linphone_chat_message_get_file_transfer_filepath()

MS2_DEPRECATED const char * linphone_chat_message_get_file_transfer_filepath | ( | const LinphoneChatMessage * | message | ) |

Get the path to the file to read from or write to during the file transfer.

Parameters

  message | LinphoneChatMessage object

Returns
  The path to the file to use for the file transfer.

Deprecated
  12/07/2018 use linphone_content_get_file_path() instead.

## ◆ linphone_chat_message_get_file_transfer_information()

LinphoneContent * linphone_chat_message_get_file_transfer_information | ( | const LinphoneChatMessage * | message | ) |

Get the file_transfer_information (used by call backs to recover informations during a rcs file transfer).

Parameters

  message | LinphoneChatMessage object.

Returns
  a pointer to the LinphoneContent structure or NULL if not present.

## ◆ linphone_chat_message_get_forward_info()

const char * linphone_chat_message_get_forward_info | ( | const LinphoneChatMessage * | message | ) |

Gets the forward info if available as a string.

Parameters

  message | LinphoneChatMessage object.

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

## ◆ linphone_chat_message_get_from_address()

const LinphoneAddress * linphone_chat_message_get_from_address | ( | const LinphoneChatMessage * | message | ) |

Get origin of the message.

Parameters

  message | LinphoneChatMessage object.

Returns
  the LinphoneAddress of the sender.

## ◆ linphone_chat_message_get_local_address()

const LinphoneAddress * linphone_chat_message_get_local_address | ( | const LinphoneChatMessage * | message | ) |

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

Parameters

  message | LinphoneChatMessage object.

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

## ◆ linphone_chat_message_get_message_id()

const char * linphone_chat_message_get_message_id | ( | const LinphoneChatMessage * | message | ) |

Get the message identifier.

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

Parameters

  message | LinphoneChatMessage object.

Returns
  The message identifier.

## ◆ linphone_chat_message_get_own_reaction()

const LinphoneChatMessageReaction * linphone_chat_message_get_own_reaction | ( | const LinphoneChatMessage * | message | ) |

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

Parameters

  message | LinphoneChatMessage object.

Returns
  Our own LinphoneChatMessageReaction for that message if any, NULL otherwise.

## ◆ linphone_chat_message_get_participants_by_imdn_state()

bctbx_list_t * linphone_chat_message_get_participants_by_imdn_state | ( | const LinphoneChatMessage * | message,
|  | LinphoneChatMessageState | state )

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

Parameters

  message | LinphoneChatMessage object.
  state | The LinphoneChatMessageState the imdn have reached (only use LinphoneChatMessageStateDelivered, LinphoneChatMessageStateDeliveredToUser, LinphoneChatMessageStateDisplayed and LinphoneChatMessageStateNotDelivered)

Returns
  The list of participants.

## ◆ linphone_chat_message_get_reactions()

bctbx_list_t * linphone_chat_message_get_reactions | ( | const LinphoneChatMessage * | message | ) |

Gets the list of reactions received for this chat message.

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

Parameters

  message | LinphoneChatMessage object.

Returns
  The sorted list of reaction if any.

## ◆ linphone_chat_message_get_reply_message()

LinphoneChatMessage * linphone_chat_message_get_reply_message | ( | LinphoneChatMessage * | message | ) |

Returns the LinphoneChatMessage this message is a reply to.

Parameters

  message | LinphoneChatMessage object.

Returns
  the original message LinphoneChatMessage.

## ◆ linphone_chat_message_get_reply_message_id()

const char * linphone_chat_message_get_reply_message_id | ( | LinphoneChatMessage * | message | ) |

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

Parameters

  message | LinphoneChatMessage object.

Returns
  the original message id.

## ◆ linphone_chat_message_get_reply_message_sender_address()

const LinphoneAddress * linphone_chat_message_get_reply_message_sender_address | ( | LinphoneChatMessage * | message | ) |

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

Parameters

  message | LinphoneChatMessage object.

Returns
  the original message sender LinphoneAddress.

## ◆ linphone_chat_message_get_state()

LinphoneChatMessageState linphone_chat_message_get_state | ( | const LinphoneChatMessage * | message | ) |

Get the state of the message.

Parameters

  message | LinphoneChatMessage object.

Returns
  the current LinphoneChatMessageState of the message.

## ◆ linphone_chat_message_get_text()

MS2_DEPRECATED const char * linphone_chat_message_get_text | ( | const LinphoneChatMessage * | message | ) |

Get text part of this message.

Parameters

  message | LinphoneChatMessage object.

Returns
  text or NULL if no text.

Deprecated
  07/11/2017 use linphone_chat_message_get_utf8_text() instead

## ◆ linphone_chat_message_get_text_content()

MS2_DEPRECATED const char * linphone_chat_message_get_text_content | ( | const LinphoneChatMessage * | message | ) |

Gets the text content if available as a string.

Parameters

  message | LinphoneChatMessage object.

Returns
  the LinphoneContent buffer if available in System Locale, null otherwise.

Deprecated
  01/07/2020. Use linphone_chat_message_get_utf8_text() instead.

## ◆ linphone_chat_message_get_time()

time_t linphone_chat_message_get_time | ( | const LinphoneChatMessage * | message | ) |

Get the time the message was sent.

Parameters

  message | LinphoneChatMessage object.

Returns
  the timestamp of when the message was sent.

## ◆ linphone_chat_message_get_to_address()

const LinphoneAddress * linphone_chat_message_get_to_address | ( | const LinphoneChatMessage * | message | ) |

Get destination of the message.

Parameters

  message | LinphoneChatMessage object.

Returns
  the LinphoneAddress of the recipient.

## ◆ linphone_chat_message_get_to_be_stored()

bool_t linphone_chat_message_get_to_be_stored | ( | const LinphoneChatMessage * | message | ) |

Get if a chat message is to be stored.

Parameters

  message | LinphoneChatMessage object.

Returns
  Whether or not the message is to be stored

## ◆ linphone_chat_message_get_user_data()

void * linphone_chat_message_get_user_data | ( | const LinphoneChatMessage * | message | ) |

Retrieve the user pointer associated with the chat message.

Parameters

  message | LinphoneChatMessage object.

Returns
  The user pointer associated with the chat message.

## ◆ linphone_chat_message_get_utf8_text()

const char * linphone_chat_message_get_utf8_text | ( | const LinphoneChatMessage * | message | ) |

Get text part of this message.

Introduced in 01/07/2020

Parameters

  message | LinphoneChatMessage object.

Returns
  The text in UTF8 or NULL if no text.

## ◆ linphone_chat_message_has_conference_invitation_content()

bool_t linphone_chat_message_has_conference_invitation_content | ( | const LinphoneChatMessage * | message | ) |

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

Parameters

  message | LinphoneChatMessage object.

Returns
  TRUE if it has one, FALSE otherwise.

## ◆ linphone_chat_message_has_text_content()

bool_t linphone_chat_message_has_text_content | ( | const LinphoneChatMessage * | message | ) |

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

Parameters

  message | LinphoneChatMessage object.

Returns
  TRUE if it has one, FALSE otherwise.

Deprecated
  27/10/2020. Check if linphone_chat_message_get_contents() contains a LinphoneContent for which it's content type is PlainText.

## ◆ linphone_chat_message_is_ephemeral()

bool_t linphone_chat_message_is_ephemeral | ( | const LinphoneChatMessage * | message | ) |

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.

Parameters

  message | LinphoneChatMessage object.

Returns
  TRUE if it is an ephemeral message, FALSE otherwise

## ◆ linphone_chat_message_is_file_transfer()

MS2_DEPRECATED bool_t linphone_chat_message_is_file_transfer | ( | const LinphoneChatMessage * | message | ) |

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

Parameters

  message | LinphoneChatMessage object

Returns
  Whether or not the message is a file transfer

Deprecated
  06/07/2020 check if linphone_chat_message_get_contents() contains a LinphoneContent for which linphone_content_is_file_transfer() returns TRUE.

## ◆ linphone_chat_message_is_file_transfer_in_progress()

bool_t linphone_chat_message_is_file_transfer_in_progress | ( | const LinphoneChatMessage * | message | ) |

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

Parameters

  message | LinphoneChatMessage object.

Returns
  TRUE if download or upload is in progress, FALSE otherwise

## ◆ linphone_chat_message_is_forward()

bool_t linphone_chat_message_is_forward | ( | LinphoneChatMessage * | message | ) |

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

Parameters

  message | LinphoneChatMessage object.

Returns
  TRUE if it is a forward message, FALSE otherwise

## ◆ linphone_chat_message_is_outgoing()

bool_t linphone_chat_message_is_outgoing | ( | const LinphoneChatMessage * | message | ) |

Returns wehther the message has been sent or received.

Parameters

  message | LinphoneChatMessage object.

Returns
  TRUE if message has been sent, FALSE if it has been received.

## ◆ linphone_chat_message_is_read()

bool_t linphone_chat_message_is_read | ( | const LinphoneChatMessage * | message | ) |

Returns wether the message has been read or not.

Parameters

  message | LinphoneChatMessage object.

Returns
  TRUE if message has been marked as read, FALSE otherwise.

## ◆ linphone_chat_message_is_reply()

bool_t linphone_chat_message_is_reply | ( | LinphoneChatMessage * | message | ) |

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

Parameters

  message | LinphoneChatMessage object.

Returns
  TRUE if it is a reply message, FALSE otherwise

## ◆ linphone_chat_message_is_secured()

bool_t linphone_chat_message_is_secured | ( | const LinphoneChatMessage * | message | ) |

Get if the message was encrypted when transfered.

Parameters

  message | LinphoneChatMessage object.

Returns
  TRUE if the message was encrypted when transfered, FALSE otherwise.

## ◆ linphone_chat_message_is_text()

MS2_DEPRECATED bool_t linphone_chat_message_is_text | ( | const LinphoneChatMessage * | message | ) |

Return whether or not a chat message is a text.

Parameters

  message | LinphoneChatMessage object.

Returns
  Whether or not the message is a text

Deprecated
  06/07/2020 check if linphone_chat_message_get_contents() contains a LinphoneContent with a PlainText content type.

## ◆ linphone_chat_message_put_char()

LinphoneStatus linphone_chat_message_put_char | ( | LinphoneChatMessage * | message,
|  | 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

  message | LinphoneChatMessage object.
  character | T.140 char

Returns
  0 if succeed.

## ◆ linphone_chat_message_ref()

LinphoneChatMessage * linphone_chat_message_ref | ( | LinphoneChatMessage * | message | ) |

Acquire a reference to the chat message.

Parameters

  message | LinphoneChatMessage object.

Returns
  The same LinphoneChatMessage object.

## ◆ linphone_chat_message_remove_callbacks()

void linphone_chat_message_remove_callbacks | ( | LinphoneChatMessage * | message,
|  | LinphoneChatMessageCbs * | cbs )

Remove a listener from a LinphoneChatMessage.

Parameters

  message | LinphoneChatMessage object
  cbs | LinphoneChatMessageCbs object to remove.

## ◆ linphone_chat_message_remove_content()

void linphone_chat_message_remove_content | ( | LinphoneChatMessage * | message,
|  | LinphoneContent * | content )

Removes a content from the ChatMessage.

Parameters

  message | LinphoneChatMessage object.
  content | the LinphoneContent object to remove.

## ◆ linphone_chat_message_remove_custom_header()

void linphone_chat_message_remove_custom_header | ( | LinphoneChatMessage * | message,
|  | const char * | header_name )

Removes a custom header from the message.

Parameters

  message | LinphoneChatMessage object.
  header_name | name of the header to remove

## ◆ linphone_chat_message_resend()

MS2_DEPRECATED void linphone_chat_message_resend | ( | LinphoneChatMessage * | message | ) |

Resend a chat message if it is in the 'not delivered' state for whatever reason.

Parameters

  message | LinphoneChatMessage object.

Deprecated
  13/10/2017 Use linphone_chat_message_send instead.

## ◆ linphone_chat_message_send()

void linphone_chat_message_send | ( | LinphoneChatMessage * | message | ) |

Send a chat message.

Parameters

  message | LinphoneChatMessage object.

## ◆ linphone_chat_message_set_appdata()

void linphone_chat_message_set_appdata | ( | LinphoneChatMessage * | message,
|  | const char * | 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

  message | LinphoneChatMessage object.
  data | the data to store into the message.

## ◆ linphone_chat_message_set_content_type()

void linphone_chat_message_set_content_type | ( | LinphoneChatMessage * | message,
|  | const char * | content_type )

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

  message | LinphoneChatMessage object.
  content_type | The new content type of the chat message

## ◆ linphone_chat_message_set_external_body_url()

void linphone_chat_message_set_external_body_url | ( | LinphoneChatMessage * | message,
|  | const char * | external_body_url )

Linphone message can carry external body as defined by rfc2017.

Parameters

  message | LinphoneChatMessage object.
  external_body_url | ex: access-type=URL; URL="http://www.foo.com/file"

## ◆ linphone_chat_message_set_file_transfer_filepath()

MS2_DEPRECATED void linphone_chat_message_set_file_transfer_filepath | ( | LinphoneChatMessage * | message,
|  | const char * | filepath )

Set the path to the file to read from or write to during the file transfer.

Parameters

  message | LinphoneChatMessage object.
  filepath | The path to the file to use for the file transfer.

Deprecated
  12/07/2018 use linphone_content_set_file_path() instead.

## ◆ linphone_chat_message_set_text()

MS2_DEPRECATED int linphone_chat_message_set_text | ( | LinphoneChatMessage * | message,
|  | const char * | text )

Set a chat message text to be sent by linphone_chat_room_send_message().

Parameters

  message | LinphoneChatMessage
  text | The text is in System Locale.

Returns
  0 if succeed.

Deprecated
  01/07/2020. Use linphone_chat_message_set_utf8_text() instead.

## ◆ linphone_chat_message_set_to_be_stored()

void linphone_chat_message_set_to_be_stored | ( | LinphoneChatMessage * | message,
|  | bool_t | to_be_stored )

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

  message | LinphoneChatMessage object.
  to_be_stored | Whether or not the chat message is to be stored

## ◆ linphone_chat_message_set_user_data()

void linphone_chat_message_set_user_data | ( | LinphoneChatMessage * | message,
|  | void * | user_data )

Assign a user pointer to the chat message.

Parameters

  message | LinphoneChatMessage object.
  user_data | The user pointer to associate with the chat message.

## ◆ linphone_chat_message_set_utf8_text()

int linphone_chat_message_set_utf8_text | ( | LinphoneChatMessage * | message,
|  | const char * | text )

Set a chat message text to be sent by linphone_chat_room_send_message().

Introduced in 01/07/2020

Parameters

  message | LinphoneChatMessage
  text | The text in UTF8 to set.

Returns
  0 if succeed.

## ◆ linphone_chat_message_start_file_download()

MS2_DEPRECATED void linphone_chat_message_start_file_download | ( | LinphoneChatMessage * | message,
|  | LinphoneChatMessageStateChangedCb | status_cb,
|  | void * | user_data )

Start the download of the file from remote server.

Parameters

  message | LinphoneChatMessage object.
  status_cb | #LinphoneChatMessageStateChangeCb status callback invoked when file is downloaded or could not be downloaded
  user_data | user data

Deprecated
  21/09/2017 Use linphone_chat_message_download_file() instead.

## ◆ linphone_chat_message_unref()

void linphone_chat_message_unref | ( | LinphoneChatMessage * | message | ) |

Release reference to the chat message.

Parameters

  message | LinphoneChatMessage object.