Display proper error when call link deletion fails due to call link being in use.

This commit is contained in:
Alex Hart
2024-11-18 13:01:35 -04:00
committed by Greyson Parrelli
parent a9c37a9668
commit 5f67bd9725
4 changed files with 22 additions and 3 deletions

View File

@@ -226,7 +226,10 @@ class SignalCallLinkManager(
if (result.isSuccess && result.value == true) {
emitter.onSuccess(UpdateCallLinkResult.Delete(credentials.roomId))
} else {
emitter.onSuccess(UpdateCallLinkResult.Failure(result.status))
when (result.status) {
409.toShort() -> emitter.onSuccess(UpdateCallLinkResult.CallLinkIsInUse)
else -> emitter.onSuccess(UpdateCallLinkResult.Failure(result.status))
}
}
}
}

View File

@@ -21,5 +21,11 @@ sealed interface UpdateCallLinkResult {
val status: Short
) : UpdateCallLinkResult
object NotAuthorized : UpdateCallLinkResult
/**
* Occurs when a user tries to delete a call link that
* the call server believes is currently being utilized.
*/
data object CallLinkIsInUse : UpdateCallLinkResult
data object NotAuthorized : UpdateCallLinkResult
}