forked from Juby210/discord-jadx
122 lines
8.8 KiB
Java
122 lines
8.8 KiB
Java
package com.discord.widgets.user;
|
|
|
|
import c.d.b.a.a;
|
|
import c0.t.h0;
|
|
import c0.t.n0;
|
|
import c0.z.d.m;
|
|
import c0.z.d.o;
|
|
import com.discord.api.channel.Channel;
|
|
import com.discord.api.message.MessageReference;
|
|
import com.discord.api.role.GuildRole;
|
|
import com.discord.models.guild.Guild;
|
|
import com.discord.models.member.GuildMember;
|
|
import com.discord.models.message.Message;
|
|
import com.discord.stores.StoreMessageReplies;
|
|
import com.discord.stores.StoreStream;
|
|
import com.discord.stores.StoreUserSettings;
|
|
import com.discord.utilities.embed.InviteEmbedModel;
|
|
import com.discord.utilities.rx.ObservableCombineLatestOverloadsKt;
|
|
import com.discord.widgets.chat.list.entries.LoadingEntry;
|
|
import com.discord.widgets.chat.list.entries.MentionFooterEntry;
|
|
import com.discord.widgets.chat.list.entries.MessageHeaderEntry;
|
|
import com.discord.widgets.chat.list.model.WidgetChatListModelMessages;
|
|
import com.discord.widgets.tabs.NavigationTab;
|
|
import com.discord.widgets.user.WidgetUserMentions;
|
|
import i0.k.b;
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.LinkedHashMap;
|
|
import java.util.Map;
|
|
import java.util.Set;
|
|
import kotlin.jvm.functions.Function11;
|
|
import rx.Observable;
|
|
/* compiled from: WidgetUserMentions.kt */
|
|
public final class WidgetUserMentions$Model$Companion$get$1<T, R> implements b<WidgetUserMentions.Model.MessageLoader.LoadingState, Observable<? extends WidgetUserMentions.Model>> {
|
|
public final /* synthetic */ NavigationTab $selectedTab;
|
|
|
|
/* compiled from: WidgetUserMentions.kt */
|
|
/* renamed from: com.discord.widgets.user.WidgetUserMentions$Model$Companion$get$1$1 reason: invalid class name */
|
|
public static final class AnonymousClass1 extends o implements Function11<WidgetChatListModelMessages.MessagesWithMetadata, Guild, Map<Long, ? extends Channel>, Map<Long, ? extends String>, Map<Long, ? extends Guild>, Map<Long, ? extends Map<Long, ? extends GuildRole>>, Map<Long, ? extends Map<Long, ? extends GuildMember>>, Long, Boolean, Boolean, InviteEmbedModel, WidgetUserMentions.Model> {
|
|
public final /* synthetic */ WidgetUserMentions.Model.MessageLoader.LoadingState $loadedState;
|
|
public final /* synthetic */ WidgetUserMentions$Model$Companion$get$1 this$0;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public AnonymousClass1(WidgetUserMentions$Model$Companion$get$1 widgetUserMentions$Model$Companion$get$1, WidgetUserMentions.Model.MessageLoader.LoadingState loadingState) {
|
|
super(11);
|
|
this.this$0 = widgetUserMentions$Model$Companion$get$1;
|
|
this.$loadedState = loadingState;
|
|
}
|
|
|
|
public final WidgetUserMentions.Model invoke(WidgetChatListModelMessages.MessagesWithMetadata messagesWithMetadata, Guild guild, Map<Long, Channel> map, Map<Long, String> map2, Map<Long, Guild> map3, Map<Long, ? extends Map<Long, GuildRole>> map4, Map<Long, ? extends Map<Long, GuildMember>> map5, long j, boolean z2, boolean z3, InviteEmbedModel inviteEmbedModel) {
|
|
Map<Long, Channel> map6 = map;
|
|
Map<Long, ? extends Map<Long, GuildRole>> map7 = map4;
|
|
Map<Long, ? extends Map<Long, GuildMember>> map8 = map5;
|
|
m.checkNotNullParameter(messagesWithMetadata, "messagesWithMetadata");
|
|
m.checkNotNullParameter(map6, "channels");
|
|
m.checkNotNullParameter(map2, "names");
|
|
m.checkNotNullParameter(map3, "guilds");
|
|
m.checkNotNullParameter(map7, "roles");
|
|
m.checkNotNullParameter(map8, "members");
|
|
m.checkNotNullParameter(inviteEmbedModel, "inviteEmbedModel");
|
|
long id2 = guild != null ? guild.getId() : 0;
|
|
String name = guild != null ? guild.getName() : null;
|
|
ArrayList arrayList = new ArrayList(this.$loadedState.getMentions().size() * 2);
|
|
Set emptySet = n0.emptySet();
|
|
Map<Long, StoreMessageReplies.MessageState> allMessageReferences = StoreStream.Companion.getRepliedMessages().getAllMessageReferences();
|
|
for (Message message : this.$loadedState.getMentions()) {
|
|
Channel channel = map6.get(Long.valueOf(message.getChannelId()));
|
|
if (channel != null) {
|
|
Object obj = map8.get(Long.valueOf(message.getChannelId()));
|
|
if (obj == null) {
|
|
obj = h0.emptyMap();
|
|
}
|
|
Map map9 = (Map) obj;
|
|
Object s0 = a.s0(channel, map7);
|
|
if (s0 == null) {
|
|
s0 = h0.emptyMap();
|
|
}
|
|
Map map10 = (Map) s0;
|
|
LinkedHashMap linkedHashMap = new LinkedHashMap();
|
|
MessageReference messageReference = message.getMessageReference();
|
|
Long c2 = messageReference != null ? messageReference.c() : null;
|
|
if (c2 != null) {
|
|
Object obj2 = (StoreMessageReplies.MessageState) allMessageReferences.get(c2);
|
|
if (obj2 == null) {
|
|
obj2 = StoreMessageReplies.MessageState.Unloaded.INSTANCE;
|
|
}
|
|
linkedHashMap.put(c2, obj2);
|
|
}
|
|
arrayList.add(new MessageHeaderEntry(message, channel, (Guild) a.s0(channel, map3)));
|
|
arrayList.addAll(WidgetChatListModelMessages.Companion.getMessageItems$default(WidgetChatListModelMessages.Companion, channel, map9, map10, h0.emptyMap(), messagesWithMetadata.getMessageThreads().get(Long.valueOf(message.getId())), messagesWithMetadata.getThreadCountsAndLatestMessages().get(Long.valueOf(message.getId())), message, messagesWithMetadata.getMessageState().get(Long.valueOf(message.getId())), linkedHashMap, false, false, null, z2, z3, StoreStream.Companion.getUserSettings().getIsRenderEmbedsEnabled(), j, false, new HashMap(), inviteEmbedModel, false, 524288, null));
|
|
}
|
|
map6 = map;
|
|
map7 = map4;
|
|
map8 = map5;
|
|
}
|
|
if (this.$loadedState.isLoading()) {
|
|
arrayList.add(new LoadingEntry());
|
|
} else if (this.$loadedState.isAllLoaded()) {
|
|
arrayList.add(new MentionFooterEntry());
|
|
}
|
|
return new WidgetUserMentions.Model(j, -1, map3.get(Long.valueOf(id2)), id2, map2, -1, arrayList, emptySet, -1, false, z2, name, this.this$0.$selectedTab, 512, null);
|
|
}
|
|
|
|
/* 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, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object] */
|
|
@Override // kotlin.jvm.functions.Function11
|
|
public /* bridge */ /* synthetic */ WidgetUserMentions.Model invoke(WidgetChatListModelMessages.MessagesWithMetadata messagesWithMetadata, Guild guild, Map<Long, ? extends Channel> map, Map<Long, ? extends String> map2, Map<Long, ? extends Guild> map3, Map<Long, ? extends Map<Long, ? extends GuildRole>> map4, Map<Long, ? extends Map<Long, ? extends GuildMember>> map5, Long l, Boolean bool, Boolean bool2, InviteEmbedModel inviteEmbedModel) {
|
|
return invoke(messagesWithMetadata, guild, (Map<Long, Channel>) map, (Map<Long, String>) map2, (Map<Long, Guild>) map3, (Map<Long, ? extends Map<Long, GuildRole>>) map4, (Map<Long, ? extends Map<Long, GuildMember>>) map5, l.longValue(), bool.booleanValue(), bool2.booleanValue(), inviteEmbedModel);
|
|
}
|
|
}
|
|
|
|
public WidgetUserMentions$Model$Companion$get$1(NavigationTab navigationTab) {
|
|
this.$selectedTab = navigationTab;
|
|
}
|
|
|
|
public final Observable<? extends WidgetUserMentions.Model> call(WidgetUserMentions.Model.MessageLoader.LoadingState loadingState) {
|
|
Observable<WidgetChatListModelMessages.MessagesWithMetadata> observable = WidgetChatListModelMessages.MessagesWithMetadata.Companion.get(loadingState.getMentions());
|
|
StoreStream.Companion companion = StoreStream.Companion;
|
|
return ObservableCombineLatestOverloadsKt.combineLatest(observable, companion.getGuildSelected().observeSelectedGuild(), companion.getChannels().observeAllChannels(), companion.getChannels().observeNames(), companion.getGuilds().observeGuilds(), companion.getGuilds().observeRoles(), companion.getGuilds().observeComputed(), companion.getUsers().observeMeId(), StoreUserSettings.observeIsAnimatedEmojisEnabled$default(companion.getUserSettings(), false, 1, null), StoreUserSettings.observeIsAutoPlayGifsEnabled$default(companion.getUserSettings(), false, 1, null), InviteEmbedModel.Companion.observe$default(InviteEmbedModel.Companion, null, null, null, null, 15, null), new AnonymousClass1(this, loadingState));
|
|
}
|
|
}
|