Skip to content

Commit

Permalink
Merge pull request #170 from ably/add-all-features-enabled-room-options
Browse files Browse the repository at this point in the history
Add an “all features enabled” room option
  • Loading branch information
lawrence-forooghian authored Dec 4, 2024
2 parents e017c72 + c595df1 commit 2b2bfc0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
7 changes: 1 addition & 6 deletions Example/AblyChatExample/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
}

Expand Down
8 changes: 8 additions & 0 deletions Sources/AblyChat/RoomOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2b2bfc0

Please sign in to comment.