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

Public API Refactor #11

Merged
merged 5 commits into from
Oct 25, 2023
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ extension HMSRoomModel {
continuation.resume(throwing: error);
}
else {
self.roomState = .leftMeeting(reason: .roomEnded)
self.roomState = .leftMeeting(reason: .roomEnded(reasonString: reason))
continuation.resume()
}
}
Expand Down Expand Up @@ -340,7 +340,7 @@ extension HMSRoomModel {
#endif
}

public func changeUserName(_ name: String) async throws {
public func changeUserName(to name: String) async throws {
#if !Preview
return try await withCheckedThrowingContinuation { continuation in
sdk.change(name: name) { _, error in
Expand Down Expand Up @@ -368,12 +368,12 @@ extension HMSRoomModel {
#endif
}

public func changeRole(of peer: HMSPeerModel, to role: String, force: Bool = false) async throws {
public func changeRole(of peer: HMSPeerModel, to role: String, shouldAskForApproval: Bool = true) async throws {
#if !Preview
guard let destinationRole = roles.first(where: { $0.name == role }) else { return }

return try await withCheckedThrowingContinuation { continuation in
sdk.changeRole(for: peer.peer, to: destinationRole, force: force) {_, error in
sdk.changeRole(for: peer.peer, to: destinationRole, force: !shouldAskForApproval) {_, error in
if let error = error {
continuation.resume(throwing: error)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ extension HMSRoomModel: HMSUpdateListener {

@MainActor public func on(removedFromRoom notification: HMSRemovedFromRoomNotification) {
removedFromRoomNotification = notification
self.roomState = .leftMeeting(reason: notification.roomEnded ? .roomEnded : .userKickedOut)
self.roomState = .leftMeeting(reason: notification.roomEnded ? .roomEnded(reasonString: notification.reason) : .removedFromRoom(reasonString: notification.reason))
}

@MainActor public func on(sessionStoreAvailable store: HMSSessionStore) {
Expand Down
4 changes: 2 additions & 2 deletions Sources/HMSRoomModels/RoomModel/HMSRoomModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import HMSAnalyticsSDK
public enum HMSRoomState {

public enum LeaveReason {
case roomEnded
case roomEnded(reasonString: String)
case userLeft
case userKickedOut
case removedFromRoom(reasonString: String)
}

case notJoined
Expand Down
9 changes: 0 additions & 9 deletions docs/css/chunk-c0335d80.10a2f091.css

This file was deleted.

9 changes: 0 additions & 9 deletions docs/css/documentation-topic.1d1eec04.css

This file was deleted.

9 changes: 0 additions & 9 deletions docs/css/documentation-topic~topic.b6287bcf.css

This file was deleted.

This file was deleted.

9 changes: 0 additions & 9 deletions docs/css/index.038e887c.css

This file was deleted.

9 changes: 0 additions & 9 deletions docs/css/topic.d8c126f3.css

This file was deleted.

9 changes: 0 additions & 9 deletions docs/css/tutorials-overview.c249c765.css

This file was deleted.

Loading