Liblinphone  5.5.0
Linphone.ChatMessage Class Reference
Inheritance diagram for Linphone.ChatMessage:
Linphone.LinphoneObject

Public Member Functions

void AddContent (Linphone.Content content)
 
void AddCustomHeader (string headerName, string headerValue)
 
void AddFileContent (Linphone.Content content)
 
void AddTextContent (string text)
 
void AddUtf8TextContent (string text)
 
void CancelFileTransfer ()
 
Linphone.ChatMessageReaction CreateReaction (string utf8Reaction)
 
bool DownloadContent (Linphone.Content content)
 
bool DownloadContents ()
 
string GetCustomHeader (string headerName)
 
IEnumerable< Linphone.ParticipantImdnStateGetParticipantsByImdnState (Linphone.ChatMessageState state)
 
bool HasConferenceInvitationContent ()
 
bool HasTextContent ()
 
void MarkAsRead ()
 
void PutChar (uint character)
 
void RemoveContent (Linphone.Content content)
 
void RemoveCustomHeader (string headerName)
 
void Send ()
 

Properties

ChatMessageListener Listener [get, set]
 
string Appdata [get, set]
 
string CallId [get]
 
Linphone.ChatRoom ChatRoom [get]
 
string ContentType [get, set]
 
IEnumerable< Linphone.ContentContents [get]
 
Linphone.Core Core [get]
 
long EphemeralExpireTime [get]
 
int EphemeralLifetime [get]
 
Linphone.ErrorInfo ErrorInfo [get]
 
Linphone.EventLog EventLog [get]
 
string ExternalBodyUrl [get, set]
 
Linphone.Content FileTransferInformation [get]
 
string ForwardInfo [get]
 
Linphone.Address FromAddress [get]
 
bool IsEditable [get]
 
bool IsEdited [get]
 
bool IsEphemeral [get]
 
bool IsFileTransfer [get]
 
bool IsFileTransferInProgress [get]
 
bool IsForward [get]
 
bool IsOutgoing [get]
 
bool IsRead [get]
 
bool IsReply [get]
 
bool IsRetractable [get]
 
bool IsRetracted [get]
 
bool IsSecured [get]
 
bool IsText [get]
 
Linphone.Address LocalAddress [get]
 
string MessageId [get]
 
Linphone.ChatMessageReaction OwnReaction [get]
 
Linphone.Address PeerAddress [get]
 
IEnumerable< Linphone.ChatMessageReactionReactions [get]
 
Linphone.ChatMessage ReplyMessage [get]
 
string ReplyMessageId [get]
 
Linphone.Address ReplyMessageSenderAddress [get]
 
Linphone.ChatMessageState State [get]
 
string TextContent [get]
 
long Time [get]
 
Linphone.Address ToAddress [get]
 
bool ToBeStored [get, set]
 
string Utf8Text [get, set]
 

Additional Inherited Members

- Protected Member Functions inherited from Linphone.LinphoneObject
static String linphone_pointer_to_string (IntPtr ptr)
 
static IntPtr linphone_string_to_pointer ([MarshalAs(LinphoneWrapper.ByteStringMarshalling)] String str)
 
IntPtr StringArrayToBctbxList (IEnumerable< string > stringlist)
 
void CleanStringArrayPtrs (IntPtr l)
 

Detailed Description

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

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

Member Function Documentation

void Linphone.ChatMessage.AddContent ( Linphone.Content  content)
inline

Adds a content to the ChatMessage.

Parameters
contentthe Linphone.Content object to add.
void Linphone.ChatMessage.AddCustomHeader ( string  headerName,
string  headerValue 
)
inline

Adds custom headers to the message.

Parameters
headerNamename of the header
headerValueheader value
void Linphone.ChatMessage.AddFileContent ( Linphone.Content  content)
inline

Adds a file content to the ChatMessage.

Parameters
contentthe Linphone.Content object to add.
void Linphone.ChatMessage.AddTextContent ( string  text)
inline

Creates a Linphone.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 Linphone.ChatMessage.AddUtf8TextContent() instead.

void Linphone.ChatMessage.AddUtf8TextContent ( string  text)
inline

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

Parameters
textThe text to add to the message.
void Linphone.ChatMessage.CancelFileTransfer ( )
inline

Cancels an ongoing file transfer attached to this message (upload or download).

Linphone.ChatMessageReaction Linphone.ChatMessage.CreateReaction ( string  utf8Reaction)
inline

Creates a emoji reaction for the given chat mesage.

To send it, use Linphone.ChatMessageReaction.Send().

Parameters
utf8Reactionthe emoji character(s) as UTF-8.
Returns
a Linphone.ChatMessageReaction object.
bool Linphone.ChatMessage.DownloadContent ( Linphone.Content  content)
inline

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

Parameters
contentthe Linphone.Content object to download (must have the Linphone.Content.IsFileTransfer() method return true).
Returns
false if there is an error, true otherwise.
bool Linphone.ChatMessage.DownloadContents ( )
inline

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

Returns
false if there is an error, true otherwise.
string Linphone.ChatMessage.GetCustomHeader ( string  headerName)
inline

Retrieves a custom header value given its name.

Parameters
headerNameheader name searched
Returns
the custom header value or null if not found.
IEnumerable<Linphone.ParticipantImdnState> Linphone.ChatMessage.GetParticipantsByImdnState ( Linphone.ChatMessageState  state)
inline

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. A list of Linphone.ParticipantImdnState objects.
bool Linphone.ChatMessage.HasConferenceInvitationContent ( )
inline

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

Returns
true if it has one, false otherwise.
bool Linphone.ChatMessage.HasTextContent ( )
inline

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

Returns
true if it has one, false otherwise.

Deprecated : 27/10/2020. Check if Linphone.ChatMessage.Contents contains a Linphone.Content for which it's content type is PlainText.

void Linphone.ChatMessage.MarkAsRead ( )
inline

Marks the message as read.

Only triggers LinphoneChatRoomCbsChatRoomReadCb if it was the last unread message.

void Linphone.ChatMessage.PutChar ( uint  character)
inline

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 Linphone.Core (see Linphone.Core.EnableBaudot()). If real-time text is used, the Linphone.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 Linphone.CallParams.EnableRealtimeText() ), and getting the Linphone.ChatRoom interface from the call with Linphone.Call.ChatRoom. When the message is terminated (ie a new line needs to be started), use Linphone.ChatMessage.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.
void Linphone.ChatMessage.RemoveContent ( Linphone.Content  content)
inline

Removes a content from the ChatMessage.

Parameters
contentthe Linphone.Content object to remove.
void Linphone.ChatMessage.RemoveCustomHeader ( string  headerName)
inline

Removes a custom header from the message.

Parameters
headerNamename of the header to remove
void Linphone.ChatMessage.Send ( )
inline

Sends a chat message.

Property Documentation

string Linphone.ChatMessage.Appdata
getset

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 null if none has been stored.
string Linphone.ChatMessage.CallId
get

Gets the SIP call-id accociated with the message.

Returns
the call-id
Linphone.ChatRoom Linphone.ChatMessage.ChatRoom
get

Returns the chatroom this message belongs to.

Returns
the Linphone.ChatRoom in which this message has been sent or received.
IEnumerable<Linphone.Content> Linphone.ChatMessage.Contents
get

Returns the list of contents in the message.

Returns
The list of Linphone.Content. A list of Linphone.Content objects.
string Linphone.ChatMessage.ContentType
getset

Gets the content type of a chat message.

Returns
The content type of the chat message
Linphone.Core Linphone.ChatMessage.Core
get

Returns back pointer to Linphone.Core object.

Returns
the Linphone.Core object associated with this message.
long Linphone.ChatMessage.EphemeralExpireTime
get

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

See : Linphone.ChatMessage.IsEphemeral()

Returns
the time at which an ephemeral message expires. 0 means the message has not been read.
int Linphone.ChatMessage.EphemeralLifetime
get

Returns lifetime of an ephemeral message.

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

See : Linphone.ChatMessage.IsEphemeral()

Returns
the lifetime of an ephemeral message, by default 0 (disabled).
Linphone.ErrorInfo Linphone.ChatMessage.ErrorInfo
get

Gets full details about delivery error of a chat message.

Returns
a Linphone.ErrorInfo describing the details.
Linphone.EventLog Linphone.ChatMessage.EventLog
get

Returns the event log associated to the chat message.

Returns
The event log, if exists, null otherwise
string Linphone.ChatMessage.ExternalBodyUrl
getset

Messages can carry external body as defined by rfc2017.

