mirror of
https://github.com/oxen-io/session-android.git
synced 2025-06-09 03:38:33 +00:00
Don't run ProfileUploadJob if you're not registered.
This commit is contained in:
parent
2883d2eb31
commit
9c44a0c7d3
@ -11,14 +11,18 @@ import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
|||||||
import org.thoughtcrime.securesms.jobmanager.Data;
|
import org.thoughtcrime.securesms.jobmanager.Data;
|
||||||
import org.thoughtcrime.securesms.jobmanager.Job;
|
import org.thoughtcrime.securesms.jobmanager.Job;
|
||||||
import org.thoughtcrime.securesms.jobmanager.impl.NetworkConstraint;
|
import org.thoughtcrime.securesms.jobmanager.impl.NetworkConstraint;
|
||||||
|
import org.thoughtcrime.securesms.logging.Log;
|
||||||
import org.thoughtcrime.securesms.profiles.AvatarHelper;
|
import org.thoughtcrime.securesms.profiles.AvatarHelper;
|
||||||
import org.thoughtcrime.securesms.profiles.ProfileName;
|
import org.thoughtcrime.securesms.profiles.ProfileName;
|
||||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||||
|
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||||
import org.whispersystems.signalservice.api.SignalServiceAccountManager;
|
import org.whispersystems.signalservice.api.SignalServiceAccountManager;
|
||||||
import org.whispersystems.signalservice.api.util.StreamDetails;
|
import org.whispersystems.signalservice.api.util.StreamDetails;
|
||||||
|
|
||||||
public final class ProfileUploadJob extends BaseJob {
|
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 KEY = "ProfileUploadJob";
|
||||||
|
|
||||||
public static final String QUEUE = "ProfileAlteration";
|
public static final String QUEUE = "ProfileAlteration";
|
||||||
@ -45,6 +49,11 @@ public final class ProfileUploadJob extends BaseJob {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onRun() throws Exception {
|
protected void onRun() throws Exception {
|
||||||
|
if (!TextSecurePreferences.isPushRegistered(context)) {
|
||||||
|
Log.w(TAG, "Not registered. Skipping.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ProfileKey profileKey = ProfileKeyUtil.getSelfProfileKey();
|
ProfileKey profileKey = ProfileKeyUtil.getSelfProfileKey();
|
||||||
ProfileName profileName = Recipient.self().getProfileName();
|
ProfileName profileName = Recipient.self().getProfileName();
|
||||||
String avatarPath;
|
String avatarPath;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user