51 lines
1.9 KiB
Java
51 lines
1.9 KiB
Java
package com.discord.stores;
|
|
|
|
import com.discord.api.channel.Channel;
|
|
import com.discord.api.message.Message;
|
|
import com.discord.utilities.message.MessageUtils;
|
|
import d0.d0.f;
|
|
import d0.t.g0;
|
|
import d0.z.d.o;
|
|
import java.util.ArrayList;
|
|
import java.util.LinkedHashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import kotlin.jvm.functions.Function0;
|
|
/* compiled from: StoreChannels.kt */
|
|
public final class StoreChannels$observeThreadsFromMessages$1 extends o implements Function0<Map<Long, ? extends Channel>> {
|
|
public final /* synthetic */ List $messages;
|
|
public final /* synthetic */ StoreChannels this$0;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public StoreChannels$observeThreadsFromMessages$1(StoreChannels storeChannels, List list) {
|
|
super(0);
|
|
this.this$0 = storeChannels;
|
|
this.$messages = list;
|
|
}
|
|
|
|
/* Return type fixed from 'java.util.Map<java.lang.Long, com.discord.api.channel.Channel>' to match base method */
|
|
@Override // kotlin.jvm.functions.Function0
|
|
/* renamed from: invoke */
|
|
public final Map<Long, ? extends Channel> mo1invoke() {
|
|
List list = this.$messages;
|
|
ArrayList<Message> arrayList = new ArrayList();
|
|
for (Object obj : list) {
|
|
if (MessageUtils.INSTANCE.hasThread((Message) obj)) {
|
|
arrayList.add(obj);
|
|
}
|
|
}
|
|
ArrayList arrayList2 = new ArrayList();
|
|
for (Message message : arrayList) {
|
|
Channel channel = this.this$0.getChannel(message.r());
|
|
if (channel != null) {
|
|
arrayList2.add(channel);
|
|
}
|
|
}
|
|
LinkedHashMap linkedHashMap = new LinkedHashMap(f.coerceAtLeast(g0.mapCapacity(d0.t.o.collectionSizeOrDefault(arrayList2, 10)), 16));
|
|
for (Object obj2 : arrayList2) {
|
|
linkedHashMap.put(Long.valueOf(((Channel) obj2).g()), obj2);
|
|
}
|
|
return linkedHashMap;
|
|
}
|
|
}
|