forked from Juby210/discord-jadx
1919 lines
97 KiB
Java
1919 lines
97 KiB
Java
package com.discord.widgets.guilds.list;
|
|
|
|
import a0.a.a.b;
|
|
import android.content.Context;
|
|
import androidx.fragment.app.FragmentManager;
|
|
import androidx.media.AudioAttributesCompat;
|
|
import b.d.b.a.a;
|
|
import com.discord.R;
|
|
import com.discord.api.channel.Channel;
|
|
import com.discord.api.channel.ChannelUtils;
|
|
import com.discord.api.guildjoinrequest.ApplicationStatus;
|
|
import com.discord.api.guildjoinrequest.GuildJoinRequest;
|
|
import com.discord.api.permission.Permission;
|
|
import com.discord.app.AppViewModel;
|
|
import com.discord.models.domain.ModelNotificationSettings;
|
|
import com.discord.models.guild.Guild;
|
|
import com.discord.restapi.RestAPIParams;
|
|
import com.discord.stores.StoreGuildsSorted;
|
|
import com.discord.stores.StoreNavigation;
|
|
import com.discord.stores.StoreStream;
|
|
import com.discord.stores.StoreUser;
|
|
import com.discord.utilities.channel.ChannelSelector;
|
|
import com.discord.utilities.features.GrowthTeamFeatures;
|
|
import com.discord.utilities.guilds.MemberVerificationUtils;
|
|
import com.discord.utilities.permissions.PermissionUtils;
|
|
import com.discord.utilities.rest.RestAPI;
|
|
import com.discord.utilities.rx.ObservableExtensionsKt;
|
|
import com.discord.utilities.streams.StreamContext;
|
|
import com.discord.utilities.streams.StreamContextService;
|
|
import com.discord.utilities.time.Clock;
|
|
import com.discord.utilities.time.ClockFactory;
|
|
import com.discord.widgets.guilds.list.GuildListItem;
|
|
import com.discord.widgets.guilds.list.WidgetGuildListAdapter;
|
|
import d0.c0.c;
|
|
import d0.f0.q;
|
|
import d0.t.n;
|
|
import d0.t.r;
|
|
import d0.t.u;
|
|
import d0.z.d.m;
|
|
import d0.z.d.o;
|
|
import java.util.ArrayList;
|
|
import java.util.Collection;
|
|
import java.util.HashMap;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Objects;
|
|
import java.util.Set;
|
|
import java.util.concurrent.TimeUnit;
|
|
import kotlin.Unit;
|
|
import kotlin.jvm.functions.Function0;
|
|
import kotlin.jvm.functions.Function1;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import kotlin.sequences.Sequence;
|
|
import rx.Observable;
|
|
import rx.subjects.PublishSubject;
|
|
/* compiled from: WidgetGuildsListViewModel.kt */
|
|
public final class WidgetGuildsListViewModel extends AppViewModel<ViewState> {
|
|
public static final Companion Companion = new Companion(null);
|
|
private final Clock clock;
|
|
private WidgetGuildListAdapter.Operation.TargetOperation currentTargetOperation;
|
|
private final PublishSubject<Event> eventSubject;
|
|
private boolean wasLeftPanelOpened;
|
|
private boolean wasOnHomeTab;
|
|
|
|
/* compiled from: WidgetGuildsListViewModel.kt */
|
|
/* renamed from: com.discord.widgets.guilds.list.WidgetGuildsListViewModel$1 reason: invalid class name */
|
|
public static final class AnonymousClass1 extends o implements Function1<StoreState, Unit> {
|
|
public final /* synthetic */ WidgetGuildsListViewModel this$0;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public AnonymousClass1(WidgetGuildsListViewModel widgetGuildsListViewModel) {
|
|
super(1);
|
|
this.this$0 = widgetGuildsListViewModel;
|
|
}
|
|
|
|
/* 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) {
|
|
WidgetGuildsListViewModel widgetGuildsListViewModel = this.this$0;
|
|
m.checkNotNullExpressionValue(storeState, "storeState");
|
|
WidgetGuildsListViewModel.access$handleStoreState(widgetGuildsListViewModel, storeState);
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetGuildsListViewModel.kt */
|
|
public static final class Companion {
|
|
|
|
/* compiled from: WidgetGuildsListViewModel.kt */
|
|
public static final class Chunk {
|
|
private final Map<Long, List<Long>> channelIds;
|
|
private final Map<Long, ModelNotificationSettings> guildSettings;
|
|
private final Map<Long, Integer> mentionCounts;
|
|
private final Map<Long, Channel> privateChannels;
|
|
private final long selectedGuildId;
|
|
private final long selectedVoiceChannelId;
|
|
private final List<StoreGuildsSorted.Entry> sortedGuilds;
|
|
private final Set<Long> unavailableGuilds;
|
|
private final Set<Long> unreadGuildIds;
|
|
|
|
/* JADX DEBUG: Multi-variable search result rejected for r6v0, resolved type: java.util.Map<java.lang.Long, ? extends com.discord.models.domain.ModelNotificationSettings> */
|
|
/* JADX DEBUG: Multi-variable search result rejected for r9v0, resolved type: java.util.Map<java.lang.Long, ? extends java.util.List<java.lang.Long>> */
|
|
/* JADX DEBUG: Multi-variable search result rejected for r12v0, resolved type: java.util.List<? extends com.discord.stores.StoreGuildsSorted$Entry> */
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public Chunk(long j, long j2, Map<Long, ? extends ModelNotificationSettings> map, Set<Long> set, Map<Long, Integer> map2, Map<Long, ? extends List<Long>> map3, Set<Long> set2, Map<Long, Channel> map4, List<? extends StoreGuildsSorted.Entry> list) {
|
|
m.checkNotNullParameter(map, "guildSettings");
|
|
m.checkNotNullParameter(set, "unreadGuildIds");
|
|
m.checkNotNullParameter(map2, "mentionCounts");
|
|
m.checkNotNullParameter(map3, "channelIds");
|
|
m.checkNotNullParameter(set2, "unavailableGuilds");
|
|
m.checkNotNullParameter(map4, "privateChannels");
|
|
m.checkNotNullParameter(list, "sortedGuilds");
|
|
this.selectedGuildId = j;
|
|
this.selectedVoiceChannelId = j2;
|
|
this.guildSettings = map;
|
|
this.unreadGuildIds = set;
|
|
this.mentionCounts = map2;
|
|
this.channelIds = map3;
|
|
this.unavailableGuilds = set2;
|
|
this.privateChannels = map4;
|
|
this.sortedGuilds = list;
|
|
}
|
|
|
|
public static /* synthetic */ Chunk copy$default(Chunk chunk, long j, long j2, Map map, Set set, Map map2, Map map3, Set set2, Map map4, List list, int i, Object obj) {
|
|
return chunk.copy((i & 1) != 0 ? chunk.selectedGuildId : j, (i & 2) != 0 ? chunk.selectedVoiceChannelId : j2, (i & 4) != 0 ? chunk.guildSettings : map, (i & 8) != 0 ? chunk.unreadGuildIds : set, (i & 16) != 0 ? chunk.mentionCounts : map2, (i & 32) != 0 ? chunk.channelIds : map3, (i & 64) != 0 ? chunk.unavailableGuilds : set2, (i & 128) != 0 ? chunk.privateChannels : map4, (i & 256) != 0 ? chunk.sortedGuilds : list);
|
|
}
|
|
|
|
public final long component1() {
|
|
return this.selectedGuildId;
|
|
}
|
|
|
|
public final long component2() {
|
|
return this.selectedVoiceChannelId;
|
|
}
|
|
|
|
public final Map<Long, ModelNotificationSettings> component3() {
|
|
return this.guildSettings;
|
|
}
|
|
|
|
public final Set<Long> component4() {
|
|
return this.unreadGuildIds;
|
|
}
|
|
|
|
public final Map<Long, Integer> component5() {
|
|
return this.mentionCounts;
|
|
}
|
|
|
|
public final Map<Long, List<Long>> component6() {
|
|
return this.channelIds;
|
|
}
|
|
|
|
public final Set<Long> component7() {
|
|
return this.unavailableGuilds;
|
|
}
|
|
|
|
public final Map<Long, Channel> component8() {
|
|
return this.privateChannels;
|
|
}
|
|
|
|
public final List<StoreGuildsSorted.Entry> component9() {
|
|
return this.sortedGuilds;
|
|
}
|
|
|
|
public final Chunk copy(long j, long j2, Map<Long, ? extends ModelNotificationSettings> map, Set<Long> set, Map<Long, Integer> map2, Map<Long, ? extends List<Long>> map3, Set<Long> set2, Map<Long, Channel> map4, List<? extends StoreGuildsSorted.Entry> list) {
|
|
m.checkNotNullParameter(map, "guildSettings");
|
|
m.checkNotNullParameter(set, "unreadGuildIds");
|
|
m.checkNotNullParameter(map2, "mentionCounts");
|
|
m.checkNotNullParameter(map3, "channelIds");
|
|
m.checkNotNullParameter(set2, "unavailableGuilds");
|
|
m.checkNotNullParameter(map4, "privateChannels");
|
|
m.checkNotNullParameter(list, "sortedGuilds");
|
|
return new Chunk(j, j2, map, set, map2, map3, set2, map4, list);
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof Chunk)) {
|
|
return false;
|
|
}
|
|
Chunk chunk = (Chunk) obj;
|
|
return this.selectedGuildId == chunk.selectedGuildId && this.selectedVoiceChannelId == chunk.selectedVoiceChannelId && m.areEqual(this.guildSettings, chunk.guildSettings) && m.areEqual(this.unreadGuildIds, chunk.unreadGuildIds) && m.areEqual(this.mentionCounts, chunk.mentionCounts) && m.areEqual(this.channelIds, chunk.channelIds) && m.areEqual(this.unavailableGuilds, chunk.unavailableGuilds) && m.areEqual(this.privateChannels, chunk.privateChannels) && m.areEqual(this.sortedGuilds, chunk.sortedGuilds);
|
|
}
|
|
|
|
public final Map<Long, List<Long>> getChannelIds() {
|
|
return this.channelIds;
|
|
}
|
|
|
|
public final Map<Long, ModelNotificationSettings> getGuildSettings() {
|
|
return this.guildSettings;
|
|
}
|
|
|
|
public final Map<Long, Integer> getMentionCounts() {
|
|
return this.mentionCounts;
|
|
}
|
|
|
|
public final Map<Long, Channel> getPrivateChannels() {
|
|
return this.privateChannels;
|
|
}
|
|
|
|
public final long getSelectedGuildId() {
|
|
return this.selectedGuildId;
|
|
}
|
|
|
|
public final long getSelectedVoiceChannelId() {
|
|
return this.selectedVoiceChannelId;
|
|
}
|
|
|
|
public final List<StoreGuildsSorted.Entry> getSortedGuilds() {
|
|
return this.sortedGuilds;
|
|
}
|
|
|
|
public final Set<Long> getUnavailableGuilds() {
|
|
return this.unavailableGuilds;
|
|
}
|
|
|
|
public final Set<Long> getUnreadGuildIds() {
|
|
return this.unreadGuildIds;
|
|
}
|
|
|
|
public int hashCode() {
|
|
int a = (b.a(this.selectedVoiceChannelId) + (b.a(this.selectedGuildId) * 31)) * 31;
|
|
Map<Long, ModelNotificationSettings> map = this.guildSettings;
|
|
int i = 0;
|
|
int hashCode = (a + (map != null ? map.hashCode() : 0)) * 31;
|
|
Set<Long> set = this.unreadGuildIds;
|
|
int hashCode2 = (hashCode + (set != null ? set.hashCode() : 0)) * 31;
|
|
Map<Long, Integer> map2 = this.mentionCounts;
|
|
int hashCode3 = (hashCode2 + (map2 != null ? map2.hashCode() : 0)) * 31;
|
|
Map<Long, List<Long>> map3 = this.channelIds;
|
|
int hashCode4 = (hashCode3 + (map3 != null ? map3.hashCode() : 0)) * 31;
|
|
Set<Long> set2 = this.unavailableGuilds;
|
|
int hashCode5 = (hashCode4 + (set2 != null ? set2.hashCode() : 0)) * 31;
|
|
Map<Long, Channel> map4 = this.privateChannels;
|
|
int hashCode6 = (hashCode5 + (map4 != null ? map4.hashCode() : 0)) * 31;
|
|
List<StoreGuildsSorted.Entry> list = this.sortedGuilds;
|
|
if (list != null) {
|
|
i = list.hashCode();
|
|
}
|
|
return hashCode6 + i;
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder R = a.R("Chunk(selectedGuildId=");
|
|
R.append(this.selectedGuildId);
|
|
R.append(", selectedVoiceChannelId=");
|
|
R.append(this.selectedVoiceChannelId);
|
|
R.append(", guildSettings=");
|
|
R.append(this.guildSettings);
|
|
R.append(", unreadGuildIds=");
|
|
R.append(this.unreadGuildIds);
|
|
R.append(", mentionCounts=");
|
|
R.append(this.mentionCounts);
|
|
R.append(", channelIds=");
|
|
R.append(this.channelIds);
|
|
R.append(", unavailableGuilds=");
|
|
R.append(this.unavailableGuilds);
|
|
R.append(", privateChannels=");
|
|
R.append(this.privateChannels);
|
|
R.append(", sortedGuilds=");
|
|
return a.J(R, this.sortedGuilds, ")");
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetGuildsListViewModel.kt */
|
|
public static final class SecondChunk {
|
|
private final Map<Long, Channel> channels;
|
|
private final Set<Long> guildIds;
|
|
private final Set<Long> guildIdsWithActiveScheduledEvents;
|
|
private final Set<Long> guildIdsWithActiveStageEvents;
|
|
private final Map<Long, GuildJoinRequest> guildJoinRequests;
|
|
private final List<Guild> pendingGuilds;
|
|
private final boolean showHubSparkle;
|
|
|
|
public SecondChunk(Map<Long, GuildJoinRequest> map, List<Guild> list, Set<Long> set, Set<Long> set2, Set<Long> set3, Map<Long, Channel> map2, boolean z2) {
|
|
m.checkNotNullParameter(map, "guildJoinRequests");
|
|
m.checkNotNullParameter(list, "pendingGuilds");
|
|
m.checkNotNullParameter(set, "guildIds");
|
|
m.checkNotNullParameter(set2, "guildIdsWithActiveStageEvents");
|
|
m.checkNotNullParameter(set3, "guildIdsWithActiveScheduledEvents");
|
|
m.checkNotNullParameter(map2, "channels");
|
|
this.guildJoinRequests = map;
|
|
this.pendingGuilds = list;
|
|
this.guildIds = set;
|
|
this.guildIdsWithActiveStageEvents = set2;
|
|
this.guildIdsWithActiveScheduledEvents = set3;
|
|
this.channels = map2;
|
|
this.showHubSparkle = z2;
|
|
}
|
|
|
|
/* JADX DEBUG: Multi-variable search result rejected for r5v0, resolved type: com.discord.widgets.guilds.list.WidgetGuildsListViewModel$Companion$SecondChunk */
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public static /* synthetic */ SecondChunk copy$default(SecondChunk secondChunk, Map map, List list, Set set, Set set2, Set set3, Map map2, boolean z2, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
map = secondChunk.guildJoinRequests;
|
|
}
|
|
if ((i & 2) != 0) {
|
|
list = secondChunk.pendingGuilds;
|
|
}
|
|
if ((i & 4) != 0) {
|
|
set = secondChunk.guildIds;
|
|
}
|
|
if ((i & 8) != 0) {
|
|
set2 = secondChunk.guildIdsWithActiveStageEvents;
|
|
}
|
|
if ((i & 16) != 0) {
|
|
set3 = secondChunk.guildIdsWithActiveScheduledEvents;
|
|
}
|
|
if ((i & 32) != 0) {
|
|
map2 = secondChunk.channels;
|
|
}
|
|
if ((i & 64) != 0) {
|
|
z2 = secondChunk.showHubSparkle;
|
|
}
|
|
return secondChunk.copy(map, list, set, set2, set3, map2, z2);
|
|
}
|
|
|
|
public final Map<Long, GuildJoinRequest> component1() {
|
|
return this.guildJoinRequests;
|
|
}
|
|
|
|
public final List<Guild> component2() {
|
|
return this.pendingGuilds;
|
|
}
|
|
|
|
public final Set<Long> component3() {
|
|
return this.guildIds;
|
|
}
|
|
|
|
public final Set<Long> component4() {
|
|
return this.guildIdsWithActiveStageEvents;
|
|
}
|
|
|
|
public final Set<Long> component5() {
|
|
return this.guildIdsWithActiveScheduledEvents;
|
|
}
|
|
|
|
public final Map<Long, Channel> component6() {
|
|
return this.channels;
|
|
}
|
|
|
|
public final boolean component7() {
|
|
return this.showHubSparkle;
|
|
}
|
|
|
|
public final SecondChunk copy(Map<Long, GuildJoinRequest> map, List<Guild> list, Set<Long> set, Set<Long> set2, Set<Long> set3, Map<Long, Channel> map2, boolean z2) {
|
|
m.checkNotNullParameter(map, "guildJoinRequests");
|
|
m.checkNotNullParameter(list, "pendingGuilds");
|
|
m.checkNotNullParameter(set, "guildIds");
|
|
m.checkNotNullParameter(set2, "guildIdsWithActiveStageEvents");
|
|
m.checkNotNullParameter(set3, "guildIdsWithActiveScheduledEvents");
|
|
m.checkNotNullParameter(map2, "channels");
|
|
return new SecondChunk(map, list, set, set2, set3, map2, z2);
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof SecondChunk)) {
|
|
return false;
|
|
}
|
|
SecondChunk secondChunk = (SecondChunk) obj;
|
|
return m.areEqual(this.guildJoinRequests, secondChunk.guildJoinRequests) && m.areEqual(this.pendingGuilds, secondChunk.pendingGuilds) && m.areEqual(this.guildIds, secondChunk.guildIds) && m.areEqual(this.guildIdsWithActiveStageEvents, secondChunk.guildIdsWithActiveStageEvents) && m.areEqual(this.guildIdsWithActiveScheduledEvents, secondChunk.guildIdsWithActiveScheduledEvents) && m.areEqual(this.channels, secondChunk.channels) && this.showHubSparkle == secondChunk.showHubSparkle;
|
|
}
|
|
|
|
public final Map<Long, Channel> getChannels() {
|
|
return this.channels;
|
|
}
|
|
|
|
public final Set<Long> getGuildIds() {
|
|
return this.guildIds;
|
|
}
|
|
|
|
public final Set<Long> getGuildIdsWithActiveScheduledEvents() {
|
|
return this.guildIdsWithActiveScheduledEvents;
|
|
}
|
|
|
|
public final Set<Long> getGuildIdsWithActiveStageEvents() {
|
|
return this.guildIdsWithActiveStageEvents;
|
|
}
|
|
|
|
public final Map<Long, GuildJoinRequest> getGuildJoinRequests() {
|
|
return this.guildJoinRequests;
|
|
}
|
|
|
|
public final List<Guild> getPendingGuilds() {
|
|
return this.pendingGuilds;
|
|
}
|
|
|
|
public final boolean getShowHubSparkle() {
|
|
return this.showHubSparkle;
|
|
}
|
|
|
|
public int hashCode() {
|
|
Map<Long, GuildJoinRequest> map = this.guildJoinRequests;
|
|
int i = 0;
|
|
int hashCode = (map != null ? map.hashCode() : 0) * 31;
|
|
List<Guild> list = this.pendingGuilds;
|
|
int hashCode2 = (hashCode + (list != null ? list.hashCode() : 0)) * 31;
|
|
Set<Long> set = this.guildIds;
|
|
int hashCode3 = (hashCode2 + (set != null ? set.hashCode() : 0)) * 31;
|
|
Set<Long> set2 = this.guildIdsWithActiveStageEvents;
|
|
int hashCode4 = (hashCode3 + (set2 != null ? set2.hashCode() : 0)) * 31;
|
|
Set<Long> set3 = this.guildIdsWithActiveScheduledEvents;
|
|
int hashCode5 = (hashCode4 + (set3 != null ? set3.hashCode() : 0)) * 31;
|
|
Map<Long, Channel> map2 = this.channels;
|
|
if (map2 != null) {
|
|
i = map2.hashCode();
|
|
}
|
|
int i2 = (hashCode5 + i) * 31;
|
|
boolean z2 = this.showHubSparkle;
|
|
if (z2) {
|
|
z2 = true;
|
|
}
|
|
int i3 = z2 ? 1 : 0;
|
|
int i4 = z2 ? 1 : 0;
|
|
int i5 = z2 ? 1 : 0;
|
|
return i2 + i3;
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder R = a.R("SecondChunk(guildJoinRequests=");
|
|
R.append(this.guildJoinRequests);
|
|
R.append(", pendingGuilds=");
|
|
R.append(this.pendingGuilds);
|
|
R.append(", guildIds=");
|
|
R.append(this.guildIds);
|
|
R.append(", guildIdsWithActiveStageEvents=");
|
|
R.append(this.guildIdsWithActiveStageEvents);
|
|
R.append(", guildIdsWithActiveScheduledEvents=");
|
|
R.append(this.guildIdsWithActiveScheduledEvents);
|
|
R.append(", channels=");
|
|
R.append(this.channels);
|
|
R.append(", showHubSparkle=");
|
|
return a.L(R, this.showHubSparkle, ")");
|
|
}
|
|
}
|
|
|
|
private Companion() {
|
|
}
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
|
|
public static final /* synthetic */ Observable access$observeStores(Companion companion, Clock clock) {
|
|
return companion.observeStores(clock);
|
|
}
|
|
|
|
private final Observable<StoreState> observeStores(Clock clock) {
|
|
WidgetGuildsListViewModel$Companion$observeStores$1 widgetGuildsListViewModel$Companion$observeStores$1 = WidgetGuildsListViewModel$Companion$observeStores$1.INSTANCE;
|
|
WidgetGuildsListViewModel$Companion$observeStores$2 widgetGuildsListViewModel$Companion$observeStores$2 = WidgetGuildsListViewModel$Companion$observeStores$2.INSTANCE;
|
|
Observable<Chunk> invoke = widgetGuildsListViewModel$Companion$observeStores$1.mo1invoke();
|
|
Observable<SecondChunk> invoke2 = widgetGuildsListViewModel$Companion$observeStores$2.mo1invoke();
|
|
StoreStream.Companion companion = StoreStream.Companion;
|
|
Observable c = Observable.c(invoke, invoke2, companion.getLurking().getLurkingGuildIds(), companion.getExpandedGuildFolders().observeOpenFolderIds(), StoreUser.observeMe$default(companion.getUsers(), false, 1, null).q().F(new WidgetGuildsListViewModel$Companion$observeStores$3(clock)), new StreamContextService(null, null, null, null, null, null, null, null, 255, null).getForAllStreamingUsers(), companion.getPermissions().observePermissionsForAllChannels(), companion.getNavigation().observeLeftPanelState().F(WidgetGuildsListViewModel$Companion$observeStores$4.INSTANCE), companion.getTabsNavigation().observeSelectedTab().F(WidgetGuildsListViewModel$Companion$observeStores$5.INSTANCE), WidgetGuildsListViewModel$Companion$observeStores$6.INSTANCE);
|
|
m.checkNotNullExpressionValue(c, "Observable.combineLatest…Sparkle\n )\n }");
|
|
return ObservableExtensionsKt.leadingEdgeThrottle(c, 100, TimeUnit.MILLISECONDS);
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetGuildsListViewModel.kt */
|
|
public static abstract class Event {
|
|
|
|
/* compiled from: WidgetGuildsListViewModel.kt */
|
|
public static final class AnnounceFolderToggleForAccessibility extends Event {
|
|
private final GuildListItem.FolderItem item;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public AnnounceFolderToggleForAccessibility(GuildListItem.FolderItem folderItem) {
|
|
super(null);
|
|
m.checkNotNullParameter(folderItem, "item");
|
|
this.item = folderItem;
|
|
}
|
|
|
|
public static /* synthetic */ AnnounceFolderToggleForAccessibility copy$default(AnnounceFolderToggleForAccessibility announceFolderToggleForAccessibility, GuildListItem.FolderItem folderItem, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
folderItem = announceFolderToggleForAccessibility.item;
|
|
}
|
|
return announceFolderToggleForAccessibility.copy(folderItem);
|
|
}
|
|
|
|
public final GuildListItem.FolderItem component1() {
|
|
return this.item;
|
|
}
|
|
|
|
public final AnnounceFolderToggleForAccessibility copy(GuildListItem.FolderItem folderItem) {
|
|
m.checkNotNullParameter(folderItem, "item");
|
|
return new AnnounceFolderToggleForAccessibility(folderItem);
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this != obj) {
|
|
return (obj instanceof AnnounceFolderToggleForAccessibility) && m.areEqual(this.item, ((AnnounceFolderToggleForAccessibility) obj).item);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public final GuildListItem.FolderItem getItem() {
|
|
return this.item;
|
|
}
|
|
|
|
public int hashCode() {
|
|
GuildListItem.FolderItem folderItem = this.item;
|
|
if (folderItem != null) {
|
|
return folderItem.hashCode();
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder R = a.R("AnnounceFolderToggleForAccessibility(item=");
|
|
R.append(this.item);
|
|
R.append(")");
|
|
return R.toString();
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetGuildsListViewModel.kt */
|
|
public static final class FocusFirstElement extends Event {
|
|
public static final FocusFirstElement INSTANCE = new FocusFirstElement();
|
|
|
|
private FocusFirstElement() {
|
|
super(null);
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetGuildsListViewModel.kt */
|
|
public static final class ShowChannelActions extends Event {
|
|
private final long channelId;
|
|
|
|
public ShowChannelActions(long j) {
|
|
super(null);
|
|
this.channelId = j;
|
|
}
|
|
|
|
public static /* synthetic */ ShowChannelActions copy$default(ShowChannelActions showChannelActions, long j, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
j = showChannelActions.channelId;
|
|
}
|
|
return showChannelActions.copy(j);
|
|
}
|
|
|
|
public final long component1() {
|
|
return this.channelId;
|
|
}
|
|
|
|
public final ShowChannelActions copy(long j) {
|
|
return new ShowChannelActions(j);
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this != obj) {
|
|
return (obj instanceof ShowChannelActions) && this.channelId == ((ShowChannelActions) obj).channelId;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public final long getChannelId() {
|
|
return this.channelId;
|
|
}
|
|
|
|
public int hashCode() {
|
|
return b.a(this.channelId);
|
|
}
|
|
|
|
public String toString() {
|
|
return a.B(a.R("ShowChannelActions(channelId="), this.channelId, ")");
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetGuildsListViewModel.kt */
|
|
public static final class ShowCreateGuild extends Event {
|
|
public static final ShowCreateGuild INSTANCE = new ShowCreateGuild();
|
|
|
|
private ShowCreateGuild() {
|
|
super(null);
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetGuildsListViewModel.kt */
|
|
public static final class ShowHelp extends Event {
|
|
public static final ShowHelp INSTANCE = new ShowHelp();
|
|
|
|
private ShowHelp() {
|
|
super(null);
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetGuildsListViewModel.kt */
|
|
public static final class ShowHubVerification extends Event {
|
|
public static final ShowHubVerification INSTANCE = new ShowHubVerification();
|
|
|
|
private ShowHubVerification() {
|
|
super(null);
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetGuildsListViewModel.kt */
|
|
public static final class ShowUnavailableGuilds extends Event {
|
|
private final int unavailableGuildCount;
|
|
|
|
public ShowUnavailableGuilds(int i) {
|
|
super(null);
|
|
this.unavailableGuildCount = i;
|
|
}
|
|
|
|
public static /* synthetic */ ShowUnavailableGuilds copy$default(ShowUnavailableGuilds showUnavailableGuilds, int i, int i2, Object obj) {
|
|
if ((i2 & 1) != 0) {
|
|
i = showUnavailableGuilds.unavailableGuildCount;
|
|
}
|
|
return showUnavailableGuilds.copy(i);
|
|
}
|
|
|
|
public final int component1() {
|
|
return this.unavailableGuildCount;
|
|
}
|
|
|
|
public final ShowUnavailableGuilds copy(int i) {
|
|
return new ShowUnavailableGuilds(i);
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this != obj) {
|
|
return (obj instanceof ShowUnavailableGuilds) && this.unavailableGuildCount == ((ShowUnavailableGuilds) obj).unavailableGuildCount;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public final int getUnavailableGuildCount() {
|
|
return this.unavailableGuildCount;
|
|
}
|
|
|
|
public int hashCode() {
|
|
return this.unavailableGuildCount;
|
|
}
|
|
|
|
public String toString() {
|
|
return a.A(a.R("ShowUnavailableGuilds(unavailableGuildCount="), this.unavailableGuildCount, ")");
|
|
}
|
|
}
|
|
|
|
private Event() {
|
|
}
|
|
|
|
public /* synthetic */ Event(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetGuildsListViewModel.kt */
|
|
public static final class StoreState {
|
|
private final Map<Long, StreamContext> allApplicationStreamContexts;
|
|
private final Map<Long, Long> allChannelPermissions;
|
|
private final Map<Long, List<Long>> channelIds;
|
|
private final Map<Long, Channel> channels;
|
|
private final Set<Long> guildIds;
|
|
private final Set<Long> guildIdsWithActiveScheduledEvents;
|
|
private final Set<Long> guildIdsWithActiveStageEvents;
|
|
private final Map<Long, GuildJoinRequest> guildJoinRequests;
|
|
private final Map<Long, ModelNotificationSettings> guildSettings;
|
|
private final boolean isLeftPanelOpened;
|
|
private final boolean isNewUser;
|
|
private final boolean isOnHomeTab;
|
|
private final Set<Long> lurkingGuildIds;
|
|
private final Map<Long, Integer> mentionCounts;
|
|
private final Set<Long> openFolderIds;
|
|
private final List<Guild> pendingGuilds;
|
|
private final Map<Long, Channel> privateChannels;
|
|
private final long selectedGuildId;
|
|
private final long selectedVoiceChannelId;
|
|
private final boolean showHubSparkle;
|
|
private final List<StoreGuildsSorted.Entry> sortedGuilds;
|
|
private final Set<Long> unavailableGuilds;
|
|
private final Set<Long> unreadGuildIds;
|
|
|
|
/* JADX DEBUG: Multi-variable search result rejected for r21v0, resolved type: java.util.Map<java.lang.Long, ? extends com.discord.models.domain.ModelNotificationSettings> */
|
|
/* JADX DEBUG: Multi-variable search result rejected for r24v0, resolved type: java.util.Map<java.lang.Long, ? extends java.util.List<java.lang.Long>> */
|
|
/* JADX DEBUG: Multi-variable search result rejected for r27v0, resolved type: java.util.List<? extends com.discord.stores.StoreGuildsSorted$Entry> */
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public StoreState(long j, long j2, Map<Long, ? extends ModelNotificationSettings> map, Set<Long> set, Map<Long, Integer> map2, Map<Long, ? extends List<Long>> map3, Set<Long> set2, Map<Long, Channel> map4, List<? extends StoreGuildsSorted.Entry> list, Map<Long, GuildJoinRequest> map5, List<Guild> list2, Set<Long> set3, Set<Long> set4, Set<Long> set5, Set<Long> set6, Map<Long, Channel> map6, Set<Long> set7, boolean z2, Map<Long, StreamContext> map7, Map<Long, Long> map8, boolean z3, boolean z4, boolean z5) {
|
|
m.checkNotNullParameter(map, "guildSettings");
|
|
m.checkNotNullParameter(set, "unreadGuildIds");
|
|
m.checkNotNullParameter(map2, "mentionCounts");
|
|
m.checkNotNullParameter(map3, "channelIds");
|
|
m.checkNotNullParameter(set2, "unavailableGuilds");
|
|
m.checkNotNullParameter(map4, "privateChannels");
|
|
m.checkNotNullParameter(list, "sortedGuilds");
|
|
m.checkNotNullParameter(map5, "guildJoinRequests");
|
|
m.checkNotNullParameter(list2, "pendingGuilds");
|
|
m.checkNotNullParameter(set3, "guildIds");
|
|
m.checkNotNullParameter(set4, "lurkingGuildIds");
|
|
m.checkNotNullParameter(set5, "guildIdsWithActiveStageEvents");
|
|
m.checkNotNullParameter(set6, "guildIdsWithActiveScheduledEvents");
|
|
m.checkNotNullParameter(map6, "channels");
|
|
m.checkNotNullParameter(set7, "openFolderIds");
|
|
m.checkNotNullParameter(map7, "allApplicationStreamContexts");
|
|
m.checkNotNullParameter(map8, "allChannelPermissions");
|
|
this.selectedGuildId = j;
|
|
this.selectedVoiceChannelId = j2;
|
|
this.guildSettings = map;
|
|
this.unreadGuildIds = set;
|
|
this.mentionCounts = map2;
|
|
this.channelIds = map3;
|
|
this.unavailableGuilds = set2;
|
|
this.privateChannels = map4;
|
|
this.sortedGuilds = list;
|
|
this.guildJoinRequests = map5;
|
|
this.pendingGuilds = list2;
|
|
this.guildIds = set3;
|
|
this.lurkingGuildIds = set4;
|
|
this.guildIdsWithActiveStageEvents = set5;
|
|
this.guildIdsWithActiveScheduledEvents = set6;
|
|
this.channels = map6;
|
|
this.openFolderIds = set7;
|
|
this.isNewUser = z2;
|
|
this.allApplicationStreamContexts = map7;
|
|
this.allChannelPermissions = map8;
|
|
this.isLeftPanelOpened = z3;
|
|
this.isOnHomeTab = z4;
|
|
this.showHubSparkle = z5;
|
|
}
|
|
|
|
public static /* synthetic */ StoreState copy$default(StoreState storeState, long j, long j2, Map map, Set set, Map map2, Map map3, Set set2, Map map4, List list, Map map5, List list2, Set set3, Set set4, Set set5, Set set6, Map map6, Set set7, boolean z2, Map map7, Map map8, boolean z3, boolean z4, boolean z5, int i, Object obj) {
|
|
return storeState.copy((i & 1) != 0 ? storeState.selectedGuildId : j, (i & 2) != 0 ? storeState.selectedVoiceChannelId : j2, (i & 4) != 0 ? storeState.guildSettings : map, (i & 8) != 0 ? storeState.unreadGuildIds : set, (i & 16) != 0 ? storeState.mentionCounts : map2, (i & 32) != 0 ? storeState.channelIds : map3, (i & 64) != 0 ? storeState.unavailableGuilds : set2, (i & 128) != 0 ? storeState.privateChannels : map4, (i & 256) != 0 ? storeState.sortedGuilds : list, (i & 512) != 0 ? storeState.guildJoinRequests : map5, (i & 1024) != 0 ? storeState.pendingGuilds : list2, (i & 2048) != 0 ? storeState.guildIds : set3, (i & 4096) != 0 ? storeState.lurkingGuildIds : set4, (i & 8192) != 0 ? storeState.guildIdsWithActiveStageEvents : set5, (i & 16384) != 0 ? storeState.guildIdsWithActiveScheduledEvents : set6, (i & 32768) != 0 ? storeState.channels : map6, (i & 65536) != 0 ? storeState.openFolderIds : set7, (i & 131072) != 0 ? storeState.isNewUser : z2, (i & 262144) != 0 ? storeState.allApplicationStreamContexts : map7, (i & 524288) != 0 ? storeState.allChannelPermissions : map8, (i & 1048576) != 0 ? storeState.isLeftPanelOpened : z3, (i & 2097152) != 0 ? storeState.isOnHomeTab : z4, (i & 4194304) != 0 ? storeState.showHubSparkle : z5);
|
|
}
|
|
|
|
public final long component1() {
|
|
return this.selectedGuildId;
|
|
}
|
|
|
|
public final Map<Long, GuildJoinRequest> component10() {
|
|
return this.guildJoinRequests;
|
|
}
|
|
|
|
public final List<Guild> component11() {
|
|
return this.pendingGuilds;
|
|
}
|
|
|
|
public final Set<Long> component12() {
|
|
return this.guildIds;
|
|
}
|
|
|
|
public final Set<Long> component13() {
|
|
return this.lurkingGuildIds;
|
|
}
|
|
|
|
public final Set<Long> component14() {
|
|
return this.guildIdsWithActiveStageEvents;
|
|
}
|
|
|
|
public final Set<Long> component15() {
|
|
return this.guildIdsWithActiveScheduledEvents;
|
|
}
|
|
|
|
public final Map<Long, Channel> component16() {
|
|
return this.channels;
|
|
}
|
|
|
|
public final Set<Long> component17() {
|
|
return this.openFolderIds;
|
|
}
|
|
|
|
public final boolean component18() {
|
|
return this.isNewUser;
|
|
}
|
|
|
|
public final Map<Long, StreamContext> component19() {
|
|
return this.allApplicationStreamContexts;
|
|
}
|
|
|
|
public final long component2() {
|
|
return this.selectedVoiceChannelId;
|
|
}
|
|
|
|
public final Map<Long, Long> component20() {
|
|
return this.allChannelPermissions;
|
|
}
|
|
|
|
public final boolean component21() {
|
|
return this.isLeftPanelOpened;
|
|
}
|
|
|
|
public final boolean component22() {
|
|
return this.isOnHomeTab;
|
|
}
|
|
|
|
public final boolean component23() {
|
|
return this.showHubSparkle;
|
|
}
|
|
|
|
public final Map<Long, ModelNotificationSettings> component3() {
|
|
return this.guildSettings;
|
|
}
|
|
|
|
public final Set<Long> component4() {
|
|
return this.unreadGuildIds;
|
|
}
|
|
|
|
public final Map<Long, Integer> component5() {
|
|
return this.mentionCounts;
|
|
}
|
|
|
|
public final Map<Long, List<Long>> component6() {
|
|
return this.channelIds;
|
|
}
|
|
|
|
public final Set<Long> component7() {
|
|
return this.unavailableGuilds;
|
|
}
|
|
|
|
public final Map<Long, Channel> component8() {
|
|
return this.privateChannels;
|
|
}
|
|
|
|
public final List<StoreGuildsSorted.Entry> component9() {
|
|
return this.sortedGuilds;
|
|
}
|
|
|
|
public final StoreState copy(long j, long j2, Map<Long, ? extends ModelNotificationSettings> map, Set<Long> set, Map<Long, Integer> map2, Map<Long, ? extends List<Long>> map3, Set<Long> set2, Map<Long, Channel> map4, List<? extends StoreGuildsSorted.Entry> list, Map<Long, GuildJoinRequest> map5, List<Guild> list2, Set<Long> set3, Set<Long> set4, Set<Long> set5, Set<Long> set6, Map<Long, Channel> map6, Set<Long> set7, boolean z2, Map<Long, StreamContext> map7, Map<Long, Long> map8, boolean z3, boolean z4, boolean z5) {
|
|
m.checkNotNullParameter(map, "guildSettings");
|
|
m.checkNotNullParameter(set, "unreadGuildIds");
|
|
m.checkNotNullParameter(map2, "mentionCounts");
|
|
m.checkNotNullParameter(map3, "channelIds");
|
|
m.checkNotNullParameter(set2, "unavailableGuilds");
|
|
m.checkNotNullParameter(map4, "privateChannels");
|
|
m.checkNotNullParameter(list, "sortedGuilds");
|
|
m.checkNotNullParameter(map5, "guildJoinRequests");
|
|
m.checkNotNullParameter(list2, "pendingGuilds");
|
|
m.checkNotNullParameter(set3, "guildIds");
|
|
m.checkNotNullParameter(set4, "lurkingGuildIds");
|
|
m.checkNotNullParameter(set5, "guildIdsWithActiveStageEvents");
|
|
m.checkNotNullParameter(set6, "guildIdsWithActiveScheduledEvents");
|
|
m.checkNotNullParameter(map6, "channels");
|
|
m.checkNotNullParameter(set7, "openFolderIds");
|
|
m.checkNotNullParameter(map7, "allApplicationStreamContexts");
|
|
m.checkNotNullParameter(map8, "allChannelPermissions");
|
|
return new StoreState(j, j2, map, set, map2, map3, set2, map4, list, map5, list2, set3, set4, set5, set6, map6, set7, z2, map7, map8, z3, z4, z5);
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof StoreState)) {
|
|
return false;
|
|
}
|
|
StoreState storeState = (StoreState) obj;
|
|
return this.selectedGuildId == storeState.selectedGuildId && this.selectedVoiceChannelId == storeState.selectedVoiceChannelId && m.areEqual(this.guildSettings, storeState.guildSettings) && m.areEqual(this.unreadGuildIds, storeState.unreadGuildIds) && m.areEqual(this.mentionCounts, storeState.mentionCounts) && m.areEqual(this.channelIds, storeState.channelIds) && m.areEqual(this.unavailableGuilds, storeState.unavailableGuilds) && m.areEqual(this.privateChannels, storeState.privateChannels) && m.areEqual(this.sortedGuilds, storeState.sortedGuilds) && m.areEqual(this.guildJoinRequests, storeState.guildJoinRequests) && m.areEqual(this.pendingGuilds, storeState.pendingGuilds) && m.areEqual(this.guildIds, storeState.guildIds) && m.areEqual(this.lurkingGuildIds, storeState.lurkingGuildIds) && m.areEqual(this.guildIdsWithActiveStageEvents, storeState.guildIdsWithActiveStageEvents) && m.areEqual(this.guildIdsWithActiveScheduledEvents, storeState.guildIdsWithActiveScheduledEvents) && m.areEqual(this.channels, storeState.channels) && m.areEqual(this.openFolderIds, storeState.openFolderIds) && this.isNewUser == storeState.isNewUser && m.areEqual(this.allApplicationStreamContexts, storeState.allApplicationStreamContexts) && m.areEqual(this.allChannelPermissions, storeState.allChannelPermissions) && this.isLeftPanelOpened == storeState.isLeftPanelOpened && this.isOnHomeTab == storeState.isOnHomeTab && this.showHubSparkle == storeState.showHubSparkle;
|
|
}
|
|
|
|
public final Map<Long, StreamContext> getAllApplicationStreamContexts() {
|
|
return this.allApplicationStreamContexts;
|
|
}
|
|
|
|
public final Map<Long, Long> getAllChannelPermissions() {
|
|
return this.allChannelPermissions;
|
|
}
|
|
|
|
public final Map<Long, List<Long>> getChannelIds() {
|
|
return this.channelIds;
|
|
}
|
|
|
|
public final Map<Long, Channel> getChannels() {
|
|
return this.channels;
|
|
}
|
|
|
|
public final Set<Long> getGuildIds() {
|
|
return this.guildIds;
|
|
}
|
|
|
|
public final Set<Long> getGuildIdsWithActiveScheduledEvents() {
|
|
return this.guildIdsWithActiveScheduledEvents;
|
|
}
|
|
|
|
public final Set<Long> getGuildIdsWithActiveStageEvents() {
|
|
return this.guildIdsWithActiveStageEvents;
|
|
}
|
|
|
|
public final Map<Long, GuildJoinRequest> getGuildJoinRequests() {
|
|
return this.guildJoinRequests;
|
|
}
|
|
|
|
public final Map<Long, ModelNotificationSettings> getGuildSettings() {
|
|
return this.guildSettings;
|
|
}
|
|
|
|
public final Set<Long> getLurkingGuildIds() {
|
|
return this.lurkingGuildIds;
|
|
}
|
|
|
|
public final Map<Long, Integer> getMentionCounts() {
|
|
return this.mentionCounts;
|
|
}
|
|
|
|
public final Set<Long> getOpenFolderIds() {
|
|
return this.openFolderIds;
|
|
}
|
|
|
|
public final List<Guild> getPendingGuilds() {
|
|
return this.pendingGuilds;
|
|
}
|
|
|
|
public final Map<Long, Channel> getPrivateChannels() {
|
|
return this.privateChannels;
|
|
}
|
|
|
|
public final long getSelectedGuildId() {
|
|
return this.selectedGuildId;
|
|
}
|
|
|
|
public final long getSelectedVoiceChannelId() {
|
|
return this.selectedVoiceChannelId;
|
|
}
|
|
|
|
public final boolean getShowHubSparkle() {
|
|
return this.showHubSparkle;
|
|
}
|
|
|
|
public final List<StoreGuildsSorted.Entry> getSortedGuilds() {
|
|
return this.sortedGuilds;
|
|
}
|
|
|
|
public final Set<Long> getUnavailableGuilds() {
|
|
return this.unavailableGuilds;
|
|
}
|
|
|
|
public final Set<Long> getUnreadGuildIds() {
|
|
return this.unreadGuildIds;
|
|
}
|
|
|
|
public int hashCode() {
|
|
int a = (b.a(this.selectedVoiceChannelId) + (b.a(this.selectedGuildId) * 31)) * 31;
|
|
Map<Long, ModelNotificationSettings> map = this.guildSettings;
|
|
int i = 0;
|
|
int hashCode = (a + (map != null ? map.hashCode() : 0)) * 31;
|
|
Set<Long> set = this.unreadGuildIds;
|
|
int hashCode2 = (hashCode + (set != null ? set.hashCode() : 0)) * 31;
|
|
Map<Long, Integer> map2 = this.mentionCounts;
|
|
int hashCode3 = (hashCode2 + (map2 != null ? map2.hashCode() : 0)) * 31;
|
|
Map<Long, List<Long>> map3 = this.channelIds;
|
|
int hashCode4 = (hashCode3 + (map3 != null ? map3.hashCode() : 0)) * 31;
|
|
Set<Long> set2 = this.unavailableGuilds;
|
|
int hashCode5 = (hashCode4 + (set2 != null ? set2.hashCode() : 0)) * 31;
|
|
Map<Long, Channel> map4 = this.privateChannels;
|
|
int hashCode6 = (hashCode5 + (map4 != null ? map4.hashCode() : 0)) * 31;
|
|
List<StoreGuildsSorted.Entry> list = this.sortedGuilds;
|
|
int hashCode7 = (hashCode6 + (list != null ? list.hashCode() : 0)) * 31;
|
|
Map<Long, GuildJoinRequest> map5 = this.guildJoinRequests;
|
|
int hashCode8 = (hashCode7 + (map5 != null ? map5.hashCode() : 0)) * 31;
|
|
List<Guild> list2 = this.pendingGuilds;
|
|
int hashCode9 = (hashCode8 + (list2 != null ? list2.hashCode() : 0)) * 31;
|
|
Set<Long> set3 = this.guildIds;
|
|
int hashCode10 = (hashCode9 + (set3 != null ? set3.hashCode() : 0)) * 31;
|
|
Set<Long> set4 = this.lurkingGuildIds;
|
|
int hashCode11 = (hashCode10 + (set4 != null ? set4.hashCode() : 0)) * 31;
|
|
Set<Long> set5 = this.guildIdsWithActiveStageEvents;
|
|
int hashCode12 = (hashCode11 + (set5 != null ? set5.hashCode() : 0)) * 31;
|
|
Set<Long> set6 = this.guildIdsWithActiveScheduledEvents;
|
|
int hashCode13 = (hashCode12 + (set6 != null ? set6.hashCode() : 0)) * 31;
|
|
Map<Long, Channel> map6 = this.channels;
|
|
int hashCode14 = (hashCode13 + (map6 != null ? map6.hashCode() : 0)) * 31;
|
|
Set<Long> set7 = this.openFolderIds;
|
|
int hashCode15 = (hashCode14 + (set7 != null ? set7.hashCode() : 0)) * 31;
|
|
boolean z2 = this.isNewUser;
|
|
int i2 = 1;
|
|
if (z2) {
|
|
z2 = true;
|
|
}
|
|
int i3 = z2 ? 1 : 0;
|
|
int i4 = z2 ? 1 : 0;
|
|
int i5 = z2 ? 1 : 0;
|
|
int i6 = (hashCode15 + i3) * 31;
|
|
Map<Long, StreamContext> map7 = this.allApplicationStreamContexts;
|
|
int hashCode16 = (i6 + (map7 != null ? map7.hashCode() : 0)) * 31;
|
|
Map<Long, Long> map8 = this.allChannelPermissions;
|
|
if (map8 != null) {
|
|
i = map8.hashCode();
|
|
}
|
|
int i7 = (hashCode16 + i) * 31;
|
|
boolean z3 = this.isLeftPanelOpened;
|
|
if (z3) {
|
|
z3 = true;
|
|
}
|
|
int i8 = z3 ? 1 : 0;
|
|
int i9 = z3 ? 1 : 0;
|
|
int i10 = z3 ? 1 : 0;
|
|
int i11 = (i7 + i8) * 31;
|
|
boolean z4 = this.isOnHomeTab;
|
|
if (z4) {
|
|
z4 = true;
|
|
}
|
|
int i12 = z4 ? 1 : 0;
|
|
int i13 = z4 ? 1 : 0;
|
|
int i14 = z4 ? 1 : 0;
|
|
int i15 = (i11 + i12) * 31;
|
|
boolean z5 = this.showHubSparkle;
|
|
if (!z5) {
|
|
i2 = z5 ? 1 : 0;
|
|
}
|
|
return i15 + i2;
|
|
}
|
|
|
|
public final boolean isLeftPanelOpened() {
|
|
return this.isLeftPanelOpened;
|
|
}
|
|
|
|
public final boolean isNewUser() {
|
|
return this.isNewUser;
|
|
}
|
|
|
|
public final boolean isOnHomeTab() {
|
|
return this.isOnHomeTab;
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder R = a.R("StoreState(selectedGuildId=");
|
|
R.append(this.selectedGuildId);
|
|
R.append(", selectedVoiceChannelId=");
|
|
R.append(this.selectedVoiceChannelId);
|
|
R.append(", guildSettings=");
|
|
R.append(this.guildSettings);
|
|
R.append(", unreadGuildIds=");
|
|
R.append(this.unreadGuildIds);
|
|
R.append(", mentionCounts=");
|
|
R.append(this.mentionCounts);
|
|
R.append(", channelIds=");
|
|
R.append(this.channelIds);
|
|
R.append(", unavailableGuilds=");
|
|
R.append(this.unavailableGuilds);
|
|
R.append(", privateChannels=");
|
|
R.append(this.privateChannels);
|
|
R.append(", sortedGuilds=");
|
|
R.append(this.sortedGuilds);
|
|
R.append(", guildJoinRequests=");
|
|
R.append(this.guildJoinRequests);
|
|
R.append(", pendingGuilds=");
|
|
R.append(this.pendingGuilds);
|
|
R.append(", guildIds=");
|
|
R.append(this.guildIds);
|
|
R.append(", lurkingGuildIds=");
|
|
R.append(this.lurkingGuildIds);
|
|
R.append(", guildIdsWithActiveStageEvents=");
|
|
R.append(this.guildIdsWithActiveStageEvents);
|
|
R.append(", guildIdsWithActiveScheduledEvents=");
|
|
R.append(this.guildIdsWithActiveScheduledEvents);
|
|
R.append(", channels=");
|
|
R.append(this.channels);
|
|
R.append(", openFolderIds=");
|
|
R.append(this.openFolderIds);
|
|
R.append(", isNewUser=");
|
|
R.append(this.isNewUser);
|
|
R.append(", allApplicationStreamContexts=");
|
|
R.append(this.allApplicationStreamContexts);
|
|
R.append(", allChannelPermissions=");
|
|
R.append(this.allChannelPermissions);
|
|
R.append(", isLeftPanelOpened=");
|
|
R.append(this.isLeftPanelOpened);
|
|
R.append(", isOnHomeTab=");
|
|
R.append(this.isOnHomeTab);
|
|
R.append(", showHubSparkle=");
|
|
return a.L(R, this.showHubSparkle, ")");
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetGuildsListViewModel.kt */
|
|
public static abstract class ViewState {
|
|
|
|
/* compiled from: WidgetGuildsListViewModel.kt */
|
|
public static final class Loaded extends ViewState {
|
|
private final boolean hasChannels;
|
|
private final List<GuildListItem> items;
|
|
private final boolean wasDragResult;
|
|
|
|
/* JADX DEBUG: Multi-variable search result rejected for r2v0, resolved type: java.util.List<? extends com.discord.widgets.guilds.list.GuildListItem> */
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public Loaded(List<? extends GuildListItem> list, boolean z2, boolean z3) {
|
|
super(null);
|
|
m.checkNotNullParameter(list, "items");
|
|
this.items = list;
|
|
this.hasChannels = z2;
|
|
this.wasDragResult = z3;
|
|
}
|
|
|
|
/* JADX DEBUG: Multi-variable search result rejected for r0v0, resolved type: com.discord.widgets.guilds.list.WidgetGuildsListViewModel$ViewState$Loaded */
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public static /* synthetic */ Loaded copy$default(Loaded loaded, List list, boolean z2, boolean z3, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
list = loaded.items;
|
|
}
|
|
if ((i & 2) != 0) {
|
|
z2 = loaded.hasChannels;
|
|
}
|
|
if ((i & 4) != 0) {
|
|
z3 = loaded.wasDragResult;
|
|
}
|
|
return loaded.copy(list, z2, z3);
|
|
}
|
|
|
|
public final List<GuildListItem> component1() {
|
|
return this.items;
|
|
}
|
|
|
|
public final boolean component2() {
|
|
return this.hasChannels;
|
|
}
|
|
|
|
public final boolean component3() {
|
|
return this.wasDragResult;
|
|
}
|
|
|
|
public final Loaded copy(List<? extends GuildListItem> list, boolean z2, boolean z3) {
|
|
m.checkNotNullParameter(list, "items");
|
|
return new Loaded(list, z2, z3);
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof Loaded)) {
|
|
return false;
|
|
}
|
|
Loaded loaded = (Loaded) obj;
|
|
return m.areEqual(this.items, loaded.items) && this.hasChannels == loaded.hasChannels && this.wasDragResult == loaded.wasDragResult;
|
|
}
|
|
|
|
public final boolean getHasChannels() {
|
|
return this.hasChannels;
|
|
}
|
|
|
|
public final List<GuildListItem> getItems() {
|
|
return this.items;
|
|
}
|
|
|
|
public final boolean getWasDragResult() {
|
|
return this.wasDragResult;
|
|
}
|
|
|
|
public int hashCode() {
|
|
List<GuildListItem> list = this.items;
|
|
int hashCode = (list != null ? list.hashCode() : 0) * 31;
|
|
boolean z2 = this.hasChannels;
|
|
int i = 1;
|
|
if (z2) {
|
|
z2 = true;
|
|
}
|
|
int i2 = z2 ? 1 : 0;
|
|
int i3 = z2 ? 1 : 0;
|
|
int i4 = z2 ? 1 : 0;
|
|
int i5 = (hashCode + i2) * 31;
|
|
boolean z3 = this.wasDragResult;
|
|
if (!z3) {
|
|
i = z3 ? 1 : 0;
|
|
}
|
|
return i5 + i;
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder R = a.R("Loaded(items=");
|
|
R.append(this.items);
|
|
R.append(", hasChannels=");
|
|
R.append(this.hasChannels);
|
|
R.append(", wasDragResult=");
|
|
return a.L(R, this.wasDragResult, ")");
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetGuildsListViewModel.kt */
|
|
public static final class Uninitialized extends ViewState {
|
|
public static final Uninitialized INSTANCE = new Uninitialized();
|
|
|
|
private Uninitialized() {
|
|
super(null);
|
|
}
|
|
}
|
|
|
|
private ViewState() {
|
|
}
|
|
|
|
public /* synthetic */ ViewState(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
}
|
|
|
|
public WidgetGuildsListViewModel() {
|
|
this(null, null, 3, null);
|
|
}
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public WidgetGuildsListViewModel(Clock clock, Observable<StoreState> observable) {
|
|
super(ViewState.Uninitialized.INSTANCE);
|
|
m.checkNotNullParameter(clock, "clock");
|
|
m.checkNotNullParameter(observable, "storeObservable");
|
|
this.clock = clock;
|
|
this.eventSubject = PublishSubject.k0();
|
|
Observable q = ObservableExtensionsKt.computationLatest(observable).q();
|
|
m.checkNotNullExpressionValue(q, "storeObservable\n … .distinctUntilChanged()");
|
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(q, this, null, 2, null), WidgetGuildsListViewModel.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 */ WidgetGuildsListViewModel(Clock clock, Observable observable, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
|
this(clock, (i & 2) != 0 ? Companion.access$observeStores(Companion, clock) : observable);
|
|
clock = (i & 1) != 0 ? ClockFactory.get() : clock;
|
|
}
|
|
|
|
public static final /* synthetic */ void access$handleStoreState(WidgetGuildsListViewModel widgetGuildsListViewModel, StoreState storeState) {
|
|
widgetGuildsListViewModel.handleStoreState(storeState);
|
|
}
|
|
|
|
private final Sequence<GuildListItem.PrivateChannelItem> createDirectMessageItems(Map<Long, Channel> map, Map<Long, Integer> map2, ModelNotificationSettings modelNotificationSettings) {
|
|
return q.map(q.sortedWith(q.filter(q.filterNotNull(u.asSequence(map.values())), new WidgetGuildsListViewModel$createDirectMessageItems$1(modelNotificationSettings, map2)), ChannelUtils.h(Channel.Companion)), new WidgetGuildsListViewModel$createDirectMessageItems$2(map2));
|
|
}
|
|
|
|
private final GuildListItem.GuildItem createGuildItem(Guild guild, long j, long j2, Set<Long> set, Map<Long, ? extends ModelNotificationSettings> map, int i, Map<Long, ? extends List<Long>> map2, Map<Long, Channel> map3, Set<Long> set2, Set<Long> set3, Set<Long> set4, Long l, Boolean bool, Map<Long, StreamContext> map4, Map<Long, Long> map5, ApplicationStatus applicationStatus, boolean z2) {
|
|
boolean z3;
|
|
boolean z4;
|
|
long id2 = guild.getId();
|
|
List list = (List) map2.get(Long.valueOf(id2));
|
|
ModelNotificationSettings modelNotificationSettings = (ModelNotificationSettings) map.get(Long.valueOf(id2));
|
|
boolean contains = (modelNotificationSettings == null || !modelNotificationSettings.isMuted()) ? set.contains(Long.valueOf(id2)) : false;
|
|
boolean z5 = id2 == j;
|
|
if (j2 > 0 && list != null && !list.isEmpty()) {
|
|
Iterator it = list.iterator();
|
|
while (true) {
|
|
if (!it.hasNext()) {
|
|
break;
|
|
}
|
|
if (j2 == ((Number) it.next()).longValue()) {
|
|
z4 = true;
|
|
continue;
|
|
} else {
|
|
z4 = false;
|
|
continue;
|
|
}
|
|
if (z4) {
|
|
z3 = true;
|
|
break;
|
|
}
|
|
}
|
|
boolean shouldDisplayVideoIconOnGuild = shouldDisplayVideoIconOnGuild(id2, modelNotificationSettings, map4, map5);
|
|
boolean contains2 = set2.contains(Long.valueOf(guild.getId()));
|
|
boolean z6 = !shouldShowUnread(guild) && contains;
|
|
boolean contains3 = set3.contains(Long.valueOf(guild.getId()));
|
|
Channel channel = map3.get(Long.valueOf(j2));
|
|
return new GuildListItem.GuildItem(guild, i, contains2, z6, z5, l, z3, shouldDisplayVideoIconOnGuild, false, bool, applicationStatus, z2, contains3, channel == null && ChannelUtils.z(channel), set4.contains(Long.valueOf(guild.getId())), 256, null);
|
|
}
|
|
z3 = false;
|
|
boolean shouldDisplayVideoIconOnGuild = shouldDisplayVideoIconOnGuild(id2, modelNotificationSettings, map4, map5);
|
|
boolean contains2 = set2.contains(Long.valueOf(guild.getId()));
|
|
if (!shouldShowUnread(guild)) {
|
|
}
|
|
boolean contains3 = set3.contains(Long.valueOf(guild.getId()));
|
|
Channel channel = map3.get(Long.valueOf(j2));
|
|
return new GuildListItem.GuildItem(guild, i, contains2, z6, z5, l, z3, shouldDisplayVideoIconOnGuild, false, bool, applicationStatus, z2, contains3, channel == null && ChannelUtils.z(channel), set4.contains(Long.valueOf(guild.getId())), 256, null);
|
|
}
|
|
|
|
public static /* synthetic */ GuildListItem.GuildItem createGuildItem$default(WidgetGuildsListViewModel widgetGuildsListViewModel, Guild guild, long j, long j2, Set set, Map map, int i, Map map2, Map map3, Set set2, Set set3, Set set4, Long l, Boolean bool, Map map4, Map map5, ApplicationStatus applicationStatus, boolean z2, int i2, Object obj) {
|
|
return widgetGuildsListViewModel.createGuildItem(guild, j, j2, set, map, i, map2, map3, set2, set3, set4, l, bool, map4, map5, applicationStatus, (i2 & 65536) != 0 ? false : z2);
|
|
}
|
|
|
|
private final List<GuildListItem> createPendingGuildsFolder(List<Guild> list, Map<Long, GuildJoinRequest> map, Set<Long> set, long j, long j2, Set<Long> set2, Map<Long, ? extends ModelNotificationSettings> map2, Map<Long, ? extends List<Long>> map3, Map<Long, Channel> map4, Set<Long> set3, Set<Long> set4, Set<Long> set5, Map<Long, StreamContext> map5, Map<Long, Long> map6) {
|
|
ArrayList arrayList = new ArrayList();
|
|
GuildListItem.FolderItem folderItem = new GuildListItem.FolderItem(-7, null, null, set.contains(-7L), list, false, false, false, 0, false, false);
|
|
arrayList.add(folderItem);
|
|
if (folderItem.isOpen()) {
|
|
ArrayList arrayList2 = new ArrayList(d0.t.o.collectionSizeOrDefault(list, 10));
|
|
int i = 0;
|
|
for (Object obj : list) {
|
|
int i2 = i + 1;
|
|
if (i < 0) {
|
|
n.throwIndexOverflow();
|
|
}
|
|
Guild guild = (Guild) obj;
|
|
Long valueOf = Long.valueOf(folderItem.getFolderId());
|
|
Boolean valueOf2 = Boolean.valueOf(n.getLastIndex(list) == i);
|
|
GuildJoinRequest guildJoinRequest = (GuildJoinRequest) a.d(guild, map);
|
|
arrayList2.add(createGuildItem(guild, j, j2, set2, map2, 0, map3, map4, set3, set4, set5, valueOf, valueOf2, map5, map6, guildJoinRequest != null ? guildJoinRequest.a() : null, true));
|
|
i = i2;
|
|
}
|
|
arrayList.addAll(arrayList2);
|
|
}
|
|
return arrayList;
|
|
}
|
|
|
|
/* JADX WARNING: Code restructure failed: missing block: B:53:0x0247, code lost:
|
|
if (com.discord.api.channel.ChannelUtils.z(r6) == true) goto L_0x024e;
|
|
*/
|
|
/* JADX WARNING: Removed duplicated region for block: B:113:0x0426 */
|
|
/* JADX WARNING: Removed duplicated region for block: B:114:0x046c */
|
|
/* JADX WARNING: Removed duplicated region for block: B:117:0x048b */
|
|
/* JADX WARNING: Removed duplicated region for block: B:120:0x04a8 */
|
|
/* JADX WARNING: Removed duplicated region for block: B:129:0x04c5 */
|
|
/* JADX WARNING: Removed duplicated region for block: B:156:0x0295 A[SYNTHETIC] */
|
|
/* JADX WARNING: Removed duplicated region for block: B:50:0x022e */
|
|
/* JADX WARNING: Removed duplicated region for block: B:56:0x024d */
|
|
/* JADX WARNING: Removed duplicated region for block: B:60:0x0253 */
|
|
/* JADX WARNING: Removed duplicated region for block: B:72:0x0293 */
|
|
private final void handleStoreState(StoreState storeState) {
|
|
boolean z2;
|
|
ArrayList arrayList;
|
|
ArrayList arrayList2;
|
|
GrowthTeamFeatures growthTeamFeatures;
|
|
ArrayList arrayList3;
|
|
Sequence sequence;
|
|
HashMap hashMap;
|
|
ArrayList arrayList4;
|
|
HashMap hashMap2;
|
|
ArrayList arrayList5;
|
|
boolean z3;
|
|
int i;
|
|
boolean z4;
|
|
boolean z5;
|
|
boolean z6;
|
|
HashMap hashMap3;
|
|
boolean z7;
|
|
Integer num;
|
|
ModelNotificationSettings modelNotificationSettings;
|
|
ArrayList arrayList6 = new ArrayList(storeState.getPendingGuilds().size() + storeState.getSortedGuilds().size() + 3);
|
|
arrayList6.add(new GuildListItem.FriendsItem(storeState.getSelectedGuildId() <= 0));
|
|
r.addAll(arrayList6, createDirectMessageItems(storeState.getPrivateChannels(), storeState.getMentionCounts(), storeState.getGuildSettings().get(0L)));
|
|
HashMap hashMap4 = new HashMap();
|
|
for (StoreGuildsSorted.Entry entry : storeState.getSortedGuilds()) {
|
|
if (entry instanceof StoreGuildsSorted.Entry.SingletonGuild) {
|
|
long id2 = ((StoreGuildsSorted.Entry.SingletonGuild) entry).getGuild().getId();
|
|
hashMap4.put(Long.valueOf(id2), Integer.valueOf(sumMentionCountsForGuild(id2, storeState.getChannelIds(), storeState.getMentionCounts())));
|
|
} else if (entry instanceof StoreGuildsSorted.Entry.Folder) {
|
|
for (Guild guild : ((StoreGuildsSorted.Entry.Folder) entry).getGuilds()) {
|
|
long id3 = guild.getId();
|
|
hashMap4.put(Long.valueOf(id3), Integer.valueOf(sumMentionCountsForGuild(id3, storeState.getChannelIds(), storeState.getMentionCounts())));
|
|
}
|
|
}
|
|
}
|
|
Sequence filter = q.filter(u.asSequence(storeState.getSortedGuilds()), WidgetGuildsListViewModel$handleStoreState$$inlined$filterIsInstance$1.INSTANCE);
|
|
Objects.requireNonNull(filter, "null cannot be cast to non-null type kotlin.sequences.Sequence<R>");
|
|
Sequence map = q.map(q.filter(filter, new WidgetGuildsListViewModel$handleStoreState$lurkerGuildItems$1(storeState)), new WidgetGuildsListViewModel$handleStoreState$lurkerGuildItems$2(this, storeState, hashMap4));
|
|
ArrayList arrayList7 = new ArrayList();
|
|
for (StoreGuildsSorted.Entry entry2 : q.filter(u.asSequence(storeState.getSortedGuilds()), new WidgetGuildsListViewModel$handleStoreState$2(storeState))) {
|
|
ApplicationStatus applicationStatus = null;
|
|
if (entry2 instanceof StoreGuildsSorted.Entry.SingletonGuild) {
|
|
StoreGuildsSorted.Entry.SingletonGuild singletonGuild = (StoreGuildsSorted.Entry.SingletonGuild) entry2;
|
|
Guild guild2 = singletonGuild.getGuild();
|
|
long selectedGuildId = storeState.getSelectedGuildId();
|
|
long selectedVoiceChannelId = storeState.getSelectedVoiceChannelId();
|
|
Set<Long> unreadGuildIds = storeState.getUnreadGuildIds();
|
|
Map<Long, ModelNotificationSettings> guildSettings = storeState.getGuildSettings();
|
|
Integer num2 = (Integer) hashMap4.get(Long.valueOf(singletonGuild.getGuild().getId()));
|
|
if (num2 == null) {
|
|
num2 = 0;
|
|
}
|
|
m.checkNotNullExpressionValue(num2, "mentionCountsByGuild[folder.guild.id] ?: 0");
|
|
int intValue = num2.intValue();
|
|
Map<Long, List<Long>> channelIds = storeState.getChannelIds();
|
|
Map<Long, Channel> channels = storeState.getChannels();
|
|
Set<Long> lurkingGuildIds = storeState.getLurkingGuildIds();
|
|
Set<Long> guildIdsWithActiveStageEvents = storeState.getGuildIdsWithActiveStageEvents();
|
|
Set<Long> guildIdsWithActiveScheduledEvents = storeState.getGuildIdsWithActiveScheduledEvents();
|
|
Map<Long, StreamContext> allApplicationStreamContexts = storeState.getAllApplicationStreamContexts();
|
|
Map<Long, Long> allChannelPermissions = storeState.getAllChannelPermissions();
|
|
GuildJoinRequest guildJoinRequest = storeState.getGuildJoinRequests().get(Long.valueOf(singletonGuild.getGuild().getId()));
|
|
if (guildJoinRequest != null) {
|
|
applicationStatus = guildJoinRequest.a();
|
|
}
|
|
sequence = map;
|
|
hashMap2 = hashMap4;
|
|
arrayList3 = arrayList6;
|
|
arrayList5 = arrayList7;
|
|
arrayList5.add(createGuildItem$default(this, guild2, selectedGuildId, selectedVoiceChannelId, unreadGuildIds, guildSettings, intValue, channelIds, channels, lurkingGuildIds, guildIdsWithActiveStageEvents, guildIdsWithActiveScheduledEvents, null, null, allApplicationStreamContexts, allChannelPermissions, applicationStatus, false, 65536, null));
|
|
} else {
|
|
arrayList5 = arrayList7;
|
|
sequence = map;
|
|
hashMap2 = hashMap4;
|
|
arrayList3 = arrayList6;
|
|
if (entry2 instanceof StoreGuildsSorted.Entry.Folder) {
|
|
StoreGuildsSorted.Entry.Folder folder = (StoreGuildsSorted.Entry.Folder) entry2;
|
|
boolean contains = storeState.getOpenFolderIds().contains(Long.valueOf(folder.getId()));
|
|
String str = "mentionCountsByGuild[guild.id] ?: 0";
|
|
if (!contains) {
|
|
boolean z8 = false;
|
|
int i2 = 0;
|
|
boolean z9 = false;
|
|
boolean z10 = false;
|
|
boolean z11 = false;
|
|
for (Guild guild3 : folder.getGuilds()) {
|
|
z9 = z9 || guild3.getId() == storeState.getSelectedGuildId();
|
|
if (!z10) {
|
|
List list = (List) a.d(guild3, storeState.getChannelIds());
|
|
if (!(list != null ? list.contains(Long.valueOf(storeState.getSelectedVoiceChannelId())) : false)) {
|
|
z10 = false;
|
|
if (z11) {
|
|
Channel channel = storeState.getChannels().get(Long.valueOf(storeState.getSelectedVoiceChannelId()));
|
|
if (channel != null) {
|
|
z7 = true;
|
|
} else {
|
|
z7 = true;
|
|
}
|
|
z11 = false;
|
|
if (!z8) {
|
|
z8 = shouldShowUnread(guild3) && storeState.getUnreadGuildIds().contains(Long.valueOf(guild3.getId())) && ((modelNotificationSettings = (ModelNotificationSettings) a.d(guild3, storeState.getGuildSettings())) == null || modelNotificationSettings.isMuted() != z7);
|
|
}
|
|
num = (Integer) hashMap2.get(Long.valueOf(guild3.getId()));
|
|
if (num == null) {
|
|
num = 0;
|
|
}
|
|
m.checkNotNullExpressionValue(num, str);
|
|
i2 += num.intValue();
|
|
hashMap2 = hashMap2;
|
|
} else {
|
|
z7 = true;
|
|
}
|
|
z11 = true;
|
|
if (!z8) {
|
|
}
|
|
num = (Integer) hashMap2.get(Long.valueOf(guild3.getId()));
|
|
if (num == null) {
|
|
}
|
|
m.checkNotNullExpressionValue(num, str);
|
|
i2 += num.intValue();
|
|
hashMap2 = hashMap2;
|
|
}
|
|
}
|
|
z10 = true;
|
|
if (z11) {
|
|
}
|
|
z11 = true;
|
|
if (!z8) {
|
|
}
|
|
num = (Integer) hashMap2.get(Long.valueOf(guild3.getId()));
|
|
if (num == null) {
|
|
}
|
|
m.checkNotNullExpressionValue(num, str);
|
|
i2 += num.intValue();
|
|
hashMap2 = hashMap2;
|
|
}
|
|
hashMap3 = hashMap2;
|
|
z3 = z8;
|
|
i = i2;
|
|
z6 = z9;
|
|
z5 = z10;
|
|
z4 = z11;
|
|
} else {
|
|
hashMap3 = hashMap2;
|
|
z6 = false;
|
|
z5 = false;
|
|
z4 = false;
|
|
i = 0;
|
|
z3 = false;
|
|
}
|
|
arrayList5.add(new GuildListItem.FolderItem(folder.getId(), folder.getColor(), folder.getName(), contains, folder.getGuilds(), z6, z5, z4, i, z3, false, 1024, null));
|
|
if (contains) {
|
|
List<Guild> guilds = folder.getGuilds();
|
|
ArrayList arrayList8 = new ArrayList(d0.t.o.collectionSizeOrDefault(guilds, 10));
|
|
int i3 = 0;
|
|
for (Object obj : guilds) {
|
|
int i4 = i3 + 1;
|
|
if (i3 < 0) {
|
|
n.throwIndexOverflow();
|
|
}
|
|
Guild guild4 = (Guild) obj;
|
|
long selectedGuildId2 = storeState.getSelectedGuildId();
|
|
long selectedVoiceChannelId2 = storeState.getSelectedVoiceChannelId();
|
|
Set<Long> unreadGuildIds2 = storeState.getUnreadGuildIds();
|
|
Map<Long, ModelNotificationSettings> guildSettings2 = storeState.getGuildSettings();
|
|
Integer num3 = (Integer) hashMap3.get(Long.valueOf(guild4.getId()));
|
|
if (num3 == null) {
|
|
num3 = 0;
|
|
}
|
|
m.checkNotNullExpressionValue(num3, str);
|
|
int intValue2 = num3.intValue();
|
|
Map<Long, List<Long>> channelIds2 = storeState.getChannelIds();
|
|
Map<Long, Channel> channels2 = storeState.getChannels();
|
|
Set<Long> lurkingGuildIds2 = storeState.getLurkingGuildIds();
|
|
Set<Long> guildIdsWithActiveStageEvents2 = storeState.getGuildIdsWithActiveStageEvents();
|
|
Set<Long> guildIdsWithActiveScheduledEvents2 = storeState.getGuildIdsWithActiveScheduledEvents();
|
|
Long valueOf = Long.valueOf(folder.getId());
|
|
Boolean valueOf2 = Boolean.valueOf(n.getLastIndex(folder.getGuilds()) == i3);
|
|
Map<Long, StreamContext> allApplicationStreamContexts2 = storeState.getAllApplicationStreamContexts();
|
|
Map<Long, Long> allChannelPermissions2 = storeState.getAllChannelPermissions();
|
|
GuildJoinRequest guildJoinRequest2 = (GuildJoinRequest) a.d(guild4, storeState.getGuildJoinRequests());
|
|
arrayList8.add(createGuildItem$default(this, guild4, selectedGuildId2, selectedVoiceChannelId2, unreadGuildIds2, guildSettings2, intValue2, channelIds2, channels2, lurkingGuildIds2, guildIdsWithActiveStageEvents2, guildIdsWithActiveScheduledEvents2, valueOf, valueOf2, allApplicationStreamContexts2, allChannelPermissions2, guildJoinRequest2 != null ? guildJoinRequest2.a() : null, false, 65536, null));
|
|
arrayList8 = arrayList8;
|
|
i3 = i4;
|
|
hashMap3 = hashMap3;
|
|
str = str;
|
|
arrayList5 = arrayList5;
|
|
}
|
|
hashMap = hashMap3;
|
|
arrayList4 = arrayList5;
|
|
arrayList4.addAll(arrayList8);
|
|
} else {
|
|
hashMap = hashMap3;
|
|
arrayList4 = arrayList5;
|
|
}
|
|
arrayList7 = arrayList4;
|
|
hashMap4 = hashMap;
|
|
map = sequence;
|
|
arrayList6 = arrayList3;
|
|
}
|
|
}
|
|
arrayList4 = arrayList5;
|
|
hashMap = hashMap2;
|
|
arrayList7 = arrayList4;
|
|
hashMap4 = hashMap;
|
|
map = sequence;
|
|
arrayList6 = arrayList3;
|
|
}
|
|
if (storeState.getOpenFolderIds().contains(-7L)) {
|
|
StoreStream.Companion.getGuildJoinRequests().fetchPendingGuilds();
|
|
}
|
|
Map<Long, GuildJoinRequest> guildJoinRequests = storeState.getGuildJoinRequests();
|
|
if (!guildJoinRequests.isEmpty()) {
|
|
Iterator<Map.Entry<Long, GuildJoinRequest>> it = guildJoinRequests.entrySet().iterator();
|
|
while (true) {
|
|
if (it.hasNext()) {
|
|
if (n.emptyList().contains(it.next().getKey())) {
|
|
z2 = true;
|
|
break;
|
|
}
|
|
} else {
|
|
break;
|
|
}
|
|
}
|
|
if (!z2) {
|
|
arrayList = arrayList7;
|
|
arrayList2 = arrayList6;
|
|
arrayList2.addAll(createPendingGuildsFolder(storeState.getPendingGuilds(), storeState.getGuildJoinRequests(), storeState.getOpenFolderIds(), storeState.getSelectedGuildId(), storeState.getSelectedVoiceChannelId(), storeState.getUnreadGuildIds(), storeState.getGuildSettings(), storeState.getChannelIds(), storeState.getChannels(), storeState.getLurkingGuildIds(), storeState.getGuildIdsWithActiveStageEvents(), storeState.getGuildIdsWithActiveScheduledEvents(), storeState.getAllApplicationStreamContexts(), storeState.getAllChannelPermissions()));
|
|
} else {
|
|
arrayList = arrayList7;
|
|
arrayList2 = arrayList6;
|
|
}
|
|
r.addAll(arrayList2, map);
|
|
GuildListItem.DividerItem dividerItem = GuildListItem.DividerItem.INSTANCE;
|
|
arrayList2.add(dividerItem);
|
|
arrayList2.addAll(arrayList);
|
|
if (!storeState.getUnavailableGuilds().isEmpty()) {
|
|
arrayList2.add(new GuildListItem.UnavailableItem(storeState.getUnavailableGuilds().size()));
|
|
}
|
|
arrayList2.add(GuildListItem.CreateItem.INSTANCE);
|
|
growthTeamFeatures = GrowthTeamFeatures.INSTANCE;
|
|
if (growthTeamFeatures.isHubDiscoveryEnabled()) {
|
|
arrayList2.add(new GuildListItem.HubItem(storeState.getShowHubSparkle() && growthTeamFeatures.isHubDiscoverySparkleEnabled()));
|
|
}
|
|
if (storeState.isNewUser()) {
|
|
arrayList2.add(dividerItem);
|
|
arrayList2.add(GuildListItem.HelpItem.INSTANCE);
|
|
}
|
|
arrayList2.add(GuildListItem.SpaceItem.INSTANCE);
|
|
ViewState.Loaded loaded = new ViewState.Loaded(arrayList2, !storeState.getChannelIds().isEmpty(), false);
|
|
if (!(storeState.isLeftPanelOpened() == this.wasLeftPanelOpened && storeState.isOnHomeTab() == this.wasOnHomeTab)) {
|
|
if (storeState.isLeftPanelOpened() && storeState.isOnHomeTab()) {
|
|
this.eventSubject.k.onNext(Event.FocusFirstElement.INSTANCE);
|
|
}
|
|
this.wasLeftPanelOpened = storeState.isLeftPanelOpened();
|
|
this.wasOnHomeTab = storeState.isOnHomeTab();
|
|
}
|
|
updateViewState(loaded);
|
|
}
|
|
z2 = false;
|
|
if (!z2) {
|
|
}
|
|
r.addAll(arrayList2, map);
|
|
GuildListItem.DividerItem dividerItem = GuildListItem.DividerItem.INSTANCE;
|
|
arrayList2.add(dividerItem);
|
|
arrayList2.addAll(arrayList);
|
|
if (!storeState.getUnavailableGuilds().isEmpty()) {
|
|
}
|
|
arrayList2.add(GuildListItem.CreateItem.INSTANCE);
|
|
growthTeamFeatures = GrowthTeamFeatures.INSTANCE;
|
|
if (growthTeamFeatures.isHubDiscoveryEnabled()) {
|
|
}
|
|
if (storeState.isNewUser()) {
|
|
}
|
|
arrayList2.add(GuildListItem.SpaceItem.INSTANCE);
|
|
ViewState.Loaded loaded = new ViewState.Loaded(arrayList2, !storeState.getChannelIds().isEmpty(), false);
|
|
this.eventSubject.k.onNext(Event.FocusFirstElement.INSTANCE);
|
|
this.wasLeftPanelOpened = storeState.isLeftPanelOpened();
|
|
this.wasOnHomeTab = storeState.isOnHomeTab();
|
|
updateViewState(loaded);
|
|
}
|
|
|
|
private final void move(int i, int i2, Long l) {
|
|
ArrayList<GuildListItem> arrayList;
|
|
int i3 = i2;
|
|
ViewState viewState = getViewState();
|
|
if (!(viewState instanceof ViewState.Loaded)) {
|
|
viewState = null;
|
|
}
|
|
ViewState.Loaded loaded = (ViewState.Loaded) viewState;
|
|
if (loaded != null) {
|
|
List<GuildListItem> items = loaded.getItems();
|
|
GuildListItem guildListItem = items.get(i);
|
|
if (this.currentTargetOperation != null || (i > i3 || Math.abs(i - i3) >= 2) || ((guildListItem instanceof GuildListItem.GuildItem) && (m.areEqual(((GuildListItem.GuildItem) guildListItem).getFolderId(), l) ^ true))) {
|
|
ArrayList<GuildListItem> arrayList2 = new ArrayList<>(items);
|
|
untargetCurrentTarget(arrayList2);
|
|
if (i < i3) {
|
|
i3--;
|
|
}
|
|
if (guildListItem instanceof GuildListItem.FolderItem) {
|
|
arrayList2.remove(i);
|
|
arrayList2.add(i3, guildListItem);
|
|
} else if (guildListItem instanceof GuildListItem.GuildItem) {
|
|
arrayList2.remove(i);
|
|
GuildListItem.GuildItem guildItem = (GuildListItem.GuildItem) guildListItem;
|
|
arrayList = arrayList2;
|
|
arrayList.add(i3, GuildListItem.GuildItem.copy$default(guildItem, null, 0, false, false, false, l, false, false, false, null, null, false, false, false, false, 32735, null));
|
|
rebuildFolders(arrayList, u.toSet(n.listOfNotNull((Object[]) new Long[]{guildItem.getFolderId(), l})));
|
|
updateViewState(ViewState.Loaded.copy$default(loaded, arrayList, false, true, 2, null));
|
|
}
|
|
arrayList = arrayList2;
|
|
updateViewState(ViewState.Loaded.copy$default(loaded, arrayList, false, true, 2, null));
|
|
}
|
|
}
|
|
}
|
|
|
|
private final void performTargetOperation(ArrayList<GuildListItem> arrayList, int i, int i2) {
|
|
GuildListItem guildListItem = arrayList.get(i);
|
|
m.checkNotNullExpressionValue(guildListItem, "editingList[fromPosition]");
|
|
GuildListItem guildListItem2 = guildListItem;
|
|
GuildListItem guildListItem3 = arrayList.get(i2);
|
|
m.checkNotNullExpressionValue(guildListItem3, "editingList[toPosition]");
|
|
GuildListItem guildListItem4 = guildListItem3;
|
|
boolean z2 = guildListItem2 instanceof GuildListItem.GuildItem;
|
|
if (z2 && (guildListItem4 instanceof GuildListItem.GuildItem)) {
|
|
GuildListItem.GuildItem guildItem = (GuildListItem.GuildItem) guildListItem4;
|
|
GuildListItem.GuildItem guildItem2 = (GuildListItem.GuildItem) guildListItem2;
|
|
arrayList.set(i2, new GuildListItem.FolderItem(c.k.nextLong(), null, null, false, n.listOf((Object[]) new Guild[]{guildItem.getGuild(), guildItem2.getGuild()}), guildItem.isSelected() || guildItem2.isSelected(), guildItem.isConnectedToVoice() || guildItem2.isConnectedToVoice(), guildItem.isConnectedToStageChannel() || guildItem2.isConnectedToStageChannel(), guildItem2.getMentionCount() + guildItem.getMentionCount(), guildItem.isUnread() || guildItem2.isUnread(), false));
|
|
m.checkNotNullExpressionValue(arrayList.remove(i), "editingList.removeAt(fromPosition)");
|
|
} else if (z2 && (guildListItem4 instanceof GuildListItem.FolderItem)) {
|
|
GuildListItem.FolderItem folderItem = (GuildListItem.FolderItem) guildListItem4;
|
|
GuildListItem.GuildItem guildItem3 = (GuildListItem.GuildItem) guildListItem2;
|
|
arrayList.set(i2, GuildListItem.FolderItem.copy$default(folderItem, 0, null, null, false, u.plus((Collection<? extends Guild>) u.toMutableList((Collection) folderItem.getGuilds()), guildItem3.getGuild()), folderItem.isAnyGuildSelected() || guildItem3.isSelected(), folderItem.isAnyGuildConnectedToVoice() || guildItem3.isConnectedToVoice(), false, 0, folderItem.isUnread() || guildItem3.isUnread(), false, 399, null));
|
|
arrayList.remove(i);
|
|
}
|
|
}
|
|
|
|
private final void rebuildFolders(ArrayList<GuildListItem> arrayList, Set<Long> set) {
|
|
if (!set.isEmpty()) {
|
|
HashMap hashMap = new HashMap();
|
|
ArrayList<GuildListItem.GuildItem> arrayList2 = new ArrayList();
|
|
for (Object obj : arrayList) {
|
|
if (obj instanceof GuildListItem.GuildItem) {
|
|
arrayList2.add(obj);
|
|
}
|
|
}
|
|
for (GuildListItem.GuildItem guildItem : arrayList2) {
|
|
Long folderId = guildItem.getFolderId();
|
|
if (folderId != null) {
|
|
long longValue = folderId.longValue();
|
|
ArrayList arrayList3 = (ArrayList) hashMap.get(Long.valueOf(longValue));
|
|
if (arrayList3 == null) {
|
|
arrayList3 = new ArrayList();
|
|
}
|
|
arrayList3.add(guildItem.getGuild());
|
|
hashMap.put(Long.valueOf(longValue), arrayList3);
|
|
}
|
|
}
|
|
for (Number number : set) {
|
|
long longValue2 = number.longValue();
|
|
Iterator<GuildListItem> it = arrayList.iterator();
|
|
int i = 0;
|
|
while (true) {
|
|
if (!it.hasNext()) {
|
|
i = -1;
|
|
break;
|
|
}
|
|
GuildListItem next = it.next();
|
|
if ((next instanceof GuildListItem.FolderItem) && ((GuildListItem.FolderItem) next).getFolderId() == longValue2) {
|
|
break;
|
|
}
|
|
i++;
|
|
}
|
|
GuildListItem guildListItem = arrayList.get(i);
|
|
Objects.requireNonNull(guildListItem, "null cannot be cast to non-null type com.discord.widgets.guilds.list.GuildListItem.FolderItem");
|
|
GuildListItem.FolderItem folderItem = (GuildListItem.FolderItem) guildListItem;
|
|
ArrayList arrayList4 = (ArrayList) hashMap.get(Long.valueOf(longValue2));
|
|
if (arrayList4 == null) {
|
|
arrayList4 = new ArrayList();
|
|
}
|
|
arrayList.set(i, GuildListItem.FolderItem.copy$default(folderItem, 0, null, null, false, arrayList4, false, false, false, 0, false, false, 2031, null));
|
|
}
|
|
}
|
|
}
|
|
|
|
private final boolean shouldDisplayVideoIconOnGuild(long j, ModelNotificationSettings modelNotificationSettings, Map<Long, StreamContext> map, Map<Long, Long> map2) {
|
|
boolean z2;
|
|
if (map == null || map.isEmpty()) {
|
|
return false;
|
|
}
|
|
if (modelNotificationSettings != null && modelNotificationSettings.isMuted()) {
|
|
return false;
|
|
}
|
|
Collection<StreamContext> values = map.values();
|
|
if (!(values instanceof Collection) || !values.isEmpty()) {
|
|
for (StreamContext streamContext : values) {
|
|
Guild guild = streamContext.getGuild();
|
|
if (guild == null || guild.getId() != j || !PermissionUtils.can(Permission.VIEW_CHANNEL, map2.get(Long.valueOf(streamContext.getStream().getChannelId())))) {
|
|
z2 = false;
|
|
continue;
|
|
} else {
|
|
z2 = true;
|
|
continue;
|
|
}
|
|
if (z2) {
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
private final boolean shouldShowUnread(Guild guild) {
|
|
return !guild.isHub() || GrowthTeamFeatures.hubUnreadsEnabled$default(GrowthTeamFeatures.INSTANCE, false, 1, null);
|
|
}
|
|
|
|
private final int sumMentionCountsForGuild(long j, Map<Long, ? extends Collection<Long>> map, Map<Long, Integer> map2) {
|
|
Collection<Number> collection = (Collection) map.get(Long.valueOf(j));
|
|
if (collection == null) {
|
|
return 0;
|
|
}
|
|
ArrayList arrayList = new ArrayList(d0.t.o.collectionSizeOrDefault(collection, 10));
|
|
for (Number number : collection) {
|
|
Integer num = map2.get(Long.valueOf(number.longValue()));
|
|
arrayList.add(Integer.valueOf(num != null ? num.intValue() : 0));
|
|
}
|
|
return u.sumOfInt(arrayList);
|
|
}
|
|
|
|
private final void untargetCurrentTarget(ArrayList<GuildListItem> arrayList) {
|
|
GuildListItem guildListItem;
|
|
WidgetGuildListAdapter.Operation.TargetOperation targetOperation = this.currentTargetOperation;
|
|
if (targetOperation != null) {
|
|
int component2 = targetOperation.component2();
|
|
GuildListItem guildListItem2 = arrayList.get(component2);
|
|
m.checkNotNullExpressionValue(guildListItem2, "editingList[toPosition]");
|
|
GuildListItem guildListItem3 = guildListItem2;
|
|
if (guildListItem3 instanceof GuildListItem.GuildItem) {
|
|
guildListItem = GuildListItem.GuildItem.copy$default((GuildListItem.GuildItem) guildListItem3, null, 0, false, false, false, null, false, false, false, null, null, false, false, false, false, 32511, null);
|
|
} else if (guildListItem3 instanceof GuildListItem.FolderItem) {
|
|
guildListItem = GuildListItem.FolderItem.copy$default((GuildListItem.FolderItem) guildListItem3, 0, null, null, false, null, false, false, false, 0, false, false, AudioAttributesCompat.FLAG_ALL, null);
|
|
}
|
|
arrayList.set(component2, guildListItem);
|
|
}
|
|
this.currentTargetOperation = null;
|
|
}
|
|
|
|
public final Observable<Event> listenForEvents() {
|
|
PublishSubject<Event> publishSubject = this.eventSubject;
|
|
m.checkNotNullExpressionValue(publishSubject, "eventSubject");
|
|
return publishSubject;
|
|
}
|
|
|
|
public final void moveAbove(int i, int i2) {
|
|
ViewState viewState = getViewState();
|
|
Long l = null;
|
|
if (!(viewState instanceof ViewState.Loaded)) {
|
|
viewState = null;
|
|
}
|
|
ViewState.Loaded loaded = (ViewState.Loaded) viewState;
|
|
if (loaded != null) {
|
|
GuildListItem guildListItem = loaded.getItems().get(i2);
|
|
if (guildListItem instanceof GuildListItem.GuildItem) {
|
|
l = ((GuildListItem.GuildItem) guildListItem).getFolderId();
|
|
} else if (!(guildListItem instanceof GuildListItem.FolderItem) && !(guildListItem instanceof GuildListItem.HelpItem) && !(guildListItem instanceof GuildListItem.CreateItem)) {
|
|
throw new IllegalStateException("invalid target");
|
|
}
|
|
move(i, i2, l);
|
|
}
|
|
}
|
|
|
|
public final void moveBelow(int i, int i2) {
|
|
ViewState viewState = getViewState();
|
|
Long l = null;
|
|
if (!(viewState instanceof ViewState.Loaded)) {
|
|
viewState = null;
|
|
}
|
|
ViewState.Loaded loaded = (ViewState.Loaded) viewState;
|
|
if (loaded != null) {
|
|
GuildListItem guildListItem = loaded.getItems().get(i2);
|
|
if (guildListItem instanceof GuildListItem.GuildItem) {
|
|
l = ((GuildListItem.GuildItem) guildListItem).getFolderId();
|
|
} else if (guildListItem instanceof GuildListItem.FolderItem) {
|
|
GuildListItem.FolderItem folderItem = (GuildListItem.FolderItem) guildListItem;
|
|
if (folderItem.isOpen()) {
|
|
l = Long.valueOf(folderItem.getFolderId());
|
|
}
|
|
} else {
|
|
throw new IllegalStateException("invalid target");
|
|
}
|
|
move(i, i2 + 1, l);
|
|
}
|
|
}
|
|
|
|
public final boolean onDrop() {
|
|
ViewState viewState = getViewState();
|
|
if (!(viewState instanceof ViewState.Loaded)) {
|
|
viewState = null;
|
|
}
|
|
ViewState.Loaded loaded = (ViewState.Loaded) viewState;
|
|
if (loaded == null) {
|
|
return false;
|
|
}
|
|
List<GuildListItem> items = loaded.getItems();
|
|
ArrayList<StoreGuildsSorted.Entry> arrayList = new ArrayList();
|
|
WidgetGuildListAdapter.Operation.TargetOperation targetOperation = this.currentTargetOperation;
|
|
if (targetOperation != null) {
|
|
ArrayList<GuildListItem> arrayList2 = new ArrayList<>(items);
|
|
untargetCurrentTarget(arrayList2);
|
|
performTargetOperation(arrayList2, targetOperation.getFromPosition(), targetOperation.getTargetPosition());
|
|
items = arrayList2;
|
|
}
|
|
for (GuildListItem guildListItem : items) {
|
|
if (guildListItem instanceof GuildListItem.FolderItem) {
|
|
GuildListItem.FolderItem folderItem = (GuildListItem.FolderItem) guildListItem;
|
|
arrayList.add(new StoreGuildsSorted.Entry.Folder(folderItem.getFolderId(), folderItem.getGuilds(), folderItem.getColor(), folderItem.getName()));
|
|
} else if (guildListItem instanceof GuildListItem.GuildItem) {
|
|
GuildListItem.GuildItem guildItem = (GuildListItem.GuildItem) guildListItem;
|
|
if (guildItem.getFolderId() == null) {
|
|
arrayList.add(new StoreGuildsSorted.Entry.SingletonGuild(guildItem.getGuild()));
|
|
}
|
|
}
|
|
}
|
|
StoreStream.Companion.getGuildsSorted().setPositions(arrayList);
|
|
ArrayList arrayList3 = new ArrayList(d0.t.o.collectionSizeOrDefault(arrayList, 10));
|
|
for (StoreGuildsSorted.Entry entry : arrayList) {
|
|
arrayList3.add(entry.asModelGuildFolder());
|
|
}
|
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.restSubscribeOn$default(RestAPI.Companion.getApi().updateUserSettings(RestAPIParams.UserSettings.Companion.createWithGuildFolders(arrayList3)), false, 1, null), WidgetGuildsListViewModel.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, WidgetGuildsListViewModel$onDrop$2.INSTANCE, 62, (Object) null);
|
|
return targetOperation != null;
|
|
}
|
|
|
|
public final void onItemClicked(GuildListItem guildListItem, Context context, FragmentManager fragmentManager) {
|
|
m.checkNotNullParameter(guildListItem, "item");
|
|
m.checkNotNullParameter(context, "context");
|
|
m.checkNotNullParameter(fragmentManager, "fragmentManager");
|
|
boolean z2 = !GrowthTeamFeatures.INSTANCE.isHubEnabled();
|
|
if (guildListItem instanceof GuildListItem.GuildItem) {
|
|
GuildListItem.GuildItem guildItem = (GuildListItem.GuildItem) guildListItem;
|
|
if (guildItem.isPendingGuild()) {
|
|
MemberVerificationUtils.maybeShowVerificationGate$default(MemberVerificationUtils.INSTANCE, context, fragmentManager, guildItem.getGuild().getId(), "Guilds List", null, null, WidgetGuildsListViewModel$onItemClicked$1.INSTANCE, 48, null);
|
|
} else if (guildItem.isSelected()) {
|
|
StoreNavigation.setNavigationPanelAction$default(StoreStream.Companion.getNavigation(), StoreNavigation.PanelAction.CLOSE, null, 2, null);
|
|
} else if (!guildItem.getGuild().isHub() || !z2) {
|
|
StoreStream.Companion.getGuildSelected().set(guildItem.getGuild().getId());
|
|
} else {
|
|
b.a.d.m.g(context, R.string.discord_u_coming_soon_to_mobile, 0, null, 12);
|
|
}
|
|
} else if (guildListItem instanceof GuildListItem.PrivateChannelItem) {
|
|
ChannelSelector.selectChannel$default(ChannelSelector.Companion.getInstance(), 0, ((GuildListItem.PrivateChannelItem) guildListItem).getChannel().h(), null, null, 12, null);
|
|
} else if (guildListItem instanceof GuildListItem.UnavailableItem) {
|
|
this.eventSubject.k.onNext(new Event.ShowUnavailableGuilds(((GuildListItem.UnavailableItem) guildListItem).getUnavailableGuildCount()));
|
|
} else if (guildListItem instanceof GuildListItem.FriendsItem) {
|
|
if (((GuildListItem.FriendsItem) guildListItem).isSelected()) {
|
|
StoreNavigation.setNavigationPanelAction$default(StoreStream.Companion.getNavigation(), StoreNavigation.PanelAction.CLOSE, null, 2, null);
|
|
} else {
|
|
StoreStream.Companion.getGuildSelected().set(0);
|
|
}
|
|
} else if (m.areEqual(guildListItem, GuildListItem.CreateItem.INSTANCE)) {
|
|
this.eventSubject.k.onNext(Event.ShowCreateGuild.INSTANCE);
|
|
} else if (guildListItem instanceof GuildListItem.HubItem) {
|
|
StoreStream.Companion.getDirectories().markDiscordHubClicked();
|
|
this.eventSubject.k.onNext(Event.ShowHubVerification.INSTANCE);
|
|
} else if (m.areEqual(guildListItem, GuildListItem.HelpItem.INSTANCE)) {
|
|
this.eventSubject.k.onNext(Event.ShowHelp.INSTANCE);
|
|
} else if (guildListItem instanceof GuildListItem.FolderItem) {
|
|
GuildListItem.FolderItem folderItem = (GuildListItem.FolderItem) guildListItem;
|
|
if (folderItem.isOpen()) {
|
|
StoreStream.Companion.getExpandedGuildFolders().closeFolder(guildListItem.getItemId());
|
|
} else {
|
|
StoreStream.Companion.getExpandedGuildFolders().openFolder(guildListItem.getItemId());
|
|
}
|
|
this.eventSubject.k.onNext(new Event.AnnounceFolderToggleForAccessibility(folderItem));
|
|
}
|
|
}
|
|
|
|
public final void onItemLongPressed(GuildListItem guildListItem) {
|
|
m.checkNotNullParameter(guildListItem, "item");
|
|
if (guildListItem instanceof GuildListItem.PrivateChannelItem) {
|
|
PublishSubject<Event> publishSubject = this.eventSubject;
|
|
publishSubject.k.onNext(new Event.ShowChannelActions(((GuildListItem.PrivateChannelItem) guildListItem).getChannel().h()));
|
|
}
|
|
}
|
|
|
|
public final void target(int i, int i2) {
|
|
GuildListItem guildListItem;
|
|
ViewState viewState = getViewState();
|
|
if (!(viewState instanceof ViewState.Loaded)) {
|
|
viewState = null;
|
|
}
|
|
ViewState.Loaded loaded = (ViewState.Loaded) viewState;
|
|
if (loaded != null) {
|
|
ArrayList<GuildListItem> arrayList = new ArrayList<>(loaded.getItems());
|
|
untargetCurrentTarget(arrayList);
|
|
GuildListItem guildListItem2 = arrayList.get(i2);
|
|
if (guildListItem2 instanceof GuildListItem.GuildItem) {
|
|
guildListItem = GuildListItem.GuildItem.copy$default((GuildListItem.GuildItem) guildListItem2, null, 0, false, false, false, null, false, false, true, null, null, false, false, false, false, 32511, null);
|
|
} else if (guildListItem2 instanceof GuildListItem.FolderItem) {
|
|
guildListItem = GuildListItem.FolderItem.copy$default((GuildListItem.FolderItem) guildListItem2, 0, null, null, false, null, false, false, false, 0, false, true, AudioAttributesCompat.FLAG_ALL, null);
|
|
} else {
|
|
throw new IllegalStateException("invalid target item: " + guildListItem2);
|
|
}
|
|
arrayList.set(i2, guildListItem);
|
|
this.currentTargetOperation = new WidgetGuildListAdapter.Operation.TargetOperation(i, i2);
|
|
updateViewState(ViewState.Loaded.copy$default(loaded, arrayList, false, true, 2, null));
|
|
return;
|
|
}
|
|
throw new IllegalStateException("targeting with no items");
|
|
}
|
|
}
|