Add support for homeserver capabilities to disable the UserDetailsEditScreen UI. (#5421)

Add support for homeserver capabilities to disable editing your user profile.

Also updates editable avatar size/formatting to match the latest Figma at the same time.
This commit is contained in:
Doug
2026-04-17 11:52:46 +01:00
committed by GitHub
parent c40454bbd3
commit eef4a2497a
46 changed files with 482 additions and 142 deletions
@@ -64,6 +64,9 @@ class ClientProxy: ClientProxyProtocol {
let spaceService: SpaceServiceProxyProtocol
let capabilities: HomeserverCapabilitiesProxyProtocol
private var capabilitiesRefreshTask: Task<Void, Never>?
let eventStringBuilder: RoomEventStringBuilder
private static var roomCreationPowerLevelOverrides: PowerLevels {
@@ -208,6 +211,8 @@ class ClientProxy: ClientProxyProtocol {
spaceService = await SpaceServiceProxy(spaceService: client.spaceService())
capabilities = HomeserverCapabilitiesProxy(underlyingCapabilities: client.homeserverCapabilities())
let configuredAppService = try await ClientProxyServices(client: client,
actionsSubject: actionsSubject,
notificationSettings: notificationSettings,
@@ -1122,17 +1127,25 @@ class ClientProxy: ClientProxyProtocol {
MXLog.info("Received room list update: \(state)")
guard state != .error,
state != .terminated else {
// The sync service is responsible of handling error and termination
return
}
// Hide the sync spinner as soon as we get any update back
actionsSubject.send(.receivedSyncUpdate)
if ignoredUsersSubject.value == nil {
updateIgnoredUsers()
switch state {
case .initial, .settingUp, .recovering:
break // Don't do anything until we're actually running.
case .running:
// Hide the sync spinner as soon as we get any update back
actionsSubject.send(.receivedSyncUpdate)
if ignoredUsersSubject.value == nil {
updateIgnoredUsers()
}
if capabilitiesRefreshTask == nil {
capabilitiesRefreshTask = Task { [weak self] in
await self?.capabilities.refresh()
self?.capabilitiesRefreshTask = nil
}
}
case .error, .terminated:
break // The sync service is responsible for handling error and termination
}
})
}