Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an “all features enabled” room option #170

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading