forked from Juby210/discord-jadx
84 lines
3.9 KiB
Java
84 lines
3.9 KiB
Java
package com.discord.widgets.stage;
|
|
|
|
import c0.g;
|
|
import c0.z.d.m;
|
|
import com.discord.models.experiments.domain.Experiment;
|
|
import com.discord.stores.StoreExperiments;
|
|
import com.discord.stores.StoreStream;
|
|
import com.discord.stores.updates.ObservationDeck;
|
|
import com.discord.stores.updates.ObservationDeckProvider;
|
|
import kotlin.Lazy;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import rx.Observable;
|
|
/* compiled from: LiveStageNotificationsFeatureFlag.kt */
|
|
public final class LiveStageNotificationsFeatureFlag {
|
|
public static final Companion Companion = new Companion(null);
|
|
private static final Lazy INSTANCE$delegate = g.lazy(LiveStageNotificationsFeatureFlag$Companion$INSTANCE$2.INSTANCE);
|
|
private final ObservationDeck observationDeck;
|
|
private final StoreExperiments storeExperiments;
|
|
|
|
/* compiled from: LiveStageNotificationsFeatureFlag.kt */
|
|
public static final class Companion {
|
|
private Companion() {
|
|
}
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
|
|
public final LiveStageNotificationsFeatureFlag getINSTANCE() {
|
|
Lazy access$getINSTANCE$cp = LiveStageNotificationsFeatureFlag.access$getINSTANCE$cp();
|
|
Companion companion = LiveStageNotificationsFeatureFlag.Companion;
|
|
return (LiveStageNotificationsFeatureFlag) access$getINSTANCE$cp.getValue();
|
|
}
|
|
}
|
|
|
|
public LiveStageNotificationsFeatureFlag() {
|
|
this(null, null, 3, null);
|
|
}
|
|
|
|
public LiveStageNotificationsFeatureFlag(StoreExperiments storeExperiments, ObservationDeck observationDeck) {
|
|
m.checkNotNullParameter(storeExperiments, "storeExperiments");
|
|
m.checkNotNullParameter(observationDeck, "observationDeck");
|
|
this.storeExperiments = storeExperiments;
|
|
this.observationDeck = observationDeck;
|
|
}
|
|
|
|
/* JADX INFO: this call moved to the top of the method (can break code semantics) */
|
|
public /* synthetic */ LiveStageNotificationsFeatureFlag(StoreExperiments storeExperiments, ObservationDeck observationDeck, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
|
this((i & 1) != 0 ? StoreStream.Companion.getExperiments() : storeExperiments, (i & 2) != 0 ? ObservationDeckProvider.get() : observationDeck);
|
|
}
|
|
|
|
public static final /* synthetic */ Lazy access$getINSTANCE$cp() {
|
|
return INSTANCE$delegate;
|
|
}
|
|
|
|
public final Experiment getExperiment(long j) {
|
|
return this.storeExperiments.getGuildExperiment("2021-07_live_stage_notifications", j, false);
|
|
}
|
|
|
|
public final Observable<Experiment> observeExperiment(long j) {
|
|
Observable<Experiment> q = ObservationDeck.connectRx$default(this.observationDeck, new ObservationDeck.UpdateSource[]{this.storeExperiments}, false, null, null, new LiveStageNotificationsFeatureFlag$observeExperiment$1(this, j), 14, null).q();
|
|
m.checkNotNullExpressionValue(q, "observationDeck.connectR… }.distinctUntilChanged()");
|
|
return q;
|
|
}
|
|
|
|
public final Observable<Boolean> observeShowNotificationSurfaces(long j) {
|
|
Observable<Boolean> q = ObservationDeck.connectRx$default(this.observationDeck, new ObservationDeck.UpdateSource[]{this.storeExperiments}, false, null, null, new LiveStageNotificationsFeatureFlag$observeShowNotificationSurfaces$1(this, j), 14, null).q();
|
|
m.checkNotNullExpressionValue(q, "observationDeck.connectR… }.distinctUntilChanged()");
|
|
return q;
|
|
}
|
|
|
|
public final boolean showNotificationSurfaces(long j) {
|
|
Experiment experiment = getExperiment(j);
|
|
Integer valueOf = experiment != null ? Integer.valueOf(experiment.getBucket()) : null;
|
|
if (valueOf != null && valueOf.intValue() == 1) {
|
|
return true;
|
|
}
|
|
if (valueOf != null && valueOf.intValue() == 2) {
|
|
return true;
|
|
}
|
|
return valueOf != null && valueOf.intValue() == 3;
|
|
}
|
|
}
|