Add the "My Daily Life" sticker pack by Plastic Thing.

This commit is contained in:
Greyson Parrelli
2021-08-05 11:06:06 -04:00
committed by Alex Hart
parent 3fca46de92
commit 89b1243885
4 changed files with 67 additions and 6 deletions

View File

@@ -81,9 +81,10 @@ public class ApplicationMigrations {
static final int LOG_CLEANUP = 39;
static final int ATTACHMENT_CLEANUP_2 = 40;
static final int ANNOUNCEMENT_GROUP_CAPABILITY = 41;
static final int STICKER_MY_DAILY_LIFE = 42;
}
public static final int CURRENT_VERSION = 41;
public static final int CURRENT_VERSION = 42;
/**
* This *must* be called after the {@link JobManager} has been instantiated, but *before* the call
@@ -357,6 +358,10 @@ public class ApplicationMigrations {
jobs.put(Version.ANNOUNCEMENT_GROUP_CAPABILITY, new AttributesMigrationJob());
}
if (lastSeenVersion < Version.STICKER_MY_DAILY_LIFE) {
jobs.put(Version.STICKER_MY_DAILY_LIFE, new StickerMyDailyLifeMigrationJob());
}
return jobs;
}

View File

@@ -0,0 +1,52 @@
package org.thoughtcrime.securesms.migrations;
import androidx.annotation.NonNull;
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
import org.thoughtcrime.securesms.jobmanager.Data;
import org.thoughtcrime.securesms.jobmanager.Job;
import org.thoughtcrime.securesms.jobs.StickerPackDownloadJob;
import org.thoughtcrime.securesms.stickers.BlessedPacks;
/**
* Installs Piece of Cake blessed pack.
*/
public class StickerMyDailyLifeMigrationJob extends MigrationJob {
public static final String KEY = "StickerMyDailyLifeMigrationJob";
StickerMyDailyLifeMigrationJob() {
this(new Parameters.Builder().build());
}
private StickerMyDailyLifeMigrationJob(@NonNull Parameters parameters) {
super(parameters);
}
@Override
public boolean isUiBlocking() {
return false;
}
@Override
public @NonNull String getFactoryKey() {
return KEY;
}
@Override
public void performMigration() {
ApplicationDependencies.getJobManager().add(StickerPackDownloadJob.forInstall(BlessedPacks.MY_DAILY_LIFE.getPackId(), BlessedPacks.MY_DAILY_LIFE.getPackKey(), false));
}
@Override
boolean shouldRetry(@NonNull Exception e) {
return false;
}
public static class Factory implements Job.Factory<StickerMyDailyLifeMigrationJob> {
@Override
public @NonNull StickerMyDailyLifeMigrationJob create(@NonNull Parameters parameters, @NonNull Data data) {
return new StickerMyDailyLifeMigrationJob(parameters);
}
}
}