Don't run ProfileUploadJob if you're not registered.

fork-5.53.8
Greyson Parrelli 2020-07-09 07:57:37 -04:00
rodzic 2883d2eb31
commit 9c44a0c7d3
1 zmienionych plików z 9 dodań i 0 usunięć

Wyświetl plik

@ -11,14 +11,18 @@ import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
import org.thoughtcrime.securesms.jobmanager.Data;
import org.thoughtcrime.securesms.jobmanager.Job;
import org.thoughtcrime.securesms.jobmanager.impl.NetworkConstraint;
import org.thoughtcrime.securesms.logging.Log;
import org.thoughtcrime.securesms.profiles.AvatarHelper;
import org.thoughtcrime.securesms.profiles.ProfileName;
import org.thoughtcrime.securesms.recipients.Recipient;
import org.thoughtcrime.securesms.util.TextSecurePreferences;
import org.whispersystems.signalservice.api.SignalServiceAccountManager;
import org.whispersystems.signalservice.api.util.StreamDetails;
public final class ProfileUploadJob extends BaseJob {
private static final String TAG = Log.tag(ProfileUploadJob.class);
public static final String KEY = "ProfileUploadJob";
public static final String QUEUE = "ProfileAlteration";
@ -45,6 +49,11 @@ public final class ProfileUploadJob extends BaseJob {
@Override
protected void onRun() throws Exception {
if (!TextSecurePreferences.isPushRegistered(context)) {
Log.w(TAG, "Not registered. Skipping.");
return;
}
ProfileKey profileKey = ProfileKeyUtil.getSelfProfileKey();
ProfileName profileName = Recipient.self().getProfileName();
String avatarPath;