61 lines
3.7 KiB
Java
61 lines
3.7 KiB
Java
package com.discord.widgets.home;
|
|
|
|
import com.discord.api.permission.Permission;
|
|
import com.discord.models.experiments.domain.Experiment;
|
|
import com.discord.stores.StoreExperiments;
|
|
import com.discord.stores.StoreGuildWelcomeScreens;
|
|
import com.discord.stores.StoreLurking;
|
|
import com.discord.stores.StorePermissions;
|
|
import com.discord.utilities.permissions.PermissionUtils;
|
|
import com.discord.widgets.home.WidgetHomeViewModel;
|
|
import d0.z.d.m;
|
|
import j0.k.b;
|
|
import rx.Observable;
|
|
import rx.functions.Func3;
|
|
/* compiled from: WidgetHomeViewModel.kt */
|
|
public final class WidgetHomeViewModel$Companion$observeStoreState$guildInfoObservable$1<T, R> implements b<Long, Observable<? extends WidgetHomeViewModel.GuildInfo>> {
|
|
public final /* synthetic */ StoreExperiments $storeExperiments;
|
|
public final /* synthetic */ StoreGuildWelcomeScreens $storeGuildWelcomeScreens;
|
|
public final /* synthetic */ StoreLurking $storeLurking;
|
|
public final /* synthetic */ StorePermissions $storePermissions;
|
|
|
|
/* compiled from: WidgetHomeViewModel.kt */
|
|
/* renamed from: com.discord.widgets.home.WidgetHomeViewModel$Companion$observeStoreState$guildInfoObservable$1$1 reason: invalid class name */
|
|
public static final class AnonymousClass1<T1, T2, T3, R> implements Func3<Boolean, StoreGuildWelcomeScreens.State, Long, WidgetHomeViewModel.GuildInfo> {
|
|
public final /* synthetic */ Long $selectedGuildId;
|
|
public final /* synthetic */ WidgetHomeViewModel$Companion$observeStoreState$guildInfoObservable$1 this$0;
|
|
|
|
public AnonymousClass1(WidgetHomeViewModel$Companion$observeStoreState$guildInfoObservable$1 widgetHomeViewModel$Companion$observeStoreState$guildInfoObservable$1, Long l) {
|
|
this.this$0 = widgetHomeViewModel$Companion$observeStoreState$guildInfoObservable$1;
|
|
this.$selectedGuildId = l;
|
|
}
|
|
|
|
public final WidgetHomeViewModel.GuildInfo call(Boolean bool, StoreGuildWelcomeScreens.State state, Long l) {
|
|
Long l2 = this.$selectedGuildId;
|
|
m.checkNotNullExpressionValue(l2, "selectedGuildId");
|
|
long longValue = l2.longValue();
|
|
m.checkNotNullExpressionValue(bool, "isLurking");
|
|
boolean booleanValue = bool.booleanValue();
|
|
boolean can = l != null ? PermissionUtils.can(Permission.MANAGE_EVENTS, Long.valueOf(l.longValue())) : false;
|
|
StoreExperiments storeExperiments = this.this$0.$storeExperiments;
|
|
Long l3 = this.$selectedGuildId;
|
|
m.checkNotNullExpressionValue(l3, "selectedGuildId");
|
|
Experiment guildExperiment = storeExperiments.getGuildExperiment("2021-06_stage_events", l3.longValue(), false);
|
|
return new WidgetHomeViewModel.GuildInfo(longValue, booleanValue, state, can, guildExperiment != null && guildExperiment.getBucket() == 1);
|
|
}
|
|
}
|
|
|
|
public WidgetHomeViewModel$Companion$observeStoreState$guildInfoObservable$1(StoreLurking storeLurking, StoreGuildWelcomeScreens storeGuildWelcomeScreens, StorePermissions storePermissions, StoreExperiments storeExperiments) {
|
|
this.$storeLurking = storeLurking;
|
|
this.$storeGuildWelcomeScreens = storeGuildWelcomeScreens;
|
|
this.$storePermissions = storePermissions;
|
|
this.$storeExperiments = storeExperiments;
|
|
}
|
|
|
|
public final Observable<? extends WidgetHomeViewModel.GuildInfo> call(Long l) {
|
|
StoreLurking storeLurking = this.$storeLurking;
|
|
m.checkNotNullExpressionValue(l, "selectedGuildId");
|
|
return Observable.i(storeLurking.isLurkingObs(l.longValue()), this.$storeGuildWelcomeScreens.observeGuildWelcomeScreen(l.longValue()), this.$storePermissions.observePermissionsForGuild(l.longValue()), new AnonymousClass1(this, l));
|
|
}
|
|
}
|