ChatMessage
public class ChatMessage : LinphoneObject
An chat message is the object that is sent and received through LinphoneChatRooms.
-
LinphoneChatMessageState is used to notify if messages have been successfully delivered or not.
See moreDeclaration
Swift
public enum State : Int -
LinphoneChatMessageDirection is used to indicate if a message is outgoing or incoming.
See moreDeclaration
Swift
public enum Direction : Int -
Undocumented
Declaration
Swift
public func getDelegate() -> ChatMessageDelegate? -
Undocumented
Declaration
Swift
public func addDelegate(delegate: ChatMessageDelegate) -
Undocumented
Declaration
Swift
public func removeDelegate(delegate: ChatMessageDelegate) -
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.
Declaration
Swift
public var appdata: String { get set }Return Value
the application-specific data or nil if none has been stored.
-
Returns the chatroom this message belongs to.
Declaration
Swift
public var chatRoom: ChatRoom? { get } -
Get the content type of a chat message.
Declaration
Swift
public var contentType: String { get set }Return Value
The content type of the chat 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.
Declaration
Swift
public var currentCallbacks: ChatMessageDelegate? { get }Return Value
The LinphoneChatMessageCbs that has called the last callback
-
Linphone message can carry external body as defined by rfc2017.
Declaration
Swift
public var externalBodyUrl: String { get set }Return Value
external body url or nil if not present.
-
Get the path to the file to read from or write to during the file transfer.
deprecated: use Content.getFilePath() instead.
Declaration
Swift
public var fileTransferFilepath: String { get set }Return Value
The path to the file to use for the file transfer.
-
Gets the forward info if available as a string.
Declaration
Swift
public var forwardInfo: String { get }Return Value
the
Contentbuffer if available, null otherwise -
Return whether or not a chat message is a file transfer.
Declaration
Swift
public var isFileTransfer: Bool { get }Return Value
Whether or not the message is a file transfer
-
Gets whether or not a file is currently being downloaded or uploaded.
Declaration
Swift
public var isFileTransferInProgress: Bool { get }Return Value
true if download or upload is in progress, false otherwise
-
Returns true if the chat message is a forward message.
Declaration
Swift
public var isForward: Bool { get }Return Value
true if it is a forward message, false otherwise
-
Returns true if the message has been sent, returns true if the message has been received.
Declaration
Swift
public var isOutgoing: Bool { get } -
Returns true if the message has been read, otherwise returns true.
Declaration
Swift
public var isRead: Bool { get } -
Get if the message was encrypted when transfered.
Declaration
Swift
public var isSecured: Bool { get }Return Value
whether the message was encrypted when transfered or not
-
Return whether or not a chat message is a text.
Declaration
Swift
public var isText: Bool { get }Return Value
Whether or not the message is a text
-
Get the message identifier. It is used to identify a message so that it can be notified as delivered and/or displayed.
Declaration
Swift
public var messageId: String { get }Return Value
The message identifier.
-
Get the state of the message.
Declaration
Swift
public var state: ChatMessage.State { get }Return Value
LinphoneChatMessageState
-
Get text part of this message.
deprecated: use getTextContent() instead
Declaration
Swift
public var text: String { get }Return Value
text or nil if no text.
-
Gets the text content if available as a string.
Declaration
Swift
public var textContent: String { get }Return Value
the
Contentbuffer if available, null otherwise -
Get the time the message was sent.
Declaration
Swift
public var time: Int { get } -
Get if a chat message is to be stored.
Declaration
Swift
public var toBeStored: Bool { get set }Return Value
Whether or not the message is to be stored
-
Add custom headers to the message.
Declaration
Swift
public func addCustomHeader(headerName: String, headerValue: String)Parameters
headerNamename of the header
headerValueheader value
-
Adds a text content to the ChatMessage.
Declaration
Swift
public func addTextContent(text: String)Parameters
textThe text to add to the message.
-
Cancel an ongoing file transfer attached to this message. (upload or download)
Declaration
Swift
public func cancelFileTransfer() -
Start the download of the file referenced in a
ChatMessagefrom remote server.- deprecated: Use downloadContent() instead
Declaration
Swift
public func downloadFile() -> Bool -
Retrieve a custom header value given its name.
Declaration
Swift
public func getCustomHeader(headerName: String) -> StringParameters
headerNameheader name searched
-
Gets the list of participants for which the imdn state has reached the specified state and the time at which they did.
Declaration
Swift
public func getParticipantsByImdnState(state: ChatMessage.State) -> [ParticipantImdnState]Parameters
stateThe LinphoneChatMessageState the imdn have reached (only use LinphoneChatMessageStateDelivered, LinphoneChatMessageStateDeliveredToUser, LinphoneChatMessageStateDisplayed and LinphoneChatMessageStateNotDelivered)
Return Value
A list of
ParticipantImdnStateobjects. 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. -
Returns true if the chat message has a text content.
Declaration
Swift
public func hasTextContent() -> BoolReturn Value
true if it has one, false otherwise
-
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
Declaration
Swift
public func putChar(character: UInt32) throwsParameters
characterT.140 char
Return Value
0 if succeed.
-
Removes a custom header from the message.
Declaration
Swift
public func removeCustomHeader(headerName: String)Parameters
headerNamename of the header to remove
-
Resend a chat message if it is in the ‘not delivered’ state for whatever reason.
Note
Unlike linphone_chat_message_resend, that function only takes a reference on theChatMessageinstead of totaly takes ownership on it. Thus, theChatMessageobject must be released by the API user after calling that function.Declaration
Swift
public func resend() -
Send a chat message.
Declaration
Swift
public func send()
ChatMessage Class Reference