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

141 lines
7.1 KiB
Java

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<T, R> implements b<Long, Observable<? extends Collection<? extends User>>> {
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<T, R> implements b<Map<Long, ? extends GuildMember>, Set<? extends Long>> {
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<? extends Long> call(Map<Long, ? extends GuildMember> map) {
return call((Map<Long, GuildMember>) map);
}
public final Set<Long> call(Map<Long, GuildMember> 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<T, R> implements b<Set<? extends Long>, List<? extends Long>> {
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<? extends Long> call(Set<? extends Long> set) {
return call((Set<Long>) set);
}
public final List<Long> call(Set<Long> 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<T, R> implements b<List<? extends Long>, Observable<? extends Collection<? extends User>>> {
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<T> implements Action1<Map<Long, ? extends User>> {
public final /* synthetic */ AnonymousClass3 this$0;
public AnonymousClass1(AnonymousClass3 r1) {
this.this$0 = r1;
}
public final void call(Map<Long, ? extends User> 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<T, R> implements b<Map<Long, ? extends User>, Collection<? extends User>> {
public static final AnonymousClass2 INSTANCE = new AnonymousClass2();
/* JADX DEBUG: Type inference failed for r1v1. Raw type applied. Possible types: java.util.Collection<? extends com.discord.models.user.User>, java.util.Collection<com.discord.models.user.User> */
public final Collection<User> call(Map<Long, ? extends User> 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<? extends Collection<? extends User>> call(List<? extends Long> list) {
return call((List<Long>) list);
}
public final Observable<? extends Collection<User>> call(List<Long> 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<? extends Collection<User>> call(Long l) {
return StoreStream.Companion.getGuilds().observeComputed(this.$channel.f()).F(AnonymousClass1.INSTANCE).F(new AnonymousClass2(this, l)).Y(new AnonymousClass3(this));
}
}