discord-jadx/app/src/main/java/com/discord/widgets/channels/permissions/WidgetChannelSettingsPermis...

62 lines
3.2 KiB
Java

package com.discord.widgets.channels.permissions;
import com.discord.api.channel.Channel;
import com.discord.api.role.GuildRole;
import com.discord.models.guild.Guild;
import com.discord.models.user.MeUser;
import com.discord.stores.StoreStream;
import com.discord.stores.StoreUser;
import com.discord.widgets.channels.permissions.WidgetChannelSettingsPermissionsOverview;
import d0.z.d.m;
import j0.k.b;
import j0.l.e.j;
import java.util.Map;
import rx.Observable;
import rx.functions.Func4;
/* compiled from: WidgetChannelSettingsPermissionsOverview.kt */
public final class WidgetChannelSettingsPermissionsOverview$Model$Companion$get$1<T, R> implements b<Channel, Observable<? extends WidgetChannelSettingsPermissionsOverview.Model>> {
public final /* synthetic */ long $channelId;
/* compiled from: WidgetChannelSettingsPermissionsOverview.kt */
/* renamed from: com.discord.widgets.channels.permissions.WidgetChannelSettingsPermissionsOverview$Model$Companion$get$1$1 reason: invalid class name */
public static final class AnonymousClass1<T1, T2, T3, T4, R> implements Func4<Guild, MeUser, Long, Map<Long, ? extends GuildRole>, WidgetChannelSettingsPermissionsOverview.Model> {
public final /* synthetic */ Channel $channel;
public AnonymousClass1(Channel channel) {
this.$channel = channel;
}
public final WidgetChannelSettingsPermissionsOverview.Model call(Guild guild, MeUser meUser, Long l, Map<Long, GuildRole> map) {
if (!WidgetChannelSettingsPermissionsOverview.Model.Companion.isValid(meUser, guild, this.$channel, l)) {
return null;
}
m.checkNotNullExpressionValue(meUser, "meUser");
m.checkNotNull(guild);
Channel channel = this.$channel;
m.checkNotNull(l);
long longValue = l.longValue();
m.checkNotNullExpressionValue(map, "roles");
return new WidgetChannelSettingsPermissionsOverview.Model(meUser, guild, channel, longValue, 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] */
@Override // rx.functions.Func4
public /* bridge */ /* synthetic */ WidgetChannelSettingsPermissionsOverview.Model call(Guild guild, MeUser meUser, Long l, Map<Long, ? extends GuildRole> map) {
return call(guild, meUser, l, (Map<Long, GuildRole>) map);
}
}
public WidgetChannelSettingsPermissionsOverview$Model$Companion$get$1(long j) {
this.$channelId = j;
}
public final Observable<? extends WidgetChannelSettingsPermissionsOverview.Model> call(Channel channel) {
if (channel == null) {
return new j(null);
}
StoreStream.Companion companion = StoreStream.Companion;
return Observable.h(companion.getGuilds().observeGuild(channel.f()), StoreUser.observeMe$default(companion.getUsers(), false, 1, null), companion.getPermissions().observePermissionsForChannel(this.$channelId), companion.getGuilds().observeRoles(channel.f()), new AnonymousClass1(channel));
}
}