kopia lustrzana https://github.com/ryukoposting/Signal-Android
Enqueue profile refresh sync after badge redemption.
rodzic
25788ef751
commit
2d57cb4ed0
|
@ -72,14 +72,16 @@ public class BoostReceiptRequestResponseJob extends BaseJob {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static JobManager.Chain createJobChainForBoost(@NonNull StripeApi.PaymentIntent paymentIntent) {
|
public static JobManager.Chain createJobChainForBoost(@NonNull StripeApi.PaymentIntent paymentIntent) {
|
||||||
BoostReceiptRequestResponseJob requestReceiptJob = createJob(paymentIntent, DonationErrorSource.BOOST, Long.parseLong(SubscriptionLevels.BOOST_LEVEL));
|
BoostReceiptRequestResponseJob requestReceiptJob = createJob(paymentIntent, DonationErrorSource.BOOST, Long.parseLong(SubscriptionLevels.BOOST_LEVEL));
|
||||||
DonationReceiptRedemptionJob redeemReceiptJob = DonationReceiptRedemptionJob.createJobForBoost();
|
DonationReceiptRedemptionJob redeemReceiptJob = DonationReceiptRedemptionJob.createJobForBoost();
|
||||||
RefreshOwnProfileJob refreshOwnProfileJob = RefreshOwnProfileJob.forBoost();
|
RefreshOwnProfileJob refreshOwnProfileJob = RefreshOwnProfileJob.forBoost();
|
||||||
|
MultiDeviceProfileContentUpdateJob multiDeviceProfileContentUpdateJob = new MultiDeviceProfileContentUpdateJob();
|
||||||
|
|
||||||
return ApplicationDependencies.getJobManager()
|
return ApplicationDependencies.getJobManager()
|
||||||
.startChain(requestReceiptJob)
|
.startChain(requestReceiptJob)
|
||||||
.then(redeemReceiptJob)
|
.then(redeemReceiptJob)
|
||||||
.then(refreshOwnProfileJob);
|
.then(refreshOwnProfileJob)
|
||||||
|
.then(multiDeviceProfileContentUpdateJob);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static JobManager.Chain createJobChainForGift(@NonNull StripeApi.PaymentIntent paymentIntent,
|
public static JobManager.Chain createJobChainForGift(@NonNull StripeApi.PaymentIntent paymentIntent,
|
||||||
|
|
|
@ -89,11 +89,13 @@ public class DonationReceiptRedemptionJob extends BaseJob {
|
||||||
.setLifespan(TimeUnit.DAYS.toMillis(1))
|
.setLifespan(TimeUnit.DAYS.toMillis(1))
|
||||||
.build());
|
.build());
|
||||||
|
|
||||||
RefreshOwnProfileJob refreshOwnProfileJob = new RefreshOwnProfileJob();
|
RefreshOwnProfileJob refreshOwnProfileJob = new RefreshOwnProfileJob();
|
||||||
|
MultiDeviceProfileContentUpdateJob multiDeviceProfileContentUpdateJob = new MultiDeviceProfileContentUpdateJob();
|
||||||
|
|
||||||
return ApplicationDependencies.getJobManager()
|
return ApplicationDependencies.getJobManager()
|
||||||
.startChain(redeemReceiptJob)
|
.startChain(redeemReceiptJob)
|
||||||
.then(refreshOwnProfileJob);
|
.then(refreshOwnProfileJob)
|
||||||
|
.then(multiDeviceProfileContentUpdateJob);
|
||||||
}
|
}
|
||||||
|
|
||||||
private DonationReceiptRedemptionJob(long giftMessageId, boolean primary, @NonNull DonationErrorSource errorSource, @NonNull Job.Parameters parameters) {
|
private DonationReceiptRedemptionJob(long giftMessageId, boolean primary, @NonNull DonationErrorSource errorSource, @NonNull Job.Parameters parameters) {
|
||||||
|
|
|
@ -90,15 +90,17 @@ public class SubscriptionReceiptRequestResponseJob extends BaseJob {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static JobManager.Chain createSubscriptionContinuationJobChain(boolean isForKeepAlive) {
|
public static JobManager.Chain createSubscriptionContinuationJobChain(boolean isForKeepAlive) {
|
||||||
Subscriber subscriber = SignalStore.donationsValues().requireSubscriber();
|
Subscriber subscriber = SignalStore.donationsValues().requireSubscriber();
|
||||||
SubscriptionReceiptRequestResponseJob requestReceiptJob = createJob(subscriber.getSubscriberId(), isForKeepAlive);
|
SubscriptionReceiptRequestResponseJob requestReceiptJob = createJob(subscriber.getSubscriberId(), isForKeepAlive);
|
||||||
DonationReceiptRedemptionJob redeemReceiptJob = DonationReceiptRedemptionJob.createJobForSubscription(requestReceiptJob.getErrorSource());
|
DonationReceiptRedemptionJob redeemReceiptJob = DonationReceiptRedemptionJob.createJobForSubscription(requestReceiptJob.getErrorSource());
|
||||||
RefreshOwnProfileJob refreshOwnProfileJob = RefreshOwnProfileJob.forSubscription();
|
RefreshOwnProfileJob refreshOwnProfileJob = RefreshOwnProfileJob.forSubscription();
|
||||||
|
MultiDeviceProfileContentUpdateJob multiDeviceProfileContentUpdateJob = new MultiDeviceProfileContentUpdateJob();
|
||||||
|
|
||||||
return ApplicationDependencies.getJobManager()
|
return ApplicationDependencies.getJobManager()
|
||||||
.startChain(requestReceiptJob)
|
.startChain(requestReceiptJob)
|
||||||
.then(redeemReceiptJob)
|
.then(redeemReceiptJob)
|
||||||
.then(refreshOwnProfileJob);
|
.then(refreshOwnProfileJob)
|
||||||
|
.then(multiDeviceProfileContentUpdateJob);
|
||||||
}
|
}
|
||||||
|
|
||||||
private SubscriptionReceiptRequestResponseJob(@NonNull Parameters parameters,
|
private SubscriptionReceiptRequestResponseJob(@NonNull Parameters parameters,
|
||||||
|
|
Ładowanie…
Reference in New Issue