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.isNetworkFailure(),
sendMessageResult.isUnregisteredFailure(), sendMessageResult.isUnregisteredFailure(),
sendMessageResult.getIdentityFailure() != null, sendMessageResult.getIdentityFailure() != null,
sendMessageResult.getRateLimitFailure() != null, sendMessageResult.getRateLimitFailure() != null || sendMessageResult.getProofRequiredFailure() != null,
sendMessageResult.getProofRequiredFailure() == null sendMessageResult.getProofRequiredFailure() == null
? null ? null
: new ProofRequiredException(sendMessageResult.getProofRequiredFailure())); : new ProofRequiredException(sendMessageResult.getProofRequiredFailure()));

View file

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