package com.discord.stores; import com.discord.api.channel.Channel; import com.discord.api.stageinstance.StageInstance; import com.discord.api.stageinstance.StageInstancePrivacyLevel; import com.discord.models.member.GuildMember; import com.discord.models.user.User; import com.discord.stores.StoreStream; import d0.z.d.m; import j0.k.b; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Map; import java.util.Set; import rx.Observable; import rx.functions.Action1; /* compiled from: StoreVoiceParticipants.kt */ public final class StoreVoiceParticipants$getOtherVoiceUsers$1 implements b>> { public final /* synthetic */ Channel $channel; public final /* synthetic */ Map $voiceStates; /* compiled from: StoreVoiceParticipants.kt */ /* renamed from: com.discord.stores.StoreVoiceParticipants$getOtherVoiceUsers$1$1 reason: invalid class name */ public static final class AnonymousClass1 implements b, Set> { public static final AnonymousClass1 INSTANCE = new AnonymousClass1(); /* 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 */ Set call(Map map) { return call((Map) map); } public final Set call(Map map) { return map.keySet(); } } /* compiled from: StoreVoiceParticipants.kt */ /* renamed from: com.discord.stores.StoreVoiceParticipants$getOtherVoiceUsers$1$2 reason: invalid class name */ public static final class AnonymousClass2 implements b, List> { public final /* synthetic */ Long $meId; public final /* synthetic */ StoreVoiceParticipants$getOtherVoiceUsers$1 this$0; public AnonymousClass2(StoreVoiceParticipants$getOtherVoiceUsers$1 storeVoiceParticipants$getOtherVoiceUsers$1, Long l) { this.this$0 = storeVoiceParticipants$getOtherVoiceUsers$1; this.$meId = l; } /* 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 */ List call(Set set) { return call((Set) set); } public final List call(Set set) { m.checkNotNullExpressionValue(set, "memberIds"); ArrayList arrayList = new ArrayList(); for (T t : set) { long longValue = t.longValue(); Long l = this.$meId; if ((l == null || longValue != l.longValue()) && this.this$0.$voiceStates.containsKey(Long.valueOf(longValue))) { arrayList.add(t); } } return arrayList; } } /* compiled from: StoreVoiceParticipants.kt */ /* renamed from: com.discord.stores.StoreVoiceParticipants$getOtherVoiceUsers$1$3 reason: invalid class name */ public static final class AnonymousClass3 implements b, Observable>> { public final /* synthetic */ StoreVoiceParticipants$getOtherVoiceUsers$1 this$0; /* compiled from: StoreVoiceParticipants.kt */ /* renamed from: com.discord.stores.StoreVoiceParticipants$getOtherVoiceUsers$1$3$1 reason: invalid class name */ public static final class AnonymousClass1 implements Action1> { public final /* synthetic */ AnonymousClass3 this$0; public AnonymousClass1(AnonymousClass3 r1) { this.this$0 = r1; } public final void call(Map map) { StoreStream.Companion companion = StoreStream.Companion; StageInstance stageInstanceForChannel = companion.getStageInstances().getStageInstanceForChannel(this.this$0.this$0.$channel.h()); if ((stageInstanceForChannel != null ? stageInstanceForChannel.e() : null) == StageInstancePrivacyLevel.PUBLIC) { StoreGuildMemberRequester guildMemberRequester = companion.getGuildMemberRequester(); for (Number number : this.this$0.this$0.$voiceStates.keySet()) { long longValue = number.longValue(); m.checkNotNullExpressionValue(map, "otherUsers"); if (!map.containsKey(Long.valueOf(longValue))) { guildMemberRequester.queueRequest(this.this$0.this$0.$channel.f(), longValue); } } guildMemberRequester.performQueuedRequests(); } } } /* compiled from: StoreVoiceParticipants.kt */ /* renamed from: com.discord.stores.StoreVoiceParticipants$getOtherVoiceUsers$1$3$2 reason: invalid class name */ public static final class AnonymousClass2 implements b, Collection> { public static final AnonymousClass2 INSTANCE = new AnonymousClass2(); /* JADX DEBUG: Type inference failed for r1v1. Raw type applied. Possible types: java.util.Collection, java.util.Collection */ public final Collection call(Map map) { return map.values(); } } public AnonymousClass3(StoreVoiceParticipants$getOtherVoiceUsers$1 storeVoiceParticipants$getOtherVoiceUsers$1) { this.this$0 = storeVoiceParticipants$getOtherVoiceUsers$1; } /* 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> call(List list) { return call((List) list); } public final Observable> call(List list) { StoreUser users = StoreStream.Companion.getUsers(); m.checkNotNullExpressionValue(list, "otherMemberIds"); return users.observeUsers(list).t(new AnonymousClass1(this)).F(AnonymousClass2.INSTANCE); } } public StoreVoiceParticipants$getOtherVoiceUsers$1(Channel channel, Map map) { this.$channel = channel; this.$voiceStates = map; } public final Observable> call(Long l) { return StoreStream.Companion.getGuilds().observeComputed(this.$channel.f()).F(AnonymousClass1.INSTANCE).F(new AnonymousClass2(this, l)).Y(new AnonymousClass3(this)); } }