497 lines
25 KiB
Java
497 lines
25 KiB
Java
package com.discord.widgets.channels.threads.browser;
|
|
|
|
import android.content.Context;
|
|
import androidx.annotation.MainThread;
|
|
import c.d.b.a.a;
|
|
import com.discord.api.channel.Channel;
|
|
import com.discord.api.role.GuildRole;
|
|
import com.discord.app.AppViewModel;
|
|
import com.discord.models.guild.Guild;
|
|
import com.discord.models.member.GuildMember;
|
|
import com.discord.models.message.Message;
|
|
import com.discord.models.user.MeUser;
|
|
import com.discord.models.user.User;
|
|
import com.discord.stores.StoreChannels;
|
|
import com.discord.stores.StoreGuildMemberRequester;
|
|
import com.discord.stores.StoreGuilds;
|
|
import com.discord.stores.StorePermissions;
|
|
import com.discord.stores.StoreStream;
|
|
import com.discord.stores.StoreThreadMessages;
|
|
import com.discord.stores.StoreThreadsActive;
|
|
import com.discord.stores.StoreThreadsActiveJoined;
|
|
import com.discord.stores.StoreUser;
|
|
import com.discord.utilities.rx.ObservableExtensionsKt;
|
|
import com.discord.utilities.threads.ThreadUtils;
|
|
import com.discord.widgets.channels.threads.browser.ThreadBrowserThreadView;
|
|
import com.discord.widgets.channels.threads.browser.WidgetThreadBrowserAdapter;
|
|
import d0.t.n;
|
|
import d0.z.d.m;
|
|
import d0.z.d.o;
|
|
import java.util.ArrayList;
|
|
import java.util.Iterator;
|
|
import java.util.LinkedHashSet;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import kotlin.Triple;
|
|
import kotlin.Unit;
|
|
import kotlin.jvm.functions.Function0;
|
|
import kotlin.jvm.functions.Function1;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import rx.Observable;
|
|
/* compiled from: WidgetThreadBrowserActiveViewModel.kt */
|
|
public final class WidgetThreadBrowserActiveViewModel extends AppViewModel<ViewState> {
|
|
public static final Companion Companion = new Companion(null);
|
|
private final long channelId;
|
|
private final long guildId;
|
|
private final StoreChannels storeChannels;
|
|
private final StoreGuildMemberRequester storeGuildMemberRequester;
|
|
private final StoreGuilds storeGuilds;
|
|
private final StorePermissions storePermissions;
|
|
private final StoreThreadMessages storeThreadMessages;
|
|
private final StoreThreadsActive storeThreadsActive;
|
|
private final StoreThreadsActiveJoined storeThreadsActiveJoined;
|
|
private final StoreUser storeUser;
|
|
|
|
/* compiled from: WidgetThreadBrowserActiveViewModel.kt */
|
|
/* renamed from: com.discord.widgets.channels.threads.browser.WidgetThreadBrowserActiveViewModel$1 reason: invalid class name */
|
|
public static final class AnonymousClass1 extends o implements Function1<StoreState, Unit> {
|
|
public final /* synthetic */ WidgetThreadBrowserActiveViewModel this$0;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public AnonymousClass1(WidgetThreadBrowserActiveViewModel widgetThreadBrowserActiveViewModel) {
|
|
super(1);
|
|
this.this$0 = widgetThreadBrowserActiveViewModel;
|
|
}
|
|
|
|
/* 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] */
|
|
@Override // kotlin.jvm.functions.Function1
|
|
public /* bridge */ /* synthetic */ Unit invoke(StoreState storeState) {
|
|
invoke(storeState);
|
|
return Unit.a;
|
|
}
|
|
|
|
public final void invoke(StoreState storeState) {
|
|
m.checkNotNullParameter(storeState, "storeState");
|
|
WidgetThreadBrowserActiveViewModel.access$handleStoreState(this.this$0, storeState);
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetThreadBrowserActiveViewModel.kt */
|
|
public static final class Companion {
|
|
private Companion() {
|
|
}
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
|
|
public static final /* synthetic */ Observable access$observeStoreState(Companion companion, long j, long j2, StoreUser storeUser, StoreThreadsActive storeThreadsActive, StoreThreadsActiveJoined storeThreadsActiveJoined, StoreThreadMessages storeThreadMessages, StoreGuilds storeGuilds, StoreChannels storeChannels, StorePermissions storePermissions) {
|
|
return companion.observeStoreState(j, j2, storeUser, storeThreadsActive, storeThreadsActiveJoined, storeThreadMessages, storeGuilds, storeChannels, storePermissions);
|
|
}
|
|
|
|
private final Observable<StoreState> observeStoreState(long j, long j2, StoreUser storeUser, StoreThreadsActive storeThreadsActive, StoreThreadsActiveJoined storeThreadsActiveJoined, StoreThreadMessages storeThreadMessages, StoreGuilds storeGuilds, StoreChannels storeChannels, StorePermissions storePermissions) {
|
|
Observable<StoreState> Y = Observable.j(storeThreadsActiveJoined.observeActiveJoinedThreadsForChannel(j, j2).F(WidgetThreadBrowserActiveViewModel$Companion$observeStoreState$1.INSTANCE), storeThreadsActive.observeActiveThreadsForChannel(j, Long.valueOf(j2)), WidgetThreadBrowserActiveViewModel$Companion$observeStoreState$2.INSTANCE).Y(new WidgetThreadBrowserActiveViewModel$Companion$observeStoreState$3(storeUser, storeThreadMessages, storeGuilds, j, storeChannels, storePermissions, j2));
|
|
m.checkNotNullExpressionValue(Y, "Observable.combineLatest… }\n }");
|
|
return Y;
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetThreadBrowserActiveViewModel.kt */
|
|
public static final class StoreState {
|
|
private final Map<Long, Channel> activeJoinedThreads;
|
|
private final Map<Long, Channel> activeThreads;
|
|
private final Channel channel;
|
|
private final Map<Long, String> channelNames;
|
|
private final Guild guild;
|
|
private final Map<Long, GuildMember> guildMembers;
|
|
private final Map<Long, GuildRole> guildRoles;
|
|
private final MeUser meUser;
|
|
private final Long permissions;
|
|
private final Map<Long, StoreThreadMessages.ThreadState> threadStates;
|
|
private final Map<Long, User> users;
|
|
|
|
/* JADX DEBUG: Multi-variable search result rejected for r7v0, resolved type: java.util.Map<java.lang.Long, ? extends com.discord.models.user.User> */
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public StoreState(MeUser meUser, Map<Long, Channel> map, Map<Long, Channel> map2, Map<Long, StoreThreadMessages.ThreadState> map3, Map<Long, GuildMember> map4, Map<Long, ? extends User> map5, Map<Long, GuildRole> map6, Map<Long, String> map7, Long l, Channel channel, Guild guild) {
|
|
m.checkNotNullParameter(meUser, "meUser");
|
|
m.checkNotNullParameter(map, "activeJoinedThreads");
|
|
m.checkNotNullParameter(map2, "activeThreads");
|
|
m.checkNotNullParameter(map3, "threadStates");
|
|
m.checkNotNullParameter(map4, "guildMembers");
|
|
m.checkNotNullParameter(map5, "users");
|
|
m.checkNotNullParameter(map6, "guildRoles");
|
|
m.checkNotNullParameter(map7, "channelNames");
|
|
this.meUser = meUser;
|
|
this.activeJoinedThreads = map;
|
|
this.activeThreads = map2;
|
|
this.threadStates = map3;
|
|
this.guildMembers = map4;
|
|
this.users = map5;
|
|
this.guildRoles = map6;
|
|
this.channelNames = map7;
|
|
this.permissions = l;
|
|
this.channel = channel;
|
|
this.guild = guild;
|
|
}
|
|
|
|
public static /* synthetic */ StoreState copy$default(StoreState storeState, MeUser meUser, Map map, Map map2, Map map3, Map map4, Map map5, Map map6, Map map7, Long l, Channel channel, Guild guild, int i, Object obj) {
|
|
return storeState.copy((i & 1) != 0 ? storeState.meUser : meUser, (i & 2) != 0 ? storeState.activeJoinedThreads : map, (i & 4) != 0 ? storeState.activeThreads : map2, (i & 8) != 0 ? storeState.threadStates : map3, (i & 16) != 0 ? storeState.guildMembers : map4, (i & 32) != 0 ? storeState.users : map5, (i & 64) != 0 ? storeState.guildRoles : map6, (i & 128) != 0 ? storeState.channelNames : map7, (i & 256) != 0 ? storeState.permissions : l, (i & 512) != 0 ? storeState.channel : channel, (i & 1024) != 0 ? storeState.guild : guild);
|
|
}
|
|
|
|
public final MeUser component1() {
|
|
return this.meUser;
|
|
}
|
|
|
|
public final Channel component10() {
|
|
return this.channel;
|
|
}
|
|
|
|
public final Guild component11() {
|
|
return this.guild;
|
|
}
|
|
|
|
public final Map<Long, Channel> component2() {
|
|
return this.activeJoinedThreads;
|
|
}
|
|
|
|
public final Map<Long, Channel> component3() {
|
|
return this.activeThreads;
|
|
}
|
|
|
|
public final Map<Long, StoreThreadMessages.ThreadState> component4() {
|
|
return this.threadStates;
|
|
}
|
|
|
|
public final Map<Long, GuildMember> component5() {
|
|
return this.guildMembers;
|
|
}
|
|
|
|
public final Map<Long, User> component6() {
|
|
return this.users;
|
|
}
|
|
|
|
public final Map<Long, GuildRole> component7() {
|
|
return this.guildRoles;
|
|
}
|
|
|
|
public final Map<Long, String> component8() {
|
|
return this.channelNames;
|
|
}
|
|
|
|
public final Long component9() {
|
|
return this.permissions;
|
|
}
|
|
|
|
public final StoreState copy(MeUser meUser, Map<Long, Channel> map, Map<Long, Channel> map2, Map<Long, StoreThreadMessages.ThreadState> map3, Map<Long, GuildMember> map4, Map<Long, ? extends User> map5, Map<Long, GuildRole> map6, Map<Long, String> map7, Long l, Channel channel, Guild guild) {
|
|
m.checkNotNullParameter(meUser, "meUser");
|
|
m.checkNotNullParameter(map, "activeJoinedThreads");
|
|
m.checkNotNullParameter(map2, "activeThreads");
|
|
m.checkNotNullParameter(map3, "threadStates");
|
|
m.checkNotNullParameter(map4, "guildMembers");
|
|
m.checkNotNullParameter(map5, "users");
|
|
m.checkNotNullParameter(map6, "guildRoles");
|
|
m.checkNotNullParameter(map7, "channelNames");
|
|
return new StoreState(meUser, map, map2, map3, map4, map5, map6, map7, l, channel, guild);
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof StoreState)) {
|
|
return false;
|
|
}
|
|
StoreState storeState = (StoreState) obj;
|
|
return m.areEqual(this.meUser, storeState.meUser) && m.areEqual(this.activeJoinedThreads, storeState.activeJoinedThreads) && m.areEqual(this.activeThreads, storeState.activeThreads) && m.areEqual(this.threadStates, storeState.threadStates) && m.areEqual(this.guildMembers, storeState.guildMembers) && m.areEqual(this.users, storeState.users) && m.areEqual(this.guildRoles, storeState.guildRoles) && m.areEqual(this.channelNames, storeState.channelNames) && m.areEqual(this.permissions, storeState.permissions) && m.areEqual(this.channel, storeState.channel) && m.areEqual(this.guild, storeState.guild);
|
|
}
|
|
|
|
public final Map<Long, Channel> getActiveJoinedThreads() {
|
|
return this.activeJoinedThreads;
|
|
}
|
|
|
|
public final Map<Long, Channel> getActiveThreads() {
|
|
return this.activeThreads;
|
|
}
|
|
|
|
public final Channel getChannel() {
|
|
return this.channel;
|
|
}
|
|
|
|
public final Map<Long, String> getChannelNames() {
|
|
return this.channelNames;
|
|
}
|
|
|
|
public final Guild getGuild() {
|
|
return this.guild;
|
|
}
|
|
|
|
public final Map<Long, GuildMember> getGuildMembers() {
|
|
return this.guildMembers;
|
|
}
|
|
|
|
public final Map<Long, GuildRole> getGuildRoles() {
|
|
return this.guildRoles;
|
|
}
|
|
|
|
public final MeUser getMeUser() {
|
|
return this.meUser;
|
|
}
|
|
|
|
public final Long getPermissions() {
|
|
return this.permissions;
|
|
}
|
|
|
|
public final Map<Long, StoreThreadMessages.ThreadState> getThreadStates() {
|
|
return this.threadStates;
|
|
}
|
|
|
|
public final Map<Long, User> getUsers() {
|
|
return this.users;
|
|
}
|
|
|
|
public int hashCode() {
|
|
MeUser meUser = this.meUser;
|
|
int i = 0;
|
|
int hashCode = (meUser != null ? meUser.hashCode() : 0) * 31;
|
|
Map<Long, Channel> map = this.activeJoinedThreads;
|
|
int hashCode2 = (hashCode + (map != null ? map.hashCode() : 0)) * 31;
|
|
Map<Long, Channel> map2 = this.activeThreads;
|
|
int hashCode3 = (hashCode2 + (map2 != null ? map2.hashCode() : 0)) * 31;
|
|
Map<Long, StoreThreadMessages.ThreadState> map3 = this.threadStates;
|
|
int hashCode4 = (hashCode3 + (map3 != null ? map3.hashCode() : 0)) * 31;
|
|
Map<Long, GuildMember> map4 = this.guildMembers;
|
|
int hashCode5 = (hashCode4 + (map4 != null ? map4.hashCode() : 0)) * 31;
|
|
Map<Long, User> map5 = this.users;
|
|
int hashCode6 = (hashCode5 + (map5 != null ? map5.hashCode() : 0)) * 31;
|
|
Map<Long, GuildRole> map6 = this.guildRoles;
|
|
int hashCode7 = (hashCode6 + (map6 != null ? map6.hashCode() : 0)) * 31;
|
|
Map<Long, String> map7 = this.channelNames;
|
|
int hashCode8 = (hashCode7 + (map7 != null ? map7.hashCode() : 0)) * 31;
|
|
Long l = this.permissions;
|
|
int hashCode9 = (hashCode8 + (l != null ? l.hashCode() : 0)) * 31;
|
|
Channel channel = this.channel;
|
|
int hashCode10 = (hashCode9 + (channel != null ? channel.hashCode() : 0)) * 31;
|
|
Guild guild = this.guild;
|
|
if (guild != null) {
|
|
i = guild.hashCode();
|
|
}
|
|
return hashCode10 + i;
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder K = a.K("StoreState(meUser=");
|
|
K.append(this.meUser);
|
|
K.append(", activeJoinedThreads=");
|
|
K.append(this.activeJoinedThreads);
|
|
K.append(", activeThreads=");
|
|
K.append(this.activeThreads);
|
|
K.append(", threadStates=");
|
|
K.append(this.threadStates);
|
|
K.append(", guildMembers=");
|
|
K.append(this.guildMembers);
|
|
K.append(", users=");
|
|
K.append(this.users);
|
|
K.append(", guildRoles=");
|
|
K.append(this.guildRoles);
|
|
K.append(", channelNames=");
|
|
K.append(this.channelNames);
|
|
K.append(", permissions=");
|
|
K.append(this.permissions);
|
|
K.append(", channel=");
|
|
K.append(this.channel);
|
|
K.append(", guild=");
|
|
K.append(this.guild);
|
|
K.append(")");
|
|
return K.toString();
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetThreadBrowserActiveViewModel.kt */
|
|
public static final class ViewState {
|
|
private final boolean canCreateThread;
|
|
private final List<WidgetThreadBrowserAdapter.Item> listItems;
|
|
|
|
/* JADX DEBUG: Multi-variable search result rejected for r2v0, resolved type: java.util.List<? extends com.discord.widgets.channels.threads.browser.WidgetThreadBrowserAdapter$Item> */
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public ViewState(List<? extends WidgetThreadBrowserAdapter.Item> list, boolean z2) {
|
|
m.checkNotNullParameter(list, "listItems");
|
|
this.listItems = list;
|
|
this.canCreateThread = z2;
|
|
}
|
|
|
|
/* JADX DEBUG: Multi-variable search result rejected for r0v0, resolved type: com.discord.widgets.channels.threads.browser.WidgetThreadBrowserActiveViewModel$ViewState */
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public static /* synthetic */ ViewState copy$default(ViewState viewState, List list, boolean z2, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
list = viewState.listItems;
|
|
}
|
|
if ((i & 2) != 0) {
|
|
z2 = viewState.canCreateThread;
|
|
}
|
|
return viewState.copy(list, z2);
|
|
}
|
|
|
|
public final List<WidgetThreadBrowserAdapter.Item> component1() {
|
|
return this.listItems;
|
|
}
|
|
|
|
public final boolean component2() {
|
|
return this.canCreateThread;
|
|
}
|
|
|
|
public final ViewState copy(List<? extends WidgetThreadBrowserAdapter.Item> list, boolean z2) {
|
|
m.checkNotNullParameter(list, "listItems");
|
|
return new ViewState(list, z2);
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof ViewState)) {
|
|
return false;
|
|
}
|
|
ViewState viewState = (ViewState) obj;
|
|
return m.areEqual(this.listItems, viewState.listItems) && this.canCreateThread == viewState.canCreateThread;
|
|
}
|
|
|
|
public final boolean getCanCreateThread() {
|
|
return this.canCreateThread;
|
|
}
|
|
|
|
public final List<WidgetThreadBrowserAdapter.Item> getListItems() {
|
|
return this.listItems;
|
|
}
|
|
|
|
public int hashCode() {
|
|
List<WidgetThreadBrowserAdapter.Item> list = this.listItems;
|
|
int hashCode = (list != null ? list.hashCode() : 0) * 31;
|
|
boolean z2 = this.canCreateThread;
|
|
if (z2) {
|
|
z2 = true;
|
|
}
|
|
int i = z2 ? 1 : 0;
|
|
int i2 = z2 ? 1 : 0;
|
|
int i3 = z2 ? 1 : 0;
|
|
return hashCode + i;
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder K = a.K("ViewState(listItems=");
|
|
K.append(this.listItems);
|
|
K.append(", canCreateThread=");
|
|
return a.F(K, this.canCreateThread, ")");
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public WidgetThreadBrowserActiveViewModel(long j, long j2, StoreUser storeUser, StoreGuildMemberRequester storeGuildMemberRequester, StoreThreadsActive storeThreadsActive, StoreThreadsActiveJoined storeThreadsActiveJoined, StoreThreadMessages storeThreadMessages, StoreGuilds storeGuilds, StoreChannels storeChannels, StorePermissions storePermissions, Observable<StoreState> observable) {
|
|
super(null, 1, null);
|
|
m.checkNotNullParameter(storeUser, "storeUser");
|
|
m.checkNotNullParameter(storeGuildMemberRequester, "storeGuildMemberRequester");
|
|
m.checkNotNullParameter(storeThreadsActive, "storeThreadsActive");
|
|
m.checkNotNullParameter(storeThreadsActiveJoined, "storeThreadsActiveJoined");
|
|
m.checkNotNullParameter(storeThreadMessages, "storeThreadMessages");
|
|
m.checkNotNullParameter(storeGuilds, "storeGuilds");
|
|
m.checkNotNullParameter(storeChannels, "storeChannels");
|
|
m.checkNotNullParameter(storePermissions, "storePermissions");
|
|
m.checkNotNullParameter(observable, "storeStateObservable");
|
|
this.guildId = j;
|
|
this.channelId = j2;
|
|
this.storeUser = storeUser;
|
|
this.storeGuildMemberRequester = storeGuildMemberRequester;
|
|
this.storeThreadsActive = storeThreadsActive;
|
|
this.storeThreadsActiveJoined = storeThreadsActiveJoined;
|
|
this.storeThreadMessages = storeThreadMessages;
|
|
this.storeGuilds = storeGuilds;
|
|
this.storeChannels = storeChannels;
|
|
this.storePermissions = storePermissions;
|
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(observable, this, null, 2, null), WidgetThreadBrowserActiveViewModel.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new AnonymousClass1(this), 62, (Object) null);
|
|
}
|
|
|
|
/* JADX WARNING: Illegal instructions before constructor call */
|
|
public /* synthetic */ WidgetThreadBrowserActiveViewModel(long j, long j2, StoreUser storeUser, StoreGuildMemberRequester storeGuildMemberRequester, StoreThreadsActive storeThreadsActive, StoreThreadsActiveJoined storeThreadsActiveJoined, StoreThreadMessages storeThreadMessages, StoreGuilds storeGuilds, StoreChannels storeChannels, StorePermissions storePermissions, Observable observable, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
|
this(j, j2, r1, r14, r15, r16, r17, r18, r19, r20, (i & 1024) != 0 ? Companion.access$observeStoreState(Companion, j, j2, r1, r15, r16, r17, r18, r19, r20) : observable);
|
|
StoreUser users = (i & 4) != 0 ? StoreStream.Companion.getUsers() : storeUser;
|
|
StoreGuildMemberRequester guildMemberRequester = (i & 8) != 0 ? StoreStream.Companion.getGuildMemberRequester() : storeGuildMemberRequester;
|
|
StoreThreadsActive threadsActive = (i & 16) != 0 ? StoreStream.Companion.getThreadsActive() : storeThreadsActive;
|
|
StoreThreadsActiveJoined threadsActiveJoined = (i & 32) != 0 ? StoreStream.Companion.getThreadsActiveJoined() : storeThreadsActiveJoined;
|
|
StoreThreadMessages threadMessages = (i & 64) != 0 ? StoreStream.Companion.getThreadMessages() : storeThreadMessages;
|
|
StoreGuilds guilds = (i & 128) != 0 ? StoreStream.Companion.getGuilds() : storeGuilds;
|
|
StoreChannels channels = (i & 256) != 0 ? StoreStream.Companion.getChannels() : storeChannels;
|
|
StorePermissions permissions = (i & 512) != 0 ? StoreStream.Companion.getPermissions() : storePermissions;
|
|
}
|
|
|
|
public static final /* synthetic */ void access$handleStoreState(WidgetThreadBrowserActiveViewModel widgetThreadBrowserActiveViewModel, StoreState storeState) {
|
|
widgetThreadBrowserActiveViewModel.handleStoreState(storeState);
|
|
}
|
|
|
|
@MainThread
|
|
private final void handleStoreState(StoreState storeState) {
|
|
int i;
|
|
Iterator it;
|
|
Iterator it2;
|
|
com.discord.api.user.User author;
|
|
ArrayList arrayList = new ArrayList();
|
|
LinkedHashSet linkedHashSet = new LinkedHashSet();
|
|
boolean z2 = true;
|
|
Iterator it3 = n.listOf((Object[]) new Triple[]{new Triple("joined", 2131894079, storeState.getActiveJoinedThreads()), new Triple("other", 2131894082, storeState.getActiveThreads())}).iterator();
|
|
while (it3.hasNext()) {
|
|
Triple triple = (Triple) it3.next();
|
|
String str = (String) triple.component1();
|
|
int intValue = ((Number) triple.component2()).intValue();
|
|
Map map = (Map) triple.component3();
|
|
if (map.isEmpty()) {
|
|
i = 0;
|
|
} else {
|
|
i = 0;
|
|
for (Map.Entry entry : map.entrySet()) {
|
|
if (linkedHashSet.contains(Long.valueOf(((Number) entry.getKey()).longValue())) ^ z2) {
|
|
i++;
|
|
}
|
|
}
|
|
}
|
|
if (i != 0) {
|
|
arrayList.add(new WidgetThreadBrowserAdapter.Item.Header(str, intValue, i));
|
|
Iterator it4 = map.entrySet().iterator();
|
|
while (it4.hasNext()) {
|
|
Map.Entry entry2 = (Map.Entry) it4.next();
|
|
long longValue = ((Number) entry2.getKey()).longValue();
|
|
Channel channel = (Channel) entry2.getValue();
|
|
if (linkedHashSet.contains(Long.valueOf(longValue))) {
|
|
it2 = it3;
|
|
it = it4;
|
|
} else {
|
|
User user = storeState.getUsers().get(Long.valueOf(channel.q()));
|
|
if (user == null || !storeState.getGuildMembers().containsKey(Long.valueOf(channel.q()))) {
|
|
this.storeGuildMemberRequester.queueRequest(channel.f(), channel.q());
|
|
}
|
|
StoreThreadMessages.ThreadState threadState = storeState.getThreadStates().get(Long.valueOf(longValue));
|
|
Message mostRecentMessage = threadState != null ? threadState.getMostRecentMessage() : null;
|
|
if (mostRecentMessage == null || (author = mostRecentMessage.getAuthor()) == null || storeState.getGuildMembers().containsKey(Long.valueOf(author.i()))) {
|
|
it2 = it3;
|
|
it = it4;
|
|
} else {
|
|
it2 = it3;
|
|
it = it4;
|
|
this.storeGuildMemberRequester.queueRequest(channel.f(), author.i());
|
|
}
|
|
arrayList.add(new WidgetThreadBrowserAdapter.Item.Thread(new ThreadBrowserThreadView.ThreadData.ActiveThread(channel, user, mostRecentMessage, storeState.getMeUser().getId(), storeState.getGuildMembers(), storeState.getGuildRoles(), storeState.getChannelNames())));
|
|
linkedHashSet.add(Long.valueOf(longValue));
|
|
}
|
|
it3 = it2;
|
|
it4 = it;
|
|
}
|
|
}
|
|
it3 = it3;
|
|
z2 = true;
|
|
}
|
|
if (linkedHashSet.isEmpty()) {
|
|
arrayList.clear();
|
|
}
|
|
this.storeGuildMemberRequester.performQueuedRequests();
|
|
updateViewState(new ViewState(arrayList, ThreadUtils.INSTANCE.canCreateThread(storeState.getPermissions(), storeState.getChannel(), null, storeState.getGuild())));
|
|
}
|
|
}
|