Output RATE_LIMIT_FAILURE type more reliably in json output

Fixes #923
This commit is contained in:
AsamK 2022-04-06 22:35:51 +02:00
parent af71115767
commit 2c15995289
2 changed files with 5 additions and 5 deletions

View file

@ -48,7 +48,7 @@ public record SendMessageResult(
sendMessageResult.isNetworkFailure(),
sendMessageResult.isUnregisteredFailure(),
sendMessageResult.getIdentityFailure() != null,
sendMessageResult.getRateLimitFailure() != null,
sendMessageResult.getRateLimitFailure() != null || sendMessageResult.getProofRequiredFailure() != null,
sendMessageResult.getProofRequiredFailure() == null
? null
: new ProofRequiredException(sendMessageResult.getProofRequiredFailure()));

View file

@ -22,10 +22,10 @@ public record JsonSendMessageResult(
groupId != null ? groupId.toBase64() : null,
result.isSuccess()
? Type.SUCCESS
: result.isNetworkFailure()
? Type.NETWORK_FAILURE
: result.isRateLimitFailure()
? Type.RATE_LIMIT_FAILURE
: result.isNetworkFailure()
? Type.NETWORK_FAILURE
: result.isUnregisteredFailure()
? Type.UNREGISTERED_FAILURE
: Type.IDENTITY_FAILURE,