Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import SwiftUI

// View model for the `ChatChannelInfoView`.
open class ChatChannelInfoViewModel: ObservableObject, ChatChannelControllerDelegate {
@Injected(\.chatClient) private var chatClient
@Injected(\.chatClient) public var chatClient

@Published public var participants = [ParticipantInfo]()
@Published public var muted: Bool {
Expand Down Expand Up @@ -60,8 +60,8 @@ open class ChatChannelInfoViewModel: ObservableObject, ChatChannelControllerDele
}
}

var channelController: ChatChannelController!
var currentUserController: CurrentChatUserController?
public var channelController: ChatChannelController!
public var currentUserController: CurrentChatUserController?

private var memberListController: ChatChannelMemberListController!
private var loadingUsers = false
Expand Down Expand Up @@ -184,7 +184,7 @@ open class ChatChannelInfoViewModel: ObservableObject, ChatChannelControllerDele
loadAdditionalUsers()
}

public func leaveConversationTapped(completion: @escaping () -> Void) {
open func leaveConversationTapped(completion: @escaping () -> Void) {
if !channel.isDirectMessageChannel {
removeUserFromConversation(completion: completion)
} else {
Expand Down Expand Up @@ -231,7 +231,7 @@ open class ChatChannelInfoViewModel: ObservableObject, ChatChannelControllerDele

// MARK: - private

private func removeUserFromConversation(completion: @escaping () -> Void) {
public func removeUserFromConversation(completion: @escaping () -> Void) {
guard let userId = chatClient.currentUserId else { return }
channelController.removeMembers(userIds: [userId]) { [weak self] error in
if error != nil {
Expand Down