Room
public final class Room : Identifiable, ObservableObject, OrangeChatLoggable
extension Room: Equatable
An object representing a room.
Instances are created by using the RoomList.room(with:and:)
method.
-
The identifier of this room.
Declaration
Swift
@Published public var id: OrangeChatKey { get set }
-
The last time date this room was updated.
Declaration
Swift
@Published public var lastUpdateDate: Date { get set }
-
The last message sent in this room.
Declaration
Swift
@Published public var lastMessage: String? { get set }
-
The name of this room.
Declaration
Swift
@Published public var name: String { get set }
-
The messages exchanged in this room.
Declaration
Swift
@Published public var messages: [Message] { get set }
-
The participants who are typing.
Declaration
Swift
@Published public var typingParticipants: [OrangeChatKey : String] { get set }
-
Declaration
Swift
public enum SendTextState
-
Send a text message in this room.
Declaration
Swift
public func send(_ text: String, image: UIImage? = nil, thumbnail: UIImage? = nil) -> OrangeChatPublisher<SendTextState>
Parameters
texty
The text to send
image
The image associated to the text
thumbnail
The thumbnail of the image. If nil, will be computed by contentManger
Return Value
A publisher with a
SendTextState
value. -
Update the presence of the current user of the room.
The presence of the current user need to be updated each time he or she enters and exits the room.
Declaration
Swift
public func update(presence: Presence) -> OrangeChatPublisher<Void>
Parameters
presence
The presence of the curent user of the room.
Return Value
A publisher with a
Void
value. -
Indicates to other users in the room if the current user is typing.
Declaration
Swift
public func user(isTyping: Bool) -> OrangeChatPublisher<Void>
Parameters
isTyping
A boolean defining whether the current user is typing.
Return Value
A publisher with a
Void
value.
-
Declaration
Swift
public static func == (lhs: Room, rhs: Room) -> Bool