discord-jadx/app/src/main/java/com/discord/widgets/channels/list/WidgetChannelListModel$Comp...

220 lines
13 KiB
Java

package com.discord.widgets.channels.list;
import com.discord.api.channel.Channel;
import com.discord.api.channel.ChannelUtils;
import com.discord.api.permission.Permission;
import com.discord.api.permission.PermissionOverwrite;
import com.discord.stores.StoreStream;
import com.discord.utilities.PermissionOverwriteUtilsKt;
import com.discord.utilities.channel.GuildChannelsInfo;
import com.discord.widgets.channels.list.WidgetChannelListModel;
import d0.z.d.m;
import d0.z.d.o;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function3;
/* compiled from: WidgetChannelListModel.kt */
public final class WidgetChannelListModel$Companion$guildListBuilder$$inlined$forEach$lambda$1 extends o implements Function3<Channel, Boolean, Boolean, WidgetChannelListModel.Companion.TextLikeChannelData> {
public final /* synthetic */ WidgetChannelListModel$Companion$guildListBuilder$4 $areAllChildThreadsRead$4$inlined;
public final /* synthetic */ WidgetChannelListModel$Companion$guildListBuilder$5 $areAnyChildThreadsSelected$5$inlined;
public final /* synthetic */ boolean $canSeeGuildRoleSubscriptions$inlined;
public final /* synthetic */ Set $channelsWithActiveThreads$inlined;
public final /* synthetic */ Set $collapsedCategories$inlined;
public final /* synthetic */ Map $directories$inlined;
public final /* synthetic */ Map $directoryEvents$inlined;
public final /* synthetic */ HashSet $forceViewCategories$inlined;
public final /* synthetic */ GuildChannelsInfo $guild$inlined;
public final /* synthetic */ List $guildScheduledEvents$inlined;
public final /* synthetic */ HashSet $hiddenChannelsIds$inlined;
public final /* synthetic */ boolean $isCategoryMuted;
public final /* synthetic */ boolean $isGuildHub$inlined;
public final /* synthetic */ WidgetChannelListModel$Companion$guildListBuilder$3 $isThreadUnread$3$inlined;
public final /* synthetic */ ArrayList $items$inlined;
public final /* synthetic */ Map $joinedThreads$inlined;
public final /* synthetic */ Map $mentionCounts$inlined;
public final /* synthetic */ Map $messageAcks$inlined;
public final /* synthetic */ Channel $selectedChannel$inlined;
public final /* synthetic */ long $selectedGuildId$inlined;
public final /* synthetic */ long $selectedVoiceChannelId$inlined;
public final /* synthetic */ Map $stageChannels$inlined;
public final /* synthetic */ Map $stageInstances$inlined;
public final /* synthetic */ Map $threadParentMap$inlined;
public final /* synthetic */ WidgetChannelListModel$Companion$guildListBuilder$2 $tryRemoveEmptyCategory$2$inlined;
public final /* synthetic */ Set $unreadChannelIds$inlined;
public final /* synthetic */ Map $voiceStates$inlined;
/* compiled from: WidgetChannelListModel.kt */
/* renamed from: com.discord.widgets.channels.list.WidgetChannelListModel$Companion$guildListBuilder$$inlined$forEach$lambda$1$1 reason: invalid class name */
public static final class AnonymousClass1 extends o implements Function0<Boolean> {
public final /* synthetic */ Boolean $isParentMuted;
public final /* synthetic */ Channel $textChannel;
public final /* synthetic */ WidgetChannelListModel$Companion$guildListBuilder$$inlined$forEach$lambda$1 this$0;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public AnonymousClass1(WidgetChannelListModel$Companion$guildListBuilder$$inlined$forEach$lambda$1 widgetChannelListModel$Companion$guildListBuilder$$inlined$forEach$lambda$1, Channel channel, Boolean bool) {
super(0);
this.this$0 = widgetChannelListModel$Companion$guildListBuilder$$inlined$forEach$lambda$1;
this.$textChannel = channel;
this.$isParentMuted = bool;
}
/* Return type fixed from 'boolean' to match base method */
@Override // kotlin.jvm.functions.Function0
/* renamed from: invoke */
public final Boolean mo1invoke() {
Channel channel = StoreStream.Companion.getChannels().getChannel(this.$textChannel.r());
if (channel == null) {
return 1;
}
long h = channel.h();
Channel channel2 = this.this$0.$selectedChannel$inlined;
boolean z2 = (channel2 != null && (h > channel2.h() ? 1 : (h == channel2.h() ? 0 : -1)) == 0) || this.this$0.$areAnyChildThreadsSelected$5$inlined.invoke(channel.h());
boolean contains = this.this$0.$collapsedCategories$inlined.contains(Long.valueOf(channel.r()));
return (this.this$0.$hiddenChannelsIds$inlined.contains(Long.valueOf(this.$textChannel.r())) || (!z2 && !this.this$0.$isThreadUnread$3$inlined.invoke(this.$textChannel) && (contains || m.areEqual(this.$isParentMuted, Boolean.TRUE)))) ? 1 : null;
}
}
/* compiled from: WidgetChannelListModel.kt */
/* renamed from: com.discord.widgets.channels.list.WidgetChannelListModel$Companion$guildListBuilder$$inlined$forEach$lambda$1$2 reason: invalid class name */
public static final class AnonymousClass2 extends o implements Function0<Boolean> {
public final /* synthetic */ boolean $channelSelected;
public final /* synthetic */ boolean $isMuted;
public final /* synthetic */ int $mentionCount;
public final /* synthetic */ Channel $textChannel;
public final /* synthetic */ long $textChannelId;
public final /* synthetic */ boolean $unread;
public final /* synthetic */ WidgetChannelListModel$Companion$guildListBuilder$$inlined$forEach$lambda$1 this$0;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public AnonymousClass2(WidgetChannelListModel$Companion$guildListBuilder$$inlined$forEach$lambda$1 widgetChannelListModel$Companion$guildListBuilder$$inlined$forEach$lambda$1, int i, Channel channel, boolean z2, boolean z3, boolean z4, long j) {
super(0);
this.this$0 = widgetChannelListModel$Companion$guildListBuilder$$inlined$forEach$lambda$1;
this.$mentionCount = i;
this.$textChannel = channel;
this.$channelSelected = z2;
this.$isMuted = z3;
this.$unread = z4;
this.$textChannelId = j;
}
/* Return type fixed from 'boolean' to match base method */
/* JADX DEBUG: Failed to insert an additional move for type inference into block B:31:0x0073 */
/* JADX DEBUG: Multi-variable search result rejected for r1v1, resolved type: java.lang.Boolean */
/* JADX WARN: Multi-variable type inference failed */
@Override // kotlin.jvm.functions.Function0
/* renamed from: invoke */
public final Boolean mo1invoke() {
Boolean bool = 1;
boolean z2 = this.$mentionCount <= 0;
boolean contains = this.this$0.$collapsedCategories$inlined.contains(Long.valueOf(this.$textChannel.r()));
boolean z3 = this.$channelSelected || this.this$0.$areAnyChildThreadsSelected$5$inlined.invoke(this.$textChannel.h());
boolean invoke = this.this$0.$areAllChildThreadsRead$4$inlined.invoke(this.$textChannel.h());
boolean z4 = (contains && z2 && (this.this$0.$isCategoryMuted || this.$isMuted || !this.$unread)) || (this.$isMuted && this.this$0.$guild$inlined.getHideMutedChannels());
if (z3 || !invoke || !z4) {
bool = 0;
}
if (bool != 0) {
this.this$0.$hiddenChannelsIds$inlined.add(Long.valueOf(this.$textChannelId));
}
return bool;
}
}
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public WidgetChannelListModel$Companion$guildListBuilder$$inlined$forEach$lambda$1(boolean z2, GuildChannelsInfo guildChannelsInfo, HashSet hashSet, boolean z3, Channel channel, Map map, Set set, long j, WidgetChannelListModel$Companion$guildListBuilder$5 widgetChannelListModel$Companion$guildListBuilder$5, Set set2, WidgetChannelListModel$Companion$guildListBuilder$3 widgetChannelListModel$Companion$guildListBuilder$3, HashSet hashSet2, WidgetChannelListModel$Companion$guildListBuilder$4 widgetChannelListModel$Companion$guildListBuilder$4, long j2, Map map2, boolean z4, Set set3, List list, Map map3, Map map4, Map map5, Map map6, ArrayList arrayList, WidgetChannelListModel$Companion$guildListBuilder$2 widgetChannelListModel$Companion$guildListBuilder$2, Map map7, Map map8, Map map9) {
super(3);
this.$isCategoryMuted = z2;
this.$guild$inlined = guildChannelsInfo;
this.$forceViewCategories$inlined = hashSet;
this.$isGuildHub$inlined = z3;
this.$selectedChannel$inlined = channel;
this.$mentionCounts$inlined = map;
this.$unreadChannelIds$inlined = set;
this.$selectedGuildId$inlined = j;
this.$areAnyChildThreadsSelected$5$inlined = widgetChannelListModel$Companion$guildListBuilder$5;
this.$collapsedCategories$inlined = set2;
this.$isThreadUnread$3$inlined = widgetChannelListModel$Companion$guildListBuilder$3;
this.$hiddenChannelsIds$inlined = hashSet2;
this.$areAllChildThreadsRead$4$inlined = widgetChannelListModel$Companion$guildListBuilder$4;
this.$selectedVoiceChannelId$inlined = j2;
this.$voiceStates$inlined = map2;
this.$canSeeGuildRoleSubscriptions$inlined = z4;
this.$channelsWithActiveThreads$inlined = set3;
this.$guildScheduledEvents$inlined = list;
this.$stageInstances$inlined = map3;
this.$stageChannels$inlined = map4;
this.$threadParentMap$inlined = map5;
this.$joinedThreads$inlined = map6;
this.$items$inlined = arrayList;
this.$tryRemoveEmptyCategory$2$inlined = widgetChannelListModel$Companion$guildListBuilder$2;
this.$messageAcks$inlined = map7;
this.$directories$inlined = map8;
this.$directoryEvents$inlined = map9;
}
public static /* synthetic */ WidgetChannelListModel.Companion.TextLikeChannelData invoke$default(WidgetChannelListModel$Companion$guildListBuilder$$inlined$forEach$lambda$1 widgetChannelListModel$Companion$guildListBuilder$$inlined$forEach$lambda$1, Channel channel, boolean z2, Boolean bool, int i, Object obj) {
if ((i & 2) != 0) {
z2 = false;
}
if ((i & 4) != 0) {
bool = null;
}
return widgetChannelListModel$Companion$guildListBuilder$$inlined$forEach$lambda$1.invoke(channel, z2, bool);
}
/* JADX WARNING: Removed duplicated region for block: B:29:0x0091 */
/* JADX WARNING: Removed duplicated region for block: B:30:0x0096 */
public final WidgetChannelListModel.Companion.TextLikeChannelData invoke(Channel channel, boolean z2, Boolean bool) {
boolean z3;
Object obj;
boolean z4;
m.checkNotNullParameter(channel, "textChannel");
long h = channel.h();
Channel channel2 = this.$selectedChannel$inlined;
boolean z5 = channel2 != null && h == channel2.h();
Integer num = (Integer) this.$mentionCounts$inlined.get(Long.valueOf(h));
int intValue = num != null ? num.intValue() : 0;
boolean contains = this.$unreadChannelIds$inlined.contains(Long.valueOf(h));
List<PermissionOverwrite> s2 = channel.s();
if (s2 != null) {
Iterator<T> it = s2.iterator();
while (true) {
if (!it.hasNext()) {
obj = null;
break;
}
obj = it.next();
if (((PermissionOverwrite) obj).e() == this.$selectedGuildId$inlined) {
z4 = true;
continue;
} else {
z4 = false;
continue;
}
if (z4) {
break;
}
}
PermissionOverwrite permissionOverwrite = (PermissionOverwrite) obj;
if (permissionOverwrite != null && PermissionOverwriteUtilsKt.denies(permissionOverwrite, Permission.VIEW_CHANNEL)) {
z3 = true;
return new WidgetChannelListModel.Companion.TextLikeChannelData(z5, intValue, contains, z3, !ChannelUtils.C(channel) ? new AnonymousClass1(this, channel, bool).mo1invoke() : new AnonymousClass2(this, intValue, channel, z5, z2, contains, h).mo1invoke());
}
}
z3 = false;
return new WidgetChannelListModel.Companion.TextLikeChannelData(z5, intValue, contains, z3, !ChannelUtils.C(channel) ? new AnonymousClass1(this, channel, bool).mo1invoke() : new AnonymousClass2(this, intValue, channel, z5, z2, contains, h).mo1invoke());
}
/* Return type fixed from 'java.lang.Object' to match base method */
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object, java.lang.Object] */
@Override // kotlin.jvm.functions.Function3
public /* bridge */ /* synthetic */ WidgetChannelListModel.Companion.TextLikeChannelData invoke(Channel channel, Boolean bool, Boolean bool2) {
return invoke(channel, bool.booleanValue(), bool2);
}
}