mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
Update the SDK and use RoomHero.status and subscribeToOwnProfile. (#5905)
* Update the SDK and hook up the status from Room Heroes. Also start requesting profiles via sss when the feature flag is enabled. * Add support for subscribing to your own profile.
This commit is contained in:
@@ -348,7 +348,7 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
|
||||
// Delay user profile detail loading until after the initial room list loads
|
||||
if roomListMode == .rooms {
|
||||
Task {
|
||||
await self.userSession.clientProxy.loadUserProfile()
|
||||
await self.userSession.clientProxy.loadUserProfileIfNeeded()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -335,6 +335,7 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
|
||||
private func updateRoomInfo(_ roomInfo: RoomInfoProxyProtocol) {
|
||||
state.roomTitle = roomInfo.displayName ?? roomProxy.id
|
||||
state.roomAvatar = roomInfo.avatar
|
||||
state.dmRecipientDetails.statusEmoji = roomInfo.statusEmoji
|
||||
state.hasOngoingCall = roomInfo.hasRoomCall
|
||||
state.activeRoomCallIntent = roomInfo.activeRoomCallIntent
|
||||
state.hasSuccessor = roomInfo.successor != nil
|
||||
|
||||
@@ -86,7 +86,7 @@ class SettingsScreenViewModel: SettingsScreenViewModelType, SettingsScreenViewMo
|
||||
.store(in: &cancellables)
|
||||
|
||||
Task {
|
||||
await userSession.clientProxy.loadUserProfile()
|
||||
await userSession.clientProxy.loadUserProfileIfNeeded()
|
||||
await state.accountProfileURL = userSession.clientProxy.accountURL(action: .profile)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,6 +98,8 @@ struct SettingsScreen: View {
|
||||
SettingsScreenUserStatusPickerView { action in
|
||||
context.send(viewAction: .userStatus(action))
|
||||
}
|
||||
.presentationDetents([.medium]) // Stop using a List and calculate the exact height?
|
||||
.presentationBackground(.compound.bgCanvasDefault)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ class UserDetailsEditScreenViewModel: UserDetailsEditScreenViewModelType, UserDe
|
||||
.store(in: &cancellables)
|
||||
|
||||
Task {
|
||||
await self.clientProxy.loadUserProfile()
|
||||
await self.clientProxy.loadUserProfileIfNeeded()
|
||||
state.canEditAvatar = await clientProxy.capabilities.canChangeAvatar()
|
||||
state.canEditDisplayName = await clientProxy.capabilities.canChangeDisplayName()
|
||||
}
|
||||
|
||||
@@ -103,6 +103,8 @@ class ThreadTimelineScreenViewModel: ThreadTimelineScreenViewModelType, ThreadTi
|
||||
private func updateRoomInfo(_ roomInfo: RoomInfoProxyProtocol) {
|
||||
state.roomTitle = roomInfo.displayName ?? roomProxy.id
|
||||
state.roomAvatar = roomInfo.avatar
|
||||
state.dmRecipientDetails.statusEmoji = roomInfo.statusEmoji
|
||||
|
||||
if let powerLevels = roomInfo.powerLevels {
|
||||
state.canSendMessage = powerLevels.canOwnUser(sendMessage: .roomMessage)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user