discord-jadx/app/src/main/java/com/discord/widgets/forums/ForumUtils$observeSelectedP...

40 lines
1.8 KiB
Java

package com.discord.widgets.forums;
import com.discord.api.channel.Channel;
import com.discord.api.channel.ChannelUtils;
import com.discord.stores.StoreChannels;
import com.discord.stores.StoreChannelsSelected;
import com.discord.stores.StoreExperiments;
import d0.z.d.o;
import kotlin.jvm.functions.Function0;
/* compiled from: ForumUtils.kt */
/* loaded from: classes2.dex */
public final class ForumUtils$observeSelectedPostChannel$1 extends o implements Function0<Channel> {
public final /* synthetic */ StoreChannels $storeChannels;
public final /* synthetic */ StoreChannelsSelected $storeChannelsSelected;
public final /* synthetic */ StoreExperiments $storeExperiments;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
public ForumUtils$observeSelectedPostChannel$1(StoreChannelsSelected storeChannelsSelected, StoreExperiments storeExperiments, StoreChannels storeChannels) {
super(0);
this.$storeChannelsSelected = storeChannelsSelected;
this.$storeExperiments = storeExperiments;
this.$storeChannels = storeChannels;
}
/* JADX WARN: Can't rename method to resolve collision */
@Override // kotlin.jvm.functions.Function0
public final Channel invoke() {
Channel selectedChannel = this.$storeChannelsSelected.getSelectedChannel();
if (selectedChannel == null) {
return null;
}
boolean canAccessRedesignedForumChannels = ForumUtils.INSTANCE.canAccessRedesignedForumChannels(selectedChannel.i(), this.$storeExperiments);
Channel channel = this.$storeChannels.getChannel(selectedChannel.u());
if (!canAccessRedesignedForumChannels || channel == null || !ChannelUtils.q(channel)) {
return null;
}
return selectedChannel;
}
}