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

76 lines
5.0 KiB
Java
Raw Normal View History

2021-08-24 17:45:16 +00:00
package com.discord.widgets.chat.list.adapter;
import com.discord.api.channel.Channel;
import com.discord.api.guildscheduledevent.GuildScheduledEvent;
2021-10-19 23:48:27 +00:00
import com.discord.api.permission.Permission;
2021-08-24 17:45:16 +00:00
import com.discord.models.domain.ModelInvite;
2021-09-01 21:26:33 +00:00
import com.discord.models.guild.Guild;
2021-11-15 19:38:30 +00:00
import com.discord.models.guild.UserGuildMember;
2021-08-24 17:45:16 +00:00
import com.discord.stores.StoreChannels;
import com.discord.stores.StoreGuildScheduledEvents;
import com.discord.stores.StoreGuilds;
2021-10-19 23:48:27 +00:00
import com.discord.stores.StorePermissions;
2021-08-24 17:45:16 +00:00
import com.discord.stores.StoreUser;
2021-10-05 20:14:30 +00:00
import com.discord.stores.StoreVoiceChannelSelected;
2021-11-08 18:25:28 +00:00
import com.discord.utilities.guildscheduledevent.GuildScheduledEventUtilities;
2021-11-15 19:38:30 +00:00
import com.discord.utilities.guildscheduledevent.GuildScheduledEventUtilitiesKt;
2021-10-19 23:48:27 +00:00
import com.discord.utilities.permissions.PermissionUtils;
2021-08-24 17:45:16 +00:00
import com.discord.widgets.chat.list.adapter.WidgetChatListAdapterItemGuildScheduledEventInvite;
import com.discord.widgets.chat.list.entries.GuildScheduledEventInviteEntry;
2021-11-08 18:25:28 +00:00
import d0.z.d.m;
import d0.z.d.o;
2021-08-24 17:45:16 +00:00
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;
2021-10-19 23:48:27 +00:00
public final /* synthetic */ StorePermissions $permissionStore;
2021-08-24 17:45:16 +00:00
public final /* synthetic */ StoreUser $userStore;
2021-10-05 20:14:30 +00:00
public final /* synthetic */ StoreVoiceChannelSelected $voiceChannelSelectedStore;
2021-08-24 17:45:16 +00:00
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
2021-10-19 23:48:27 +00:00
public WidgetChatListAdapterItemGuildScheduledEventInvite$Model$Companion$observe$1(GuildScheduledEventInviteEntry guildScheduledEventInviteEntry, StoreGuilds storeGuilds, StoreUser storeUser, StoreGuildScheduledEvents storeGuildScheduledEvents, StoreChannels storeChannels, StoreVoiceChannelSelected storeVoiceChannelSelected, StorePermissions storePermissions) {
2021-08-24 17:45:16 +00:00
super(0);
this.$item = guildScheduledEventInviteEntry;
this.$guildStore = storeGuilds;
this.$userStore = storeUser;
this.$guildScheduledEventStore = storeGuildScheduledEvents;
this.$channelStore = storeChannels;
2021-10-05 20:14:30 +00:00
this.$voiceChannelSelectedStore = storeVoiceChannelSelected;
2021-10-19 23:48:27 +00:00
this.$permissionStore = storePermissions;
2021-08-24 17:45:16 +00:00
}
@Override // kotlin.jvm.functions.Function0
/* renamed from: invoke */
2021-11-08 18:25:28 +00:00
public final WidgetChatListAdapterItemGuildScheduledEventInvite.Model mo1invoke() {
2021-10-05 20:14:30 +00:00
Channel channel;
2021-08-24 17:45:16 +00:00
GuildScheduledEvent guildScheduledEvent = this.$item.getGuildScheduledEvent();
2021-10-05 20:14:30 +00:00
Channel channel2 = this.$item.getInvite().getChannel();
2021-11-15 19:38:30 +00:00
Guild guild = null;
2021-10-05 20:14:30 +00:00
if (channel2 != null) {
2022-01-05 20:38:26 +00:00
com.discord.api.guild.Guild guild2 = this.$item.getInvite().guild;
2021-12-17 22:03:14 +00:00
channel = Channel.a(channel2, null, 0, guild2 != null ? guild2.r() : 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);
2021-10-05 20:14:30 +00:00
} else {
channel = null;
}
2021-11-15 19:38:30 +00:00
UserGuildMember creatorUserGuildMember$default = GuildScheduledEventUtilitiesKt.getCreatorUserGuildMember$default(guildScheduledEvent, (StoreGuilds) null, (StoreUser) null, 3, (Object) null);
2021-08-24 17:45:16 +00:00
ModelInvite invite = this.$item.getInvite();
2021-12-21 23:37:30 +00:00
boolean z2 = this.$guildStore.getMember(this.$item.getGuildScheduledEvent().h(), this.$userStore.getMe().getId()) != null;
boolean isMeRsvpedToEvent = this.$guildScheduledEventStore.isMeRsvpedToEvent(this.$item.getGuildScheduledEvent().h(), this.$item.getGuildScheduledEvent().i());
2021-10-05 20:14:30 +00:00
Channel channel3 = channel != null ? this.$channelStore.getChannel(channel.h()) : null;
2021-12-21 23:37:30 +00:00
Guild guild3 = this.$guildStore.getGuild(this.$item.getGuildScheduledEvent().h());
2021-11-15 19:38:30 +00:00
if (guild3 != null) {
guild = guild3;
2021-10-05 20:14:30 +00:00
} else {
2022-01-05 20:38:26 +00:00
com.discord.api.guild.Guild guild4 = this.$item.getInvite().guild;
2021-11-15 19:38:30 +00:00
if (guild4 != null) {
m.checkNotNullExpressionValue(guild4, "apiGuild");
guild = new Guild(guild4);
2021-09-01 21:26:33 +00:00
}
}
2021-12-21 23:37:30 +00:00
return new WidgetChatListAdapterItemGuildScheduledEventInvite.Model(invite, z2, isMeRsvpedToEvent, guildScheduledEvent, channel3, guild, creatorUserGuildMember$default, Long.valueOf(this.$voiceChannelSelectedStore.getSelectedVoiceChannelId()), channel != null ? PermissionUtils.can(Permission.CONNECT, this.$permissionStore.getPermissionsByChannel().get(Long.valueOf(channel.h()))) : false, GuildScheduledEventUtilities.Companion.canShareEvent$default(GuildScheduledEventUtilities.Companion, this.$item.getGuildScheduledEvent().b(), this.$item.getGuildScheduledEvent().h(), this.$channelStore, this.$guildStore, null, null, 48, null));
2021-08-24 17:45:16 +00:00
}
}