mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-07-07 14:35:29 +01:00
Remove Option.RECAPTCHA from ProofRequiredException.
This commit is contained in:
committed by
Cody Henthorne
parent
58d769b21f
commit
02629020df
@@ -602,13 +602,8 @@ public abstract class PushSendJob extends SendJob {
|
||||
SignalDatabase.messages().markAsRateLimited(messageId);
|
||||
}
|
||||
|
||||
final Optional<ProofRequiredException.Option> captchaRequired =
|
||||
proofRequired.getOptions().stream()
|
||||
.filter(option -> option.equals(ProofRequiredException.Option.RECAPTCHA) || option.equals(ProofRequiredException.Option.CAPTCHA))
|
||||
.findFirst();
|
||||
|
||||
if (captchaRequired.isPresent()) {
|
||||
Log.i(TAG, "[Proof Required] " + captchaRequired.get() + " required.");
|
||||
if (proofRequired.getOptions().contains(ProofRequiredException.Option.CAPTCHA)) {
|
||||
Log.i(TAG, "[Proof Required] CAPTCHA required.");
|
||||
SignalStore.rateLimit().markNeedsRecaptcha(proofRequired.getToken());
|
||||
|
||||
if (recipient != null) {
|
||||
|
||||
+1
-3
@@ -42,8 +42,6 @@ public class ProofRequiredException extends NonSuccessfulResponseCodeException {
|
||||
|
||||
for (String raw : rawOptions) {
|
||||
switch (raw) {
|
||||
case "recaptcha":
|
||||
options.add(Option.RECAPTCHA);
|
||||
case "captcha":
|
||||
options.add(Option.CAPTCHA);
|
||||
break;
|
||||
@@ -60,6 +58,6 @@ public class ProofRequiredException extends NonSuccessfulResponseCodeException {
|
||||
}
|
||||
|
||||
public enum Option {
|
||||
@Deprecated RECAPTCHA, CAPTCHA, PUSH_CHALLENGE
|
||||
CAPTCHA, PUSH_CHALLENGE
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user