mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
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:
@@ -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())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user