discord-jadx/app/src/main/java/com/discord/widgets/channels/memberlist/WidgetChannelMembersListViewModel$Companion$observeStoreState$1.java
2021-07-24 04:37:17 +02:00

209 lines
16 KiB
Java

package com.discord.widgets.channels.memberlist;
import com.airbnb.lottie.parser.AnimatableValueParser;
import com.discord.api.channel.Channel;
import com.discord.api.role.GuildRole;
import com.discord.models.domain.ModelApplicationStream;
import com.discord.models.guild.Guild;
import com.discord.models.member.GuildMember;
import com.discord.models.presence.Presence;
import com.discord.models.user.User;
import com.discord.stores.StoreApplicationStreaming;
import com.discord.stores.StoreChannelMembers;
import com.discord.stores.StoreChannels;
import com.discord.stores.StoreGuilds;
import com.discord.stores.StorePermissions;
import com.discord.stores.StoreThreadMembers;
import com.discord.stores.StoreUser;
import com.discord.stores.StoreUserPresence;
import com.discord.stores.StoreUserRelationships;
import com.discord.utilities.lazy.memberlist.ChannelMemberList;
import com.discord.widgets.channels.memberlist.PrivateChannelMemberListService;
import com.discord.widgets.channels.memberlist.WidgetChannelMembersListViewModel;
import d0.z.d.m;
import j0.k.b;
import java.util.Map;
import java.util.Set;
import rx.Observable;
import rx.functions.Func2;
import rx.functions.Func5;
import rx.functions.Func8;
/* compiled from: WidgetChannelMembersListViewModel.kt */
public final class WidgetChannelMembersListViewModel$Companion$observeStoreState$1<T, R> implements b<Channel, Observable<? extends WidgetChannelMembersListViewModel.StoreState>> {
public final /* synthetic */ Observable $isPanelOpenObservable;
public final /* synthetic */ PrivateChannelMemberListService $privateChannelMemberListService;
public final /* synthetic */ StoreApplicationStreaming $storeApplicationStreaming;
public final /* synthetic */ StoreChannelMembers $storeChannelMembers;
public final /* synthetic */ StoreChannels $storeChannels;
public final /* synthetic */ StoreGuilds $storeGuilds;
public final /* synthetic */ StorePermissions $storePermissions;
public final /* synthetic */ StoreUserPresence $storePresence;
public final /* synthetic */ StoreThreadMembers $storeThreadMembers;
public final /* synthetic */ StoreUser $storeUser;
public final /* synthetic */ StoreUserRelationships $storeUserRelationships;
/* compiled from: WidgetChannelMembersListViewModel.kt */
/* renamed from: com.discord.widgets.channels.memberlist.WidgetChannelMembersListViewModel$Companion$observeStoreState$1$1 reason: invalid class name */
public static final class AnonymousClass1<T, R> implements b<Boolean, WidgetChannelMembersListViewModel.StoreState.None> {
public static final AnonymousClass1 INSTANCE = new AnonymousClass1();
public final WidgetChannelMembersListViewModel.StoreState.None call(Boolean bool) {
m.checkNotNullExpressionValue(bool, "isPanelOpen");
return new WidgetChannelMembersListViewModel.StoreState.None(bool.booleanValue());
}
}
/* compiled from: WidgetChannelMembersListViewModel.kt */
/* renamed from: com.discord.widgets.channels.memberlist.WidgetChannelMembersListViewModel$Companion$observeStoreState$1$2 reason: invalid class name */
public static final class AnonymousClass2<T1, T2, R> implements Func2<PrivateChannelMemberListService.State, Boolean, WidgetChannelMembersListViewModel.StoreState.Private> {
public final /* synthetic */ WidgetChannelMembersListViewModel$Companion$observeStoreState$1 this$0;
public AnonymousClass2(WidgetChannelMembersListViewModel$Companion$observeStoreState$1 widgetChannelMembersListViewModel$Companion$observeStoreState$1) {
this.this$0 = widgetChannelMembersListViewModel$Companion$observeStoreState$1;
}
public final WidgetChannelMembersListViewModel.StoreState.Private call(PrivateChannelMemberListService.State state, Boolean bool) {
m.checkNotNullExpressionValue(bool, "isPanelOpen");
return new WidgetChannelMembersListViewModel.StoreState.Private(bool.booleanValue(), state.getChannel(), state.getUsers(), state.getPresences(), state.getApplicationStreams(), this.this$0.$storeUserRelationships.getRelationships());
}
}
/* compiled from: WidgetChannelMembersListViewModel.kt */
/* renamed from: com.discord.widgets.channels.memberlist.WidgetChannelMembersListViewModel$Companion$observeStoreState$1$3 reason: invalid class name */
public static final class AnonymousClass3<T, R> implements b<Channel, Observable<? extends WidgetChannelMembersListViewModel.StoreState>> {
public final /* synthetic */ Channel $channel;
public final /* synthetic */ WidgetChannelMembersListViewModel$Companion$observeStoreState$1 this$0;
/* compiled from: WidgetChannelMembersListViewModel.kt */
/* renamed from: com.discord.widgets.channels.memberlist.WidgetChannelMembersListViewModel$Companion$observeStoreState$1$3$1 reason: invalid class name */
public static final class AnonymousClass1<T, R> implements b<Boolean, WidgetChannelMembersListViewModel.StoreState.None> {
public static final AnonymousClass1 INSTANCE = new AnonymousClass1();
public final WidgetChannelMembersListViewModel.StoreState.None call(Boolean bool) {
m.checkNotNullExpressionValue(bool, "isPanelOpen");
return new WidgetChannelMembersListViewModel.StoreState.None(bool.booleanValue());
}
}
/* compiled from: WidgetChannelMembersListViewModel.kt */
/* renamed from: com.discord.widgets.channels.memberlist.WidgetChannelMembersListViewModel$Companion$observeStoreState$1$3$2 reason: invalid class name */
public static final class AnonymousClass2<T1, T2, T3, T4, T5, R> implements Func5<Long, ChannelMemberList, Boolean, Map<Long, ? extends GuildRole>, Guild, WidgetChannelMembersListViewModel.StoreState.Guild> {
public final /* synthetic */ Channel $parentChannel;
public AnonymousClass2(Channel channel) {
this.$parentChannel = channel;
}
public final WidgetChannelMembersListViewModel.StoreState.Guild call(Long l, ChannelMemberList channelMemberList, Boolean bool, Map<Long, GuildRole> map, Guild guild) {
m.checkNotNullExpressionValue(bool, "isPanelOpen");
boolean booleanValue = bool.booleanValue();
Channel channel = this.$parentChannel;
m.checkNotNullExpressionValue(channelMemberList, "channelMemberList");
m.checkNotNullExpressionValue(map, "roles");
return new WidgetChannelMembersListViewModel.StoreState.Guild(booleanValue, channel, guild, channelMemberList, l, map);
}
/* 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] */
@Override // rx.functions.Func5
public /* bridge */ /* synthetic */ WidgetChannelMembersListViewModel.StoreState.Guild call(Long l, ChannelMemberList channelMemberList, Boolean bool, Map<Long, ? extends GuildRole> map, Guild guild) {
return call(l, channelMemberList, bool, (Map<Long, GuildRole>) map, guild);
}
}
/* compiled from: WidgetChannelMembersListViewModel.kt */
/* renamed from: com.discord.widgets.channels.memberlist.WidgetChannelMembersListViewModel$Companion$observeStoreState$1$3$3 reason: invalid class name */
public static final class AnonymousClass3<T1, T2, T3, T4, T5, T6, T7, T8, R> implements Func8<Set<? extends Long>, Boolean, Map<Long, ? extends GuildRole>, Map<Long, ? extends GuildMember>, Guild, Map<Long, ? extends User>, Map<Long, ? extends Presence>, Map<Long, ? extends ModelApplicationStream>, WidgetChannelMembersListViewModel.StoreState.Thread> {
public final /* synthetic */ AnonymousClass3 this$0;
public AnonymousClass3(AnonymousClass3 r1) {
this.this$0 = r1;
}
public final WidgetChannelMembersListViewModel.StoreState.Thread call(Set<Long> set, Boolean bool, Map<Long, GuildRole> map, Map<Long, GuildMember> map2, Guild guild, Map<Long, ? extends User> map3, Map<Long, Presence> map4, Map<Long, ? extends ModelApplicationStream> map5) {
m.checkNotNullExpressionValue(bool, "isPanelOpen");
boolean booleanValue = bool.booleanValue();
Channel channel = this.this$0.$channel;
m.checkNotNullExpressionValue(map, "roles");
m.checkNotNullExpressionValue(map2, "guildMembers");
m.checkNotNullExpressionValue(map3, "users");
m.checkNotNullExpressionValue(map4, "presences");
m.checkNotNullExpressionValue(map5, "streams");
m.checkNotNullExpressionValue(set, "threadMembers");
return new WidgetChannelMembersListViewModel.StoreState.Thread(booleanValue, channel, guild, map, map2, map3, map4, map5, set);
}
/* 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] */
@Override // rx.functions.Func8
public /* bridge */ /* synthetic */ WidgetChannelMembersListViewModel.StoreState.Thread call(Set<? extends Long> set, Boolean bool, Map<Long, ? extends GuildRole> map, Map<Long, ? extends GuildMember> map2, Guild guild, Map<Long, ? extends User> map3, Map<Long, ? extends Presence> map4, Map<Long, ? extends ModelApplicationStream> map5) {
return call((Set<Long>) set, bool, (Map<Long, GuildRole>) map, (Map<Long, GuildMember>) map2, guild, map3, (Map<Long, Presence>) map4, map5);
}
}
public AnonymousClass3(WidgetChannelMembersListViewModel$Companion$observeStoreState$1 widgetChannelMembersListViewModel$Companion$observeStoreState$1, Channel channel) {
this.this$0 = widgetChannelMembersListViewModel$Companion$observeStoreState$1;
this.$channel = channel;
}
public final Observable<? extends WidgetChannelMembersListViewModel.StoreState> call(Channel channel) {
if (channel == null) {
return this.this$0.$isPanelOpenObservable.F(AnonymousClass1.INSTANCE);
}
if (AnimatableValueParser.d1(channel)) {
Observable<Long> observePermissionsForChannel = this.this$0.$storePermissions.observePermissionsForChannel(channel.h());
Observable<ChannelMemberList> observeChannelMemberList = this.this$0.$storeChannelMembers.observeChannelMemberList(channel.f(), channel.h());
WidgetChannelMembersListViewModel$Companion$observeStoreState$1 widgetChannelMembersListViewModel$Companion$observeStoreState$1 = this.this$0;
return Observable.g(observePermissionsForChannel, observeChannelMemberList, widgetChannelMembersListViewModel$Companion$observeStoreState$1.$isPanelOpenObservable, widgetChannelMembersListViewModel$Companion$observeStoreState$1.$storeGuilds.observeRoles(this.$channel.f()), this.this$0.$storeGuilds.observeGuild(this.$channel.f()), new AnonymousClass2(channel));
}
Observable<Set<Long>> observeThreadMembers = this.this$0.$storeThreadMembers.observeThreadMembers(this.$channel.h());
WidgetChannelMembersListViewModel$Companion$observeStoreState$1 widgetChannelMembersListViewModel$Companion$observeStoreState$12 = this.this$0;
return Observable.d(observeThreadMembers, widgetChannelMembersListViewModel$Companion$observeStoreState$12.$isPanelOpenObservable, widgetChannelMembersListViewModel$Companion$observeStoreState$12.$storeGuilds.observeRoles(this.$channel.f()), this.this$0.$storeGuilds.observeGuildMembers(this.$channel.f()), this.this$0.$storeGuilds.observeGuild(this.$channel.f()), this.this$0.$storeUser.observeAllUsers(), this.this$0.$storePresence.observeAllPresences(), this.this$0.$storeApplicationStreaming.observeStreamsByUser(), new AnonymousClass3(this));
}
}
/* compiled from: WidgetChannelMembersListViewModel.kt */
/* renamed from: com.discord.widgets.channels.memberlist.WidgetChannelMembersListViewModel$Companion$observeStoreState$1$4 reason: invalid class name */
public static final class AnonymousClass4<T1, T2, T3, T4, T5, R> implements Func5<Guild, Map<Long, ? extends GuildRole>, Long, ChannelMemberList, Boolean, WidgetChannelMembersListViewModel.StoreState.Guild> {
public final /* synthetic */ Channel $channel;
public AnonymousClass4(Channel channel) {
this.$channel = channel;
}
public final WidgetChannelMembersListViewModel.StoreState.Guild call(Guild guild, Map<Long, GuildRole> map, Long l, ChannelMemberList channelMemberList, Boolean bool) {
m.checkNotNullExpressionValue(bool, "isPanelOpen");
boolean booleanValue = bool.booleanValue();
Channel channel = this.$channel;
m.checkNotNullExpressionValue(channelMemberList, "channelMemberList");
m.checkNotNullExpressionValue(map, "guildRoles");
return new WidgetChannelMembersListViewModel.StoreState.Guild(booleanValue, channel, guild, channelMemberList, l, map);
}
/* 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] */
@Override // rx.functions.Func5
public /* bridge */ /* synthetic */ WidgetChannelMembersListViewModel.StoreState.Guild call(Guild guild, Map<Long, ? extends GuildRole> map, Long l, ChannelMemberList channelMemberList, Boolean bool) {
return call(guild, (Map<Long, GuildRole>) map, l, channelMemberList, bool);
}
}
public WidgetChannelMembersListViewModel$Companion$observeStoreState$1(Observable observable, PrivateChannelMemberListService privateChannelMemberListService, StoreUserRelationships storeUserRelationships, StoreChannels storeChannels, StorePermissions storePermissions, StoreChannelMembers storeChannelMembers, StoreGuilds storeGuilds, StoreThreadMembers storeThreadMembers, StoreUser storeUser, StoreUserPresence storeUserPresence, StoreApplicationStreaming storeApplicationStreaming) {
this.$isPanelOpenObservable = observable;
this.$privateChannelMemberListService = privateChannelMemberListService;
this.$storeUserRelationships = storeUserRelationships;
this.$storeChannels = storeChannels;
this.$storePermissions = storePermissions;
this.$storeChannelMembers = storeChannelMembers;
this.$storeGuilds = storeGuilds;
this.$storeThreadMembers = storeThreadMembers;
this.$storeUser = storeUser;
this.$storePresence = storeUserPresence;
this.$storeApplicationStreaming = storeApplicationStreaming;
}
public final Observable<? extends WidgetChannelMembersListViewModel.StoreState> call(Channel channel) {
return channel == null ? this.$isPanelOpenObservable.F(AnonymousClass1.INSTANCE) : AnimatableValueParser.t1(channel) ? Observable.j(this.$privateChannelMemberListService.observeStateForGroupDm(channel), this.$isPanelOpenObservable, new AnonymousClass2(this)) : AnimatableValueParser.A1(channel) ? this.$storeChannels.observeChannel(channel.r()).Y(new AnonymousClass3(this, channel)) : Observable.g(this.$storeGuilds.observeGuild(channel.f()), this.$storeGuilds.observeRoles(channel.f()), this.$storePermissions.observePermissionsForChannel(channel.h()), this.$storeChannelMembers.observeChannelMemberList(channel.f(), channel.h()), this.$isPanelOpenObservable, new AnonymousClass4(channel));
}
}