mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 09:20:19 +01:00
Remove deprecated storage service fields.
This commit is contained in:
@@ -110,7 +110,7 @@ public class ApplicationMigrations {
|
||||
static final int PNI_2 = 66;
|
||||
static final int SYSTEM_NAME_SYNC = 67;
|
||||
static final int STORY_VIEWED_STATE = 68;
|
||||
static final int STORY_READ_STATE = 69;
|
||||
// static final int STORY_READ_STATE = 69;
|
||||
static final int THREAD_MESSAGE_SCHEMA_CHANGE = 70;
|
||||
static final int SMS_MMS_MERGE = 71;
|
||||
static final int REBUILD_MESSAGE_FTS_INDEX = 72;
|
||||
@@ -517,9 +517,9 @@ public class ApplicationMigrations {
|
||||
jobs.put(Version.STORY_VIEWED_STATE, new StoryViewedReceiptsStateMigrationJob());
|
||||
}
|
||||
|
||||
if (lastSeenVersion < Version.STORY_READ_STATE) {
|
||||
jobs.put(Version.STORY_READ_STATE, new StoryReadStateMigrationJob());
|
||||
}
|
||||
// if (lastSeenVersion < Version.STORY_READ_STATE) {
|
||||
// jobs.put(Version.STORY_READ_STATE, new StoryReadStateMigrationJob());
|
||||
// }
|
||||
|
||||
if (lastSeenVersion < Version.THREAD_MESSAGE_SCHEMA_CHANGE) {
|
||||
jobs.put(Version.THREAD_MESSAGE_SCHEMA_CHANGE, new DatabaseMigrationJob());
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
package org.thoughtcrime.securesms.migrations
|
||||
|
||||
import org.thoughtcrime.securesms.database.SignalDatabase
|
||||
import org.thoughtcrime.securesms.database.SignalDatabase.Companion.recipients
|
||||
import org.thoughtcrime.securesms.jobmanager.Job
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore
|
||||
import org.thoughtcrime.securesms.recipients.Recipient
|
||||
import org.thoughtcrime.securesms.storage.StorageSyncHelper
|
||||
|
||||
/**
|
||||
* Added to initialize whether the user has seen the onboarding story
|
||||
*/
|
||||
internal class StoryReadStateMigrationJob(
|
||||
parameters: Parameters = Parameters.Builder().build()
|
||||
) : MigrationJob(parameters) {
|
||||
|
||||
companion object {
|
||||
const val KEY = "StoryReadStateMigrationJob"
|
||||
}
|
||||
|
||||
override fun getFactoryKey(): String = KEY
|
||||
|
||||
override fun isUiBlocking(): Boolean = false
|
||||
|
||||
override fun performMigration() {
|
||||
if (!SignalStore.storyValues().hasUserOnboardingStoryReadBeenSet()) {
|
||||
SignalStore.storyValues().userHasReadOnboardingStory = SignalStore.storyValues().userHasReadOnboardingStory
|
||||
SignalDatabase.messages.markOnboardingStoryRead()
|
||||
|
||||
if (SignalStore.account().isRegistered) {
|
||||
recipients.markNeedsSync(Recipient.self().id)
|
||||
StorageSyncHelper.scheduleSyncForDataChange()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun shouldRetry(e: Exception): Boolean = false
|
||||
|
||||
class Factory : Job.Factory<StoryReadStateMigrationJob> {
|
||||
override fun create(parameters: Parameters, serializedData: ByteArray?): StoryReadStateMigrationJob {
|
||||
return StoryReadStateMigrationJob(parameters)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user