73 lines
3.9 KiB
Java
73 lines
3.9 KiB
Java
package com.discord.widgets.channels.permissions;
|
|
|
|
import com.discord.api.channel.Channel;
|
|
import com.discord.api.permission.PermissionOverwrite;
|
|
import com.discord.api.role.GuildRole;
|
|
import com.discord.models.guild.Guild;
|
|
import com.discord.models.member.GuildMember;
|
|
import com.discord.models.user.User;
|
|
import com.discord.stores.StoreGuilds;
|
|
import com.discord.stores.StoreUser;
|
|
import com.discord.widgets.channels.permissions.WidgetChannelSettingsAddMemberFragmentViewModel;
|
|
import d0.d0.f;
|
|
import d0.t.g0;
|
|
import d0.t.h0;
|
|
import d0.t.o;
|
|
import d0.z.d.m;
|
|
import j0.k.b;
|
|
import java.util.LinkedHashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import rx.Observable;
|
|
import rx.functions.Func4;
|
|
/* compiled from: WidgetChannelSettingsAddMemberFragmentViewModel.kt */
|
|
public final class WidgetChannelSettingsAddMemberFragmentViewModel$Companion$observeStoreState$1<T, R> implements b<Channel, Observable<? extends WidgetChannelSettingsAddMemberFragmentViewModel.StoreState>> {
|
|
public final /* synthetic */ StoreGuilds $guildsStore;
|
|
public final /* synthetic */ StoreUser $userStore;
|
|
|
|
/* compiled from: WidgetChannelSettingsAddMemberFragmentViewModel.kt */
|
|
/* renamed from: com.discord.widgets.channels.permissions.WidgetChannelSettingsAddMemberFragmentViewModel$Companion$observeStoreState$1$1 reason: invalid class name */
|
|
public static final class AnonymousClass1<T1, T2, T3, T4, R> implements Func4<Guild, Map<Long, ? extends GuildRole>, Map<Long, ? extends GuildMember>, Map<Long, ? extends User>, WidgetChannelSettingsAddMemberFragmentViewModel.StoreState> {
|
|
public final /* synthetic */ Channel $channel;
|
|
|
|
public AnonymousClass1(Channel channel) {
|
|
this.$channel = channel;
|
|
}
|
|
|
|
public final WidgetChannelSettingsAddMemberFragmentViewModel.StoreState call(Guild guild, Map<Long, GuildRole> map, Map<Long, GuildMember> map2, Map<Long, ? extends User> map3) {
|
|
Map map4;
|
|
Channel channel = this.$channel;
|
|
m.checkNotNullExpressionValue(channel, "channel");
|
|
List<PermissionOverwrite> s2 = this.$channel.s();
|
|
if (s2 != null) {
|
|
map4 = new LinkedHashMap(f.coerceAtLeast(g0.mapCapacity(o.collectionSizeOrDefault(s2, 10)), 16));
|
|
for (T t : s2) {
|
|
map4.put(Long.valueOf(t.e()), t);
|
|
}
|
|
} else {
|
|
map4 = h0.emptyMap();
|
|
}
|
|
m.checkNotNullExpressionValue(map, "roles");
|
|
m.checkNotNullExpressionValue(map2, "members");
|
|
m.checkNotNullExpressionValue(map3, "users");
|
|
return new WidgetChannelSettingsAddMemberFragmentViewModel.StoreState(guild, channel, map4, map, map2, map3);
|
|
}
|
|
|
|
/* 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] */
|
|
@Override // rx.functions.Func4
|
|
public /* bridge */ /* synthetic */ WidgetChannelSettingsAddMemberFragmentViewModel.StoreState call(Guild guild, Map<Long, ? extends GuildRole> map, Map<Long, ? extends GuildMember> map2, Map<Long, ? extends User> map3) {
|
|
return call(guild, (Map<Long, GuildRole>) map, (Map<Long, GuildMember>) map2, map3);
|
|
}
|
|
}
|
|
|
|
public WidgetChannelSettingsAddMemberFragmentViewModel$Companion$observeStoreState$1(StoreGuilds storeGuilds, StoreUser storeUser) {
|
|
this.$guildsStore = storeGuilds;
|
|
this.$userStore = storeUser;
|
|
}
|
|
|
|
public final Observable<? extends WidgetChannelSettingsAddMemberFragmentViewModel.StoreState> call(Channel channel) {
|
|
return Observable.h(this.$guildsStore.observeGuild(channel.f()), this.$guildsStore.observeRoles(channel.f()), this.$guildsStore.observeComputed(channel.f()), this.$userStore.observeAllUsers(), new AnonymousClass1(channel));
|
|
}
|
|
}
|