mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-26 03:40:56 +01:00
Add support for syncing default reactions.
This commit is contained in:
committed by
Alex Hart
parent
2281e83607
commit
7267d77dcb
@@ -88,9 +88,10 @@ public class ApplicationMigrations {
|
||||
static final int CHANGE_NUMBER_SYNC = 44;
|
||||
static final int CHANGE_NUMBER_CAPABILITY = 45;
|
||||
static final int CHANGE_NUMBER_CAPABILITY_2 = 46;
|
||||
static final int DEFAULT_REACTIONS_SYNC = 47;
|
||||
}
|
||||
|
||||
public static final int CURRENT_VERSION = 46;
|
||||
public static final int CURRENT_VERSION = 47;
|
||||
|
||||
/**
|
||||
* This *must* be called after the {@link JobManager} has been instantiated, but *before* the call
|
||||
@@ -384,6 +385,10 @@ public class ApplicationMigrations {
|
||||
jobs.put(Version.CHANGE_NUMBER_CAPABILITY_2, new AttributesMigrationJob());
|
||||
}
|
||||
|
||||
if (lastSeenVersion < Version.DEFAULT_REACTIONS_SYNC) {
|
||||
jobs.put(Version.DEFAULT_REACTIONS_SYNC, new StorageServiceMigrationJob());
|
||||
}
|
||||
|
||||
return jobs;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,12 +3,14 @@ package org.thoughtcrime.securesms.migrations;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.signal.core.util.logging.Log;
|
||||
import org.thoughtcrime.securesms.database.DatabaseFactory;
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
import org.thoughtcrime.securesms.jobmanager.Data;
|
||||
import org.thoughtcrime.securesms.jobmanager.Job;
|
||||
import org.thoughtcrime.securesms.jobmanager.JobManager;
|
||||
import org.thoughtcrime.securesms.jobs.MultiDeviceKeysUpdateJob;
|
||||
import org.thoughtcrime.securesms.jobs.StorageSyncJob;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
|
||||
/**
|
||||
@@ -40,6 +42,13 @@ public class StorageServiceMigrationJob extends MigrationJob {
|
||||
|
||||
@Override
|
||||
public void performMigration() {
|
||||
if (TextSecurePreferences.getLocalUuid(context) == null) {
|
||||
Log.w(TAG, "Self not yet available.");
|
||||
return;
|
||||
}
|
||||
|
||||
DatabaseFactory.getRecipientDatabase(context).markNeedsSync(Recipient.self().getId());
|
||||
|
||||
JobManager jobManager = ApplicationDependencies.getJobManager();
|
||||
|
||||
if (TextSecurePreferences.isMultiDevice(context)) {
|
||||
|
||||
Reference in New Issue
Block a user