ChatRoom
public class ChatRoom : LinphoneObject
A chat room is the place where text messages are exchanged. Can be created by Core.createChatRoom().
-
LinphoneChatRoomState is used to indicate the current state of a chat room.
See moreDeclaration
Swift
public enum State : Int -
Undocumented
Declaration
Swift
public func addDelegate(delegate: ChatRoomDelegate) -
Undocumented
Declaration
Swift
public func removeDelegate(delegate: ChatRoomDelegate) -
Get the capabilities of a chat room.
Declaration
Swift
public var capabilities: UInt { get }Return Value
The capabilities of the chat room
-
When realtime text is enabled linphone_call_params_realtime_text_enabled, LinphoneCoreIsComposingReceivedCb is call everytime a char is received from peer. At the end of remote typing a regular
ChatMessageis received with committed data from LinphoneCoreMessageReceivedCb.Declaration
Swift
public var char: UInt32 { get }Return Value
RFC 4103/T.140 char
-
Get the conference address of the chat room.
Declaration
Swift
public var conferenceAddress: Address? { get set }Return Value
The conference address of the chat room or nil if this type of chat room is not conference based
-
Gets the current LinphoneChatRoomCbs. This is meant only to be called from a callback to be able to get the user_data associated with the LinphoneChatRoomCbs that is calling the callback.
Declaration
Swift
public var currentCallbacks: ChatRoomDelegate? { get }Return Value
The LinphoneChatRoomCbs that has called the last callback
-
Returns current parameters associated with the chat room. This is typically the parameters passed at chat room creation to Core.createChatRoom() or some default parameters if no
ChatRoomParamswas explicitely passed during chat room creation.Declaration
Swift
public var currentParams: ChatRoomParams? { get }Return Value
the chat room current parameters.
-
Gets the number of events in a chat room.
Declaration
Swift
public var historyEventsSize: Int { get }Return Value
the number of events.
-
Gets the number of messages in a chat room.
Declaration
Swift
public var historySize: Int { get }Return Value
the number of messages.
-
Returns whether or not a
ChatRoomhas at least oneChatMessageor not.Declaration
Swift
public var isEmpty: Bool { get }Return Value
true if there are no
ChatMessage, false otherwise. -
Tells whether the remote is currently composing a message.
Declaration
Swift
public var isRemoteComposing: Bool { get }Return Value
if the remote is currently composing a message, true otherwise.
-
Gets the last chat message sent or received in this chat room.
Declaration
Swift
public var lastMessageInHistory: ChatMessage? { get }Return Value
the latest
ChatMessage -
Return the last updated time for the chat room.
Declaration
Swift
public var lastUpdateTime: Int { get }Return Value
the last updated time
-
Get the participant representing myself in the chat room.
Declaration
Swift
public var me: Participant? { get }Return Value
The participant representing myself in the conference.
-
Get the number of participants in the chat room (that is without ourselves).
Declaration
Swift
public var nbParticipants: Int { get }Return Value
The number of participants in the chat room
-
Get the list of participants of a chat room.
Declaration
Swift
public var participants: [Participant] { get }Return Value
A list of LinphoneParticipant objects. LinphoneParticipant
-
Get the security level of a chat room.
Declaration
Swift
public var securityLevel: ChatRoomSecurityLevel { get }Return Value
The security level of the chat room
-
Get the state of the chat room.
Declaration
Swift
public var state: ChatRoom.State { get }Return Value
The state of the chat room
-
Get the subject of a chat room.
Declaration
Swift
public var subject: String { get set }Return Value
The subject of the chat room
-
Gets the number of unread messages in the chatroom.
Declaration
Swift
public var unreadMessagesCount: Int { get }Return Value
the number of unread messages.
-
Add a participant to a chat room. This may fail if this type of chat room does not handle participants. Use canHandleParticipants() to know if this chat room handles participants.
Declaration
Swift
public func addParticipant(addr: Address)Parameters
addrThe address of the participant to add to the chat room
-
Add several participants to a chat room at once. This may fail if this type of chat room does not handle participants. Use canHandleParticipants() to know if this chat room handles participants.
Declaration
Swift
public func addParticipants(addresses: [Address]) -> BoolParameters
addressesA list of
Addressobjects. LinphoneAddressReturn Value
True if everything is OK, False otherwise
-
Allow cpim on a basic chat room .
Declaration
Swift
public func allowCpim() -
Allow multipart on a basic chat room .
Declaration
Swift
public func allowMultipart() -
Tells whether a chat room is able to handle participants.
Declaration
Swift
public func canHandleParticipants() -> BoolReturn Value
A boolean value telling whether the chat room can handle participants or not
-
Notifies the destination of the chat message being composed that the user is typing a new message.
Declaration
Swift
public func compose() -
Creates an empty message attached to a dedicated chat room.
Declaration
Swift
public func createEmptyMessage() throws -> ChatMessageReturn Value
a new
ChatMessage -
Creates a message attached to a dedicated chat room with a particular content. Use linphone_chat_room_send_message to initiate the transfer
Declaration
Swift
public func createFileTransferMessage(initialContent: Content) throws -> ChatMessageParameters
initialContentContentinitial content. LinphoneCoreVTable.file_transfer_send is invoked later to notify file transfer progress and collect next chunk of the message if LinphoneContent.data is nil.Return Value
a new
ChatMessage -
Creates a forward message attached to a dedicated chat room with a particular message.
Declaration
Swift
public func createForwardMessage(msg: ChatMessage) throws -> ChatMessageParameters
msgChatMessagemessage to be forwarded.Return Value
a new
ChatMessage -
Creates a message attached to a dedicated chat room.
Declaration
Swift
public func createMessage(message: String) throws -> ChatMessageParameters
messagetext message, nil if absent.
Return Value
a new
ChatMessage -
Delete all messages from the history.
Declaration
Swift
public func deleteHistory() -
Delete a message from the chat room history.
Declaration
Swift
public func deleteMessage(msg: ChatMessage)Parameters
msgThe
ChatMessageobject to remove. -
Gets the chat message sent or received in this chat room that matches the message_id.
Declaration
Swift
public func findMessage(messageId: String) -> ChatMessage?Parameters
messageIdThe id of the message to find
Return Value
the
ChatMessage -
Find a participant of a chat room from its address.
Declaration
Swift
public func findParticipant(addr: Address) -> Participant?Parameters
addrThe address to search in the list of participants of the chat room
Return Value
The participant if found, nil otherwise.
-
Gets nb_message most recent messages from cr chat room, sorted from oldest to most recent.
Declaration
Swift
public func getHistory(nbMessage: Int) -> [ChatMessage]Parameters
nbMessageNumber of message to retrieve. 0 means everything.
Return Value
A list of
ChatMessageobjects. LinphoneChatMessage 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. -
Gets nb_events most recent events from cr chat room, sorted from oldest to most recent.
Declaration
Swift
public func getHistoryEvents(nbEvents: Int) -> [EventLog]Parameters
nbEventsNumber of events to retrieve. 0 means everything.
Return Value
A list of
EventLogobjects. LinphoneEventLog 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. -
Gets nb_events most recent chat message events from cr chat room, sorted from oldest to most recent.
Declaration
Swift
public func getHistoryMessageEvents(nbEvents: Int) -> [EventLog]Parameters
nbEventsNumber of events to retrieve. 0 means everything.
Return Value
A list of
EventLogobjects. LinphoneEventLog 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. -
Gets the partial list of messages in the given range, sorted from oldest to most recent.
Declaration
Swift
public func getHistoryRange(begin: Int, end: Int) -> [ChatMessage]Parameters
beginThe first message of the range to be retrieved. History most recent message has index 0.
endThe last message of the range to be retrieved. History oldest message has index of history size - 1 (use linphone_chat_room_get_history_size to retrieve history size)
Return Value
A list of
ChatMessageobjects. LinphoneChatMessage 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. -
Gets the partial list of events in the given range, sorted from oldest to most recent.
Declaration
Swift
public func getHistoryRangeEvents(begin: Int, end: Int) -> [EventLog]Parameters
beginThe first event of the range to be retrieved. History most recent event has index 0.
endThe last event of the range to be retrieved. History oldest event has index of history size - 1
Return Value
A list of
EventLogobjects. LinphoneEventLog 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. -
Gets the partial list of chat message events in the given range, sorted from oldest to most recent.
Declaration
Swift
public func getHistoryRangeMessageEvents(begin: Int, end: Int) -> [EventLog]Parameters
beginThe first event of the range to be retrieved. History most recent event has index 0.
endThe last event of the range to be retrieved. History oldest event has index of history size - 1
Return Value
A list of
EventLogobjects. LinphoneEventLog 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. -
Return whether or not the chat room has been left.
Declaration
Swift
public func hasBeenLeft() -> BoolReturn Value
whether or not the chat room has been left
-
Check if a chat room has given capabilities.
Declaration
Swift
public func hasCapability(mask: Int) -> BoolParameters
maskA Capabilities mask
Return Value
True if the mask matches, false otherwise
-
Leave a chat room.
Declaration
Swift
public func leave() -
Returns true if lime is available for given peer.
Declaration
Swift
public func limeAvailable() -> BoolReturn Value
true if zrtp secrets have already been shared and ready to use
-
Mark all messages of the conversation as read.
Declaration
Swift
public func markAsRead() -
Notify the chatroom that a participant device has just registered. This function is meaningful only for server implementation of chatroom, and shall not by used by client applications.
Declaration
Swift
public func notifyParticipantDeviceRegistration(participantDevice: Address) -
Used to receive a chat message when using async mechanism with IM encryption engine.
Declaration
Swift
public func receiveChatMessage(msg: ChatMessage)Parameters
msgChatMessageobject -
Remove a participant of a chat room.
Declaration
Swift
public func removeParticipant(participant: Participant)Parameters
participantThe participant to remove from the chat room
-
Remove several participants of a chat room at once.
Declaration
Swift
public func removeParticipants(participants: [Participant])Parameters
participantsA list of LinphoneParticipant objects. LinphoneParticipant
-
Send a message to peer member of this chat room. The state of the sending message will be notified via the callbacks defined in the LinphoneChatMessageCbs object that can be obtained by calling linphone_chat_message_get_callbacks. - Note: Unlike linphone_chat_room_send_chat_message, that function only takes a reference on the
ChatMessageinstead of totaly takes ownership on it. Thus, theChatMessageobject must be released by the API user after calling that function.Declaration
Swift
public func sendChatMessage(msg: ChatMessage)Parameters
msgThe message to send.
-
Change the admin status of a participant of a chat room (you need to be an admin yourself to do this).
Declaration
Swift
public func setParticipantAdminStatus(participant: Participant, isAdmin: Bool)Parameters
participantThe Participant for which to change the admin status
isAdminA boolean value telling whether the participant should now be an admin or not
-
Set the list of participant devices in the form of SIP URIs with GRUUs for a given participant. This function is meaningful only for server implementation of chatroom, and shall not by used by client applications.
Declaration
Swift
public func setParticipantDevices(partAddr: Address, deviceIdentities: [ParticipantDeviceIdentity])Parameters
partAddrThe participant address
deviceIdentitiesA list of LinphoneParticipantDeviceIdentity objects. LinphoneParticipantDeviceIdentity list of the participant devices to be used by the group chat room
ChatRoom Class Reference