mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Catch ProofRequiredException from getPreKeys request and wrap in SendMessageResult
This commit is contained in:
parent
0e6644a890
commit
a17262d9ff
2 changed files with 4 additions and 1 deletions
|
@ -22,6 +22,7 @@ import org.whispersystems.signalservice.api.messages.SignalServiceReceiptMessage
|
||||||
import org.whispersystems.signalservice.api.messages.SignalServiceTypingMessage;
|
import org.whispersystems.signalservice.api.messages.SignalServiceTypingMessage;
|
||||||
import org.whispersystems.signalservice.api.messages.multidevice.SentTranscriptMessage;
|
import org.whispersystems.signalservice.api.messages.multidevice.SentTranscriptMessage;
|
||||||
import org.whispersystems.signalservice.api.messages.multidevice.SignalServiceSyncMessage;
|
import org.whispersystems.signalservice.api.messages.multidevice.SignalServiceSyncMessage;
|
||||||
|
import org.whispersystems.signalservice.api.push.exceptions.ProofRequiredException;
|
||||||
import org.whispersystems.signalservice.api.push.exceptions.UnregisteredUserException;
|
import org.whispersystems.signalservice.api.push.exceptions.UnregisteredUserException;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -282,6 +283,8 @@ public class SendHelper {
|
||||||
message,
|
message,
|
||||||
SignalServiceMessageSender.IndividualSendEvents.EMPTY);
|
SignalServiceMessageSender.IndividualSendEvents.EMPTY);
|
||||||
}
|
}
|
||||||
|
} catch (ProofRequiredException e) {
|
||||||
|
return SendMessageResult.proofRequiredFailure(address, e);
|
||||||
} catch (org.whispersystems.signalservice.api.crypto.UntrustedIdentityException e) {
|
} catch (org.whispersystems.signalservice.api.crypto.UntrustedIdentityException e) {
|
||||||
return SendMessageResult.identityFailure(address, e.getIdentityKey());
|
return SendMessageResult.identityFailure(address, e.getIdentityKey());
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,7 @@ public class ErrorUtils {
|
||||||
} else if (result.getProofRequiredFailure() != null) {
|
} 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 token \"%s\", or wait \"%d\" seconds",
|
"CAPTCHA proof required for sending to \"%s\", available options \"%s\" with challenge token \"%s\", or wait \"%d\" seconds",
|
||||||
identifier,
|
identifier,
|
||||||
failure.getOptions()
|
failure.getOptions()
|
||||||
.stream()
|
.stream()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue