public interface ChatMessage
Modifier and Type | Interface and Description |
---|---|
static class |
ChatMessage.Direction |
static class |
ChatMessage.State |
Modifier and Type | Method and Description |
---|---|
void |
addCustomHeader(java.lang.String headerName,
java.lang.String headerValue)
Add custom headers to the message.
|
void |
addFileContent(Content cContent)
Adds a file content to the ChatMessage.
|
void |
addListener(ChatMessageListener listener) |
void |
addTextContent(java.lang.String text)
Adds a text content to the ChatMessage.
|
void |
cancelFileTransfer()
Cancel an ongoing file transfer attached to this message.
|
boolean |
downloadContent(Content cContent)
Start the download of the
Content referenced in the ChatMessage
from remote server. |
boolean |
downloadFile()
Deprecated.
Use
downloadContent(org.linphone.core.Content) instead |
java.lang.String |
getAppdata()
Linphone message has an app-specific field that can store a text.
|
java.lang.String |
getCallId()
Gets the callId accociated with the message.
|
ChatRoom |
getChatRoom()
Returns the chatroom this message belongs to.
|
Content[] |
getContents()
Returns the list of contents in the message.
|
java.lang.String |
getContentType()
Get the content type of a chat message.
|
Core |
getCore()
Returns back pointer to
Core object. |
java.lang.String |
getCustomHeader(java.lang.String headerName)
Retrieve a custom header value given its name.
|
long |
getEphemeralExpireTime()
Returns the real time at which an ephemeral message expires and will be
deleted.
|
long |
getEphemeralLifetime()
Returns lifetime of an ephemeral message.
|
ErrorInfo |
getErrorInfo()
Get full details about delivery error of a chat message.
|
java.lang.String |
getExternalBodyUrl()
Linphone message can carry external body as defined by rfc2017.
|
java.lang.String |
getFileTransferFilepath()
Deprecated.
use
Content.getFilePath() instead. |
Content |
getFileTransferInformation()
Get the file_transfer_information (used by call backs to recover informations
during a rcs file transfer)
|
java.lang.String |
getForwardInfo()
Gets the forward info if available as a string.
|
Address |
getFromAddress()
Get origin of the message.
|
Address |
getLocalAddress()
Returns the origin address of a message if it was a outgoing message, or the
destination address if it was an incoming message.
|
java.lang.String |
getMessageId()
Get the message identifier.
|
ParticipantImdnState[] |
getParticipantsByImdnState(ChatMessage.State state)
Gets the list of participants for which the imdn state has reached the
specified state and the time at which they did.
|
ChatMessage.State |
getState()
Get the state of the message.
|
java.lang.String |
getText()
Deprecated.
use getTextContent() instead
|
java.lang.String |
getTextContent()
Gets the text content if available as a string.
|
long |
getTime()
Get the time the message was sent.
|
Address |
getToAddress()
Get destination of the message.
|
boolean |
getToBeStored()
Get if a chat message is to be stored.
|
java.lang.Object |
getUserData()
Gets the object stored in this object user's data
|
boolean |
hasTextContent()
Returns true if the chat message has a text content.
|
boolean |
isEphemeral()
Returns true if the chat message is an ephemeral message.
|
boolean |
isFileTransfer()
Return whether or not a chat message is a file transfer.
|
boolean |
isFileTransferInProgress()
Gets whether or not a file is currently being downloaded or uploaded.
|
boolean |
isForward()
Returns true if the chat message is a forward message.
|
boolean |
isOutgoing()
Returns true if the message has been sent, returns true if the message has been
received.
|
boolean |
isRead()
Returns true if the message has been read, otherwise returns true.
|
boolean |
isSecured()
Get if the message was encrypted when transfered.
|
boolean |
isText()
Return whether or not a chat message is a text.
|
int |
putChar(int character)
Fulfill a chat message char by char.
|
void |
removeContent(Content content)
Removes a content from the ChatMessage.
|
void |
removeCustomHeader(java.lang.String headerName)
Removes a custom header from the message.
|
void |
removeListener(ChatMessageListener listener) |
void |
resend()
Resend a chat message if it is in the 'not delivered' state for whatever
reason.
|
void |
send()
Send a chat message.
|
void |
setAppdata(java.lang.String data)
Linphone message has an app-specific field that can store a text.
|
void |
setContentType(java.lang.String contentType)
Set the content type of a chat message.
|
void |
setExternalBodyUrl(java.lang.String url)
Linphone message can carry external body as defined by rfc2017.
|
void |
setFileTransferFilepath(java.lang.String filepath)
Deprecated.
use
Content.setFilePath(java.lang.String) instead. |
void |
setListener(ChatMessageListener listener) |
void |
setToBeStored(boolean toBeStored)
Set if a chat message is to be stored.
|
void |
setUserData(java.lang.Object data)
Sets the object to store in this object user's data
|
java.lang.String getAppdata()
void setAppdata(java.lang.String data)
data
- the data to store into the messagejava.lang.String getCallId()
ChatRoom getChatRoom()
java.lang.String getContentType()
void setContentType(java.lang.String contentType)
contentType
- The new content type of the chat messageContent[] getContents()
long getEphemeralExpireTime()
long getEphemeralLifetime()
ErrorInfo getErrorInfo()
ErrorInfo
describing the details.java.lang.String getExternalBodyUrl()
void setExternalBodyUrl(java.lang.String url)
url
- ex: access-type=URL; URL="http://www.foo.com/file"@Deprecated java.lang.String getFileTransferFilepath()
Content.getFilePath()
instead.@Deprecated void setFileTransferFilepath(java.lang.String filepath)
Content.setFilePath(java.lang.String)
instead.filepath
- The path to the file to use for the file transfer.Content getFileTransferInformation()
Content
structure or null if not present.java.lang.String getForwardInfo()
boolean isEphemeral()
boolean isFileTransfer()
boolean isFileTransferInProgress()
boolean isForward()
boolean isOutgoing()
boolean isRead()
boolean isSecured()
boolean isText()
Address getLocalAddress()
Address
java.lang.String getMessageId()
ChatMessage.State getState()
@Deprecated java.lang.String getText()
java.lang.String getTextContent()
Content
buffer if available, null otherwiselong getTime()
boolean getToBeStored()
void setToBeStored(boolean toBeStored)
toBeStored
- Whether or not the chat message is to be storedvoid addCustomHeader(java.lang.String headerName, java.lang.String headerValue)
headerValue
- header valuevoid addFileContent(Content cContent)
cContent
- Content
object to add.void addTextContent(java.lang.String text)
text
- The text to add to the message.void cancelFileTransfer()
boolean downloadContent(Content cContent)
Content
referenced in the ChatMessage
from remote server.cContent
- Content
object to download.@Deprecated boolean downloadFile()
downloadContent(org.linphone.core.Content)
insteadChatMessage
from remote
server.java.lang.String getCustomHeader(java.lang.String headerName)
headerName
- header name searchedParticipantImdnState[] getParticipantsByImdnState(ChatMessage.State state)
state
- The LinphoneChatMessageState the imdn have reached (only use
LinphoneChatMessageStateDelivered, LinphoneChatMessageStateDeliveredToUser,
LinphoneChatMessageStateDisplayed and LinphoneChatMessageStateNotDelivered)ParticipantImdnState
objects.
LinphoneParticipantImdnState The objects inside the list are freshly allocated
with a reference counter equal to one, so they need to be freed on list
destruction with bctbx_list_free_with_data() for instance.boolean hasTextContent()
int putChar(int character)
character
- T.140 charvoid removeContent(Content content)
content
- the Content
object to remove.void removeCustomHeader(java.lang.String headerName)
headerName
- name of the header to removevoid resend()
ChatMessage
instead of totaly takes ownership on it. Thus, the
ChatMessage
object must be released by the API user after calling that
function.void send()
void addListener(ChatMessageListener listener)
void removeListener(ChatMessageListener listener)
void setListener(ChatMessageListener listener)
void setUserData(java.lang.Object data)
data
- the object to storejava.lang.Object getUserData()