mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Rename UserProfileProxy to UserProfile. It's a pure struct and proxies nothing.
Also remove the redundant `userID` property given `id` already exists (for Identifiable conformance).
This commit is contained in:
@@ -50,8 +50,8 @@ struct StartChatScreenViewStateBindings {
|
||||
enum StartChatScreenViewAction {
|
||||
case close
|
||||
case createRoom
|
||||
case createDM(user: UserProfileProxy)
|
||||
case selectUser(UserProfileProxy)
|
||||
case createDM(user: UserProfile)
|
||||
case selectUser(UserProfile)
|
||||
case joinRoomByAddress
|
||||
case openRoomDirectorySearch
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ class StartChatScreenViewModel: StartChatScreenViewModelType, StartChatScreenVie
|
||||
private let userDiscoveryService: UserDiscoveryServiceProtocol
|
||||
private let appSettings: AppSettings
|
||||
|
||||
private var suggestedUsers = [UserProfileProxy]()
|
||||
private var suggestedUsers = [UserProfile]()
|
||||
|
||||
private let actionsSubject: PassthroughSubject<StartChatScreenViewModelAction, Never> = .init()
|
||||
var actions: AnyPublisher<StartChatScreenViewModelAction, Never> {
|
||||
@@ -61,7 +61,7 @@ class StartChatScreenViewModel: StartChatScreenViewModelType, StartChatScreenVie
|
||||
case .selectUser(let user):
|
||||
showLoadingIndicator(delay: .milliseconds(200))
|
||||
|
||||
let currentDirectRoom = userSession.clientProxy.directRoomForUserID(user.userID)
|
||||
let currentDirectRoom = userSession.clientProxy.directRoomForUserID(user.id)
|
||||
switch currentDirectRoom {
|
||||
case .success(.some(let roomId)):
|
||||
hideLoadingIndicator()
|
||||
@@ -69,7 +69,7 @@ class StartChatScreenViewModel: StartChatScreenViewModelType, StartChatScreenVie
|
||||
case .success:
|
||||
Task {
|
||||
// If an error occured while fetching the identity, assume they are unknown.
|
||||
let isUnknown = if case .success(let identity) = await self.userSession.clientProxy.userIdentity(for: user.userID, fallBackToServer: false) {
|
||||
let isUnknown = if case .success(let identity) = await self.userSession.clientProxy.userIdentity(for: user.id, fallBackToServer: false) {
|
||||
identity == nil
|
||||
} else {
|
||||
true
|
||||
@@ -186,12 +186,12 @@ class StartChatScreenViewModel: StartChatScreenViewModelType, StartChatScreenVie
|
||||
}
|
||||
}
|
||||
|
||||
private func createDirectRoom(user: UserProfileProxy) async {
|
||||
private func createDirectRoom(user: UserProfile) async {
|
||||
defer {
|
||||
hideLoadingIndicator()
|
||||
}
|
||||
showLoadingIndicator()
|
||||
switch await userSession.clientProxy.createDirectRoom(with: user.userID, expectedRoomName: user.displayName) {
|
||||
switch await userSession.clientProxy.createDirectRoom(with: user.id, expectedRoomName: user.displayName) {
|
||||
case .success(let roomId):
|
||||
analytics.trackCreatedRoom(isDM: true)
|
||||
actionsSubject.send(.showRoom(roomID: roomId))
|
||||
|
||||
@@ -112,7 +112,7 @@ struct StartChatScreen: View {
|
||||
private var usersSection: some View {
|
||||
if !context.viewState.usersSection.users.isEmpty {
|
||||
Section {
|
||||
ForEach(context.viewState.usersSection.users, id: \.userID) { user in
|
||||
ForEach(context.viewState.usersSection.users, id: \.id) { user in
|
||||
UserProfileListRow(user: user,
|
||||
membership: nil,
|
||||
mediaProvider: context.mediaProvider,
|
||||
|
||||
Reference in New Issue
Block a user