2020-05-17 12:40:10 +00:00
|
|
|
.class public final Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;
|
2020-07-25 00:57:58 +00:00
|
|
|
.super Lf/a/b/o0;
|
2020-05-17 12:40:10 +00:00
|
|
|
.source "SettingsPremiumViewModel.kt"
|
|
|
|
|
|
|
|
|
|
|
|
# annotations
|
|
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
|
|
value = {
|
|
|
|
Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState;,
|
|
|
|
Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$SubscriptionError;,
|
|
|
|
Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Event;,
|
|
|
|
Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$StoreState;,
|
|
|
|
Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$InvoicePreviewFetch;,
|
|
|
|
Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$SubscriptionAndInvoice;,
|
|
|
|
Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Factory;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
2020-07-25 00:57:58 +00:00
|
|
|
"Lf/a/b/o0<",
|
2020-05-17 12:40:10 +00:00
|
|
|
"Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState;",
|
|
|
|
">;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
|
|
|
|
# instance fields
|
|
|
|
.field public final eventSubject:Lrx/subjects/PublishSubject;
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"Lrx/subjects/PublishSubject<",
|
|
|
|
"Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Event;",
|
|
|
|
">;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
.end field
|
|
|
|
|
|
|
|
.field public launchPremiumTabStartTimeMs:J
|
|
|
|
|
|
|
|
.field public final requestBuyPlanSubject:Lrx/subjects/PublishSubject;
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"Lrx/subjects/PublishSubject<",
|
|
|
|
"Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;",
|
|
|
|
">;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
.end field
|
|
|
|
|
|
|
|
.field public final restAPI:Lcom/discord/utilities/rest/RestAPI;
|
|
|
|
|
|
|
|
.field public final storeEntitlements:Lcom/discord/stores/StoreEntitlements;
|
|
|
|
|
|
|
|
.field public final storePaymentsSources:Lcom/discord/stores/StorePaymentSources;
|
|
|
|
|
|
|
|
.field public final storePremiumGuildSubscription:Lcom/discord/stores/StorePremiumGuildSubscription;
|
|
|
|
|
|
|
|
.field public final storeSubscriptions:Lcom/discord/stores/StoreSubscriptions;
|
|
|
|
|
|
|
|
|
|
|
|
# direct methods
|
|
|
|
.method public constructor <init>(Lcom/discord/stores/StorePaymentSources;Lcom/discord/stores/StoreSubscriptions;Lcom/discord/stores/StoreEntitlements;Lcom/discord/stores/StorePremiumGuildSubscription;Lcom/discord/utilities/rest/RestAPI;Lrx/Observable;)V
|
|
|
|
.locals 16
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"(",
|
|
|
|
"Lcom/discord/stores/StorePaymentSources;",
|
|
|
|
"Lcom/discord/stores/StoreSubscriptions;",
|
|
|
|
"Lcom/discord/stores/StoreEntitlements;",
|
|
|
|
"Lcom/discord/stores/StorePremiumGuildSubscription;",
|
|
|
|
"Lcom/discord/utilities/rest/RestAPI;",
|
|
|
|
"Lrx/Observable<",
|
|
|
|
"Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$StoreState;",
|
|
|
|
">;)V"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
move-object/from16 v0, p0
|
|
|
|
|
|
|
|
move-object/from16 v1, p1
|
|
|
|
|
|
|
|
move-object/from16 v2, p2
|
|
|
|
|
|
|
|
move-object/from16 v3, p3
|
|
|
|
|
|
|
|
move-object/from16 v4, p4
|
|
|
|
|
|
|
|
move-object/from16 v5, p5
|
|
|
|
|
|
|
|
const/4 v6, 0x0
|
|
|
|
|
|
|
|
if-eqz v1, :cond_5
|
|
|
|
|
|
|
|
if-eqz v2, :cond_4
|
|
|
|
|
|
|
|
if-eqz v3, :cond_3
|
|
|
|
|
|
|
|
if-eqz v4, :cond_2
|
|
|
|
|
|
|
|
if-eqz v5, :cond_1
|
|
|
|
|
|
|
|
if-eqz p6, :cond_0
|
|
|
|
|
|
|
|
sget-object v7, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loading;->INSTANCE:Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loading;
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-direct {v0, v7}, Lf/a/b/o0;-><init>(Ljava/lang/Object;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
iput-object v1, v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->storePaymentsSources:Lcom/discord/stores/StorePaymentSources;
|
|
|
|
|
|
|
|
iput-object v2, v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->storeSubscriptions:Lcom/discord/stores/StoreSubscriptions;
|
|
|
|
|
|
|
|
iput-object v3, v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->storeEntitlements:Lcom/discord/stores/StoreEntitlements;
|
|
|
|
|
|
|
|
iput-object v4, v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->storePremiumGuildSubscription:Lcom/discord/stores/StorePremiumGuildSubscription;
|
|
|
|
|
|
|
|
iput-object v5, v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->restAPI:Lcom/discord/utilities/rest/RestAPI;
|
|
|
|
|
2020-08-03 21:00:21 +00:00
|
|
|
invoke-static {}, Lrx/subjects/PublishSubject;->f0()Lrx/subjects/PublishSubject;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
iput-object v1, v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->requestBuyPlanSubject:Lrx/subjects/PublishSubject;
|
|
|
|
|
2020-08-03 21:00:21 +00:00
|
|
|
invoke-static {}, Lrx/subjects/PublishSubject;->f0()Lrx/subjects/PublishSubject;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
iput-object v1, v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->eventSubject:Lrx/subjects/PublishSubject;
|
|
|
|
|
|
|
|
invoke-direct/range {p0 .. p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->fetchData()V
|
|
|
|
|
|
|
|
invoke-static/range {p6 .. p6}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->computationLatest(Lrx/Observable;)Lrx/Observable;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
const/4 v2, 0x2
|
|
|
|
|
|
|
|
invoke-static {v1, v0, v6, v2, v6}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->ui$default(Lrx/Observable;Lcom/discord/app/AppComponent;Lcom/discord/utilities/mg_recycler/MGRecyclerAdapterSimple;ILjava/lang/Object;)Lrx/Observable;
|
|
|
|
|
|
|
|
move-result-object v7
|
|
|
|
|
|
|
|
const-class v8, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;
|
|
|
|
|
|
|
|
const/4 v9, 0x0
|
|
|
|
|
|
|
|
const/4 v10, 0x0
|
|
|
|
|
|
|
|
const/4 v11, 0x0
|
|
|
|
|
|
|
|
const/4 v12, 0x0
|
|
|
|
|
|
|
|
new-instance v13, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$1;
|
|
|
|
|
|
|
|
invoke-direct {v13, v0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$1;-><init>(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;)V
|
|
|
|
|
|
|
|
const/16 v14, 0x1e
|
|
|
|
|
|
|
|
const/4 v15, 0x0
|
|
|
|
|
|
|
|
invoke-static/range {v7 .. v15}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->appSubscribe$default(Lrx/Observable;Ljava/lang/Class;Landroid/content/Context;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const-string v1, "storeObservable"
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-static {v1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
throw v6
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
const-string v1, "restAPI"
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-static {v1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
throw v6
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
const-string v1, "storePremiumGuildSubscription"
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-static {v1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
throw v6
|
|
|
|
|
|
|
|
:cond_3
|
|
|
|
const-string v1, "storeEntitlements"
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-static {v1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
throw v6
|
|
|
|
|
|
|
|
:cond_4
|
|
|
|
const-string v1, "storeSubscriptions"
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-static {v1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
throw v6
|
|
|
|
|
|
|
|
:cond_5
|
|
|
|
const-string v1, "storePaymentsSources"
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-static {v1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
throw v6
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static final synthetic access$fetchData(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;)V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->fetchData()V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static final synthetic access$handleStoreState(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$StoreState;)V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->handleStoreState(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$StoreState;)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static final synthetic access$onCancelError(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;)V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->onCancelError()V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static final synthetic access$onChangePaymentSourceError(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;)V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->onChangePaymentSourceError()V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static final synthetic access$onChangePlanError(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;)V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->onChangePlanError()V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static final synthetic access$onResubscribeError(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;)V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->onResubscribeError()V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private final fetchData()V
|
|
|
|
.locals 3
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->storePaymentsSources:Lcom/discord/stores/StorePaymentSources;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StorePaymentSources;->fetchPaymentSources()V
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->storeSubscriptions:Lcom/discord/stores/StoreSubscriptions;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreSubscriptions;->fetchSubscriptions()V
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->storeEntitlements:Lcom/discord/stores/StoreEntitlements;
|
|
|
|
|
|
|
|
const-wide v1, 0x73df54a4a020016L
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1, v2}, Lcom/discord/stores/StoreEntitlements;->fetchMyEntitlementsForApplication(J)V
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->storePremiumGuildSubscription:Lcom/discord/stores/StorePremiumGuildSubscription;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StorePremiumGuildSubscription;->fetchUserGuildPremiumState()V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private final handleStoreState(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$StoreState;)V
|
|
|
|
.locals 17
|
|
|
|
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$StoreState;->getPaymentSourcesState()Lcom/discord/stores/StorePaymentSources$PaymentSourcesState;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$StoreState;->getSubscriptionsState()Lcom/discord/stores/StoreSubscriptions$SubscriptionsState;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$StoreState;->getEntitlementState()Lcom/discord/stores/StoreEntitlements$State;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$StoreState;->getGuildSubscriptionState()Lcom/discord/stores/StorePremiumGuildSubscription$State;
|
|
|
|
|
|
|
|
move-result-object v3
|
|
|
|
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$StoreState;->getInvoicePreviewFetch()Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$InvoicePreviewFetch;
|
|
|
|
|
|
|
|
move-result-object v4
|
|
|
|
|
|
|
|
instance-of v5, v0, Lcom/discord/stores/StorePaymentSources$PaymentSourcesState$Loaded;
|
|
|
|
|
|
|
|
if-eqz v5, :cond_5
|
|
|
|
|
|
|
|
instance-of v5, v1, Lcom/discord/stores/StoreSubscriptions$SubscriptionsState$Loaded;
|
|
|
|
|
|
|
|
if-eqz v5, :cond_5
|
|
|
|
|
|
|
|
instance-of v5, v2, Lcom/discord/stores/StoreEntitlements$State$Loaded;
|
|
|
|
|
|
|
|
if-eqz v5, :cond_5
|
|
|
|
|
|
|
|
instance-of v5, v3, Lcom/discord/stores/StorePremiumGuildSubscription$State$Loaded;
|
|
|
|
|
|
|
|
if-eqz v5, :cond_5
|
|
|
|
|
|
|
|
instance-of v5, v4, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$InvoicePreviewFetch$Invoice;
|
|
|
|
|
|
|
|
if-eqz v5, :cond_5
|
|
|
|
|
|
|
|
check-cast v1, Lcom/discord/stores/StoreSubscriptions$SubscriptionsState$Loaded;
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Lcom/discord/stores/StoreSubscriptions$SubscriptionsState$Loaded;->getSubscriptions()Ljava/util/List;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
invoke-interface {v1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
|
|
|
|
move-result v5
|
|
|
|
|
|
|
|
const/4 v6, 0x1
|
|
|
|
|
|
|
|
const/4 v7, 0x0
|
|
|
|
|
|
|
|
if-eqz v5, :cond_2
|
|
|
|
|
|
|
|
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v5
|
|
|
|
|
|
|
|
move-object v8, v5
|
|
|
|
|
|
|
|
check-cast v8, Lcom/discord/models/domain/ModelSubscription;
|
|
|
|
|
|
|
|
invoke-virtual {v8}, Lcom/discord/models/domain/ModelSubscription;->getType()Lcom/discord/models/domain/ModelSubscription$Type;
|
|
|
|
|
|
|
|
move-result-object v8
|
|
|
|
|
|
|
|
sget-object v9, Lcom/discord/models/domain/ModelSubscription$Type;->PREMIUM:Lcom/discord/models/domain/ModelSubscription$Type;
|
|
|
|
|
|
|
|
if-ne v8, v9, :cond_1
|
|
|
|
|
|
|
|
const/4 v8, 0x1
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
const/4 v8, 0x0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
if-eqz v8, :cond_0
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
const/4 v5, 0x0
|
|
|
|
|
|
|
|
:goto_1
|
|
|
|
move-object v9, v5
|
|
|
|
|
|
|
|
check-cast v9, Lcom/discord/models/domain/ModelSubscription;
|
|
|
|
|
|
|
|
if-eqz v9, :cond_3
|
|
|
|
|
|
|
|
const/4 v1, 0x2
|
|
|
|
|
|
|
|
new-array v1, v1, [Ljava/lang/Long;
|
|
|
|
|
|
|
|
sget-object v5, Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;->PREMIUM_GUILD_MONTH:Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;
|
|
|
|
|
|
|
|
invoke-virtual {v5}, Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;->getPlanId()J
|
|
|
|
|
|
|
|
move-result-wide v10
|
|
|
|
|
|
|
|
invoke-static {v10, v11}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
|
|
|
|
move-result-object v5
|
|
|
|
|
|
|
|
aput-object v5, v1, v7
|
|
|
|
|
|
|
|
sget-object v5, Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;->PREMIUM_GUILD_YEAR:Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;
|
|
|
|
|
|
|
|
invoke-virtual {v5}, Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;->getPlanId()J
|
|
|
|
|
|
|
|
move-result-wide v7
|
|
|
|
|
|
|
|
invoke-static {v7, v8}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
|
|
|
|
move-result-object v5
|
|
|
|
|
|
|
|
aput-object v5, v1, v6
|
|
|
|
|
2020-07-25 02:57:47 +00:00
|
|
|
invoke-static {v1}, Lf/n/a/k/a;->setOf([Ljava/lang/Object;)Ljava/util/Set;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
invoke-virtual {v9, v1}, Lcom/discord/models/domain/ModelSubscription;->hasAnyOfPlans(Ljava/util/Set;)Z
|
|
|
|
|
|
|
|
move-result v7
|
|
|
|
|
|
|
|
move v15, v7
|
|
|
|
|
|
|
|
goto :goto_2
|
|
|
|
|
|
|
|
:cond_3
|
|
|
|
const/4 v15, 0x0
|
|
|
|
|
|
|
|
:goto_2
|
|
|
|
new-instance v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
|
|
|
|
check-cast v0, Lcom/discord/stores/StorePaymentSources$PaymentSourcesState$Loaded;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StorePaymentSources$PaymentSourcesState$Loaded;->getPaymentSources()Ljava/util/List;
|
|
|
|
|
|
|
|
move-result-object v10
|
|
|
|
|
|
|
|
const/4 v11, 0x0
|
|
|
|
|
|
|
|
const/4 v12, 0x0
|
|
|
|
|
|
|
|
check-cast v2, Lcom/discord/stores/StoreEntitlements$State$Loaded;
|
|
|
|
|
|
|
|
invoke-virtual {v2}, Lcom/discord/stores/StoreEntitlements$State$Loaded;->getOwnedEntitlements()Ljava/util/Map;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
const-wide v5, 0x73df54a4a020016L
|
|
|
|
|
|
|
|
invoke-static {v5, v6}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
invoke-interface {v0, v2}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
check-cast v0, Ljava/util/List;
|
|
|
|
|
|
|
|
if-eqz v0, :cond_4
|
|
|
|
|
|
|
|
goto :goto_3
|
|
|
|
|
|
|
|
:cond_4
|
2020-07-25 00:57:58 +00:00
|
|
|
sget-object v0, Lj0/i/n;->d:Lj0/i/n;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
:goto_3
|
|
|
|
move-object v13, v0
|
|
|
|
|
|
|
|
check-cast v3, Lcom/discord/stores/StorePremiumGuildSubscription$State$Loaded;
|
|
|
|
|
|
|
|
invoke-virtual {v3}, Lcom/discord/stores/StorePremiumGuildSubscription$State$Loaded;->getPremiumGuildSubscriptionSlotMap()Ljava/util/Map;
|
|
|
|
|
|
|
|
move-result-object v14
|
|
|
|
|
|
|
|
check-cast v4, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$InvoicePreviewFetch$Invoice;
|
|
|
|
|
|
|
|
invoke-virtual {v4}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$InvoicePreviewFetch$Invoice;->getModelInvoicePreview()Lcom/discord/models/domain/billing/ModelInvoicePreview;
|
|
|
|
|
|
|
|
move-result-object v16
|
|
|
|
|
|
|
|
move-object v8, v1
|
|
|
|
|
|
|
|
invoke-direct/range {v8 .. v16}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;-><init>(Lcom/discord/models/domain/ModelSubscription;Ljava/util/List;ZLcom/discord/widgets/settings/premium/SettingsPremiumViewModel$SubscriptionError;Ljava/util/List;Ljava/util/Map;ZLcom/discord/models/domain/billing/ModelInvoicePreview;)V
|
|
|
|
|
|
|
|
goto :goto_5
|
|
|
|
|
|
|
|
:cond_5
|
|
|
|
instance-of v0, v0, Lcom/discord/stores/StorePaymentSources$PaymentSourcesState$Failure;
|
|
|
|
|
|
|
|
if-nez v0, :cond_7
|
|
|
|
|
|
|
|
instance-of v0, v1, Lcom/discord/stores/StoreSubscriptions$SubscriptionsState$Failure;
|
|
|
|
|
|
|
|
if-nez v0, :cond_7
|
|
|
|
|
|
|
|
instance-of v0, v3, Lcom/discord/stores/StorePremiumGuildSubscription$State$Failure;
|
|
|
|
|
|
|
|
if-nez v0, :cond_7
|
|
|
|
|
|
|
|
instance-of v0, v4, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$InvoicePreviewFetch$Error;
|
|
|
|
|
|
|
|
if-eqz v0, :cond_6
|
|
|
|
|
|
|
|
goto :goto_4
|
|
|
|
|
|
|
|
:cond_6
|
|
|
|
sget-object v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loading;->INSTANCE:Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loading;
|
|
|
|
|
|
|
|
goto :goto_5
|
|
|
|
|
|
|
|
:cond_7
|
|
|
|
:goto_4
|
|
|
|
sget-object v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Failure;->INSTANCE:Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Failure;
|
|
|
|
|
|
|
|
:goto_5
|
|
|
|
move-object/from16 v0, p0
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-virtual {v0, v1}, Lf/a/b/o0;->updateViewState(Ljava/lang/Object;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private final markBusy()V
|
|
|
|
.locals 12
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-virtual {p0}, Lf/a/b/o0;->getViewState()Ljava/lang/Object;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
instance-of v1, v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
move-object v1, v0
|
|
|
|
|
|
|
|
check-cast v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
|
|
|
|
const/4 v2, 0x0
|
|
|
|
|
|
|
|
const/4 v3, 0x0
|
|
|
|
|
|
|
|
const/4 v4, 0x1
|
|
|
|
|
|
|
|
const/4 v5, 0x0
|
|
|
|
|
|
|
|
const/4 v6, 0x0
|
|
|
|
|
|
|
|
const/4 v7, 0x0
|
|
|
|
|
|
|
|
const/4 v8, 0x0
|
|
|
|
|
|
|
|
const/4 v9, 0x0
|
|
|
|
|
|
|
|
const/16 v10, 0xf3
|
|
|
|
|
|
|
|
const/4 v11, 0x0
|
|
|
|
|
|
|
|
invoke-static/range {v1 .. v11}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;->copy$default(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;Lcom/discord/models/domain/ModelSubscription;Ljava/util/List;ZLcom/discord/widgets/settings/premium/SettingsPremiumViewModel$SubscriptionError;Ljava/util/List;Ljava/util/Map;ZLcom/discord/models/domain/billing/ModelInvoicePreview;ILjava/lang/Object;)Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-virtual {p0, v0}, Lf/a/b/o0;->updateViewState(Ljava/lang/Object;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
:cond_1
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private final onCancelError()V
|
|
|
|
.locals 3
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-virtual {p0}, Lf/a/b/o0;->getViewState()Ljava/lang/Object;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
instance-of v0, v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->eventSubject:Lrx/subjects/PublishSubject;
|
|
|
|
|
|
|
|
new-instance v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Event$ErrorToast;
|
|
|
|
|
2020-08-03 21:00:21 +00:00
|
|
|
const v2, 0x7f12112d
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
invoke-direct {v1, v2}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Event$ErrorToast;-><init>(I)V
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
iget-object v0, v0, Lrx/subjects/PublishSubject;->e:Lrx/subjects/PublishSubject$b;
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Lrx/subjects/PublishSubject$b;->onNext(Ljava/lang/Object;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private final onChangePaymentSourceError()V
|
|
|
|
.locals 12
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-virtual {p0}, Lf/a/b/o0;->getViewState()Ljava/lang/Object;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
instance-of v1, v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
move-object v1, v0
|
|
|
|
|
|
|
|
check-cast v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
|
|
|
|
const/4 v2, 0x0
|
|
|
|
|
|
|
|
const/4 v3, 0x0
|
|
|
|
|
|
|
|
const/4 v4, 0x0
|
|
|
|
|
|
|
|
sget-object v5, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$SubscriptionError;->GENERIC:Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$SubscriptionError;
|
|
|
|
|
|
|
|
const/4 v6, 0x0
|
|
|
|
|
|
|
|
const/4 v7, 0x0
|
|
|
|
|
|
|
|
const/4 v8, 0x0
|
|
|
|
|
|
|
|
const/4 v9, 0x0
|
|
|
|
|
|
|
|
const/16 v10, 0xf3
|
|
|
|
|
|
|
|
const/4 v11, 0x0
|
|
|
|
|
|
|
|
invoke-static/range {v1 .. v11}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;->copy$default(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;Lcom/discord/models/domain/ModelSubscription;Ljava/util/List;ZLcom/discord/widgets/settings/premium/SettingsPremiumViewModel$SubscriptionError;Ljava/util/List;Ljava/util/Map;ZLcom/discord/models/domain/billing/ModelInvoicePreview;ILjava/lang/Object;)Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-virtual {p0, v0}, Lf/a/b/o0;->updateViewState(Ljava/lang/Object;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
:cond_1
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private final onChangePlanError()V
|
|
|
|
.locals 3
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-virtual {p0}, Lf/a/b/o0;->getViewState()Ljava/lang/Object;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
instance-of v0, v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->eventSubject:Lrx/subjects/PublishSubject;
|
|
|
|
|
|
|
|
new-instance v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Event$ErrorToast;
|
|
|
|
|
2020-08-03 21:00:21 +00:00
|
|
|
const v2, 0x7f12112d
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
invoke-direct {v1, v2}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Event$ErrorToast;-><init>(I)V
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
iget-object v0, v0, Lrx/subjects/PublishSubject;->e:Lrx/subjects/PublishSubject$b;
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Lrx/subjects/PublishSubject$b;->onNext(Ljava/lang/Object;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private final onDowngradeClicked()V
|
|
|
|
.locals 2
|
|
|
|
.annotation build Landroidx/annotation/UiThread;
|
|
|
|
.end annotation
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-virtual {p0}, Lf/a/b/o0;->getViewState()Ljava/lang/Object;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
instance-of v0, v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->eventSubject:Lrx/subjects/PublishSubject;
|
|
|
|
|
|
|
|
sget-object v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Event$DowngradePremium;->INSTANCE:Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Event$DowngradePremium;
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
iget-object v0, v0, Lrx/subjects/PublishSubject;->e:Lrx/subjects/PublishSubject$b;
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Lrx/subjects/PublishSubject$b;->onNext(Ljava/lang/Object;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private final onResubscribeError()V
|
|
|
|
.locals 12
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-virtual {p0}, Lf/a/b/o0;->getViewState()Ljava/lang/Object;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
instance-of v1, v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
move-object v1, v0
|
|
|
|
|
|
|
|
check-cast v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
|
|
|
|
const/4 v2, 0x0
|
|
|
|
|
|
|
|
const/4 v3, 0x0
|
|
|
|
|
|
|
|
const/4 v4, 0x0
|
|
|
|
|
|
|
|
sget-object v5, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$SubscriptionError;->GENERIC:Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$SubscriptionError;
|
|
|
|
|
|
|
|
const/4 v6, 0x0
|
|
|
|
|
|
|
|
const/4 v7, 0x0
|
|
|
|
|
|
|
|
const/4 v8, 0x0
|
|
|
|
|
|
|
|
const/4 v9, 0x0
|
|
|
|
|
|
|
|
const/16 v10, 0xf3
|
|
|
|
|
|
|
|
const/4 v11, 0x0
|
|
|
|
|
|
|
|
invoke-static/range {v1 .. v11}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;->copy$default(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;Lcom/discord/models/domain/ModelSubscription;Ljava/util/List;ZLcom/discord/widgets/settings/premium/SettingsPremiumViewModel$SubscriptionError;Ljava/util/List;Ljava/util/Map;ZLcom/discord/models/domain/billing/ModelInvoicePreview;ILjava/lang/Object;)Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-virtual {p0, v0}, Lf/a/b/o0;->updateViewState(Ljava/lang/Object;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
:cond_1
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private final onUpgradeClicked(Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;)V
|
|
|
|
.locals 5
|
|
|
|
.annotation build Landroidx/annotation/UiThread;
|
|
|
|
.end annotation
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-virtual {p0}, Lf/a/b/o0;->getViewState()Ljava/lang/Object;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
instance-of v0, v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->eventSubject:Lrx/subjects/PublishSubject;
|
|
|
|
|
|
|
|
new-instance v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Event$UpgradePremium;
|
|
|
|
|
|
|
|
const/4 v2, 0x0
|
|
|
|
|
|
|
|
const/4 v3, 0x2
|
|
|
|
|
|
|
|
const/4 v4, 0x0
|
|
|
|
|
|
|
|
invoke-direct {v1, p1, v2, v3, v4}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Event$UpgradePremium;-><init>(Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;ZILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
iget-object p1, v0, Lrx/subjects/PublishSubject;->e:Lrx/subjects/PublishSubject$b;
|
|
|
|
|
|
|
|
invoke-virtual {p1, v1}, Lrx/subjects/PublishSubject$b;->onNext(Ljava/lang/Object;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
|
|
|
|
# virtual methods
|
|
|
|
.method public final cancelPlanChange()V
|
|
|
|
.locals 13
|
|
|
|
.annotation build Landroidx/annotation/UiThread;
|
|
|
|
.end annotation
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-virtual {p0}, Lf/a/b/o0;->getViewState()Ljava/lang/Object;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
instance-of v1, v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
|
|
|
|
const/4 v2, 0x0
|
|
|
|
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
|
|
|
|
move-object v0, v2
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
check-cast v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;->getPremiumSubscription()Lcom/discord/models/domain/ModelSubscription;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->markBusy()V
|
|
|
|
|
|
|
|
iget-object v1, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->restAPI:Lcom/discord/utilities/rest/RestAPI;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelSubscription;->getId()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v3
|
|
|
|
|
|
|
|
new-instance v11, Lcom/discord/restapi/RestAPIParams$UpdateSubscription;
|
|
|
|
|
|
|
|
const/4 v12, 0x1
|
|
|
|
|
|
|
|
invoke-static {v12}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
|
|
|
|
move-result-object v5
|
|
|
|
|
|
|
|
const/4 v6, 0x0
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelSubscription;->getPlanId()J
|
|
|
|
|
|
|
|
move-result-wide v7
|
|
|
|
|
|
|
|
invoke-static {v7, v8}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
|
|
|
|
move-result-object v7
|
|
|
|
|
|
|
|
const/4 v8, 0x0
|
|
|
|
|
|
|
|
const/16 v9, 0xa
|
|
|
|
|
|
|
|
const/4 v10, 0x0
|
|
|
|
|
|
|
|
move-object v4, v11
|
|
|
|
|
|
|
|
invoke-direct/range {v4 .. v10}, Lcom/discord/restapi/RestAPIParams$UpdateSubscription;-><init>(Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Long;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
|
|
|
|
invoke-virtual {v1, v3, v11}, Lcom/discord/utilities/rest/RestAPI;->updateSubscription(Ljava/lang/String;Lcom/discord/restapi/RestAPIParams$UpdateSubscription;)Lrx/Observable;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
const/4 v1, 0x0
|
|
|
|
|
|
|
|
invoke-static {v0, v1, v12, v2}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->restSubscribeOn$default(Lrx/Observable;ZILjava/lang/Object;)Lrx/Observable;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
const/4 v1, 0x2
|
|
|
|
|
|
|
|
invoke-static {v0, p0, v2, v1, v2}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->ui$default(Lrx/Observable;Lcom/discord/app/AppComponent;Lcom/discord/utilities/mg_recycler/MGRecyclerAdapterSimple;ILjava/lang/Object;)Lrx/Observable;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
new-instance v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$cancelPlanChange$1;
|
|
|
|
|
|
|
|
invoke-direct {v1, p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$cancelPlanChange$1;-><init>(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;)V
|
|
|
|
|
|
|
|
new-instance v2, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$cancelPlanChange$2;
|
|
|
|
|
|
|
|
invoke-direct {v2, p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$cancelPlanChange$2;-><init>(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;)V
|
|
|
|
|
2020-08-03 21:00:21 +00:00
|
|
|
invoke-virtual {v0, v1, v2}, Lrx/Observable;->R(Lrx/functions/Action1;Lrx/functions/Action1;)Lrx/Subscription;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
:cond_1
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final cancelSubscription()V
|
|
|
|
.locals 4
|
|
|
|
.annotation build Landroidx/annotation/UiThread;
|
|
|
|
.end annotation
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-virtual {p0}, Lf/a/b/o0;->getViewState()Ljava/lang/Object;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
instance-of v1, v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
|
|
|
|
const/4 v2, 0x0
|
|
|
|
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
|
|
|
|
move-object v0, v2
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
check-cast v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;->getPremiumSubscription()Lcom/discord/models/domain/ModelSubscription;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->markBusy()V
|
|
|
|
|
|
|
|
iget-object v1, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->restAPI:Lcom/discord/utilities/rest/RestAPI;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelSubscription;->getId()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-virtual {v1, v0}, Lcom/discord/utilities/rest/RestAPI;->deleteSubscription(Ljava/lang/String;)Lrx/Observable;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
const/4 v1, 0x0
|
|
|
|
|
|
|
|
const/4 v3, 0x1
|
|
|
|
|
|
|
|
invoke-static {v0, v1, v3, v2}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->restSubscribeOn$default(Lrx/Observable;ZILjava/lang/Object;)Lrx/Observable;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
const/4 v1, 0x2
|
|
|
|
|
|
|
|
invoke-static {v0, p0, v2, v1, v2}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->ui$default(Lrx/Observable;Lcom/discord/app/AppComponent;Lcom/discord/utilities/mg_recycler/MGRecyclerAdapterSimple;ILjava/lang/Object;)Lrx/Observable;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
new-instance v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$cancelSubscription$1;
|
|
|
|
|
|
|
|
invoke-direct {v1, p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$cancelSubscription$1;-><init>(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;)V
|
|
|
|
|
|
|
|
new-instance v2, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$cancelSubscription$2;
|
|
|
|
|
|
|
|
invoke-direct {v2, p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$cancelSubscription$2;-><init>(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;)V
|
|
|
|
|
2020-08-03 21:00:21 +00:00
|
|
|
invoke-virtual {v0, v1, v2}, Lrx/Observable;->R(Lrx/functions/Action1;Lrx/functions/Action1;)Lrx/Subscription;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
:cond_1
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final changePaymentSource(Lcom/discord/models/domain/ModelPaymentSource;)V
|
|
|
|
.locals 11
|
|
|
|
.annotation build Landroidx/annotation/UiThread;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-virtual {p0}, Lf/a/b/o0;->getViewState()Ljava/lang/Object;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
instance-of v2, v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
|
|
|
|
if-nez v2, :cond_0
|
|
|
|
|
|
|
|
move-object v1, v0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
check-cast v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;->getPremiumSubscription()Lcom/discord/models/domain/ModelSubscription;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->markBusy()V
|
|
|
|
|
|
|
|
iget-object v2, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->restAPI:Lcom/discord/utilities/rest/RestAPI;
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Lcom/discord/models/domain/ModelSubscription;->getId()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
new-instance v10, Lcom/discord/restapi/RestAPIParams$UpdateSubscription;
|
|
|
|
|
|
|
|
const/4 v4, 0x0
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelPaymentSource;->getId()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v5
|
|
|
|
|
|
|
|
const/4 v6, 0x0
|
|
|
|
|
|
|
|
const/4 v7, 0x0
|
|
|
|
|
|
|
|
const/16 v8, 0xd
|
|
|
|
|
|
|
|
const/4 v9, 0x0
|
|
|
|
|
|
|
|
move-object v3, v10
|
|
|
|
|
|
|
|
invoke-direct/range {v3 .. v9}, Lcom/discord/restapi/RestAPIParams$UpdateSubscription;-><init>(Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Long;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
|
|
|
|
invoke-virtual {v2, v1, v10}, Lcom/discord/utilities/rest/RestAPI;->updateSubscription(Ljava/lang/String;Lcom/discord/restapi/RestAPIParams$UpdateSubscription;)Lrx/Observable;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
const/4 v1, 0x0
|
|
|
|
|
|
|
|
const/4 v2, 0x1
|
|
|
|
|
|
|
|
invoke-static {p1, v1, v2, v0}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->restSubscribeOn$default(Lrx/Observable;ZILjava/lang/Object;)Lrx/Observable;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
const/4 v1, 0x2
|
|
|
|
|
|
|
|
invoke-static {p1, p0, v0, v1, v0}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->ui$default(Lrx/Observable;Lcom/discord/app/AppComponent;Lcom/discord/utilities/mg_recycler/MGRecyclerAdapterSimple;ILjava/lang/Object;)Lrx/Observable;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
new-instance v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$changePaymentSource$1;
|
|
|
|
|
|
|
|
invoke-direct {v0, p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$changePaymentSource$1;-><init>(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;)V
|
|
|
|
|
|
|
|
new-instance v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$changePaymentSource$2;
|
|
|
|
|
|
|
|
invoke-direct {v1, p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$changePaymentSource$2;-><init>(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;)V
|
|
|
|
|
2020-08-03 21:00:21 +00:00
|
|
|
invoke-virtual {p1, v0, v1}, Lrx/Observable;->R(Lrx/functions/Action1;Lrx/functions/Action1;)Lrx/Subscription;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
:cond_1
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
const-string p1, "paymentSource"
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
throw v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final getEventSubject()Lrx/Observable;
|
|
|
|
.locals 2
|
|
|
|
.annotation build Landroidx/annotation/UiThread;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"()",
|
|
|
|
"Lrx/Observable<",
|
|
|
|
"Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Event;",
|
|
|
|
">;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->eventSubject:Lrx/subjects/PublishSubject;
|
|
|
|
|
|
|
|
const-string v1, "eventSubject"
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-static {v0, v1}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final getLaunchPremiumTabStartTimeMs()J
|
|
|
|
.locals 2
|
|
|
|
|
|
|
|
iget-wide v0, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->launchPremiumTabStartTimeMs:J
|
|
|
|
|
|
|
|
return-wide v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final getRequestBuyPlanSubject()Lrx/Observable;
|
|
|
|
.locals 2
|
|
|
|
.annotation build Landroidx/annotation/UiThread;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"()",
|
|
|
|
"Lrx/Observable<",
|
|
|
|
"Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;",
|
|
|
|
">;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->requestBuyPlanSubject:Lrx/subjects/PublishSubject;
|
|
|
|
|
|
|
|
const-string v1, "requestBuyPlanSubject"
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-static {v0, v1}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final getRestAPI()Lcom/discord/utilities/rest/RestAPI;
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->restAPI:Lcom/discord/utilities/rest/RestAPI;
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final getStoreEntitlements()Lcom/discord/stores/StoreEntitlements;
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->storeEntitlements:Lcom/discord/stores/StoreEntitlements;
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final getStorePaymentsSources()Lcom/discord/stores/StorePaymentSources;
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->storePaymentsSources:Lcom/discord/stores/StorePaymentSources;
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final getStorePremiumGuildSubscription()Lcom/discord/stores/StorePremiumGuildSubscription;
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->storePremiumGuildSubscription:Lcom/discord/stores/StorePremiumGuildSubscription;
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final getStoreSubscriptions()Lcom/discord/stores/StoreSubscriptions;
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->storeSubscriptions:Lcom/discord/stores/StoreSubscriptions;
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final onPlanRequested(Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;)V
|
|
|
|
.locals 3
|
|
|
|
.annotation build Landroidx/annotation/UiThread;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
if-eqz p1, :cond_6
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-virtual {p0}, Lf/a/b/o0;->getViewState()Ljava/lang/Object;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
instance-of v2, v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
|
|
|
|
if-nez v2, :cond_0
|
|
|
|
|
|
|
|
move-object v1, v0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
check-cast v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
|
|
|
|
if-eqz v1, :cond_5
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;->getPremiumSubscription()Lcom/discord/models/domain/ModelSubscription;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Lcom/discord/models/domain/ModelSubscription;->getPlanType()Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
if-nez v0, :cond_2
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->requestBuyPlanSubject:Lrx/subjects/PublishSubject;
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
iget-object v0, v0, Lrx/subjects/PublishSubject;->e:Lrx/subjects/PublishSubject$b;
|
|
|
|
|
|
|
|
invoke-virtual {v0, p1}, Lrx/subjects/PublishSubject$b;->onNext(Ljava/lang/Object;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
if-ne p1, v0, :cond_3
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_3
|
|
|
|
invoke-static {}, Lcom/discord/utilities/billing/PremiumUtilsKt;->getUPGRADE_ELIGIBILITY()Ljava/util/Map;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
invoke-interface {v1, v0}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
check-cast v0, Ljava/util/Set;
|
|
|
|
|
|
|
|
if-eqz v0, :cond_4
|
|
|
|
|
|
|
|
invoke-interface {v0, p1}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
const/4 v1, 0x1
|
|
|
|
|
|
|
|
if-ne v0, v1, :cond_4
|
|
|
|
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->onUpgradeClicked(Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;)V
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_4
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->onDowngradeClicked()V
|
|
|
|
|
|
|
|
:cond_5
|
|
|
|
:goto_0
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:cond_6
|
|
|
|
const-string p1, "requestedPlanType"
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
throw v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final onRetryClicked()V
|
|
|
|
.locals 0
|
|
|
|
.annotation build Landroidx/annotation/UiThread;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->fetchData()V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final resubscribe()V
|
|
|
|
.locals 11
|
|
|
|
.annotation build Landroidx/annotation/UiThread;
|
|
|
|
.end annotation
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-virtual {p0}, Lf/a/b/o0;->getViewState()Ljava/lang/Object;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
instance-of v1, v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
|
|
|
|
const/4 v2, 0x0
|
|
|
|
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
|
|
|
|
move-object v0, v2
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
check-cast v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;->getPremiumSubscription()Lcom/discord/models/domain/ModelSubscription;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelSubscription;->getStatus()Lcom/discord/models/domain/ModelSubscription$Status;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
sget-object v3, Lcom/discord/models/domain/ModelSubscription$Status;->CANCELED:Lcom/discord/models/domain/ModelSubscription$Status;
|
|
|
|
|
|
|
|
if-eq v1, v3, :cond_1
|
|
|
|
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->markBusy()V
|
|
|
|
|
|
|
|
iget-object v1, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->restAPI:Lcom/discord/utilities/rest/RestAPI;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelSubscription;->getId()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
new-instance v10, Lcom/discord/restapi/RestAPIParams$UpdateSubscription;
|
|
|
|
|
|
|
|
sget-object v3, Lcom/discord/models/domain/ModelSubscription$Status;->ACTIVE:Lcom/discord/models/domain/ModelSubscription$Status;
|
|
|
|
|
|
|
|
invoke-virtual {v3}, Lcom/discord/models/domain/ModelSubscription$Status;->getIntRepresentation()I
|
|
|
|
|
|
|
|
move-result v3
|
|
|
|
|
|
|
|
invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
|
|
|
|
move-result-object v4
|
|
|
|
|
|
|
|
const/4 v5, 0x0
|
|
|
|
|
|
|
|
const/4 v6, 0x0
|
|
|
|
|
|
|
|
const/4 v7, 0x0
|
|
|
|
|
|
|
|
const/16 v8, 0xe
|
|
|
|
|
|
|
|
const/4 v9, 0x0
|
|
|
|
|
|
|
|
move-object v3, v10
|
|
|
|
|
|
|
|
invoke-direct/range {v3 .. v9}, Lcom/discord/restapi/RestAPIParams$UpdateSubscription;-><init>(Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/Long;Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
|
|
|
|
invoke-virtual {v1, v0, v10}, Lcom/discord/utilities/rest/RestAPI;->updateSubscription(Ljava/lang/String;Lcom/discord/restapi/RestAPIParams$UpdateSubscription;)Lrx/Observable;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
const/4 v1, 0x0
|
|
|
|
|
|
|
|
const/4 v3, 0x1
|
|
|
|
|
|
|
|
invoke-static {v0, v1, v3, v2}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->restSubscribeOn$default(Lrx/Observable;ZILjava/lang/Object;)Lrx/Observable;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
const/4 v1, 0x2
|
|
|
|
|
|
|
|
invoke-static {v0, p0, v2, v1, v2}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->ui$default(Lrx/Observable;Lcom/discord/app/AppComponent;Lcom/discord/utilities/mg_recycler/MGRecyclerAdapterSimple;ILjava/lang/Object;)Lrx/Observable;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
new-instance v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$resubscribe$1;
|
|
|
|
|
|
|
|
invoke-direct {v1, p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$resubscribe$1;-><init>(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;)V
|
|
|
|
|
|
|
|
new-instance v2, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$resubscribe$2;
|
|
|
|
|
|
|
|
invoke-direct {v2, p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$resubscribe$2;-><init>(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;)V
|
|
|
|
|
2020-08-03 21:00:21 +00:00
|
|
|
invoke-virtual {v0, v1, v2}, Lrx/Observable;->R(Lrx/functions/Action1;Lrx/functions/Action1;)Lrx/Subscription;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
:cond_2
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final setLaunchPremiumTabStartTimeMs(J)V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iput-wide p1, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->launchPremiumTabStartTimeMs:J
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final showCancelPlanChangeDialog(Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;)V
|
|
|
|
.locals 3
|
|
|
|
.annotation build Landroidx/annotation/UiThread;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-virtual {p0}, Lf/a/b/o0;->getViewState()Ljava/lang/Object;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
instance-of v2, v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
|
|
|
|
if-nez v2, :cond_0
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
move-object v0, v1
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
check-cast v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;->getPremiumSubscription()Lcom/discord/models/domain/ModelSubscription;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
|
|
|
|
iget-object v1, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->eventSubject:Lrx/subjects/PublishSubject;
|
|
|
|
|
|
|
|
new-instance v2, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Event$CancelPlanChange;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelSubscription;->getPlanType()Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-direct {v2, p1, v0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Event$CancelPlanChange;-><init>(Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;)V
|
|
|
|
|
2020-07-08 16:44:49 +00:00
|
|
|
iget-object p1, v1, Lrx/subjects/PublishSubject;->e:Lrx/subjects/PublishSubject$b;
|
|
|
|
|
|
|
|
invoke-virtual {p1, v2}, Lrx/subjects/PublishSubject$b;->onNext(Ljava/lang/Object;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
:cond_1
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
const-string p1, "targetPlanType"
|
|
|
|
|
2020-07-25 00:57:58 +00:00
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
throw v0
|
|
|
|
.end method
|