diff --git a/Sources/AblyChat/Presence.swift b/Sources/AblyChat/Presence.swift index 711ba5b..1652ba6 100644 --- a/Sources/AblyChat/Presence.swift +++ b/Sources/AblyChat/Presence.swift @@ -80,8 +80,11 @@ public protocol Presence: AnyObject, Sendable, EmitsDiscontinuities { func get(params: PresenceQuery) async throws -> [PresenceMember] func isUserPresent(clientID: String) async throws -> Bool func enter(data: PresenceData?) async throws + func enter() async throws func update(data: PresenceData?) async throws + func update() async throws func leave(data: PresenceData?) async throws + func leave() async throws func subscribe(event: PresenceEventType, bufferingPolicy: BufferingPolicy) async -> Subscription /// Same as calling ``subscribe(event:bufferingPolicy:)`` with ``BufferingPolicy.unbounded``. /// @@ -94,6 +97,20 @@ public protocol Presence: AnyObject, Sendable, EmitsDiscontinuities { func subscribe(events: [PresenceEventType]) async -> Subscription } +public extension Presence { + func enter() async throws { + try await enter(data: nil) + } + + func update() async throws { + try await update(data: nil) + } + + func leave() async throws { + try await leave(data: nil) + } +} + public extension Presence { func subscribe(event: PresenceEventType) async -> Subscription { await subscribe(event: event, bufferingPolicy: .unbounded)