discord-jadx/app/src/main/java/com/discord/widgets/channels/WidgetCreateChannel$configu...

82 lines
4.8 KiB
Java

package com.discord.widgets.channels;
import android.content.Context;
import android.view.MenuItem;
import com.discord.R;
import com.discord.analytics.generated.events.network_action.TrackNetworkActionChannelCreate;
import com.discord.analytics.generated.traits.TrackNetworkMetadataReceiver;
import com.discord.api.channel.Channel;
import com.discord.api.permission.PermissionOverwrite;
import com.discord.restapi.RestAPIParams;
import com.discord.stores.utilities.RestCallStateKt;
import com.discord.utilities.rest.RestAPI;
import com.discord.utilities.rx.ObservableExtensionsKt;
import com.discord.utilities.view.extensions.ViewExtensions;
import com.google.android.material.textfield.TextInputLayout;
import d0.z.d.k;
import d0.z.d.m;
import d0.z.d.o;
import java.util.List;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import rx.functions.Action2;
/* compiled from: WidgetCreateChannel.kt */
public final class WidgetCreateChannel$configureUI$1<T1, T2> implements Action2<MenuItem, Context> {
public final /* synthetic */ WidgetCreateChannel this$0;
/* compiled from: WidgetCreateChannel.kt */
/* renamed from: com.discord.widgets.channels.WidgetCreateChannel$configureUI$1$1 reason: invalid class name */
public static final class AnonymousClass1 extends o implements Function1<Channel, TrackNetworkMetadataReceiver> {
public final /* synthetic */ WidgetCreateChannel$configureUI$1 this$0;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public AnonymousClass1(WidgetCreateChannel$configureUI$1 widgetCreateChannel$configureUI$1) {
super(1);
this.this$0 = widgetCreateChannel$configureUI$1;
}
public final TrackNetworkMetadataReceiver invoke(Channel channel) {
List<PermissionOverwrite> s2;
return new TrackNetworkActionChannelCreate((channel == null || (s2 = channel.s()) == null) ? null : Boolean.valueOf(!s2.isEmpty()), channel != null ? Long.valueOf((long) channel.A()) : null, channel != null ? Long.valueOf(channel.h()) : null, channel != null ? Long.valueOf(channel.r()) : null, Long.valueOf(WidgetCreateChannel.access$getGuildId$p(this.this$0.this$0)));
}
}
/* compiled from: WidgetCreateChannel.kt */
/* renamed from: com.discord.widgets.channels.WidgetCreateChannel$configureUI$1$2 reason: invalid class name */
public static final /* synthetic */ class AnonymousClass2 extends k implements Function1<Channel, Unit> {
public AnonymousClass2(WidgetCreateChannel widgetCreateChannel) {
super(1, widgetCreateChannel, WidgetCreateChannel.class, "onChannelCreated", "onChannelCreated(Lcom/discord/api/channel/Channel;)V", 0);
}
/* 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 // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Unit invoke(Channel channel) {
invoke(channel);
return Unit.a;
}
public final void invoke(Channel channel) {
m.checkNotNullParameter(channel, "p1");
WidgetCreateChannel.access$onChannelCreated((WidgetCreateChannel) this.receiver, channel);
}
}
public WidgetCreateChannel$configureUI$1(WidgetCreateChannel widgetCreateChannel) {
this.this$0 = widgetCreateChannel;
}
public final void call(MenuItem menuItem, Context context) {
m.checkNotNullParameter(menuItem, "menuItem");
if (menuItem.getItemId() == R.id.menu_sort_channel) {
RestAPI api = RestAPI.Companion.getApi();
long access$getGuildId$p = WidgetCreateChannel.access$getGuildId$p(this.this$0);
int access$getChannelType$p = WidgetCreateChannel.access$getChannelType$p(this.this$0);
TextInputLayout textInputLayout = WidgetCreateChannel.access$getBinding$p(this.this$0).d;
m.checkNotNullExpressionValue(textInputLayout, "binding.createChannelNameLayout");
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(ObservableExtensionsKt.restSubscribeOn$default(RestCallStateKt.logNetworkAction(api.createGuildChannel(access$getGuildId$p, new RestAPIParams.CreateGuildChannel(access$getChannelType$p, null, ViewExtensions.getTextOrEmpty(textInputLayout), WidgetCreateChannel.access$getCategoryId$p(this.this$0), WidgetCreateChannel.access$getPermissionOverwrites(this.this$0), null)), new AnonymousClass1(this)), false, 1, null), this.this$0, null, 2, null), this.this$0.getClass(), this.this$0.getContext(), (Function1) null, (Function1) null, (Function0) null, (Function0) null, new AnonymousClass2(this.this$0), 60, (Object) null);
}
}
}