discord-jadx/app/src/main/java/com/discord/stores/StoreVoiceParticipants$get$...

169 lines
11 KiB
Java

package com.discord.stores;
import com.airbnb.lottie.parser.AnimatableValueParser;
import com.discord.api.channel.Channel;
import com.discord.api.voice.state.VoiceState;
import com.discord.models.domain.ModelCall;
import com.discord.models.member.GuildMember;
import com.discord.models.user.MeUser;
import com.discord.models.user.User;
import com.discord.stores.StoreMediaSettings;
import com.discord.stores.StoreVideoStreams;
import com.discord.stores.StoreVoiceParticipants;
import com.discord.utilities.rx.ObservableExtensionsKt;
import com.discord.utilities.streams.StreamContext;
import d0.o;
import d0.t.h0;
import d0.t.n;
import d0.t.u;
import d0.z.d.m;
import j0.k.b;
import j0.l.e.j;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import kotlin.Pair;
import rx.Observable;
import rx.functions.Func2;
import rx.functions.Func7;
/* compiled from: StoreVoiceParticipants.kt */
public final class StoreVoiceParticipants$get$1<T, R> implements b<Channel, Observable<? extends Map<Long, ? extends StoreVoiceParticipants.VoiceUser>>> {
public final /* synthetic */ long $channelId;
public final /* synthetic */ StoreVoiceParticipants this$0;
/* compiled from: StoreVoiceParticipants.kt */
/* renamed from: com.discord.stores.StoreVoiceParticipants$get$1$1 reason: invalid class name */
public static final class AnonymousClass1<T, R> implements b<Map<Long, ? extends VoiceState>, Observable<? extends Map<Long, ? extends StoreVoiceParticipants.VoiceUser>>> {
public final /* synthetic */ Channel $channel;
public final /* synthetic */ long $guildId;
public final /* synthetic */ StoreVoiceParticipants$get$1 this$0;
/* compiled from: StoreVoiceParticipants.kt */
/* renamed from: com.discord.stores.StoreVoiceParticipants$get$1$1$1 reason: invalid class name */
public static final class AnonymousClass1<T1, T2, R> implements Func2<MeUser, Collection<? extends User>, Pair<? extends MeUser, ? extends Collection<? extends User>>> {
public static final AnonymousClass1 INSTANCE = new AnonymousClass1();
public final Pair<MeUser, Collection<User>> call(MeUser meUser, Collection<? extends User> collection) {
return o.to(meUser, collection);
}
}
/* compiled from: StoreVoiceParticipants.kt */
/* renamed from: com.discord.stores.StoreVoiceParticipants$get$1$1$2 reason: invalid class name */
public static final class AnonymousClass2<T, R> implements b<Pair<? extends MeUser, ? extends Collection<? extends User>>, Observable<? extends Map<Long, ? extends StoreVoiceParticipants.VoiceUser>>> {
public final /* synthetic */ Map $voiceStates;
public final /* synthetic */ AnonymousClass1 this$0;
/* compiled from: StoreVoiceParticipants.kt */
/* renamed from: com.discord.stores.StoreVoiceParticipants$get$1$1$2$1 reason: invalid class name */
public static final class AnonymousClass1<T, R> implements b<ModelCall, List<? extends Long>> {
public static final AnonymousClass1 INSTANCE = new AnonymousClass1();
public final List<Long> call(ModelCall modelCall) {
List<Long> ringing;
return (modelCall == null || (ringing = modelCall.getRinging()) == null) ? n.emptyList() : ringing;
}
}
/* compiled from: StoreVoiceParticipants.kt */
/* renamed from: com.discord.stores.StoreVoiceParticipants$get$1$1$2$2 reason: invalid class name */
public static final class AnonymousClass2<T1, T2, T3, T4, T5, T6, T7, R> implements Func7<Set<? extends Long>, List<? extends Long>, Map<Long, ? extends StoreVideoStreams.UserStreams>, Map<Long, ? extends GuildMember>, Map<String, ? extends List<? extends Long>>, StoreMediaSettings.VoiceConfiguration, Map<Long, ? extends StreamContext>, Map<Long, ? extends StoreVoiceParticipants.VoiceUser>> {
public final /* synthetic */ MeUser $meUser;
public final /* synthetic */ Collection $otherUsers;
public final /* synthetic */ AnonymousClass2 this$0;
public AnonymousClass2(AnonymousClass2 r1, MeUser meUser, Collection collection) {
this.this$0 = r1;
this.$meUser = meUser;
this.$otherUsers = collection;
}
/* 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] */
@Override // rx.functions.Func7
public /* bridge */ /* synthetic */ Map<Long, ? extends StoreVoiceParticipants.VoiceUser> call(Set<? extends Long> set, List<? extends Long> list, Map<Long, ? extends StoreVideoStreams.UserStreams> map, Map<Long, ? extends GuildMember> map2, Map<String, ? extends List<? extends Long>> map3, StoreMediaSettings.VoiceConfiguration voiceConfiguration, Map<Long, ? extends StreamContext> map4) {
return call((Set<Long>) set, (List<Long>) list, (Map<Long, StoreVideoStreams.UserStreams>) map, (Map<Long, GuildMember>) map2, (Map<String, ? extends List<Long>>) map3, voiceConfiguration, (Map<Long, StreamContext>) map4);
}
public final Map<Long, StoreVoiceParticipants.VoiceUser> call(Set<Long> set, List<Long> list, Map<Long, StoreVideoStreams.UserStreams> map, Map<Long, GuildMember> map2, Map<String, ? extends List<Long>> map3, StoreMediaSettings.VoiceConfiguration voiceConfiguration, Map<Long, StreamContext> map4) {
StoreVoiceParticipants storeVoiceParticipants = this.this$0.this$0.this$0.this$0;
MeUser meUser = this.$meUser;
m.checkNotNullExpressionValue(meUser, "meUser");
Collection collection = this.$otherUsers;
m.checkNotNullExpressionValue(collection, "otherUsers");
Map map5 = this.this$0.$voiceStates;
m.checkNotNullExpressionValue(map5, "voiceStates");
m.checkNotNullExpressionValue(set, "speakingUsers");
m.checkNotNullExpressionValue(list, "ringingUsers");
m.checkNotNullExpressionValue(map, "videoStreams");
m.checkNotNullExpressionValue(map2, "guildMembers");
m.checkNotNullExpressionValue(map3, "streamSpectators");
m.checkNotNullExpressionValue(voiceConfiguration, "voiceConfig");
m.checkNotNullExpressionValue(map4, "streamContexts");
return StoreVoiceParticipants.access$create(storeVoiceParticipants, meUser, collection, map5, set, list, map, map2, map3, voiceConfiguration, map4);
}
}
public AnonymousClass2(AnonymousClass1 r1, Map map) {
this.this$0 = r1;
this.$voiceStates = 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] */
@Override // j0.k.b
public /* bridge */ /* synthetic */ Observable<? extends Map<Long, ? extends StoreVoiceParticipants.VoiceUser>> call(Pair<? extends MeUser, ? extends Collection<? extends User>> pair) {
return call((Pair<MeUser, ? extends Collection<? extends User>>) pair);
}
public final Observable<? extends Map<Long, StoreVoiceParticipants.VoiceUser>> call(Pair<MeUser, ? extends Collection<? extends User>> pair) {
MeUser component1 = pair.component1();
Collection<T> collection = (Collection) pair.component2();
m.checkNotNullExpressionValue(collection, "otherUsers");
ArrayList arrayList = new ArrayList(d0.t.o.collectionSizeOrDefault(collection, 10));
for (T t : collection) {
arrayList.add(Long.valueOf(t.getId()));
}
return Observable.e(ObservableExtensionsKt.leadingEdgeThrottle(this.this$0.this$0.this$0.getStream().getVoiceSpeaking$app_productionBetaRelease().observeSpeakingUsers(), 250, TimeUnit.MILLISECONDS), this.this$0.this$0.this$0.getStream().getCalls$app_productionBetaRelease().get(this.this$0.this$0.$channelId).F(AnonymousClass1.INSTANCE), this.this$0.this$0.this$0.getStream().getVideoStreams$app_productionBetaRelease().observeUserStreams(), ObservableExtensionsKt.leadingEdgeThrottle(this.this$0.this$0.this$0.getStream().getGuilds$app_productionBetaRelease().observeComputed(this.this$0.$guildId), 1, TimeUnit.SECONDS), this.this$0.this$0.this$0.getStream().getApplicationStreaming$app_productionBetaRelease().observeStreamSpectators(), this.this$0.this$0.this$0.getStream().getMediaSettings$app_productionBetaRelease().getVoiceConfig(), StoreVoiceParticipants.access$getStreamContextsForUsers(this.this$0.this$0.this$0, u.plus((Collection<? extends Long>) arrayList, Long.valueOf(component1.getId()))), new AnonymousClass2(this, component1, collection));
}
}
public AnonymousClass1(StoreVoiceParticipants$get$1 storeVoiceParticipants$get$1, Channel channel, long j) {
this.this$0 = storeVoiceParticipants$get$1;
this.$channel = channel;
this.$guildId = j;
}
/* 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] */
@Override // j0.k.b
public /* bridge */ /* synthetic */ Observable<? extends Map<Long, ? extends StoreVoiceParticipants.VoiceUser>> call(Map<Long, ? extends VoiceState> map) {
return call((Map<Long, VoiceState>) map);
}
public final Observable<? extends Map<Long, StoreVoiceParticipants.VoiceUser>> call(Map<Long, VoiceState> map) {
Observable observeMe$default = StoreUser.observeMe$default(this.this$0.this$0.getStream().getUsers$app_productionBetaRelease(), false, 1, null);
StoreVoiceParticipants storeVoiceParticipants = this.this$0.this$0;
Channel channel = this.$channel;
m.checkNotNullExpressionValue(map, "voiceStates");
return Observable.j(observeMe$default, StoreVoiceParticipants.access$getOtherVoiceUsers(storeVoiceParticipants, channel, map), AnonymousClass1.INSTANCE).Y(new AnonymousClass2(this, map));
}
}
public StoreVoiceParticipants$get$1(StoreVoiceParticipants storeVoiceParticipants, long j) {
this.this$0 = storeVoiceParticipants;
this.$channelId = j;
}
public final Observable<? extends Map<Long, StoreVoiceParticipants.VoiceUser>> call(Channel channel) {
if (channel == null) {
return new j(h0.emptyMap());
}
long f = AnimatableValueParser.t1(channel) ? 0 : channel.f();
return this.this$0.getStream().getVoiceStates$app_productionBetaRelease().observe(f, channel.h()).Y(new AnonymousClass1(this, channel, f));
}
}