mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-05-08 09:18:39 +01:00
Fix some missed cases for blocking unregistered sends.
This commit is contained in:
@@ -1751,7 +1751,7 @@ public class ConversationActivity extends PassphraseRequiredActivity
|
|||||||
}
|
}
|
||||||
|
|
||||||
Log.i(TAG, "Resolved registered state: " + registeredState);
|
Log.i(TAG, "Resolved registered state: " + registeredState);
|
||||||
boolean signalEnabled = TextSecurePreferences.isPushRegistered(context);
|
boolean signalEnabled = Recipient.self().isRegistered();
|
||||||
|
|
||||||
if (registeredState == RegisteredState.UNKNOWN) {
|
if (registeredState == RegisteredState.UNKNOWN) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ public final class PaymentNotificationSendJob extends BaseJob {
|
|||||||
@Override
|
@Override
|
||||||
protected boolean onShouldRetry(@NonNull Exception e) {
|
protected boolean onShouldRetry(@NonNull Exception e) {
|
||||||
if (e instanceof ServerRejectedException) return false;
|
if (e instanceof ServerRejectedException) return false;
|
||||||
|
if (e instanceof NotPushRegisteredException) return false;
|
||||||
return e instanceof IOException ||
|
return e instanceof IOException ||
|
||||||
e instanceof RetryLaterException;
|
e instanceof RetryLaterException;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,6 +123,7 @@ public class ProfileKeySendJob extends BaseJob {
|
|||||||
@Override
|
@Override
|
||||||
protected boolean onShouldRetry(@NonNull Exception e) {
|
protected boolean onShouldRetry(@NonNull Exception e) {
|
||||||
if (e instanceof ServerRejectedException) return false;
|
if (e instanceof ServerRejectedException) return false;
|
||||||
|
if (e instanceof NotPushRegisteredException) return false;
|
||||||
return e instanceof IOException ||
|
return e instanceof IOException ||
|
||||||
e instanceof RetryLaterException;
|
e instanceof RetryLaterException;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,6 +151,7 @@ public final class PushGroupSilentUpdateSendJob extends BaseJob {
|
|||||||
@Override
|
@Override
|
||||||
protected boolean onShouldRetry(@NonNull Exception e) {
|
protected boolean onShouldRetry(@NonNull Exception e) {
|
||||||
if (e instanceof ServerRejectedException) return false;
|
if (e instanceof ServerRejectedException) return false;
|
||||||
|
if (e instanceof NotPushRegisteredException) return false;
|
||||||
return e instanceof IOException ||
|
return e instanceof IOException ||
|
||||||
e instanceof RetryLaterException;
|
e instanceof RetryLaterException;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -145,6 +145,10 @@ public abstract class PushSendJob extends SendJob {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (exception instanceof NotPushRegisteredException) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return exception instanceof IOException ||
|
return exception instanceof IOException ||
|
||||||
exception instanceof RetryLaterException ||
|
exception instanceof RetryLaterException ||
|
||||||
exception instanceof ProofRequiredException;
|
exception instanceof ProofRequiredException;
|
||||||
|
|||||||
@@ -186,6 +186,7 @@ public class ReactionSendJob extends BaseJob {
|
|||||||
@Override
|
@Override
|
||||||
protected boolean onShouldRetry(@NonNull Exception e) {
|
protected boolean onShouldRetry(@NonNull Exception e) {
|
||||||
if (e instanceof ServerRejectedException) return false;
|
if (e instanceof ServerRejectedException) return false;
|
||||||
|
if (e instanceof NotPushRegisteredException) return false;
|
||||||
return e instanceof IOException ||
|
return e instanceof IOException ||
|
||||||
e instanceof RetryLaterException;
|
e instanceof RetryLaterException;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -159,6 +159,7 @@ public class RemoteDeleteSendJob extends BaseJob {
|
|||||||
@Override
|
@Override
|
||||||
protected boolean onShouldRetry(@NonNull Exception e) {
|
protected boolean onShouldRetry(@NonNull Exception e) {
|
||||||
if (e instanceof ServerRejectedException) return false;
|
if (e instanceof ServerRejectedException) return false;
|
||||||
|
if (e instanceof NotPushRegisteredException) return false;
|
||||||
return e instanceof IOException ||
|
return e instanceof IOException ||
|
||||||
e instanceof RetryLaterException;
|
e instanceof RetryLaterException;
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-1
@@ -5,6 +5,7 @@ import android.content.Context;
|
|||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||||
|
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||||
import org.thoughtcrime.securesms.util.Util;
|
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("Default SMS : ").append(Util.isDefaultSmsProvider(context)).append("\n")
|
||||||
.append("Prefer Contact Photos: ").append(SignalStore.settings().isPreferSystemContactPhotos()).append("\n")
|
.append("Prefer Contact Photos: ").append(SignalStore.settings().isPreferSystemContactPhotos()).append("\n")
|
||||||
.append("Call Bandwidth Mode : ").append(SignalStore.settings().getCallBandwidthMode()).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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user