discord-jadx/app/src/main/java/com/discord/widgets/user/usersheet/WidgetUserSheetViewModelSto...

199 lines
14 KiB
Java

package com.discord.widgets.user.usersheet;
import c.d.b.a.a;
import com.airbnb.lottie.parser.AnimatableValueParser;
import com.discord.api.channel.Channel;
import com.discord.api.role.GuildRole;
import com.discord.api.voice.state.StageRequestToSpeakState;
import com.discord.api.voice.state.VoiceState;
import com.discord.models.domain.ModelUserProfile;
import com.discord.models.guild.Guild;
import com.discord.models.member.GuildMember;
import com.discord.models.user.MeUser;
import com.discord.models.user.User;
import com.discord.stores.StoreGuilds;
import com.discord.stores.StoreMediaSettings;
import com.discord.stores.StorePermissions;
import com.discord.stores.StoreStageChannels;
import com.discord.stores.StoreUserNotes;
import com.discord.stores.StoreUserPresence;
import com.discord.stores.StoreUserProfile;
import com.discord.stores.StoreUserRelationships;
import com.discord.stores.StoreVoiceStates;
import com.discord.utilities.rx.ObservableCombineLatestOverloadsKt;
import com.discord.utilities.streams.StreamContext;
import com.discord.utilities.streams.StreamContextService;
import com.discord.widgets.stage.StageRoles;
import com.discord.widgets.user.presence.ModelRichPresence;
import com.discord.widgets.user.usersheet.WidgetUserSheetViewModel;
import com.discord.widgets.user.usersheet.WidgetUserSheetViewModelStoreState;
import d0.t.h0;
import d0.t.n;
import d0.z.d.m;
import d0.z.d.o;
import j0.k.b;
import j0.l.e.j;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import kotlin.jvm.functions.Function15;
import rx.Observable;
/* compiled from: WidgetUserSheetViewModelStoreState.kt */
public final class WidgetUserSheetViewModelStoreState$observeStoreState$3<T, R> implements b<WidgetUserSheetViewModelStoreState.BootstrapData, Observable<? extends WidgetUserSheetViewModel.StoreState>> {
public final /* synthetic */ StoreGuilds $storeGuilds;
public final /* synthetic */ StoreMediaSettings $storeMediaSettings;
public final /* synthetic */ StorePermissions $storePermissions;
public final /* synthetic */ StoreStageChannels $storeStageChannels;
public final /* synthetic */ StoreUserNotes $storeUserNotes;
public final /* synthetic */ StoreUserPresence $storeUserPresence;
public final /* synthetic */ StoreUserProfile $storeUserProfile;
public final /* synthetic */ StoreUserRelationships $storeUserRelationships;
public final /* synthetic */ StoreVoiceStates $storeVoiceStates;
public final /* synthetic */ StreamContextService $streamContextService;
/* compiled from: WidgetUserSheetViewModelStoreState.kt */
/* renamed from: com.discord.widgets.user.usersheet.WidgetUserSheetViewModelStoreState$observeStoreState$3$1 reason: invalid class name */
public static final class AnonymousClass1<T, R> implements b {
public static final AnonymousClass1 INSTANCE = new AnonymousClass1();
public final Void call(Long l) {
return null;
}
}
/* compiled from: WidgetUserSheetViewModelStoreState.kt */
/* renamed from: com.discord.widgets.user.usersheet.WidgetUserSheetViewModelStoreState$observeStoreState$3$2 reason: invalid class name */
public static final class AnonymousClass2 extends o implements Function15<Map<Long, ? extends GuildMember>, Map<Long, ? extends GuildRole>, Map<Long, ? extends VoiceState>, Map<Long, ? extends VoiceState>, StoreMediaSettings.VoiceConfiguration, ModelRichPresence, Guild, Long, StreamContext, ModelUserProfile, Integer, StoreUserNotes.UserNoteState, StageRoles, StageRequestToSpeakState, StageRoles, WidgetUserSheetViewModel.StoreState> {
public final /* synthetic */ Channel $channel;
public final /* synthetic */ MeUser $me;
public final /* synthetic */ Channel $selectedVoiceChannel;
public final /* synthetic */ User $user;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public AnonymousClass2(User user, MeUser meUser, Channel channel, Channel channel2) {
super(15);
this.$user = user;
this.$me = meUser;
this.$channel = channel;
this.$selectedVoiceChannel = channel2;
}
public final WidgetUserSheetViewModel.StoreState invoke(Map<Long, GuildMember> map, Map<Long, GuildRole> map2, Map<Long, VoiceState> map3, Map<Long, VoiceState> map4, StoreMediaSettings.VoiceConfiguration voiceConfiguration, ModelRichPresence modelRichPresence, Guild guild, Long l, StreamContext streamContext, ModelUserProfile modelUserProfile, Integer num, StoreUserNotes.UserNoteState userNoteState, StageRoles stageRoles, StageRequestToSpeakState stageRequestToSpeakState, StageRoles stageRoles2) {
m.checkNotNullParameter(map, "computedMembers");
m.checkNotNullParameter(map2, "guildRoles");
m.checkNotNullParameter(map3, "mySelectedVoiceChannelVoiceStates");
m.checkNotNullParameter(map4, "currentChannelVoiceStates");
m.checkNotNullParameter(voiceConfiguration, "voiceConfig");
m.checkNotNullParameter(modelUserProfile, "userProfile");
m.checkNotNullParameter(userNoteState, "userNote");
m.checkNotNullParameter(stageRequestToSpeakState, "userRequestToSpeakState");
Boolean bool = (Boolean) a.e(this.$user, voiceConfiguration.getMutedUsers());
boolean booleanValue = bool != null ? bool.booleanValue() : false;
boolean isSelfMuted = voiceConfiguration.isSelfMuted();
boolean isSelfDeafened = voiceConfiguration.isSelfDeafened();
Float f = (Float) a.e(this.$user, voiceConfiguration.getUserOutputVolumes());
float floatValue = f != null ? f.floatValue() : 100.0f;
User user = this.$user;
MeUser meUser = this.$me;
Channel channel = this.$channel;
Channel channel2 = this.$selectedVoiceChannel;
return new WidgetUserSheetViewModel.StoreState(user, meUser, channel, map, map2, map3, map4, booleanValue, isSelfMuted, isSelfDeafened, floatValue, modelRichPresence, guild, l, streamContext, modelUserProfile, num, userNoteState, (channel2 == null || !AnimatableValueParser.u1(channel2)) ? null : channel2, stageRoles, stageRequestToSpeakState, stageRoles2, null);
}
/* Return type fixed from 'java.lang.Object' to match base method */
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object] */
@Override // kotlin.jvm.functions.Function15
public /* bridge */ /* synthetic */ WidgetUserSheetViewModel.StoreState invoke(Map<Long, ? extends GuildMember> map, Map<Long, ? extends GuildRole> map2, Map<Long, ? extends VoiceState> map3, Map<Long, ? extends VoiceState> map4, StoreMediaSettings.VoiceConfiguration voiceConfiguration, ModelRichPresence modelRichPresence, Guild guild, Long l, StreamContext streamContext, ModelUserProfile modelUserProfile, Integer num, StoreUserNotes.UserNoteState userNoteState, StageRoles stageRoles, StageRequestToSpeakState stageRequestToSpeakState, StageRoles stageRoles2) {
return invoke((Map<Long, GuildMember>) map, (Map<Long, GuildRole>) map2, (Map<Long, VoiceState>) map3, (Map<Long, VoiceState>) map4, voiceConfiguration, modelRichPresence, guild, l, streamContext, modelUserProfile, num, userNoteState, stageRoles, stageRequestToSpeakState, stageRoles2);
}
}
public WidgetUserSheetViewModelStoreState$observeStoreState$3(StoreGuilds storeGuilds, StoreVoiceStates storeVoiceStates, StoreUserPresence storeUserPresence, StorePermissions storePermissions, StreamContextService streamContextService, StoreStageChannels storeStageChannels, StoreMediaSettings storeMediaSettings, StoreUserProfile storeUserProfile, StoreUserRelationships storeUserRelationships, StoreUserNotes storeUserNotes) {
this.$storeGuilds = storeGuilds;
this.$storeVoiceStates = storeVoiceStates;
this.$storeUserPresence = storeUserPresence;
this.$storePermissions = storePermissions;
this.$streamContextService = streamContextService;
this.$storeStageChannels = storeStageChannels;
this.$storeMediaSettings = storeMediaSettings;
this.$storeUserProfile = storeUserProfile;
this.$storeUserRelationships = storeUserRelationships;
this.$storeUserNotes = storeUserNotes;
}
/* JADX WARNING: Code restructure failed: missing block: B:37:0x0109, code lost:
if (r2 != null) goto L_0x0117;
*/
/* JADX WARNING: Code restructure failed: missing block: B:42:0x0129, code lost:
if (r3 != null) goto L_0x0136;
*/
public final Observable<? extends WidgetUserSheetViewModel.StoreState> call(WidgetUserSheetViewModelStoreState.BootstrapData bootstrapData) {
Observable<Guild> observable;
Observable<Long> observable2;
Observable<ModelRichPresence> observable3;
Channel channel;
MeUser meUser;
Observable<StageRoles> observable4;
MeUser meUser2;
Observable<StageRequestToSpeakState> observable5;
Observable<StageRoles> observable6;
Observable<Map<Long, VoiceState>> observe;
Observable<Map<Long, VoiceState>> observe2;
Observable<Map<Long, GuildRole>> observeRoles;
Observable<Map<Long, GuildMember>> observeComputed;
User component1 = bootstrapData.component1();
MeUser component2 = bootstrapData.component2();
Channel component3 = bootstrapData.component3();
Channel component4 = bootstrapData.component4();
if (component1 == null) {
return Observable.e0(5, TimeUnit.SECONDS).G(AnonymousClass1.INSTANCE);
}
Observable<Map<Long, GuildMember>> jVar = (component3 == null || (observeComputed = this.$storeGuilds.observeComputed(component3.e(), n.listOf(new Long[]{Long.valueOf(component1.getId()), Long.valueOf(component2.getId())}))) == null) ? new j(h0.emptyMap()) : observeComputed;
Observable<Map<Long, GuildRole>> jVar2 = (component3 == null || (observeRoles = this.$storeGuilds.observeRoles(component3.e())) == null) ? new j(h0.emptyMap()) : observeRoles;
Observable<Map<Long, VoiceState>> jVar3 = (component4 == null || (observe2 = this.$storeVoiceStates.observe(component4.e(), component4.g())) == null) ? new j(h0.emptyMap()) : observe2;
Observable<Map<Long, VoiceState>> jVar4 = (component3 == null || (observe = this.$storeVoiceStates.observe(component3.e(), component3.g())) == null) ? new j(h0.emptyMap()) : observe;
Observable<ModelRichPresence> observable7 = ModelRichPresence.Companion.get(component1.getId(), this.$storeUserPresence);
if (component3 == null || (observable = this.$storeGuilds.observeGuild(component3.e())) == null) {
observable = new j<>(null);
}
if (component3 == null || (observable2 = this.$storePermissions.observePermissionsForChannel(component3.g())) == null) {
observable2 = new j<>(null);
}
Observable<StreamContext> forUser = this.$streamContextService.getForUser(component1.getId(), true);
if (component4 != null) {
observable3 = observable7;
meUser = component2;
channel = component3;
observable4 = this.$storeStageChannels.observeUserRoles(component1.getId(), component4.g());
} else {
meUser = component2;
channel = component3;
observable3 = observable7;
}
observable4 = new j<>(null);
if (component4 != null) {
meUser2 = meUser;
observable5 = this.$storeStageChannels.observeUserRequestToSpeakState(component1.getId(), component4.g());
} else {
meUser2 = meUser;
}
observable5 = new j(StageRequestToSpeakState.NONE);
if (component4 == null || (observable6 = this.$storeStageChannels.observeMyRoles(component4.g())) == null) {
observable6 = new j<>(null);
}
m.checkNotNullExpressionValue(jVar, "computedMembersObservable");
m.checkNotNullExpressionValue(jVar2, "guildRolesObservable");
m.checkNotNullExpressionValue(jVar3, "mySelectedVoiceChannelVoiceStatesObservable");
m.checkNotNullExpressionValue(jVar4, "currentChannelVoiceStatesObservable");
Observable<StoreMediaSettings.VoiceConfiguration> voiceConfig = this.$storeMediaSettings.getVoiceConfig();
m.checkNotNullExpressionValue(observable, "guildsObservable");
m.checkNotNullExpressionValue(observable2, "permissionsObservable");
Observable<ModelUserProfile> observeUserProfile = this.$storeUserProfile.observeUserProfile(component1.getId());
Observable<Integer> observe3 = this.$storeUserRelationships.observe(component1.getId());
Observable<StoreUserNotes.UserNoteState> observeUserNote = this.$storeUserNotes.observeUserNote(component1.getId());
m.checkNotNullExpressionValue(observable4, "userStageRolesObservable");
m.checkNotNullExpressionValue(observable5, "userStageRequestToSpeakStateObservable");
m.checkNotNullExpressionValue(observable6, "myStageRolesObservable");
return ObservableCombineLatestOverloadsKt.combineLatest(jVar, jVar2, jVar3, jVar4, voiceConfig, observable3, observable, observable2, forUser, observeUserProfile, observe3, observeUserNote, observable4, observable5, observable6, new AnonymousClass2(component1, meUser2, channel, component4));
}
}