forked from Juby210/discord-jadx
47 lines
2.6 KiB
Java
47 lines
2.6 KiB
Java
|
package com.discord.widgets.guildscheduledevent;
|
||
|
|
||
|
import android.view.View;
|
||
|
import c0.z.d.m;
|
||
|
import com.discord.api.channel.Channel;
|
||
|
import com.discord.models.domain.ModelInvite;
|
||
|
import com.discord.models.experiments.domain.Experiment;
|
||
|
import com.discord.views.CheckedSetting;
|
||
|
import com.discord.widgets.guilds.invite.WidgetInviteModel;
|
||
|
/* compiled from: WidgetGuildScheduledEventCreateSuccess.kt */
|
||
|
public final class WidgetGuildScheduledEventCreateSuccess$configureUI$2 implements View.OnClickListener {
|
||
|
public final /* synthetic */ Experiment $inviteExperiment;
|
||
|
public final /* synthetic */ WidgetInviteModel $widgetInviteModel;
|
||
|
public final /* synthetic */ WidgetGuildScheduledEventCreateSuccess this$0;
|
||
|
|
||
|
public WidgetGuildScheduledEventCreateSuccess$configureUI$2(WidgetGuildScheduledEventCreateSuccess widgetGuildScheduledEventCreateSuccess, WidgetInviteModel widgetInviteModel, Experiment experiment) {
|
||
|
this.this$0 = widgetGuildScheduledEventCreateSuccess;
|
||
|
this.$widgetInviteModel = widgetInviteModel;
|
||
|
this.$inviteExperiment = experiment;
|
||
|
}
|
||
|
|
||
|
@Override // android.view.View.OnClickListener
|
||
|
public final void onClick(View view) {
|
||
|
int i;
|
||
|
WidgetGuildScheduledEventCreateSuccess.access$getBinding$p(this.this$0).d.toggle();
|
||
|
ModelInvite.Settings settings = this.$widgetInviteModel.getSettings();
|
||
|
if (settings != null) {
|
||
|
WidgetGuildScheduledEventCreateSuccessViewModel access$getViewModel$p = WidgetGuildScheduledEventCreateSuccess.access$getViewModel$p(this.this$0);
|
||
|
CheckedSetting checkedSetting = WidgetGuildScheduledEventCreateSuccess.access$getBinding$p(this.this$0).d;
|
||
|
m.checkNotNullExpressionValue(checkedSetting, "binding.guildInviteNeverExpire");
|
||
|
if (checkedSetting.isChecked()) {
|
||
|
i = 0;
|
||
|
} else {
|
||
|
Experiment experiment = this.$inviteExperiment;
|
||
|
i = (experiment == null || experiment.getBucket() != 1) ? 86400 : ModelInvite.Settings.SEVEN_DAYS;
|
||
|
}
|
||
|
ModelInvite.Settings mergeMaxAge = settings.mergeMaxAge(i);
|
||
|
m.checkNotNullExpressionValue(mergeMaxAge, "settings.mergeMaxAge(\n … }\n )");
|
||
|
access$getViewModel$p.updateInviteSettings(mergeMaxAge);
|
||
|
}
|
||
|
Channel targetChannel = this.$widgetInviteModel.getTargetChannel();
|
||
|
if (targetChannel != null) {
|
||
|
WidgetGuildScheduledEventCreateSuccess.access$getViewModel$p(this.this$0).generateInviteLink(Long.valueOf(Long.valueOf(targetChannel.h()).longValue()));
|
||
|
}
|
||
|
}
|
||
|
}
|