2021-07-24 02:37:17 +00:00
|
|
|
package com.discord.widgets.chat.pins;
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
import com.airbnb.lottie.parser.AnimatableValueParser;
|
|
|
|
import com.discord.api.channel.Channel;
|
|
|
|
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.StoreStream;
|
2021-07-24 07:24:50 +00:00
|
|
|
import com.discord.stores.StoreUserSettings;
|
2021-07-24 02:37:17 +00:00
|
|
|
import com.discord.utilities.embed.InviteEmbedModel;
|
|
|
|
import com.discord.widgets.chat.list.entries.DividerEntry;
|
|
|
|
import com.discord.widgets.chat.list.entries.EmptyPinsEntry;
|
|
|
|
import com.discord.widgets.chat.list.entries.LoadingEntry;
|
|
|
|
import com.discord.widgets.chat.list.model.WidgetChatListModelMessages;
|
|
|
|
import com.discord.widgets.chat.pins.WidgetChannelPinnedMessages;
|
|
|
|
import d0.t.m;
|
|
|
|
import d0.t.n0;
|
|
|
|
import d0.t.u;
|
2021-07-24 07:24:50 +00:00
|
|
|
import j0.k.b;
|
2021-07-24 02:37:17 +00:00
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Set;
|
2021-07-24 07:24:50 +00:00
|
|
|
import rx.Observable;
|
2021-07-24 02:37:17 +00:00
|
|
|
import rx.functions.Func9;
|
|
|
|
/* compiled from: WidgetChannelPinnedMessages.kt */
|
2021-07-24 07:24:50 +00:00
|
|
|
public final class WidgetChannelPinnedMessages$Model$Companion$get$1<T, R> implements b<List<? extends Message>, Observable<? extends WidgetChannelPinnedMessages.Model>> {
|
2021-07-24 02:37:17 +00:00
|
|
|
public final /* synthetic */ Channel $channel;
|
|
|
|
public final /* synthetic */ Context $context;
|
|
|
|
|
2021-07-24 07:24:50 +00:00
|
|
|
/* compiled from: WidgetChannelPinnedMessages.kt */
|
|
|
|
/* renamed from: com.discord.widgets.chat.pins.WidgetChannelPinnedMessages$Model$Companion$get$1$1 reason: invalid class name */
|
|
|
|
public static final class AnonymousClass1<T1, T2, T3, T4, T5, T6, T7, T8, T9, R> implements Func9<Long, WidgetChatListModelMessages.MessagesWithMetadata, Map<Long, ? extends GuildRole>, Map<Long, ? extends GuildMember>, Map<Long, ? extends String>, Boolean, Boolean, Guild, InviteEmbedModel, WidgetChannelPinnedMessages.Model> {
|
|
|
|
public final /* synthetic */ List $pinnedMessages;
|
|
|
|
public final /* synthetic */ WidgetChannelPinnedMessages$Model$Companion$get$1 this$0;
|
|
|
|
|
|
|
|
public AnonymousClass1(WidgetChannelPinnedMessages$Model$Companion$get$1 widgetChannelPinnedMessages$Model$Companion$get$1, List list) {
|
|
|
|
this.this$0 = widgetChannelPinnedMessages$Model$Companion$get$1;
|
|
|
|
this.$pinnedMessages = list;
|
|
|
|
}
|
2021-07-24 02:37:17 +00:00
|
|
|
|
2021-07-24 07:24:50 +00:00
|
|
|
public final WidgetChannelPinnedMessages.Model call(Long l, WidgetChatListModelMessages.MessagesWithMetadata messagesWithMetadata, Map<Long, GuildRole> map, Map<Long, GuildMember> map2, Map<Long, String> map3, Boolean bool, Boolean bool2, Guild guild, InviteEmbedModel inviteEmbedModel) {
|
|
|
|
ArrayList arrayList;
|
|
|
|
Map<Long, GuildMember> map4;
|
|
|
|
List<Long> roles;
|
|
|
|
List listOf;
|
|
|
|
Long l2 = l;
|
|
|
|
Map<Long, GuildMember> map5 = map2;
|
|
|
|
List list = this.$pinnedMessages;
|
|
|
|
if (list == null) {
|
|
|
|
listOf = m.listOf(new LoadingEntry());
|
|
|
|
} else if (list.isEmpty()) {
|
|
|
|
WidgetChannelPinnedMessages$Model$Companion$get$1 widgetChannelPinnedMessages$Model$Companion$get$1 = this.this$0;
|
|
|
|
String string = widgetChannelPinnedMessages$Model$Companion$get$1.$context.getString(AnimatableValueParser.t1(widgetChannelPinnedMessages$Model$Companion$get$1.$channel) ? 2131891565 : 2131891564);
|
|
|
|
d0.z.d.m.checkNotNullExpressionValue(string, "context.getString(\n … )");
|
|
|
|
listOf = m.listOf(new EmptyPinsEntry(string));
|
|
|
|
} else {
|
|
|
|
ArrayList arrayList2 = new ArrayList();
|
|
|
|
int i = 0;
|
|
|
|
for (int size = this.$pinnedMessages.size(); i < size; size = size) {
|
|
|
|
Message message = (Message) this.$pinnedMessages.get(i);
|
|
|
|
WidgetChatListModelMessages.Companion companion = WidgetChatListModelMessages.Companion;
|
|
|
|
Channel channel = this.this$0.$channel;
|
|
|
|
d0.z.d.m.checkNotNullExpressionValue(map5, "guildMembers");
|
|
|
|
d0.z.d.m.checkNotNullExpressionValue(map, "guildRoles");
|
|
|
|
HashMap hashMap = new HashMap();
|
|
|
|
d0.z.d.m.checkNotNullExpressionValue(bool, "allowAnimateEmojis");
|
|
|
|
boolean booleanValue = bool.booleanValue();
|
|
|
|
d0.z.d.m.checkNotNullExpressionValue(bool2, "autoPlayGifs");
|
|
|
|
boolean booleanValue2 = bool2.booleanValue();
|
|
|
|
boolean isRenderEmbedsEnabled = StoreStream.Companion.getUserSettings().getIsRenderEmbedsEnabled();
|
|
|
|
HashMap hashMap2 = new HashMap();
|
|
|
|
d0.z.d.m.checkNotNullExpressionValue(inviteEmbedModel, "inviteEmbedModel");
|
|
|
|
arrayList2.addAll(WidgetChatListModelMessages.Companion.getMessageItems$default(companion, channel, map2, map, new HashMap(), messagesWithMetadata.getMessageThreads().get(Long.valueOf(message.getId())), messagesWithMetadata.getThreadCountsAndLatestMessages().get(Long.valueOf(message.getId())), message, messagesWithMetadata.getMessageState().get(Long.valueOf(message.getId())), hashMap, false, false, null, booleanValue, booleanValue2, isRenderEmbedsEnabled, false, hashMap2, inviteEmbedModel, false, 262144, null));
|
|
|
|
if (i < this.$pinnedMessages.size() - 1) {
|
|
|
|
arrayList2.add(new DividerEntry());
|
|
|
|
}
|
|
|
|
i++;
|
|
|
|
map5 = map2;
|
|
|
|
arrayList2 = arrayList2;
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
2021-07-24 07:24:50 +00:00
|
|
|
map4 = map2;
|
|
|
|
arrayList = arrayList2;
|
|
|
|
l2 = l;
|
|
|
|
GuildMember guildMember = map4.get(l2);
|
|
|
|
if (guildMember == null || (roles = guildMember.getRoles()) == null || (r2 = u.toHashSet(roles)) == null) {
|
|
|
|
Set set = n0.emptySet();
|
|
|
|
}
|
|
|
|
Channel channel2 = this.this$0.$channel;
|
|
|
|
d0.z.d.m.checkNotNullExpressionValue(l2, "meId");
|
|
|
|
long longValue = l.longValue();
|
|
|
|
d0.z.d.m.checkNotNullExpressionValue(map3, "channelNames");
|
|
|
|
return new WidgetChannelPinnedMessages.Model(channel2, guild, longValue, map3, arrayList, set, 0, 0, 0, 0, false, 1984, null);
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
2021-07-24 07:24:50 +00:00
|
|
|
arrayList = listOf;
|
|
|
|
map4 = map5;
|
|
|
|
GuildMember guildMember = map4.get(l2);
|
|
|
|
Set set = n0.emptySet();
|
|
|
|
Channel channel2 = this.this$0.$channel;
|
|
|
|
d0.z.d.m.checkNotNullExpressionValue(l2, "meId");
|
2021-07-24 02:37:17 +00:00
|
|
|
long longValue = l.longValue();
|
|
|
|
d0.z.d.m.checkNotNullExpressionValue(map3, "channelNames");
|
|
|
|
return new WidgetChannelPinnedMessages.Model(channel2, guild, longValue, map3, arrayList, set, 0, 0, 0, 0, false, 1984, null);
|
|
|
|
}
|
2021-07-24 07:24:50 +00:00
|
|
|
|
|
|
|
/* 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] */
|
|
|
|
@Override // rx.functions.Func9
|
|
|
|
public /* bridge */ /* synthetic */ WidgetChannelPinnedMessages.Model call(Long l, WidgetChatListModelMessages.MessagesWithMetadata messagesWithMetadata, Map<Long, ? extends GuildRole> map, Map<Long, ? extends GuildMember> map2, Map<Long, ? extends String> map3, Boolean bool, Boolean bool2, Guild guild, InviteEmbedModel inviteEmbedModel) {
|
|
|
|
return call(l, messagesWithMetadata, (Map<Long, GuildRole>) map, (Map<Long, GuildMember>) map2, (Map<Long, String>) map3, bool, bool2, guild, inviteEmbedModel);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public WidgetChannelPinnedMessages$Model$Companion$get$1(Channel channel, Context context) {
|
|
|
|
this.$channel = channel;
|
|
|
|
this.$context = context;
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Return type fixed from 'java.lang.Object' to match base method */
|
2021-07-24 07:24:50 +00:00
|
|
|
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
|
|
|
|
@Override // j0.k.b
|
|
|
|
public /* bridge */ /* synthetic */ Observable<? extends WidgetChannelPinnedMessages.Model> call(List<? extends Message> list) {
|
|
|
|
return call((List<Message>) list);
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Observable<? extends WidgetChannelPinnedMessages.Model> call(List<Message> list) {
|
|
|
|
StoreStream.Companion companion = StoreStream.Companion;
|
|
|
|
Observable<Long> observeMeId = companion.getUsers().observeMeId();
|
|
|
|
WidgetChatListModelMessages.MessagesWithMetadata.Companion companion2 = WidgetChatListModelMessages.MessagesWithMetadata.Companion;
|
|
|
|
d0.z.d.m.checkNotNullExpressionValue(list, "pinnedMessages");
|
|
|
|
return Observable.c(observeMeId, companion2.get(list), companion.getGuilds().observeRoles(this.$channel.f()), companion.getGuilds().observeComputed(this.$channel.f()), companion.getChannels().observeNames(), StoreUserSettings.observeIsAnimatedEmojisEnabled$default(companion.getUserSettings(), false, 1, null), StoreUserSettings.observeIsAutoPlayGifsEnabled$default(companion.getUserSettings(), false, 1, null), companion.getGuilds().observeGuild(this.$channel.f()), InviteEmbedModel.Companion.observe$default(InviteEmbedModel.Companion, null, null, null, null, 15, null), new AnonymousClass1(this, list));
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
}
|