mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Fix printing proof required error
libsignal-service classifies it as network failure as well.
This commit is contained in:
parent
eee140f74f
commit
50e5acdf52
1 changed files with 7 additions and 7 deletions
|
@ -58,13 +58,7 @@ public class ErrorUtils {
|
||||||
|
|
||||||
public static String getErrorMessageFromSendMessageResult(SendMessageResult result) {
|
public static String getErrorMessageFromSendMessageResult(SendMessageResult result) {
|
||||||
var identifier = getLegacyIdentifier(result.getAddress());
|
var identifier = getLegacyIdentifier(result.getAddress());
|
||||||
if (result.isNetworkFailure()) {
|
if (result.getProofRequiredFailure() != null) {
|
||||||
return String.format("Network failure for \"%s\"", identifier);
|
|
||||||
} else if (result.isUnregisteredFailure()) {
|
|
||||||
return String.format("Unregistered user \"%s\"", identifier);
|
|
||||||
} else if (result.getIdentityFailure() != null) {
|
|
||||||
return String.format("Untrusted Identity for \"%s\"", identifier);
|
|
||||||
} else if (result.getProofRequiredFailure() != null) {
|
|
||||||
final var failure = result.getProofRequiredFailure();
|
final var failure = result.getProofRequiredFailure();
|
||||||
return String.format(
|
return String.format(
|
||||||
"CAPTCHA proof required for sending to \"%s\", available options \"%s\" with challenge token \"%s\", or wait \"%d\" seconds.\n"
|
"CAPTCHA proof required for sending to \"%s\", available options \"%s\" with challenge token \"%s\", or wait \"%d\" seconds.\n"
|
||||||
|
@ -85,6 +79,12 @@ public class ErrorUtils {
|
||||||
.collect(Collectors.joining(", ")),
|
.collect(Collectors.joining(", ")),
|
||||||
failure.getToken(),
|
failure.getToken(),
|
||||||
failure.getRetryAfterSeconds());
|
failure.getRetryAfterSeconds());
|
||||||
|
} else if (result.isNetworkFailure()) {
|
||||||
|
return String.format("Network failure for \"%s\"", identifier);
|
||||||
|
} else if (result.isUnregisteredFailure()) {
|
||||||
|
return String.format("Unregistered user \"%s\"", identifier);
|
||||||
|
} else if (result.getIdentityFailure() != null) {
|
||||||
|
return String.format("Untrusted Identity for \"%s\"", identifier);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue