discord-jadx/app/src/main/java/com/discord/widgets/guildscheduledevent/GuildScheduledEventDetailsViewModel$Companion$observeStores$1.java

71 lines
4.4 KiB
Java
Raw Normal View History

2021-08-20 02:22:46 +00:00
package com.discord.widgets.guildscheduledevent;
2021-10-07 06:22:31 +00:00
import androidx.core.app.FrameMetricsAggregator;
2021-10-15 06:18:26 +00:00
import c0.z.d.o;
2021-08-20 02:22:46 +00:00
import com.discord.api.channel.Channel;
import com.discord.api.guildscheduledevent.GuildScheduledEvent;
2021-10-07 06:22:31 +00:00
import com.discord.api.permission.Permission;
2021-09-18 07:43:22 +00:00
import com.discord.models.guild.Guild;
2021-08-20 02:22:46 +00:00
import com.discord.stores.StoreChannels;
import com.discord.stores.StoreGuildScheduledEvents;
import com.discord.stores.StoreGuilds;
2021-09-18 07:43:22 +00:00
import com.discord.stores.StorePermissions;
import com.discord.stores.StoreUserSettings;
2021-09-29 17:50:51 +00:00
import com.discord.stores.StoreVoiceChannelSelected;
2021-09-18 07:43:22 +00:00
import com.discord.utilities.guildscheduledevent.GuildScheduledEventUtilities;
2021-10-07 06:22:31 +00:00
import com.discord.utilities.permissions.PermissionUtils;
2021-08-20 02:22:46 +00:00
import com.discord.widgets.guildscheduledevent.GuildScheduledEventDetailsViewModel;
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;
2021-09-18 07:43:22 +00:00
public final /* synthetic */ StorePermissions $permissionsStore;
2021-09-29 17:50:51 +00:00
public final /* synthetic */ StoreVoiceChannelSelected $selectedVoiceChannelStore;
2021-09-18 07:43:22 +00:00
public final /* synthetic */ StoreUserSettings $userSettingsStore;
2021-08-20 02:22:46 +00:00
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
2021-09-29 17:50:51 +00:00
public GuildScheduledEventDetailsViewModel$Companion$observeStores$1(StoreGuildScheduledEvents storeGuildScheduledEvents, long j, StoreChannels storeChannels, StoreGuilds storeGuilds, StoreVoiceChannelSelected storeVoiceChannelSelected, StorePermissions storePermissions, StoreUserSettings storeUserSettings) {
2021-08-20 02:22:46 +00:00
super(0);
this.$guildScheduledEventsStore = storeGuildScheduledEvents;
this.$guildScheduledEventId = j;
this.$channelsStore = storeChannels;
this.$guildsStore = storeGuilds;
2021-09-29 17:50:51 +00:00
this.$selectedVoiceChannelStore = storeVoiceChannelSelected;
2021-09-18 07:43:22 +00:00
this.$permissionsStore = storePermissions;
this.$userSettingsStore = storeUserSettings;
2021-08-20 02:22:46 +00:00
}
@Override // kotlin.jvm.functions.Function0
/* renamed from: invoke */
2021-10-15 06:18:26 +00:00
public final GuildScheduledEventDetailsViewModel.StoreState mo17invoke() {
2021-08-20 02:22:46 +00:00
Channel channel;
2021-10-07 06:22:31 +00:00
boolean z2;
2021-08-20 02:22:46 +00:00
GuildScheduledEvent findEventFromStore$default = StoreGuildScheduledEvents.findEventFromStore$default(this.$guildScheduledEventsStore, this.$guildScheduledEventId, null, 2, null);
if (findEventFromStore$default == null) {
2021-10-07 06:22:31 +00:00
return new GuildScheduledEventDetailsViewModel.StoreState(null, null, null, false, false, false, false, null, false, FrameMetricsAggregator.EVERY_DURATION, null);
2021-08-20 02:22:46 +00:00
}
Long b = findEventFromStore$default.b();
if (b != null) {
channel = this.$channelsStore.getChannel(b.longValue());
} else {
channel = null;
}
2021-09-18 07:43:22 +00:00
Guild guild = this.$guildsStore.getGuild(findEventFromStore$default.f());
2021-09-29 17:50:51 +00:00
Long valueOf = Long.valueOf(this.$selectedVoiceChannelStore.getSelectedVoiceChannelId());
2021-09-30 06:24:59 +00:00
boolean isRsvpedToEvent = this.$guildScheduledEventsStore.isRsvpedToEvent(findEventFromStore$default.f(), this.$guildScheduledEventId);
2021-09-18 07:43:22 +00:00
GuildScheduledEventUtilities.Companion companion = GuildScheduledEventUtilities.Companion;
2021-10-27 06:38:20 +00:00
boolean canShareEvent$default = GuildScheduledEventUtilities.Companion.canShareEvent$default(companion, findEventFromStore$default.b(), findEventFromStore$default.f(), this.$channelsStore, this.$guildsStore, null, null, 48, null);
2021-10-07 06:22:31 +00:00
boolean canStartEvent = companion.canStartEvent(findEventFromStore$default.f(), findEventFromStore$default.b(), this.$channelsStore, this.$permissionsStore);
Long b2 = findEventFromStore$default.b();
if (b2 != null) {
z2 = PermissionUtils.can(Permission.CONNECT, this.$permissionsStore.getPermissionsByChannel().get(Long.valueOf(b2.longValue())));
} else {
z2 = false;
}
return new GuildScheduledEventDetailsViewModel.StoreState(findEventFromStore$default, channel, guild, isRsvpedToEvent, canShareEvent$default, canStartEvent, this.$userSettingsStore.getIsDeveloperMode(), valueOf, z2);
2021-08-20 02:22:46 +00:00
}
}