Do not run prekey jobs if you're not registered.

This commit is contained in:
Greyson Parrelli
2022-02-18 15:23:06 -05:00
parent bec9b3d88c
commit c2830163b8
3 changed files with 7 additions and 2 deletions

View File

@@ -66,7 +66,7 @@ public class CreateSignedPreKeyJob extends BaseJob {
@Override
public void onRun() throws IOException {
if (!SignalStore.account().isRegistered()) {
if (!SignalStore.account().isRegistered() || SignalStore.account().getAci() == null || SignalStore.account().getPni() == null) {
Log.w(TAG, "Not yet registered...");
return;
}

View File

@@ -77,7 +77,7 @@ public class RefreshPreKeysJob extends BaseJob {
@Override
public void onRun() throws IOException {
if (!SignalStore.account().isRegistered()) {
if (!SignalStore.account().isRegistered() || SignalStore.account().getAci() == null || SignalStore.account().getPni() == null) {
Log.w(TAG, "Not registered. Skipping.");
return;
}

View File

@@ -58,6 +58,11 @@ public class RotateSignedPreKeyJob extends BaseJob {
@Override
public void onRun() throws Exception {
if (!SignalStore.account().isRegistered() || SignalStore.account().getAci() == null || SignalStore.account().getPni() == null) {
Log.w(TAG, "Not registered. Skipping.");
return;
}
Log.i(TAG, "Rotating signed prekey...");
ACI aci = SignalStore.account().getAci();