discord-jadx/app/src/main/java/com/discord/widgets/voice/fullscreen/WidgetCallPreviewFullscreen...

72 lines
4.2 KiB
Java

package com.discord.widgets.voice.fullscreen;
import com.discord.api.channel.Channel;
import com.discord.api.user.NsfwAllowance;
import com.discord.models.user.MeUser;
import com.discord.stores.StoreChannelsSelected;
import com.discord.stores.StoreMentions;
import com.discord.stores.StoreStream;
import com.discord.stores.StoreUser;
import com.discord.stores.StoreVoiceChannelSelected;
import com.discord.widgets.chat.list.TextInVoiceFeatureFlag;
import com.discord.widgets.voice.fullscreen.WidgetCallPreviewFullscreenViewModel;
import com.discord.widgets.voice.model.CallModel;
import d0.z.d.m;
import j0.k.b;
import rx.Observable;
import rx.functions.Func6;
/* compiled from: WidgetCallPreviewFullscreenViewModel.kt */
/* loaded from: classes2.dex */
public final class WidgetCallPreviewFullscreenViewModel$Companion$observeStoreState$1<T, R> implements b<Channel, Observable<? extends WidgetCallPreviewFullscreenViewModel.StoreState>> {
public final /* synthetic */ StoreChannelsSelected $storeChannelsSelected;
public final /* synthetic */ StoreMentions $storeMentions;
public final /* synthetic */ StoreUser $storeUser;
public final /* synthetic */ StoreVoiceChannelSelected $storeVoiceChannelSelected;
public final /* synthetic */ long $voiceChannelId;
/* compiled from: WidgetCallPreviewFullscreenViewModel.kt */
/* renamed from: com.discord.widgets.voice.fullscreen.WidgetCallPreviewFullscreenViewModel$Companion$observeStoreState$1$1 reason: invalid class name */
/* loaded from: classes2.dex */
public static final class AnonymousClass1<T1, T2, T3, T4, T5, T6, R> implements Func6<MeUser, Channel, Boolean, Integer, CallModel, Channel, WidgetCallPreviewFullscreenViewModel.StoreState> {
public final /* synthetic */ Channel $voiceChannel;
public AnonymousClass1(Channel channel) {
this.$voiceChannel = channel;
}
public final WidgetCallPreviewFullscreenViewModel.StoreState call(MeUser meUser, Channel channel, Boolean bool, Integer num, CallModel callModel, Channel channel2) {
if (callModel == null || this.$voiceChannel == null || channel == null) {
return WidgetCallPreviewFullscreenViewModel.StoreState.Invalid.INSTANCE;
}
boolean z2 = !StoreStream.Companion.getGuildsNsfw().isGuildNsfwGateAgreed(this.$voiceChannel.f());
boolean o = this.$voiceChannel.o();
NsfwAllowance nsfwAllowance = meUser != null ? meUser.getNsfwAllowance() : null;
long id2 = meUser.getId();
Channel channel3 = this.$voiceChannel;
m.checkNotNullExpressionValue(bool, "isTextInVoiceEnabled");
boolean booleanValue = bool.booleanValue();
m.checkNotNullExpressionValue(num, "totalMentionsCount");
return new WidgetCallPreviewFullscreenViewModel.StoreState.Valid(id2, channel3, channel, booleanValue, num.intValue(), z2, o, nsfwAllowance, callModel, channel2);
}
}
public WidgetCallPreviewFullscreenViewModel$Companion$observeStoreState$1(StoreUser storeUser, StoreChannelsSelected storeChannelsSelected, StoreMentions storeMentions, long j, StoreVoiceChannelSelected storeVoiceChannelSelected) {
this.$storeUser = storeUser;
this.$storeChannelsSelected = storeChannelsSelected;
this.$storeMentions = storeMentions;
this.$voiceChannelId = j;
this.$storeVoiceChannelSelected = storeVoiceChannelSelected;
}
public final Observable<? extends WidgetCallPreviewFullscreenViewModel.StoreState> call(Channel channel) {
Long l = null;
Observable observeMe$default = StoreUser.observeMe$default(this.$storeUser, false, 1, null);
Observable<Channel> observeSelectedChannel = this.$storeChannelsSelected.observeSelectedChannel();
TextInVoiceFeatureFlag instance = TextInVoiceFeatureFlag.Companion.getINSTANCE();
if (channel != null) {
l = Long.valueOf(channel.f());
}
return Observable.f(observeMe$default, observeSelectedChannel, instance.observeEnabled(l), this.$storeMentions.observeTotalMentions(), CallModel.Companion.get(this.$voiceChannelId), this.$storeVoiceChannelSelected.observeSelectedChannel(), new AnonymousClass1(channel));
}
}