discord-jadx/app/src/main/java/com/discord/widgets/stage/StageChannelJoinHelper$conn...

103 lines
4.7 KiB
Java

package com.discord.widgets.stage;
import android.content.Context;
import androidx.fragment.app.FragmentManager;
import c.d.b.a.a;
import com.discord.api.channel.Channel;
import com.discord.app.AppTransitionActivity;
import com.discord.stores.StoreChannels;
import com.discord.stores.StoreUserRelationships;
import com.discord.stores.StoreVoiceChannelSelected;
import com.discord.stores.StoreVoiceStates;
import com.discord.widgets.stage.sheet.WidgetStageAudienceBlockedBottomSheet;
import com.discord.widgets.voice.fullscreen.WidgetCallFullscreen;
import d0.f0.q;
import d0.t.h0;
import d0.t.u;
import d0.z.d.o;
import java.util.Iterator;
import java.util.Map;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.sequences.Sequence;
/* compiled from: StageChannelJoinHelper.kt */
public final class StageChannelJoinHelper$connectToStage$2 extends o implements Function0<Unit> {
public final /* synthetic */ long $channelId;
public final /* synthetic */ StoreChannels $channelsStore;
public final /* synthetic */ Context $context;
public final /* synthetic */ FragmentManager $fragmentManager;
public final /* synthetic */ boolean $launchFullscreen;
public final /* synthetic */ Function0 $onCompleted;
public final /* synthetic */ StoreUserRelationships $userRelationshipsStore;
public final /* synthetic */ StoreVoiceChannelSelected $voiceChannelSelectedStore;
public final /* synthetic */ StoreVoiceStates $voiceStatesStore;
public final /* synthetic */ boolean $warnedAboutBlockedUsers;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public StageChannelJoinHelper$connectToStage$2(StoreChannels storeChannels, long j, StoreVoiceStates storeVoiceStates, StoreUserRelationships storeUserRelationships, boolean z2, StoreVoiceChannelSelected storeVoiceChannelSelected, FragmentManager fragmentManager, boolean z3, Context context, Function0 function0) {
super(0);
this.$channelsStore = storeChannels;
this.$channelId = j;
this.$voiceStatesStore = storeVoiceStates;
this.$userRelationshipsStore = storeUserRelationships;
this.$warnedAboutBlockedUsers = z2;
this.$voiceChannelSelectedStore = storeVoiceChannelSelected;
this.$fragmentManager = fragmentManager;
this.$launchFullscreen = z3;
this.$context = context;
this.$onCompleted = function0;
}
/* JADX WARNING: Code restructure failed: missing block: B:20:0x007b, code lost:
if (r10.$voiceChannelSelectedStore.getSelectedVoiceChannelId() != r10.$channelId) goto L_0x007f;
*/
@Override // kotlin.jvm.functions.Function0
/* renamed from: invoke */
public final void mo1invoke() {
Object obj;
boolean z2;
Channel channel = this.$channelsStore.getChannel(this.$channelId);
if (channel != null) {
Map map = (Map) a.n0(channel, this.$voiceStatesStore.get());
if (map == null) {
map = h0.emptyMap();
}
Sequence map2 = q.map(q.filter(u.asSequence(map.values()), new StageChannelJoinHelper$connectToStage$2$channelVoiceStateUserIds$1(channel)), StageChannelJoinHelper$connectToStage$2$channelVoiceStateUserIds$2.INSTANCE);
Map<Long, Integer> relationships = this.$userRelationshipsStore.getRelationships();
boolean z3 = true;
if (!this.$warnedAboutBlockedUsers) {
Iterator it = map2.iterator();
while (true) {
if (!it.hasNext()) {
obj = null;
break;
}
obj = it.next();
Integer num = relationships.get(Long.valueOf(((Number) obj).longValue()));
if (num != null && num.intValue() == 2) {
z2 = true;
continue;
} else {
z2 = false;
continue;
}
if (z2) {
break;
}
}
if (obj != null) {
}
}
z3 = false;
if (z3) {
WidgetStageAudienceBlockedBottomSheet.Companion.show(this.$fragmentManager, this.$channelId, this.$launchFullscreen);
} else if (this.$launchFullscreen) {
WidgetCallFullscreen.Companion.launch$default(WidgetCallFullscreen.Companion, this.$context, this.$channelId, true, null, AppTransitionActivity.Transition.TYPE_SLIDE_VERTICAL_WITH_FADE, 8, null);
} else {
this.$voiceChannelSelectedStore.selectVoiceChannel(this.$channelId);
}
this.$onCompleted.mo1invoke();
}
}
}