2021-08-09 22:50:52 +00:00
|
|
|
package com.discord.widgets.servers.community;
|
|
|
|
|
|
|
|
import com.discord.api.guild.Guild;
|
|
|
|
import com.discord.api.role.GuildRole;
|
|
|
|
import com.discord.restapi.RestAPIParams;
|
|
|
|
import com.discord.widgets.servers.community.WidgetServerSettingsEnableCommunityViewModel;
|
2021-11-01 07:19:03 +00:00
|
|
|
import d0.z.d.m;
|
|
|
|
import d0.z.d.o;
|
2021-08-09 22:50:52 +00:00
|
|
|
import java.util.Map;
|
|
|
|
import kotlin.Unit;
|
|
|
|
import kotlin.jvm.functions.Function1;
|
|
|
|
/* compiled from: WidgetServerSettingsEnableCommunityViewModel.kt */
|
|
|
|
public final class WidgetServerSettingsEnableCommunityViewModel$updateGuild$2 extends o implements Function1<Guild, Unit> {
|
|
|
|
public final /* synthetic */ WidgetServerSettingsEnableCommunityViewModel.CommunityGuildConfig $currentConfig;
|
|
|
|
public final /* synthetic */ WidgetServerSettingsEnableCommunityViewModel.ViewState.Loaded $currentViewState;
|
|
|
|
public final /* synthetic */ WidgetServerSettingsEnableCommunityViewModel this$0;
|
|
|
|
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
|
|
public WidgetServerSettingsEnableCommunityViewModel$updateGuild$2(WidgetServerSettingsEnableCommunityViewModel widgetServerSettingsEnableCommunityViewModel, WidgetServerSettingsEnableCommunityViewModel.CommunityGuildConfig communityGuildConfig, WidgetServerSettingsEnableCommunityViewModel.ViewState.Loaded loaded) {
|
|
|
|
super(1);
|
|
|
|
this.this$0 = widgetServerSettingsEnableCommunityViewModel;
|
|
|
|
this.$currentConfig = communityGuildConfig;
|
|
|
|
this.$currentViewState = loaded;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 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(Guild guild) {
|
|
|
|
invoke(guild);
|
|
|
|
return Unit.a;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void invoke(Guild guild) {
|
|
|
|
GuildRole guildRole;
|
|
|
|
m.checkNotNullParameter(guild, "it");
|
|
|
|
if (this.$currentConfig.getEveryonePermissions()) {
|
|
|
|
Map<Long, GuildRole> roles = this.$currentConfig.getRoles();
|
2022-01-10 08:29:29 +00:00
|
|
|
WidgetServerSettingsEnableCommunityViewModel.access$patchRole(this.this$0, new RestAPIParams.Role(null, null, null, null, null, Long.valueOf(-1116960071743L & ((roles == null || (guildRole = roles.get(Long.valueOf(this.this$0.getGuildId()))) == null) ? 0 : guildRole.h())), guild.r(), null, 159, null));
|
2021-08-09 22:50:52 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
WidgetServerSettingsEnableCommunityViewModel.access$updateViewState(this.this$0, WidgetServerSettingsEnableCommunityViewModel.ViewState.Loaded.copy$default(this.$currentViewState, 0, false, null, 5, null));
|
2021-12-17 22:01:24 +00:00
|
|
|
WidgetServerSettingsEnableCommunityViewModel.access$getEventSubject$p(this.this$0).k.onNext(WidgetServerSettingsEnableCommunityViewModel.Event.SaveSuccess.INSTANCE);
|
2021-08-09 22:50:52 +00:00
|
|
|
}
|
|
|
|
}
|