Only notify for unauthorized response to messages endpoint.

This commit is contained in:
Nicholas
2023-01-04 11:32:43 -05:00
committed by Greyson Parrelli
parent 0fd8f73cca
commit d70fe8f2cd
4 changed files with 11 additions and 31 deletions

View File

@@ -10,9 +10,10 @@ import org.thoughtcrime.securesms.jobmanager.JobTracker;
import org.thoughtcrime.securesms.jobs.MarkerJob;
import org.thoughtcrime.securesms.jobs.PushDecryptMessageJob;
import org.thoughtcrime.securesms.jobs.PushProcessMessageJob;
import org.thoughtcrime.securesms.keyvalue.SignalStore;
import org.thoughtcrime.securesms.stories.Stories;
import org.thoughtcrime.securesms.util.TextSecurePreferences;
import org.whispersystems.signalservice.api.SignalServiceMessageReceiver;
import org.whispersystems.signalservice.api.push.exceptions.AuthorizationFailedException;
import java.io.IOException;
import java.util.Iterator;
@@ -70,6 +71,9 @@ public class RestStrategy extends MessageRetrievalStrategy {
} catch (IOException e) {
Log.w(TAG, "Failed to retrieve messages. Resetting the SignalServiceMessageReceiver.", e);
ApplicationDependencies.resetSignalServiceMessageReceiver();
if (e instanceof AuthorizationFailedException) {
TextSecurePreferences.setUnauthorizedReceived(ApplicationDependencies.getApplication(), true);
}
return false;
} finally {
jobManager.removeListener(queueListener);