discord-jadx/app/src/main/java/com/discord/widgets/chat/list/adapter/WidgetChatListAdapterItemGu...

71 lines
4.2 KiB
Java

package com.discord.widgets.chat.list.adapter;
import com.discord.api.channel.Channel;
import com.discord.api.guildscheduledevent.GuildScheduledEvent;
import com.discord.models.domain.ModelInvite;
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.StoreUser;
import com.discord.stores.StoreVoiceChannelSelected;
import com.discord.widgets.chat.list.adapter.WidgetChatListAdapterItemGuildScheduledEventInvite;
import com.discord.widgets.chat.list.entries.GuildScheduledEventInviteEntry;
import d0.z.d.m;
import d0.z.d.o;
import kotlin.jvm.functions.Function0;
/* compiled from: WidgetChatListAdapterItemGuildScheduledEventInvite.kt */
public final class WidgetChatListAdapterItemGuildScheduledEventInvite$Model$Companion$observe$1 extends o implements Function0<WidgetChatListAdapterItemGuildScheduledEventInvite.Model> {
public final /* synthetic */ StoreChannels $channelStore;
public final /* synthetic */ StoreGuildScheduledEvents $guildScheduledEventStore;
public final /* synthetic */ StoreGuilds $guildStore;
public final /* synthetic */ GuildScheduledEventInviteEntry $item;
public final /* synthetic */ StoreUser $userStore;
public final /* synthetic */ StoreVoiceChannelSelected $voiceChannelSelectedStore;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public WidgetChatListAdapterItemGuildScheduledEventInvite$Model$Companion$observe$1(GuildScheduledEventInviteEntry guildScheduledEventInviteEntry, StoreGuilds storeGuilds, StoreUser storeUser, StoreGuildScheduledEvents storeGuildScheduledEvents, StoreChannels storeChannels, StoreVoiceChannelSelected storeVoiceChannelSelected) {
super(0);
this.$item = guildScheduledEventInviteEntry;
this.$guildStore = storeGuilds;
this.$userStore = storeUser;
this.$guildScheduledEventStore = storeGuildScheduledEvents;
this.$channelStore = storeChannels;
this.$voiceChannelSelectedStore = storeVoiceChannelSelected;
}
@Override // kotlin.jvm.functions.Function0
/* renamed from: invoke */
public final WidgetChatListAdapterItemGuildScheduledEventInvite.Model mo1invoke() {
Channel channel;
Guild guild;
GuildScheduledEvent guildScheduledEvent = this.$item.getGuildScheduledEvent();
Channel channel2 = this.$item.getInvite().getChannel();
Guild guild2 = null;
if (channel2 != null) {
com.discord.api.guild.Guild guild3 = this.$item.getInvite().getGuild();
channel = Channel.a(channel2, null, 0, guild3 != null ? guild3.p() : 0, null, 0, 0, 0, null, null, 0, null, 0, 0, null, 0, 0, null, false, 0, null, 0, null, null, null, null, null, null, null, null, 536870907);
} else {
channel = null;
}
ModelInvite invite = this.$item.getInvite();
boolean z2 = this.$guildStore.getMember(this.$item.getGuildScheduledEvent().f(), this.$userStore.getMe().getId()) != null;
boolean isRsvpedToEvent = this.$guildScheduledEventStore.isRsvpedToEvent(this.$item.getGuildScheduledEvent().g());
GuildScheduledEvent findEventFromStore = this.$guildScheduledEventStore.findEventFromStore(guildScheduledEvent.g(), Long.valueOf(guildScheduledEvent.f()));
GuildScheduledEvent guildScheduledEvent2 = findEventFromStore != null ? findEventFromStore : guildScheduledEvent;
Channel channel3 = channel != null ? this.$channelStore.getChannel(channel.h()) : null;
Guild guild4 = this.$guildStore.getGuild(this.$item.getGuildScheduledEvent().f());
if (guild4 != null) {
guild = guild4;
} else {
com.discord.api.guild.Guild guild5 = this.$item.getInvite().getGuild();
if (guild5 != null) {
m.checkNotNullExpressionValue(guild5, "apiGuild");
guild2 = new Guild(guild5);
}
guild = guild2;
}
return new WidgetChatListAdapterItemGuildScheduledEventInvite.Model(invite, z2, isRsvpedToEvent, guildScheduledEvent2, channel3, guild, Long.valueOf(this.$voiceChannelSelectedStore.getSelectedVoiceChannelId()));
}
}