discord-jadx/app/src/main/java/com/discord/widgets/chat/list/adapter/WidgetChatListAdapterItemSt...

124 lines
6.2 KiB
Java

package com.discord.widgets.chat.list.adapter;
import android.content.Context;
import android.view.View;
import androidx.fragment.app.FragmentManager;
import com.discord.api.channel.Channel;
import com.discord.api.guild.Guild;
import com.discord.models.domain.ModelInvite;
import com.discord.widgets.chat.list.adapter.WidgetChatListAdapterItemStageInvite;
import com.discord.widgets.stage.StageChannelJoinHelper;
import d0.l;
import d0.w.h.c;
import d0.w.i.a.e;
import d0.w.i.a.k;
import d0.z.d.m;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.jvm.functions.Function2;
import kotlinx.coroutines.Job;
/* compiled from: WidgetChatListAdapterItemStageInvite.kt */
public final class WidgetChatListAdapterItemStageInvite$configureUI$2 implements View.OnClickListener {
public final /* synthetic */ Context $context;
public final /* synthetic */ WidgetChatListAdapterItemStageInvite.Model $model;
public final /* synthetic */ WidgetChatListAdapterItemStageInvite this$0;
/* compiled from: WidgetChatListAdapterItemStageInvite.kt */
@e(c = "com.discord.widgets.chat.list.adapter.WidgetChatListAdapterItemStageInvite$configureUI$2$1", f = "WidgetChatListAdapterItemStageInvite.kt", l = {121}, m = "invokeSuspend")
/* renamed from: com.discord.widgets.chat.list.adapter.WidgetChatListAdapterItemStageInvite$configureUI$2$1 reason: invalid class name */
public static final class AnonymousClass1 extends k implements Function2<ModelInvite, Continuation<? super Unit>, Object> {
public final /* synthetic */ long $channelId;
public final /* synthetic */ long $guildId;
public int label;
public final /* synthetic */ WidgetChatListAdapterItemStageInvite$configureUI$2 this$0;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public AnonymousClass1(WidgetChatListAdapterItemStageInvite$configureUI$2 widgetChatListAdapterItemStageInvite$configureUI$2, long j, long j2, Continuation continuation) {
super(2, continuation);
this.this$0 = widgetChatListAdapterItemStageInvite$configureUI$2;
this.$guildId = j;
this.$channelId = j2;
}
@Override // d0.w.i.a.a
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
m.checkNotNullParameter(continuation, "completion");
return new AnonymousClass1(this.this$0, this.$guildId, this.$channelId, continuation);
}
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object] */
@Override // kotlin.jvm.functions.Function2
public final Object invoke(ModelInvite modelInvite, Continuation<? super Unit> continuation) {
return ((AnonymousClass1) create(modelInvite, continuation)).invokeSuspend(Unit.a);
}
@Override // d0.w.i.a.a
public final Object invokeSuspend(Object obj) {
Object coroutine_suspended = c.getCOROUTINE_SUSPENDED();
int i = this.label;
if (i == 0) {
l.throwOnFailure(obj);
StageChannelJoinHelper stageChannelJoinHelper = StageChannelJoinHelper.INSTANCE;
Context context = this.this$0.$context;
m.checkNotNullExpressionValue(context, "context");
FragmentManager fragmentManager = WidgetChatListAdapterItemStageInvite.access$getAdapter$p(this.this$0.this$0).getFragmentManager();
long j = this.$guildId;
long j2 = this.$channelId;
this.label = 1;
if (StageChannelJoinHelper.lurkAndJoinStageAsync$default(stageChannelJoinHelper, context, fragmentManager, j, j2, true, null, null, null, this, 224, null) == coroutine_suspended) {
return coroutine_suspended;
}
} else if (i == 1) {
l.throwOnFailure(obj);
} else {
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
return Unit.a;
}
}
public WidgetChatListAdapterItemStageInvite$configureUI$2(WidgetChatListAdapterItemStageInvite widgetChatListAdapterItemStageInvite, WidgetChatListAdapterItemStageInvite.Model model, Context context) {
this.this$0 = widgetChatListAdapterItemStageInvite;
this.$model = model;
this.$context = context;
}
/* JADX WARNING: Removed duplicated region for block: B:18:? A[RETURN, SYNTHETIC] */
/* JADX WARNING: Removed duplicated region for block: B:9:0x0023 */
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
Long l;
long f;
Guild guild = this.$model.getInvite().guild;
if (guild != null) {
f = guild.r();
} else {
Channel channel = this.$model.getChannel();
if (channel != null) {
f = channel.f();
} else {
l = null;
if (l == null) {
long longValue = l.longValue();
Channel channel2 = this.$model.getChannel();
if (channel2 != null) {
long h = channel2.h();
Job access$getInviteJoinJob$p = WidgetChatListAdapterItemStageInvite.access$getInviteJoinJob$p(this.this$0);
if (access$getInviteJoinJob$p == null || !access$getInviteJoinJob$p.a()) {
WidgetChatListAdapterItemStageInvite widgetChatListAdapterItemStageInvite = this.this$0;
WidgetChatListAdapterItemStageInvite.access$setInviteJoinJob$p(widgetChatListAdapterItemStageInvite, WidgetChatListAdapterItemInviteBase.joinServerOrDM$default(widgetChatListAdapterItemStageInvite, widgetChatListAdapterItemStageInvite.getClass(), this.$model.getInvite(), new AnonymousClass1(this, longValue, h, null), null, 8, null));
return;
}
return;
}
return;
}
return;
}
}
l = Long.valueOf(f);
if (l == null) {
}
}
}