135 lines
10 KiB
Java
135 lines
10 KiB
Java
package com.discord.widgets.servers;
|
|
|
|
import android.view.View;
|
|
import android.widget.LinearLayout;
|
|
import android.widget.TextView;
|
|
import c.a.d.q;
|
|
import com.discord.api.channel.Channel;
|
|
import com.discord.api.guild.Guild;
|
|
import com.discord.api.guild.GuildExplicitContentFilter;
|
|
import com.discord.api.guild.GuildVerificationLevel;
|
|
import com.discord.restapi.RestAPIParams;
|
|
import com.discord.stores.StoreStream;
|
|
import com.discord.utilities.icon.IconUtils;
|
|
import com.discord.utilities.rest.RestAPI;
|
|
import com.discord.utilities.rx.ObservableExtensionsKt;
|
|
import com.discord.utilities.rx.ObservableExtensionsKt$filterNull$1;
|
|
import com.discord.utilities.rx.ObservableExtensionsKt$filterNull$2;
|
|
import com.discord.utilities.stateful.StatefulViews;
|
|
import com.discord.views.CheckedSetting;
|
|
import com.discord.widgets.servers.WidgetServerSettingsOverview;
|
|
import com.facebook.drawee.view.SimpleDraweeView;
|
|
import com.google.android.material.textfield.TextInputLayout;
|
|
import d0.t.u;
|
|
import d0.z.d.m;
|
|
import j0.k.b;
|
|
import rx.Observable;
|
|
import rx.functions.Action1;
|
|
/* compiled from: WidgetServerSettingsOverview.kt */
|
|
public final class WidgetServerSettingsOverview$configureUI$7 implements View.OnClickListener {
|
|
public final /* synthetic */ WidgetServerSettingsOverview.Model $this_configureUI;
|
|
public final /* synthetic */ WidgetServerSettingsOverview this$0;
|
|
|
|
/* compiled from: WidgetServerSettingsOverview.kt */
|
|
/* renamed from: com.discord.widgets.servers.WidgetServerSettingsOverview$configureUI$7$1 reason: invalid class name */
|
|
public static final class AnonymousClass1<T, R> implements b<Guild, Observable<? extends com.discord.models.guild.Guild>> {
|
|
public static final AnonymousClass1 INSTANCE = new AnonymousClass1();
|
|
|
|
public final Observable<? extends com.discord.models.guild.Guild> call(Guild guild) {
|
|
Observable<R> F = StoreStream.Companion.getGuilds().observeGuild(guild.o()).x(ObservableExtensionsKt$filterNull$1.INSTANCE).F(ObservableExtensionsKt$filterNull$2.INSTANCE);
|
|
m.checkNotNullExpressionValue(F, "filter { it != null }.map { it!! }");
|
|
return F;
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetServerSettingsOverview.kt */
|
|
/* renamed from: com.discord.widgets.servers.WidgetServerSettingsOverview$configureUI$7$2 reason: invalid class name */
|
|
public static final class AnonymousClass2<T, R> implements b<com.discord.models.guild.Guild, Observable<? extends WidgetServerSettingsOverview.Model>> {
|
|
public static final AnonymousClass2 INSTANCE = new AnonymousClass2();
|
|
|
|
public final Observable<? extends WidgetServerSettingsOverview.Model> call(com.discord.models.guild.Guild guild) {
|
|
return WidgetServerSettingsOverview.Model.Companion.get(guild.getId());
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetServerSettingsOverview.kt */
|
|
/* renamed from: com.discord.widgets.servers.WidgetServerSettingsOverview$configureUI$7$3 reason: invalid class name */
|
|
public static final class AnonymousClass3<T> implements Action1<WidgetServerSettingsOverview.Model> {
|
|
public final /* synthetic */ WidgetServerSettingsOverview$configureUI$7 this$0;
|
|
|
|
public AnonymousClass3(WidgetServerSettingsOverview$configureUI$7 widgetServerSettingsOverview$configureUI$7) {
|
|
this.this$0 = widgetServerSettingsOverview$configureUI$7;
|
|
}
|
|
|
|
public final void call(WidgetServerSettingsOverview.Model model) {
|
|
WidgetServerSettingsOverview.access$configureUpdatedGuild(this.this$0.this$0, model);
|
|
}
|
|
}
|
|
|
|
public WidgetServerSettingsOverview$configureUI$7(WidgetServerSettingsOverview widgetServerSettingsOverview, WidgetServerSettingsOverview.Model model) {
|
|
this.this$0 = widgetServerSettingsOverview;
|
|
this.$this_configureUI = model;
|
|
}
|
|
|
|
@Override // android.view.View.OnClickListener
|
|
public final void onClick(View view) {
|
|
StatefulViews access$getState$p = WidgetServerSettingsOverview.access$getState$p(this.this$0);
|
|
CheckedSetting checkedSetting = WidgetServerSettingsOverview.access$getBinding$p(this.this$0).i.d;
|
|
m.checkNotNullExpressionValue(checkedSetting, "binding.systemChannel.systemChannelJoin");
|
|
int id2 = checkedSetting.getId();
|
|
CheckedSetting checkedSetting2 = WidgetServerSettingsOverview.access$getBinding$p(this.this$0).i.d;
|
|
m.checkNotNullExpressionValue(checkedSetting2, "binding.systemChannel.systemChannelJoin");
|
|
int i = !((Boolean) access$getState$p.get(id2, Boolean.valueOf(checkedSetting2.isChecked()))).booleanValue() ? 1 : 0;
|
|
StatefulViews access$getState$p2 = WidgetServerSettingsOverview.access$getState$p(this.this$0);
|
|
CheckedSetting checkedSetting3 = WidgetServerSettingsOverview.access$getBinding$p(this.this$0).i.f67c;
|
|
m.checkNotNullExpressionValue(checkedSetting3, "binding.systemChannel.systemChannelBoost");
|
|
int id3 = checkedSetting3.getId();
|
|
CheckedSetting checkedSetting4 = WidgetServerSettingsOverview.access$getBinding$p(this.this$0).i.f67c;
|
|
m.checkNotNullExpressionValue(checkedSetting4, "binding.systemChannel.systemChannelBoost");
|
|
if (!((Boolean) access$getState$p2.get(id3, Boolean.valueOf(checkedSetting4.isChecked()))).booleanValue()) {
|
|
i |= 2;
|
|
}
|
|
RestAPI apiSerializeNulls = RestAPI.Companion.getApiSerializeNulls();
|
|
long id4 = this.$this_configureUI.getGuild().getId();
|
|
StatefulViews access$getState$p3 = WidgetServerSettingsOverview.access$getState$p(this.this$0);
|
|
TextView textView = WidgetServerSettingsOverview.access$getBinding$p(this.this$0).b.b;
|
|
m.checkNotNullExpressionValue(textView, "binding.afk.afkChannel");
|
|
Channel channel = (Channel) access$getState$p3.get(textView.getId(), this.$this_configureUI.getAfkChannelModel());
|
|
Long valueOf = channel != null ? Long.valueOf(channel.h()) : null;
|
|
StatefulViews access$getState$p4 = WidgetServerSettingsOverview.access$getState$p(this.this$0);
|
|
LinearLayout linearLayout = WidgetServerSettingsOverview.access$getBinding$p(this.this$0).b.e;
|
|
m.checkNotNullExpressionValue(linearLayout, "binding.afk.afkTimeoutWrap");
|
|
Integer num = (Integer) access$getState$p4.get(linearLayout.getId(), Integer.valueOf(this.$this_configureUI.getGuild().getAfkTimeout()));
|
|
StatefulViews access$getState$p5 = WidgetServerSettingsOverview.access$getState$p(this.this$0);
|
|
TextView textView2 = WidgetServerSettingsOverview.access$getBinding$p(this.this$0).i.b;
|
|
m.checkNotNullExpressionValue(textView2, "binding.systemChannel.systemChannel");
|
|
Channel channel2 = (Channel) access$getState$p5.get(textView2.getId(), this.$this_configureUI.getSystemChannelModel());
|
|
Long valueOf2 = channel2 != null ? Long.valueOf(channel2.h()) : null;
|
|
Integer num2 = (Integer) WidgetServerSettingsOverview.access$getState$p(this.this$0).get(90001, Integer.valueOf(this.$this_configureUI.getGuild().getDefaultMessageNotifications()));
|
|
StatefulViews access$getState$p6 = WidgetServerSettingsOverview.access$getState$p(this.this$0);
|
|
SimpleDraweeView simpleDraweeView = WidgetServerSettingsOverview.access$getBinding$p(this.this$0).f1908c.d;
|
|
m.checkNotNullExpressionValue(simpleDraweeView, "binding.header.serverSettingsOverviewIcon");
|
|
String str = (String) access$getState$p6.get(simpleDraweeView.getId(), IconUtils.getForGuild$default(this.$this_configureUI.getGuild(), null, false, null, 14, null));
|
|
StatefulViews access$getState$p7 = WidgetServerSettingsOverview.access$getState$p(this.this$0);
|
|
TextInputLayout textInputLayout = WidgetServerSettingsOverview.access$getBinding$p(this.this$0).f1908c.f179c;
|
|
m.checkNotNullExpressionValue(textInputLayout, "binding.header.overviewName");
|
|
String str2 = (String) access$getState$p7.get(textInputLayout.getId(), this.$this_configureUI.getGuild().getName());
|
|
StatefulViews access$getState$p8 = WidgetServerSettingsOverview.access$getState$p(this.this$0);
|
|
LinearLayout linearLayout2 = WidgetServerSettingsOverview.access$getBinding$p(this.this$0).e.d;
|
|
m.checkNotNullExpressionValue(linearLayout2, "binding.region.overviewRegionWrap");
|
|
String str3 = (String) access$getState$p8.get(linearLayout2.getId(), this.$this_configureUI.getGuild().getRegion());
|
|
GuildVerificationLevel verificationLevel = this.$this_configureUI.getGuild().getVerificationLevel();
|
|
GuildExplicitContentFilter explicitContentFilter = this.$this_configureUI.getGuild().getExplicitContentFilter();
|
|
StatefulViews access$getState$p9 = WidgetServerSettingsOverview.access$getState$p(this.this$0);
|
|
SimpleDraweeView simpleDraweeView2 = WidgetServerSettingsOverview.access$getBinding$p(this.this$0).k.e;
|
|
m.checkNotNullExpressionValue(simpleDraweeView2, "binding.uploadSplash.uploadSplash");
|
|
String str4 = (String) access$getState$p9.get(simpleDraweeView2.getId(), this.$this_configureUI.getGuild().getSplash());
|
|
StatefulViews access$getState$p10 = WidgetServerSettingsOverview.access$getState$p(this.this$0);
|
|
SimpleDraweeView simpleDraweeView3 = WidgetServerSettingsOverview.access$getBinding$p(this.this$0).j.d;
|
|
m.checkNotNullExpressionValue(simpleDraweeView3, "binding.uploadBanner.uploadBanner");
|
|
Observable Y = ObservableExtensionsKt.restSubscribeOn$default(apiSerializeNulls.updateGuild(id4, new RestAPIParams.UpdateGuild(valueOf, num, valueOf2, num2, str, str2, str3, verificationLevel, explicitContentFilter, str4, (String) access$getState$p10.get(simpleDraweeView3.getId(), this.$this_configureUI.getGuild().getBanner()), Integer.valueOf(i), u.toList(this.$this_configureUI.getGuild().getFeatures()), this.$this_configureUI.getGuild().getRulesChannelId(), this.$this_configureUI.getGuild().getPublicUpdatesChannelId(), this.$this_configureUI.getGuild().getPreferredLocale())), false, 1, null).Y(AnonymousClass1.INSTANCE).Y(AnonymousClass2.INSTANCE);
|
|
m.checkNotNullExpressionValue(Y, "RestAPI\n .apiSe…atedGuild.id)\n }");
|
|
ObservableExtensionsKt.ui$default(ObservableExtensionsKt.takeSingleUntilTimeout$default(Y, 0, false, 3, null), this.this$0, null, 2, null).k(q.i(new AnonymousClass3(this), this.this$0));
|
|
}
|
|
}
|