Fix some missed cases for blocking unregistered sends.
This commit is contained in:
parent
98f432d23c
commit
65020dde1a
8 changed files with 15 additions and 2 deletions
|
@ -1751,7 +1751,7 @@ public class ConversationActivity extends PassphraseRequiredActivity
|
|||
}
|
||||
|
||||
Log.i(TAG, "Resolved registered state: " + registeredState);
|
||||
boolean signalEnabled = TextSecurePreferences.isPushRegistered(context);
|
||||
boolean signalEnabled = Recipient.self().isRegistered();
|
||||
|
||||
if (registeredState == RegisteredState.UNKNOWN) {
|
||||
try {
|
||||
|
|
|
@ -118,6 +118,7 @@ public final class PaymentNotificationSendJob extends BaseJob {
|
|||
@Override
|
||||
protected boolean onShouldRetry(@NonNull Exception e) {
|
||||
if (e instanceof ServerRejectedException) return false;
|
||||
if (e instanceof NotPushRegisteredException) return false;
|
||||
return e instanceof IOException ||
|
||||
e instanceof RetryLaterException;
|
||||
}
|
||||
|
|
|
@ -123,6 +123,7 @@ public class ProfileKeySendJob extends BaseJob {
|
|||
@Override
|
||||
protected boolean onShouldRetry(@NonNull Exception e) {
|
||||
if (e instanceof ServerRejectedException) return false;
|
||||
if (e instanceof NotPushRegisteredException) return false;
|
||||
return e instanceof IOException ||
|
||||
e instanceof RetryLaterException;
|
||||
}
|
||||
|
|
|
@ -151,6 +151,7 @@ public final class PushGroupSilentUpdateSendJob extends BaseJob {
|
|||
@Override
|
||||
protected boolean onShouldRetry(@NonNull Exception e) {
|
||||
if (e instanceof ServerRejectedException) return false;
|
||||
if (e instanceof NotPushRegisteredException) return false;
|
||||
return e instanceof IOException ||
|
||||
e instanceof RetryLaterException;
|
||||
}
|
||||
|
|
|
@ -145,6 +145,10 @@ public abstract class PushSendJob extends SendJob {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (exception instanceof NotPushRegisteredException) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return exception instanceof IOException ||
|
||||
exception instanceof RetryLaterException ||
|
||||
exception instanceof ProofRequiredException;
|
||||
|
|
|
@ -186,6 +186,7 @@ public class ReactionSendJob extends BaseJob {
|
|||
@Override
|
||||
protected boolean onShouldRetry(@NonNull Exception e) {
|
||||
if (e instanceof ServerRejectedException) return false;
|
||||
if (e instanceof NotPushRegisteredException) return false;
|
||||
return e instanceof IOException ||
|
||||
e instanceof RetryLaterException;
|
||||
}
|
||||
|
|
|
@ -159,6 +159,7 @@ public class RemoteDeleteSendJob extends BaseJob {
|
|||
@Override
|
||||
protected boolean onShouldRetry(@NonNull Exception e) {
|
||||
if (e instanceof ServerRejectedException) return false;
|
||||
if (e instanceof NotPushRegisteredException) return false;
|
||||
return e instanceof IOException ||
|
||||
e instanceof RetryLaterException;
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import android.content.Context;
|
|||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
|
||||
|
@ -24,6 +25,9 @@ final class LogSectionKeyPreferences implements LogSection {
|
|||
.append("Default SMS : ").append(Util.isDefaultSmsProvider(context)).append("\n")
|
||||
.append("Prefer Contact Photos: ").append(SignalStore.settings().isPreferSystemContactPhotos()).append("\n")
|
||||
.append("Call Bandwidth Mode : ").append(SignalStore.settings().getCallBandwidthMode()).append("\n")
|
||||
.append("Client Deprecated : ").append(SignalStore.misc().isClientDeprecated()).append("\n");
|
||||
.append("Client Deprecated : ").append(SignalStore.misc().isClientDeprecated()).append("\n")
|
||||
.append("Push Registered : ").append(TextSecurePreferences.isPushRegistered(context)).append("\n")
|
||||
.append("Unauthorized Received: ").append(TextSecurePreferences.isUnauthorizedRecieved(context)).append("\n")
|
||||
.append("self.isRegistered() : ").append(Recipient.self().isRegistered()).append("\n");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue