mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-28 18:10:38 +00:00
Update dependencies
This commit is contained in:
parent
f04f789231
commit
dfa886fae9
7 changed files with 22 additions and 17 deletions
|
@ -47,38 +47,38 @@ public class NumberVerificationUtils {
|
|||
}
|
||||
}
|
||||
|
||||
sessionId = sessionResponse.getBody().getId();
|
||||
sessionId = sessionResponse.getMetadata().getId();
|
||||
sessionIdSaver.accept(sessionId);
|
||||
|
||||
if (sessionResponse.getBody().getVerified()) {
|
||||
if (sessionResponse.getMetadata().getVerified()) {
|
||||
return sessionId;
|
||||
}
|
||||
|
||||
if (sessionResponse.getBody().getAllowedToRequestCode()) {
|
||||
if (sessionResponse.getMetadata().getAllowedToRequestCode()) {
|
||||
return sessionId;
|
||||
}
|
||||
|
||||
final var nextAttempt = voiceVerification
|
||||
? sessionResponse.getBody().getNextCall()
|
||||
: sessionResponse.getBody().getNextSms();
|
||||
? sessionResponse.getMetadata().getNextCall()
|
||||
: sessionResponse.getMetadata().getNextSms();
|
||||
if (nextAttempt == null) {
|
||||
throw new VerificationMethodNotAvailableException();
|
||||
} else if (nextAttempt > 0) {
|
||||
final var timestamp = sessionResponse.getHeaders().getTimestamp() + nextAttempt * 1000;
|
||||
final var timestamp = sessionResponse.getClientReceivedAtMilliseconds() + nextAttempt * 1000;
|
||||
throw new RateLimitException(timestamp);
|
||||
}
|
||||
|
||||
final var nextVerificationAttempt = sessionResponse.getBody().getNextVerificationAttempt();
|
||||
final var nextVerificationAttempt = sessionResponse.getMetadata().getNextVerificationAttempt();
|
||||
if (nextVerificationAttempt != null && nextVerificationAttempt > 0) {
|
||||
final var timestamp = sessionResponse.getHeaders().getTimestamp() + nextVerificationAttempt * 1000;
|
||||
final var timestamp = sessionResponse.getClientReceivedAtMilliseconds() + nextVerificationAttempt * 1000;
|
||||
throw new CaptchaRequiredException(timestamp);
|
||||
}
|
||||
|
||||
if (sessionResponse.getBody().getRequestedInformation().contains("captcha")) {
|
||||
if (sessionResponse.getMetadata().getRequestedInformation().contains("captcha")) {
|
||||
if (captcha != null) {
|
||||
sessionResponse = submitCaptcha(registrationApi, sessionId, captcha);
|
||||
}
|
||||
if (!sessionResponse.getBody().getAllowedToRequestCode()) {
|
||||
if (!sessionResponse.getMetadata().getAllowedToRequestCode()) {
|
||||
throw new CaptchaRequiredException("Captcha Required");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue