diff --git a/Example/AblyChatExample/ContentView.swift b/Example/AblyChatExample/ContentView.swift index 58f3ec61..4f334144 100644 --- a/Example/AblyChatExample/ContentView.swift +++ b/Example/AblyChatExample/ContentView.swift @@ -56,12 +56,7 @@ struct ContentView: View { private func room() async throws -> Room { try await chatClient.rooms.get( roomID: roomID, - options: .init( - presence: .init(), - typing: .init(), - reactions: .init(), - occupancy: .init() - ) + options: .allFeaturesEnabled ) } diff --git a/Sources/AblyChat/RoomOptions.swift b/Sources/AblyChat/RoomOptions.swift index 4e1ace14..8259b8e5 100644 --- a/Sources/AblyChat/RoomOptions.swift +++ b/Sources/AblyChat/RoomOptions.swift @@ -6,6 +6,14 @@ public struct RoomOptions: Sendable, Equatable { public var reactions: RoomReactionsOptions? public var occupancy: OccupancyOptions? + /// A `RoomOptions` which enables all room features, using the default settings for each feature. + public static let allFeaturesEnabled: Self = .init( + presence: .init(), + typing: .init(), + reactions: .init(), + occupancy: .init() + ) + public init(presence: PresenceOptions? = nil, typing: TypingOptions? = nil, reactions: RoomReactionsOptions? = nil, occupancy: OccupancyOptions? = nil) { self.presence = presence self.typing = typing