Returns
external body url or null if not present.
Linphone.Content Linphone.ChatMessage.FileTransferInformation
get

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

Returns
a pointer to the Linphone.Content structure or null if not present.
string Linphone.ChatMessage.ForwardInfo
get

Gets the forward info if available as a string.

Returns
the original sender of the message if it has been forwarded, null otherwise.
Linphone.Address Linphone.ChatMessage.FromAddress
get

Gets origin of the message.

Returns
the Linphone.Address of the sender.
bool Linphone.ChatMessage.IsEditable
get

Returns whether this message can be edited (maximum allowed time to edit it was reached or not).

Returns
true if the message can be edited, false otherwise.
bool Linphone.ChatMessage.IsEdited
get

Returns whether this message has been edited by it's sender after it was sent.

Returns
true if the message has been edited after it was sent, false otherwise.
bool Linphone.ChatMessage.IsEphemeral
get

Returns whether 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
bool Linphone.ChatMessage.IsFileTransfer
get

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 Linphone.ChatMessage.Contents contains a Linphone.Content for which Linphone.Content.IsFileTransfer() returns true.

bool Linphone.ChatMessage.IsFileTransferInProgress
get

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

Returns
true if download or upload is in progress, false otherwise
bool Linphone.ChatMessage.IsForward
get

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

Returns
true if it is a forward message, false otherwise
bool Linphone.ChatMessage.IsOutgoing
get

Returns wehther the message has been sent or received.

Returns
true if message has been sent, false if it has been received.
bool Linphone.ChatMessage.IsRead
get

Returns whether the message has been read or not.

Returns
true if message has been marked as read, false otherwise.
bool Linphone.ChatMessage.IsReply
get

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

Returns
true if it is a reply message, false otherwise
bool Linphone.ChatMessage.IsRetractable
get

Returns whether this message can be retracted (maximum allowed time to retract it was reached or not).

Returns
true if the message can be retracted, false otherwise.
bool Linphone.ChatMessage.IsRetracted
get

Returns whether this message has been retracted by it's sender after it was sent.

Returns
true if the message has been retracted after it was sent, false otherwise.
bool Linphone.ChatMessage.IsSecured
get

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.
bool Linphone.ChatMessage.IsText
get

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 Linphone.ChatMessage.Contents contains a Linphone.Content with a PlainText content type.

Linphone.Address Linphone.ChatMessage.LocalAddress
get

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

Returns
the Linphone.Address of the local address used to send/receive this message.
string Linphone.ChatMessage.MessageId
get

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.
Linphone.ChatMessageReaction Linphone.ChatMessage.OwnReaction
get

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

Returns
Our own Linphone.ChatMessageReaction for that message if any, null otherwise.
Linphone.Address Linphone.ChatMessage.PeerAddress
get

Returns the peer (remote) address of the message.

Returns
the Linphone.Address of the peer address used to send/receive this message.
IEnumerable<Linphone.ChatMessageReaction> Linphone.ChatMessage.Reactions
get

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. A list of Linphone.ChatMessageReaction objects.
Linphone.ChatMessage Linphone.ChatMessage.ReplyMessage
get

Returns the Linphone.ChatMessage this message is a reply to.

Returns
the original message Linphone.ChatMessage.
string Linphone.ChatMessage.ReplyMessageId
get

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

Returns
the original message id.
Linphone.Address Linphone.ChatMessage.ReplyMessageSenderAddress
get

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

Returns
the original message sender Linphone.Address.
Linphone.ChatMessageState Linphone.ChatMessage.State
get

Gets the state of the message.

Returns
the current Linphone.ChatMessageState of the message.
string Linphone.ChatMessage.TextContent
get

Gets the text content if available as a string.

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

Deprecated : 01/07/2020. Use Linphone.ChatMessage.Utf8Text instead.

long Linphone.ChatMessage.Time
get

Gets the time the message was sent.

Returns
the timestamp of when the message was sent.
Linphone.Address Linphone.ChatMessage.ToAddress
get

Gets destination of the message.

Returns
the Linphone.Address of the recipient.
bool Linphone.ChatMessage.ToBeStored
getset

Gets if a chat message is to be stored.

Returns
Whether or not the message is to be stored
string Linphone.ChatMessage.Utf8Text
getset

Gets text part of this message.

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

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