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

40 lines
1.8 KiB
Java
Raw Normal View History

2022-03-28 08:10:50 +00:00
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;
2022-04-01 08:17:34 +00:00
import com.discord.stores.StoreExperiments;
2022-03-28 08:10:50 +00:00
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;
2022-04-01 08:17:34 +00:00
public final /* synthetic */ StoreExperiments $storeExperiments;
2022-03-28 08:10:50 +00:00
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
2022-04-01 08:17:34 +00:00
public ForumUtils$observeSelectedPostChannel$1(StoreChannelsSelected storeChannelsSelected, StoreExperiments storeExperiments, StoreChannels storeChannels) {
2022-03-28 08:10:50 +00:00
super(0);
this.$storeChannelsSelected = storeChannelsSelected;
2022-04-01 08:17:34 +00:00
this.$storeExperiments = storeExperiments;
2022-03-28 08:10:50 +00:00
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;
}
2022-04-01 08:17:34 +00:00
boolean canAccessRedesignedForumChannels = ForumUtils.INSTANCE.canAccessRedesignedForumChannels(selectedChannel.i(), this.$storeExperiments);
2022-03-28 08:10:50 +00:00
Channel channel = this.$storeChannels.getChannel(selectedChannel.u());
2022-04-01 08:17:34 +00:00
if (!canAccessRedesignedForumChannels || channel == null || !ChannelUtils.q(channel)) {
2022-03-28 08:10:50 +00:00
return null;
}
return selectedChannel;
}
}