Allow clearing your own call status. (#5959)

* Allow clearing your own call status.

* Clarify the names of the SettingsScreenUserStatusRow.Mode cases.
This commit is contained in:
Doug
2026-07-31 18:15:42 +01:00
committed by GitHub
parent f5a1a7d952
commit 94cd9590b5
11 changed files with 128 additions and 41 deletions
@@ -766,7 +766,6 @@ class ClientProxy: ClientProxyProtocol {
}
}
// periphery:ignore - might be useful to have
func setUserStatus(_ status: UserStatus.Raw) async -> Result<Void, ClientProxyError> {
do {
try await client.setUserStatus(status: status.rustValue)
@@ -778,11 +777,10 @@ class ClientProxy: ClientProxyProtocol {
}
}
// periphery:ignore - might be useful to have
func removeUserStatus() async -> Result<Void, ClientProxyError> {
do {
try await client.clearUserStatus()
Task { await self.loadUserProfileIfNeeded() }
// No need to refresh the profile, we only support user status with the profiles /sync extension.
return .success(())
} catch {
MXLog.error("Failed removing user status with error: \(error)")
@@ -790,6 +788,17 @@ class ClientProxy: ClientProxyProtocol {
}
}
func removeCallStatus() async -> Result<Void, ClientProxyError> {
do {
try await client.clearCallStatus()
// No need to refresh the profile, we only support user status with the profiles /sync extension.
return .success(())
} catch {
MXLog.error("Failed removing call status with error: \(error)")
return .failure(.sdkError(error))
}
}
func linkNewDeviceService() -> LinkNewDeviceServiceProtocol {
LinkNewDeviceService(handler: client.newGrantLoginWithQrCodeHandler())
}