discord-jadx/app/src/main/java/com/discord/widgets/guildscheduledevent/GuildScheduledEventDetailsV...

59 lines
3.8 KiB
Java

package com.discord.widgets.guildscheduledevent;
import com.discord.api.channel.Channel;
import com.discord.api.guildscheduledevent.GuildScheduledEvent;
import com.discord.models.guild.Guild;
import com.discord.stores.StoreChannels;
import com.discord.stores.StoreGuildScheduledEvents;
import com.discord.stores.StoreGuilds;
import com.discord.stores.StorePermissions;
import com.discord.stores.StoreUserSettings;
import com.discord.stores.StoreVoiceChannelSelected;
import com.discord.utilities.guildscheduledevent.GuildScheduledEventUtilities;
import com.discord.widgets.guildscheduledevent.GuildScheduledEventDetailsViewModel;
import d0.z.d.o;
import kotlin.jvm.functions.Function0;
/* compiled from: GuildScheduledEventDetailsViewModel.kt */
public final class GuildScheduledEventDetailsViewModel$Companion$observeStores$1 extends o implements Function0<GuildScheduledEventDetailsViewModel.StoreState> {
public final /* synthetic */ StoreChannels $channelsStore;
public final /* synthetic */ long $guildScheduledEventId;
public final /* synthetic */ StoreGuildScheduledEvents $guildScheduledEventsStore;
public final /* synthetic */ StoreGuilds $guildsStore;
public final /* synthetic */ StorePermissions $permissionsStore;
public final /* synthetic */ StoreVoiceChannelSelected $selectedVoiceChannelStore;
public final /* synthetic */ StoreUserSettings $userSettingsStore;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public GuildScheduledEventDetailsViewModel$Companion$observeStores$1(StoreGuildScheduledEvents storeGuildScheduledEvents, long j, StoreChannels storeChannels, StoreGuilds storeGuilds, StoreVoiceChannelSelected storeVoiceChannelSelected, StorePermissions storePermissions, StoreUserSettings storeUserSettings) {
super(0);
this.$guildScheduledEventsStore = storeGuildScheduledEvents;
this.$guildScheduledEventId = j;
this.$channelsStore = storeChannels;
this.$guildsStore = storeGuilds;
this.$selectedVoiceChannelStore = storeVoiceChannelSelected;
this.$permissionsStore = storePermissions;
this.$userSettingsStore = storeUserSettings;
}
@Override // kotlin.jvm.functions.Function0
/* renamed from: invoke */
public final GuildScheduledEventDetailsViewModel.StoreState mo1invoke() {
Channel channel;
GuildScheduledEvent findEventFromStore$default = StoreGuildScheduledEvents.findEventFromStore$default(this.$guildScheduledEventsStore, this.$guildScheduledEventId, null, 2, null);
if (findEventFromStore$default == null) {
return new GuildScheduledEventDetailsViewModel.StoreState(null, null, null, false, false, false, false, null, 255, null);
}
Long b = findEventFromStore$default.b();
if (b != null) {
channel = this.$channelsStore.getChannel(b.longValue());
} else {
channel = null;
}
Guild guild = this.$guildsStore.getGuild(findEventFromStore$default.f());
Long valueOf = Long.valueOf(this.$selectedVoiceChannelStore.getSelectedVoiceChannelId());
boolean isRsvpedToEvent = this.$guildScheduledEventsStore.isRsvpedToEvent(this.$guildScheduledEventId);
GuildScheduledEventUtilities.Companion companion = GuildScheduledEventUtilities.Companion;
return new GuildScheduledEventDetailsViewModel.StoreState(findEventFromStore$default, channel, guild, isRsvpedToEvent, GuildScheduledEventUtilities.Companion.canShareEvent$default(companion, findEventFromStore$default.b(), this.$channelsStore, this.$guildsStore, null, 8, null), companion.canStartEvent(findEventFromStore$default.f(), findEventFromStore$default.b(), this.$channelsStore, this.$permissionsStore), this.$userSettingsStore.getIsDeveloperMode(), valueOf);
}
}