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

98 lines
5.7 KiB
Java

package com.discord.widgets.chat.list.adapter;
import c.d.b.a.a;
import com.discord.api.channel.Channel;
import com.discord.api.stageinstance.StageInstance;
import com.discord.models.domain.ModelInvite;
import com.discord.models.user.User;
import com.discord.stores.StoreAccessibility;
import com.discord.stores.StoreChannels;
import com.discord.stores.StoreGuilds;
import com.discord.stores.StoreRequestedStageChannels;
import com.discord.stores.StoreStageChannels;
import com.discord.stores.StoreStageInstances;
import com.discord.stores.StoreUser;
import com.discord.widgets.chat.list.adapter.WidgetChatListAdapterItemStageInvite;
import com.discord.widgets.chat.list.entries.StageInviteEntry;
import com.discord.widgets.stage.StageRoles;
import d0.t.n;
import d0.z.d.m;
import d0.z.d.o;
import java.util.List;
import java.util.Map;
import kotlin.jvm.functions.Function0;
/* compiled from: WidgetChatListAdapterItemStageInvite.kt */
public final class WidgetChatListAdapterItemStageInvite$Model$Companion$observe$1 extends o implements Function0<WidgetChatListAdapterItemStageInvite.Model> {
public final /* synthetic */ StoreAccessibility $accessibilityStore;
public final /* synthetic */ StoreChannels $channelStore;
public final /* synthetic */ StoreGuilds $guildStore;
public final /* synthetic */ StageInviteEntry $item;
public final /* synthetic */ StoreRequestedStageChannels $requestedInstanceStore;
public final /* synthetic */ StoreStageChannels $stageChannelStore;
public final /* synthetic */ StoreStageInstances $stageInstanceStore;
public final /* synthetic */ StoreUser $userStore;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public WidgetChatListAdapterItemStageInvite$Model$Companion$observe$1(StoreUser storeUser, StageInviteEntry stageInviteEntry, StoreChannels storeChannels, StoreAccessibility storeAccessibility, StoreStageInstances storeStageInstances, StoreRequestedStageChannels storeRequestedStageChannels, StoreStageChannels storeStageChannels, StoreGuilds storeGuilds) {
super(0);
this.$userStore = storeUser;
this.$item = stageInviteEntry;
this.$channelStore = storeChannels;
this.$accessibilityStore = storeAccessibility;
this.$stageInstanceStore = storeStageInstances;
this.$requestedInstanceStore = storeRequestedStageChannels;
this.$stageChannelStore = storeStageChannels;
this.$guildStore = storeGuilds;
}
/* JADX WARNING: Removed duplicated region for block: B:24:0x00e4 */
@Override // kotlin.jvm.functions.Function0
/* renamed from: invoke */
public final WidgetChatListAdapterItemStageInvite.Model mo1invoke() {
Channel channel;
Integer num;
Integer num2;
long id2 = this.$userStore.getMe().getId();
User user = this.$userStore.getUsers().get(Long.valueOf(this.$item.getUserId()));
Channel channel2 = this.$item.getInvite().getChannel();
if (channel2 == null || (channel = this.$channelStore.getChannel(channel2.h())) == null) {
channel = this.$item.getInvite().getChannel();
}
boolean isReducedMotionEnabled = this.$accessibilityStore.isReducedMotionEnabled();
StageInstance stageInstanceForChannel = this.$stageInstanceStore.getStageInstanceForChannel(channel.h());
if (stageInstanceForChannel == null) {
stageInstanceForChannel = this.$requestedInstanceStore.getStageInstanceForChannel(channel.h());
}
Map<Long, StageRoles> channelRoles = this.$stageChannelStore.getChannelRoles(channel.h());
StoreRequestedStageChannels.StageInstanceState stageInstanceState = (StoreRequestedStageChannels.StageInstanceState) a.d(channel, this.$requestedInstanceStore.getRequestedInstanceStatesByChannel());
WidgetChatListAdapterItemStageInvite.Model.Companion companion = WidgetChatListAdapterItemStageInvite.Model.Companion;
List access$speakersFromLocalStore = WidgetChatListAdapterItemStageInvite.Model.Companion.access$speakersFromLocalStore(companion, this.$guildStore, this.$userStore, this.$stageChannelStore, channel.h(), this.$item.getGuildId());
if (access$speakersFromLocalStore == null) {
access$speakersFromLocalStore = WidgetChatListAdapterItemStageInvite.Model.Companion.access$speakersFromRequest(companion, stageInstanceState);
}
if (channelRoles == null || access$speakersFromLocalStore == null) {
if ((stageInstanceState != null ? stageInstanceState.getStageInstance() : null) != null) {
num2 = Integer.valueOf(stageInstanceState.getStageInstance().c() - stageInstanceState.getStageInstance().g().size());
} else {
num = null;
ModelInvite invite = this.$item.getInvite();
m.checkNotNullExpressionValue(channel, "channel");
boolean z2 = !isReducedMotionEnabled;
if (access$speakersFromLocalStore == null) {
access$speakersFromLocalStore = n.emptyList();
}
return new WidgetChatListAdapterItemStageInvite.Model(invite, id2, user, channel, z2, stageInstanceForChannel, access$speakersFromLocalStore, num);
}
} else {
num2 = Integer.valueOf(channelRoles.size() - access$speakersFromLocalStore.size());
}
num = num2;
ModelInvite invite = this.$item.getInvite();
m.checkNotNullExpressionValue(channel, "channel");
boolean z2 = !isReducedMotionEnabled;
if (access$speakersFromLocalStore == null) {
}
return new WidgetChatListAdapterItemStageInvite.Model(invite, id2, user, channel, z2, stageInstanceForChannel, access$speakersFromLocalStore, num);
}
}