mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Prioritise joining rooms by alias if available and letting the homeserver do the right thing
This commit is contained in:
committed by
Stefan Ceriu
parent
a2faae20c2
commit
b73e5e9e5d
@@ -92,12 +92,23 @@ class JoinRoomScreenViewModel: JoinRoomScreenViewModelType, JoinRoomScreenViewMo
|
||||
hideLoadingIndicator()
|
||||
}
|
||||
|
||||
switch await clientProxy.joinRoom(roomID, via: via) {
|
||||
case .success:
|
||||
actionsSubject.send(.joined)
|
||||
case .failure(let error):
|
||||
MXLog.error("Failed joining room with error: \(error)")
|
||||
userIndicatorController.submitIndicator(.init(title: L10n.errorUnknown))
|
||||
// Prioritise joining by the alias and letting the homeserver do the right thing
|
||||
if let alias = state.roomDetails?.canonicalAlias {
|
||||
switch await clientProxy.joinRoomAlias(alias) {
|
||||
case .success:
|
||||
actionsSubject.send(.joined)
|
||||
case .failure(let error):
|
||||
MXLog.error("Failed joining room alias: \(alias) with error: \(error)")
|
||||
userIndicatorController.submitIndicator(.init(title: L10n.errorUnknown))
|
||||
}
|
||||
} else {
|
||||
switch await clientProxy.joinRoom(roomID, via: via) {
|
||||
case .success:
|
||||
actionsSubject.send(.joined)
|
||||
case .failure(let error):
|
||||
MXLog.error("Failed joining room id: \(roomID) with error: \(error)")
|
||||
userIndicatorController.submitIndicator(.init(title: L10n.errorUnknown))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user