72 lines
4.7 KiB
Java
72 lines
4.7 KiB
Java
package com.discord.utilities.voice;
|
|
|
|
import com.discord.api.channel.Channel;
|
|
import com.discord.api.guild.GuildMaxVideoChannelUsers;
|
|
import com.discord.api.guild.GuildVerificationLevel;
|
|
import com.discord.api.stageinstance.StageInstance;
|
|
import com.discord.api.voice.state.VoiceState;
|
|
import com.discord.models.guild.Guild;
|
|
import com.discord.stores.StoreGuilds;
|
|
import com.discord.stores.StorePermissions;
|
|
import com.discord.stores.StoreStageInstances;
|
|
import com.discord.stores.StoreVoiceChannelSelected;
|
|
import com.discord.stores.StoreVoiceStates;
|
|
import com.discord.utilities.guilds.GuildVerificationLevelUtils;
|
|
import d0.z.d.m;
|
|
import j0.k.b;
|
|
import j0.l.e.j;
|
|
import java.util.Collection;
|
|
import java.util.Map;
|
|
import rx.Observable;
|
|
import rx.functions.Func6;
|
|
/* compiled from: VoiceChannelJoinabilityUtils.kt */
|
|
public final class VoiceChannelJoinabilityUtils$observeJoinability$1<T, R> implements b<Channel, Observable<? extends VoiceChannelJoinability>> {
|
|
public final /* synthetic */ long $channelId;
|
|
public final /* synthetic */ StoreGuilds $guildsStore;
|
|
public final /* synthetic */ StorePermissions $permissionsStore;
|
|
public final /* synthetic */ StoreStageInstances $stageInstancesStore;
|
|
public final /* synthetic */ StoreVoiceChannelSelected $voiceChannelSelectedStore;
|
|
public final /* synthetic */ StoreVoiceStates $voiceStatesStore;
|
|
|
|
/* compiled from: VoiceChannelJoinabilityUtils.kt */
|
|
/* renamed from: com.discord.utilities.voice.VoiceChannelJoinabilityUtils$observeJoinability$1$1 reason: invalid class name */
|
|
public static final class AnonymousClass1<T1, T2, T3, T4, T5, T6, R> implements Func6<Map<Long, ? extends VoiceState>, Long, Guild, GuildVerificationLevel, Long, StageInstance, VoiceChannelJoinability> {
|
|
public final /* synthetic */ Channel $channel;
|
|
|
|
public AnonymousClass1(Channel channel) {
|
|
this.$channel = channel;
|
|
}
|
|
|
|
public final VoiceChannelJoinability call(Map<Long, VoiceState> map, Long l, Guild guild, GuildVerificationLevel guildVerificationLevel, Long l2, StageInstance stageInstance) {
|
|
GuildMaxVideoChannelUsers guildMaxVideoChannelUsers;
|
|
VoiceChannelJoinabilityUtils voiceChannelJoinabilityUtils = VoiceChannelJoinabilityUtils.INSTANCE;
|
|
Channel channel = this.$channel;
|
|
Collection<VoiceState> values = map.values();
|
|
if (guild == null || (guildMaxVideoChannelUsers = guild.getMaxVideoChannelUsers()) == null) {
|
|
guildMaxVideoChannelUsers = GuildMaxVideoChannelUsers.Unlimited.INSTANCE;
|
|
}
|
|
m.checkNotNullExpressionValue(guildVerificationLevel, "verificationLevelTriggered");
|
|
return voiceChannelJoinabilityUtils.computeJoinability(channel, values, l, guildMaxVideoChannelUsers, guildVerificationLevel, l2, stageInstance);
|
|
}
|
|
|
|
/* 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] */
|
|
@Override // rx.functions.Func6
|
|
public /* bridge */ /* synthetic */ VoiceChannelJoinability call(Map<Long, ? extends VoiceState> map, Long l, Guild guild, GuildVerificationLevel guildVerificationLevel, Long l2, StageInstance stageInstance) {
|
|
return call((Map<Long, VoiceState>) map, l, guild, guildVerificationLevel, l2, stageInstance);
|
|
}
|
|
}
|
|
|
|
public VoiceChannelJoinabilityUtils$observeJoinability$1(StoreVoiceStates storeVoiceStates, long j, StorePermissions storePermissions, StoreGuilds storeGuilds, StoreVoiceChannelSelected storeVoiceChannelSelected, StoreStageInstances storeStageInstances) {
|
|
this.$voiceStatesStore = storeVoiceStates;
|
|
this.$channelId = j;
|
|
this.$permissionsStore = storePermissions;
|
|
this.$guildsStore = storeGuilds;
|
|
this.$voiceChannelSelectedStore = storeVoiceChannelSelected;
|
|
this.$stageInstancesStore = storeStageInstances;
|
|
}
|
|
|
|
public final Observable<? extends VoiceChannelJoinability> call(Channel channel) {
|
|
return channel == null ? new j(VoiceChannelJoinability.CHANNEL_DOES_NOT_EXIST) : Observable.f(this.$voiceStatesStore.observe(channel.f(), this.$channelId), this.$permissionsStore.observePermissionsForChannel(this.$channelId), this.$guildsStore.observeGuild(channel.f()), GuildVerificationLevelUtils.observeVerificationLevelTriggered$default(GuildVerificationLevelUtils.INSTANCE, channel.f(), null, null, null, 14, null), this.$voiceChannelSelectedStore.observeSelectedVoiceChannelId(), this.$stageInstancesStore.observeStageInstanceForChannel(this.$channelId), new AnonymousClass1(channel));
|
|
}
|
|
}
|