ChatMessage
public class ChatMessage : LinphoneObject
An chat message is the object that is sent and received through LinphoneChatRooms.
-
Undocumented
Declaration
Swift
public static func getSwiftObject(cObject: OpaquePointer) -> ChatMessage
-
Undocumented
Declaration
Swift
public var getCobject: OpaquePointer? { get }
-
LinphoneChatMessageDirection is used to indicate if a message is outgoing or incoming.
See moreDeclaration
Swift
public enum Direction : Int
-
LinphoneChatMessageState is used to notify if messages have been successfully delivered or not.
See moreDeclaration
Swift
public enum State : 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.
-
Gets the callId accociated with the message.
Declaration
Swift
public var callId: String { get }
Return Value
the call Id
-
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
-
Returns the real time at which an ephemeral message expires and will be deleted.
Declaration
Swift
public var ephemeralExpireTime: time_t { get }
Return Value
the time at which an ephemeral message expires. 0 means the message has not been read.
-
Returns lifetime of an ephemeral message. The lifetime is the duration after which the ephemeral message will disappear once viewed.
Declaration
Swift
public var ephemeralLifetime: Int { get }
Return Value
the lifetime of an ephemeral message, by default 86400s.
-
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 {@link 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 original sender of the message if it has been forwarded, null otherwise
-
Returns true if the chat message is an ephemeral message. An ephemeral message will automatically disappear from the recipient’s screen after the message has been viewed.
Declaration
Swift
public var isEphemeral: Bool { get }
Return Value
true if it is an ephemeral message, false 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
Content
buffer if available, null otherwise -
Get the time the message was sent.
Declaration
Swift
public var time: time_t { 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
-
Retrieve the user pointer associated with the chat message.
Declaration
Swift
public var userData: UnsafeMutableRawPointer? { get set }
Return Value
The user pointer associated with the chat message.
-
Add custom headers to the message.
Declaration
Swift
public func addCustomHeader(headerName: String, headerValue: String)
Parameters
headerName
name of the header
headerValue
header value
-
Adds a text content to the ChatMessage.
Declaration
Swift
public func addTextContent(text: String)
Parameters
text
The 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
ChatMessage
from remote server.- deprecated: Use {@link ChatMessage#downloadContent} instead
Declaration
Swift
public func downloadFile() -> Bool
-
Retrieve a custom header value given its name.
Declaration
Swift
public func getCustomHeader(headerName: String) -> String
Parameters
headerName
header 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
state
The LinphoneChatMessageState the imdn have reached (only use LinphoneChatMessageStateDelivered, LinphoneChatMessageStateDeliveredToUser, LinphoneChatMessageStateDisplayed and LinphoneChatMessageStateNotDelivered)
Return Value
A list of
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. -
Returns true if the chat message has a text content.
Declaration
Swift
public func hasTextContent() -> Bool
Return 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) throws
Parameters
character
T.140 char
Return Value
0 if succeed.
-
Removes a custom header from the message.
Declaration
Swift
public func removeCustomHeader(headerName: String)
Parameters
headerName
name 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 theChatMessage
instead of totaly takes ownership on it. Thus, theChatMessage
object 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()