2021-08-20 02:22:46 +00:00
|
|
|
package com.discord.widgets.guildscheduledevent;
|
|
|
|
|
|
|
|
import android.content.Context;
|
2021-10-07 06:22:31 +00:00
|
|
|
import androidx.core.app.FrameMetricsAggregator;
|
2021-08-20 02:22:46 +00:00
|
|
|
import c.d.b.a.a;
|
2021-10-15 06:18:26 +00:00
|
|
|
import c0.z.d.k;
|
|
|
|
import c0.z.d.m;
|
2021-08-20 02:22:46 +00:00
|
|
|
import com.discord.api.channel.Channel;
|
|
|
|
import com.discord.api.guildscheduledevent.GuildScheduledEvent;
|
|
|
|
import com.discord.app.AppViewModel;
|
|
|
|
import com.discord.models.guild.Guild;
|
|
|
|
import com.discord.stores.StoreChannels;
|
|
|
|
import com.discord.stores.StoreGuildScheduledEvents;
|
|
|
|
import com.discord.stores.StoreGuilds;
|
2021-09-18 07:43:22 +00:00
|
|
|
import com.discord.stores.StorePermissions;
|
2021-08-20 02:22:46 +00:00
|
|
|
import com.discord.stores.StoreStream;
|
2021-09-18 07:43:22 +00:00
|
|
|
import com.discord.stores.StoreUserSettings;
|
2021-09-29 17:50:51 +00:00
|
|
|
import com.discord.stores.StoreVoiceChannelSelected;
|
2021-08-20 02:22:46 +00:00
|
|
|
import com.discord.stores.updates.ObservationDeck;
|
|
|
|
import com.discord.stores.updates.ObservationDeckProvider;
|
2021-09-18 07:43:22 +00:00
|
|
|
import com.discord.utilities.rest.RestAPI;
|
2021-08-20 02:22:46 +00:00
|
|
|
import com.discord.utilities.rx.ObservableExtensionsKt;
|
|
|
|
import kotlin.Unit;
|
|
|
|
import kotlin.jvm.functions.Function0;
|
|
|
|
import kotlin.jvm.functions.Function1;
|
|
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
|
|
import rx.Observable;
|
|
|
|
/* compiled from: GuildScheduledEventDetailsViewModel.kt */
|
|
|
|
public final class GuildScheduledEventDetailsViewModel extends AppViewModel<ViewState> {
|
|
|
|
public static final Companion Companion = new Companion(null);
|
|
|
|
private final long guildScheduledEventId;
|
|
|
|
private final StoreGuildScheduledEvents guildScheduledEventsStore;
|
|
|
|
|
|
|
|
/* compiled from: GuildScheduledEventDetailsViewModel.kt */
|
|
|
|
/* renamed from: com.discord.widgets.guildscheduledevent.GuildScheduledEventDetailsViewModel$1 reason: invalid class name */
|
|
|
|
public static final /* synthetic */ class AnonymousClass1 extends k implements Function1<StoreState, Unit> {
|
|
|
|
public AnonymousClass1(GuildScheduledEventDetailsViewModel guildScheduledEventDetailsViewModel) {
|
|
|
|
super(1, guildScheduledEventDetailsViewModel, GuildScheduledEventDetailsViewModel.class, "handleStoreState", "handleStoreState(Lcom/discord/widgets/guildscheduledevent/GuildScheduledEventDetailsViewModel$StoreState;)V", 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 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, "p1");
|
|
|
|
GuildScheduledEventDetailsViewModel.access$handleStoreState((GuildScheduledEventDetailsViewModel) this.receiver, storeState);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: GuildScheduledEventDetailsViewModel.kt */
|
|
|
|
public static final class Companion {
|
|
|
|
private Companion() {
|
|
|
|
}
|
|
|
|
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
|
|
this();
|
|
|
|
}
|
|
|
|
|
2021-09-29 17:50:51 +00:00
|
|
|
public static final /* synthetic */ Observable access$observeStores(Companion companion, long j, ObservationDeck observationDeck, StoreGuildScheduledEvents storeGuildScheduledEvents, StoreGuilds storeGuilds, StoreChannels storeChannels, StorePermissions storePermissions, StoreUserSettings storeUserSettings, StoreVoiceChannelSelected storeVoiceChannelSelected) {
|
|
|
|
return companion.observeStores(j, observationDeck, storeGuildScheduledEvents, storeGuilds, storeChannels, storePermissions, storeUserSettings, storeVoiceChannelSelected);
|
2021-08-20 02:22:46 +00:00
|
|
|
}
|
|
|
|
|
2021-09-29 17:50:51 +00:00
|
|
|
private final Observable<StoreState> observeStores(long j, ObservationDeck observationDeck, StoreGuildScheduledEvents storeGuildScheduledEvents, StoreGuilds storeGuilds, StoreChannels storeChannels, StorePermissions storePermissions, StoreUserSettings storeUserSettings, StoreVoiceChannelSelected storeVoiceChannelSelected) {
|
|
|
|
return ObservationDeck.connectRx$default(observationDeck, new ObservationDeck.UpdateSource[]{storeGuildScheduledEvents, storeGuilds, storeChannels, storePermissions, storeVoiceChannelSelected}, false, null, null, new GuildScheduledEventDetailsViewModel$Companion$observeStores$1(storeGuildScheduledEvents, j, storeChannels, storeGuilds, storeVoiceChannelSelected, storePermissions, storeUserSettings), 14, null);
|
2021-08-20 02:22:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: GuildScheduledEventDetailsViewModel.kt */
|
|
|
|
public static final class StoreState {
|
2021-10-07 06:22:31 +00:00
|
|
|
private final boolean canConnect;
|
2021-09-18 07:43:22 +00:00
|
|
|
private final boolean canShare;
|
|
|
|
private final boolean canStartEvent;
|
2021-08-20 02:22:46 +00:00
|
|
|
private final Channel channel;
|
|
|
|
private final Guild guild;
|
|
|
|
private final GuildScheduledEvent guildScheduledEvent;
|
2021-09-18 07:43:22 +00:00
|
|
|
private final boolean isDeveloperMode;
|
2021-08-20 02:22:46 +00:00
|
|
|
private final boolean isRsvped;
|
2021-09-29 17:50:51 +00:00
|
|
|
private final Long selectedVoiceChannelId;
|
2021-08-20 02:22:46 +00:00
|
|
|
|
|
|
|
public StoreState() {
|
2021-10-07 06:22:31 +00:00
|
|
|
this(null, null, null, false, false, false, false, null, false, FrameMetricsAggregator.EVERY_DURATION, null);
|
2021-08-20 02:22:46 +00:00
|
|
|
}
|
|
|
|
|
2021-10-07 06:22:31 +00:00
|
|
|
public StoreState(GuildScheduledEvent guildScheduledEvent, Channel channel, Guild guild, boolean z2, boolean z3, boolean z4, boolean z5, Long l, boolean z6) {
|
2021-08-20 02:22:46 +00:00
|
|
|
this.guildScheduledEvent = guildScheduledEvent;
|
|
|
|
this.channel = channel;
|
|
|
|
this.guild = guild;
|
|
|
|
this.isRsvped = z2;
|
2021-09-18 07:43:22 +00:00
|
|
|
this.canShare = z3;
|
|
|
|
this.canStartEvent = z4;
|
|
|
|
this.isDeveloperMode = z5;
|
2021-09-29 17:50:51 +00:00
|
|
|
this.selectedVoiceChannelId = l;
|
2021-10-07 06:22:31 +00:00
|
|
|
this.canConnect = z6;
|
2021-08-20 02:22:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* JADX INFO: this call moved to the top of the method (can break code semantics) */
|
2021-10-07 06:22:31 +00:00
|
|
|
public /* synthetic */ StoreState(GuildScheduledEvent guildScheduledEvent, Channel channel, Guild guild, boolean z2, boolean z3, boolean z4, boolean z5, Long l, boolean z6, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
|
|
|
this((i & 1) != 0 ? null : guildScheduledEvent, (i & 2) != 0 ? null : channel, (i & 4) != 0 ? null : guild, (i & 8) != 0 ? false : z2, (i & 16) != 0 ? false : z3, (i & 32) != 0 ? false : z4, (i & 64) != 0 ? false : z5, (i & 128) == 0 ? l : null, (i & 256) == 0 ? z6 : false);
|
2021-08-20 02:22:46 +00:00
|
|
|
}
|
|
|
|
|
2021-10-07 06:22:31 +00:00
|
|
|
public static /* synthetic */ StoreState copy$default(StoreState storeState, GuildScheduledEvent guildScheduledEvent, Channel channel, Guild guild, boolean z2, boolean z3, boolean z4, boolean z5, Long l, boolean z6, int i, Object obj) {
|
|
|
|
return storeState.copy((i & 1) != 0 ? storeState.guildScheduledEvent : guildScheduledEvent, (i & 2) != 0 ? storeState.channel : channel, (i & 4) != 0 ? storeState.guild : guild, (i & 8) != 0 ? storeState.isRsvped : z2, (i & 16) != 0 ? storeState.canShare : z3, (i & 32) != 0 ? storeState.canStartEvent : z4, (i & 64) != 0 ? storeState.isDeveloperMode : z5, (i & 128) != 0 ? storeState.selectedVoiceChannelId : l, (i & 256) != 0 ? storeState.canConnect : z6);
|
2021-08-20 02:22:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final GuildScheduledEvent component1() {
|
|
|
|
return this.guildScheduledEvent;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Channel component2() {
|
|
|
|
return this.channel;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Guild component3() {
|
|
|
|
return this.guild;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean component4() {
|
|
|
|
return this.isRsvped;
|
|
|
|
}
|
|
|
|
|
2021-09-18 07:43:22 +00:00
|
|
|
public final boolean component5() {
|
|
|
|
return this.canShare;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean component6() {
|
|
|
|
return this.canStartEvent;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean component7() {
|
|
|
|
return this.isDeveloperMode;
|
|
|
|
}
|
|
|
|
|
2021-09-29 17:50:51 +00:00
|
|
|
public final Long component8() {
|
|
|
|
return this.selectedVoiceChannelId;
|
|
|
|
}
|
|
|
|
|
2021-10-07 06:22:31 +00:00
|
|
|
public final boolean component9() {
|
|
|
|
return this.canConnect;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final StoreState copy(GuildScheduledEvent guildScheduledEvent, Channel channel, Guild guild, boolean z2, boolean z3, boolean z4, boolean z5, Long l, boolean z6) {
|
|
|
|
return new StoreState(guildScheduledEvent, channel, guild, z2, z3, z4, z5, l, z6);
|
2021-08-20 02:22:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public boolean equals(Object obj) {
|
|
|
|
if (this == obj) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (!(obj instanceof StoreState)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
StoreState storeState = (StoreState) obj;
|
2021-10-07 06:22:31 +00:00
|
|
|
return m.areEqual(this.guildScheduledEvent, storeState.guildScheduledEvent) && m.areEqual(this.channel, storeState.channel) && m.areEqual(this.guild, storeState.guild) && this.isRsvped == storeState.isRsvped && this.canShare == storeState.canShare && this.canStartEvent == storeState.canStartEvent && this.isDeveloperMode == storeState.isDeveloperMode && m.areEqual(this.selectedVoiceChannelId, storeState.selectedVoiceChannelId) && this.canConnect == storeState.canConnect;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean getCanConnect() {
|
|
|
|
return this.canConnect;
|
2021-09-18 07:43:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean getCanShare() {
|
|
|
|
return this.canShare;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean getCanStartEvent() {
|
|
|
|
return this.canStartEvent;
|
2021-08-20 02:22:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final Channel getChannel() {
|
|
|
|
return this.channel;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Guild getGuild() {
|
|
|
|
return this.guild;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final GuildScheduledEvent getGuildScheduledEvent() {
|
|
|
|
return this.guildScheduledEvent;
|
|
|
|
}
|
|
|
|
|
2021-09-29 17:50:51 +00:00
|
|
|
public final Long getSelectedVoiceChannelId() {
|
|
|
|
return this.selectedVoiceChannelId;
|
|
|
|
}
|
|
|
|
|
2021-08-20 02:22:46 +00:00
|
|
|
public int hashCode() {
|
|
|
|
GuildScheduledEvent guildScheduledEvent = this.guildScheduledEvent;
|
|
|
|
int i = 0;
|
|
|
|
int hashCode = (guildScheduledEvent != null ? guildScheduledEvent.hashCode() : 0) * 31;
|
|
|
|
Channel channel = this.channel;
|
|
|
|
int hashCode2 = (hashCode + (channel != null ? channel.hashCode() : 0)) * 31;
|
|
|
|
Guild guild = this.guild;
|
2021-09-29 17:50:51 +00:00
|
|
|
int hashCode3 = (hashCode2 + (guild != null ? guild.hashCode() : 0)) * 31;
|
2021-08-20 02:22:46 +00:00
|
|
|
boolean z2 = this.isRsvped;
|
2021-09-29 17:50:51 +00:00
|
|
|
int i2 = 1;
|
2021-08-20 02:22:46 +00:00
|
|
|
if (z2) {
|
|
|
|
z2 = true;
|
|
|
|
}
|
2021-09-29 17:50:51 +00:00
|
|
|
int i3 = z2 ? 1 : 0;
|
2021-08-20 02:22:46 +00:00
|
|
|
int i4 = z2 ? 1 : 0;
|
|
|
|
int i5 = z2 ? 1 : 0;
|
2021-09-29 17:50:51 +00:00
|
|
|
int i6 = (hashCode3 + i3) * 31;
|
2021-09-18 07:43:22 +00:00
|
|
|
boolean z3 = this.canShare;
|
|
|
|
if (z3) {
|
|
|
|
z3 = true;
|
|
|
|
}
|
2021-09-29 17:50:51 +00:00
|
|
|
int i7 = z3 ? 1 : 0;
|
2021-09-18 07:43:22 +00:00
|
|
|
int i8 = z3 ? 1 : 0;
|
|
|
|
int i9 = z3 ? 1 : 0;
|
2021-09-29 17:50:51 +00:00
|
|
|
int i10 = (i6 + i7) * 31;
|
2021-09-18 07:43:22 +00:00
|
|
|
boolean z4 = this.canStartEvent;
|
|
|
|
if (z4) {
|
|
|
|
z4 = true;
|
|
|
|
}
|
2021-09-29 17:50:51 +00:00
|
|
|
int i11 = z4 ? 1 : 0;
|
2021-09-18 07:43:22 +00:00
|
|
|
int i12 = z4 ? 1 : 0;
|
|
|
|
int i13 = z4 ? 1 : 0;
|
2021-09-29 17:50:51 +00:00
|
|
|
int i14 = (i10 + i11) * 31;
|
2021-09-18 07:43:22 +00:00
|
|
|
boolean z5 = this.isDeveloperMode;
|
2021-10-07 06:22:31 +00:00
|
|
|
if (z5) {
|
|
|
|
z5 = true;
|
2021-09-18 07:43:22 +00:00
|
|
|
}
|
2021-10-07 06:22:31 +00:00
|
|
|
int i15 = z5 ? 1 : 0;
|
|
|
|
int i16 = z5 ? 1 : 0;
|
|
|
|
int i17 = z5 ? 1 : 0;
|
|
|
|
int i18 = (i14 + i15) * 31;
|
2021-09-29 17:50:51 +00:00
|
|
|
Long l = this.selectedVoiceChannelId;
|
|
|
|
if (l != null) {
|
|
|
|
i = l.hashCode();
|
|
|
|
}
|
2021-10-07 06:22:31 +00:00
|
|
|
int i19 = (i18 + i) * 31;
|
|
|
|
boolean z6 = this.canConnect;
|
|
|
|
if (!z6) {
|
|
|
|
i2 = z6 ? 1 : 0;
|
|
|
|
}
|
|
|
|
return i19 + i2;
|
2021-09-18 07:43:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean isDeveloperMode() {
|
|
|
|
return this.isDeveloperMode;
|
2021-08-20 02:22:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean isRsvped() {
|
|
|
|
return this.isRsvped;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String toString() {
|
2021-10-09 06:29:02 +00:00
|
|
|
StringBuilder O = a.O("StoreState(guildScheduledEvent=");
|
|
|
|
O.append(this.guildScheduledEvent);
|
|
|
|
O.append(", channel=");
|
|
|
|
O.append(this.channel);
|
|
|
|
O.append(", guild=");
|
|
|
|
O.append(this.guild);
|
|
|
|
O.append(", isRsvped=");
|
|
|
|
O.append(this.isRsvped);
|
|
|
|
O.append(", canShare=");
|
|
|
|
O.append(this.canShare);
|
|
|
|
O.append(", canStartEvent=");
|
|
|
|
O.append(this.canStartEvent);
|
|
|
|
O.append(", isDeveloperMode=");
|
|
|
|
O.append(this.isDeveloperMode);
|
|
|
|
O.append(", selectedVoiceChannelId=");
|
|
|
|
O.append(this.selectedVoiceChannelId);
|
|
|
|
O.append(", canConnect=");
|
|
|
|
return a.K(O, this.canConnect, ")");
|
2021-08-20 02:22:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: GuildScheduledEventDetailsViewModel.kt */
|
|
|
|
public static abstract class ViewState {
|
|
|
|
|
|
|
|
/* compiled from: GuildScheduledEventDetailsViewModel.kt */
|
|
|
|
public static final class Initialized extends ViewState {
|
2021-10-07 06:22:31 +00:00
|
|
|
private final boolean canConnect;
|
2021-09-18 07:43:22 +00:00
|
|
|
private final boolean canShare;
|
|
|
|
private final boolean canStartEvent;
|
2021-08-20 02:22:46 +00:00
|
|
|
private final Guild guild;
|
|
|
|
private final GuildScheduledEvent guildScheduledEvent;
|
2021-09-29 17:50:51 +00:00
|
|
|
private final boolean isConnected;
|
2021-09-18 07:43:22 +00:00
|
|
|
private final boolean isDeveloperMode;
|
2021-08-20 02:22:46 +00:00
|
|
|
private final boolean isRsvped;
|
2021-09-24 06:27:57 +00:00
|
|
|
private final GuildScheduledEventLocationInfo locationInfo;
|
2021-08-20 02:22:46 +00:00
|
|
|
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
2021-10-07 06:22:31 +00:00
|
|
|
public Initialized(GuildScheduledEvent guildScheduledEvent, GuildScheduledEventLocationInfo guildScheduledEventLocationInfo, Guild guild, boolean z2, boolean z3, boolean z4, boolean z5, boolean z6, boolean z7) {
|
2021-08-20 02:22:46 +00:00
|
|
|
super(null);
|
|
|
|
m.checkNotNullParameter(guildScheduledEvent, "guildScheduledEvent");
|
2021-09-24 06:27:57 +00:00
|
|
|
m.checkNotNullParameter(guildScheduledEventLocationInfo, "locationInfo");
|
2021-08-20 02:22:46 +00:00
|
|
|
m.checkNotNullParameter(guild, "guild");
|
|
|
|
this.guildScheduledEvent = guildScheduledEvent;
|
2021-09-24 06:27:57 +00:00
|
|
|
this.locationInfo = guildScheduledEventLocationInfo;
|
2021-08-20 02:22:46 +00:00
|
|
|
this.guild = guild;
|
|
|
|
this.isRsvped = z2;
|
2021-09-18 07:43:22 +00:00
|
|
|
this.canShare = z3;
|
2021-09-29 17:50:51 +00:00
|
|
|
this.isConnected = z4;
|
|
|
|
this.canStartEvent = z5;
|
|
|
|
this.isDeveloperMode = z6;
|
2021-10-07 06:22:31 +00:00
|
|
|
this.canConnect = z7;
|
2021-08-20 02:22:46 +00:00
|
|
|
}
|
|
|
|
|
2021-10-07 06:22:31 +00:00
|
|
|
public static /* synthetic */ Initialized copy$default(Initialized initialized, GuildScheduledEvent guildScheduledEvent, GuildScheduledEventLocationInfo guildScheduledEventLocationInfo, Guild guild, boolean z2, boolean z3, boolean z4, boolean z5, boolean z6, boolean z7, int i, Object obj) {
|
|
|
|
return initialized.copy((i & 1) != 0 ? initialized.guildScheduledEvent : guildScheduledEvent, (i & 2) != 0 ? initialized.locationInfo : guildScheduledEventLocationInfo, (i & 4) != 0 ? initialized.guild : guild, (i & 8) != 0 ? initialized.isRsvped : z2, (i & 16) != 0 ? initialized.canShare : z3, (i & 32) != 0 ? initialized.isConnected : z4, (i & 64) != 0 ? initialized.canStartEvent : z5, (i & 128) != 0 ? initialized.isDeveloperMode : z6, (i & 256) != 0 ? initialized.canConnect : z7);
|
2021-08-20 02:22:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final GuildScheduledEvent component1() {
|
|
|
|
return this.guildScheduledEvent;
|
|
|
|
}
|
|
|
|
|
2021-09-24 06:27:57 +00:00
|
|
|
public final GuildScheduledEventLocationInfo component2() {
|
|
|
|
return this.locationInfo;
|
2021-08-20 02:22:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final Guild component3() {
|
|
|
|
return this.guild;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean component4() {
|
|
|
|
return this.isRsvped;
|
|
|
|
}
|
|
|
|
|
2021-09-18 07:43:22 +00:00
|
|
|
public final boolean component5() {
|
|
|
|
return this.canShare;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean component6() {
|
2021-09-29 17:50:51 +00:00
|
|
|
return this.isConnected;
|
2021-09-18 07:43:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean component7() {
|
2021-09-29 17:50:51 +00:00
|
|
|
return this.canStartEvent;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean component8() {
|
2021-09-18 07:43:22 +00:00
|
|
|
return this.isDeveloperMode;
|
|
|
|
}
|
|
|
|
|
2021-10-07 06:22:31 +00:00
|
|
|
public final boolean component9() {
|
|
|
|
return this.canConnect;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Initialized copy(GuildScheduledEvent guildScheduledEvent, GuildScheduledEventLocationInfo guildScheduledEventLocationInfo, Guild guild, boolean z2, boolean z3, boolean z4, boolean z5, boolean z6, boolean z7) {
|
2021-08-20 02:22:46 +00:00
|
|
|
m.checkNotNullParameter(guildScheduledEvent, "guildScheduledEvent");
|
2021-09-24 06:27:57 +00:00
|
|
|
m.checkNotNullParameter(guildScheduledEventLocationInfo, "locationInfo");
|
2021-08-20 02:22:46 +00:00
|
|
|
m.checkNotNullParameter(guild, "guild");
|
2021-10-07 06:22:31 +00:00
|
|
|
return new Initialized(guildScheduledEvent, guildScheduledEventLocationInfo, guild, z2, z3, z4, z5, z6, z7);
|
2021-08-20 02:22:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public boolean equals(Object obj) {
|
|
|
|
if (this == obj) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (!(obj instanceof Initialized)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
Initialized initialized = (Initialized) obj;
|
2021-10-07 06:22:31 +00:00
|
|
|
return m.areEqual(this.guildScheduledEvent, initialized.guildScheduledEvent) && m.areEqual(this.locationInfo, initialized.locationInfo) && m.areEqual(this.guild, initialized.guild) && this.isRsvped == initialized.isRsvped && this.canShare == initialized.canShare && this.isConnected == initialized.isConnected && this.canStartEvent == initialized.canStartEvent && this.isDeveloperMode == initialized.isDeveloperMode && this.canConnect == initialized.canConnect;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean getCanConnect() {
|
|
|
|
return this.canConnect;
|
2021-09-18 07:43:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean getCanShare() {
|
|
|
|
return this.canShare;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean getCanStartEvent() {
|
|
|
|
return this.canStartEvent;
|
2021-08-20 02:22:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final Guild getGuild() {
|
|
|
|
return this.guild;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final GuildScheduledEvent getGuildScheduledEvent() {
|
|
|
|
return this.guildScheduledEvent;
|
|
|
|
}
|
|
|
|
|
2021-09-24 06:27:57 +00:00
|
|
|
public final GuildScheduledEventLocationInfo getLocationInfo() {
|
|
|
|
return this.locationInfo;
|
|
|
|
}
|
|
|
|
|
2021-08-20 02:22:46 +00:00
|
|
|
public int hashCode() {
|
|
|
|
GuildScheduledEvent guildScheduledEvent = this.guildScheduledEvent;
|
|
|
|
int i = 0;
|
|
|
|
int hashCode = (guildScheduledEvent != null ? guildScheduledEvent.hashCode() : 0) * 31;
|
2021-09-24 06:27:57 +00:00
|
|
|
GuildScheduledEventLocationInfo guildScheduledEventLocationInfo = this.locationInfo;
|
|
|
|
int hashCode2 = (hashCode + (guildScheduledEventLocationInfo != null ? guildScheduledEventLocationInfo.hashCode() : 0)) * 31;
|
2021-08-20 02:22:46 +00:00
|
|
|
Guild guild = this.guild;
|
|
|
|
if (guild != null) {
|
|
|
|
i = guild.hashCode();
|
|
|
|
}
|
|
|
|
int i2 = (hashCode2 + i) * 31;
|
|
|
|
boolean z2 = this.isRsvped;
|
2021-09-18 07:43:22 +00:00
|
|
|
int i3 = 1;
|
2021-08-20 02:22:46 +00:00
|
|
|
if (z2) {
|
|
|
|
z2 = true;
|
|
|
|
}
|
|
|
|
int i4 = z2 ? 1 : 0;
|
|
|
|
int i5 = z2 ? 1 : 0;
|
2021-09-18 07:43:22 +00:00
|
|
|
int i6 = z2 ? 1 : 0;
|
|
|
|
int i7 = (i2 + i4) * 31;
|
|
|
|
boolean z3 = this.canShare;
|
|
|
|
if (z3) {
|
|
|
|
z3 = true;
|
|
|
|
}
|
|
|
|
int i8 = z3 ? 1 : 0;
|
|
|
|
int i9 = z3 ? 1 : 0;
|
|
|
|
int i10 = z3 ? 1 : 0;
|
|
|
|
int i11 = (i7 + i8) * 31;
|
2021-09-29 17:50:51 +00:00
|
|
|
boolean z4 = this.isConnected;
|
2021-09-18 07:43:22 +00:00
|
|
|
if (z4) {
|
|
|
|
z4 = true;
|
|
|
|
}
|
|
|
|
int i12 = z4 ? 1 : 0;
|
|
|
|
int i13 = z4 ? 1 : 0;
|
|
|
|
int i14 = z4 ? 1 : 0;
|
|
|
|
int i15 = (i11 + i12) * 31;
|
2021-09-29 17:50:51 +00:00
|
|
|
boolean z5 = this.canStartEvent;
|
|
|
|
if (z5) {
|
|
|
|
z5 = true;
|
|
|
|
}
|
|
|
|
int i16 = z5 ? 1 : 0;
|
|
|
|
int i17 = z5 ? 1 : 0;
|
|
|
|
int i18 = z5 ? 1 : 0;
|
|
|
|
int i19 = (i15 + i16) * 31;
|
|
|
|
boolean z6 = this.isDeveloperMode;
|
2021-10-07 06:22:31 +00:00
|
|
|
if (z6) {
|
|
|
|
z6 = true;
|
|
|
|
}
|
|
|
|
int i20 = z6 ? 1 : 0;
|
|
|
|
int i21 = z6 ? 1 : 0;
|
|
|
|
int i22 = z6 ? 1 : 0;
|
|
|
|
int i23 = (i19 + i20) * 31;
|
|
|
|
boolean z7 = this.canConnect;
|
|
|
|
if (!z7) {
|
|
|
|
i3 = z7 ? 1 : 0;
|
2021-09-18 07:43:22 +00:00
|
|
|
}
|
2021-10-07 06:22:31 +00:00
|
|
|
return i23 + i3;
|
2021-09-29 17:50:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean isConnected() {
|
|
|
|
return this.isConnected;
|
2021-09-18 07:43:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean isDeveloperMode() {
|
|
|
|
return this.isDeveloperMode;
|
2021-08-20 02:22:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean isRsvped() {
|
|
|
|
return this.isRsvped;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String toString() {
|
2021-10-09 06:29:02 +00:00
|
|
|
StringBuilder O = a.O("Initialized(guildScheduledEvent=");
|
|
|
|
O.append(this.guildScheduledEvent);
|
|
|
|
O.append(", locationInfo=");
|
|
|
|
O.append(this.locationInfo);
|
|
|
|
O.append(", guild=");
|
|
|
|
O.append(this.guild);
|
|
|
|
O.append(", isRsvped=");
|
|
|
|
O.append(this.isRsvped);
|
|
|
|
O.append(", canShare=");
|
|
|
|
O.append(this.canShare);
|
|
|
|
O.append(", isConnected=");
|
|
|
|
O.append(this.isConnected);
|
|
|
|
O.append(", canStartEvent=");
|
|
|
|
O.append(this.canStartEvent);
|
|
|
|
O.append(", isDeveloperMode=");
|
|
|
|
O.append(this.isDeveloperMode);
|
|
|
|
O.append(", canConnect=");
|
|
|
|
return a.K(O, this.canConnect, ")");
|
2021-08-20 02:22:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: GuildScheduledEventDetailsViewModel.kt */
|
|
|
|
public static final class Invalid extends ViewState {
|
|
|
|
public static final Invalid INSTANCE = new Invalid();
|
|
|
|
|
|
|
|
private Invalid() {
|
|
|
|
super(null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private ViewState() {
|
|
|
|
}
|
|
|
|
|
|
|
|
public /* synthetic */ ViewState(DefaultConstructorMarker defaultConstructorMarker) {
|
|
|
|
this();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
2021-09-29 17:50:51 +00:00
|
|
|
public GuildScheduledEventDetailsViewModel(long j, ObservationDeck observationDeck, StoreGuildScheduledEvents storeGuildScheduledEvents, StoreGuilds storeGuilds, StoreChannels storeChannels, StorePermissions storePermissions, StoreUserSettings storeUserSettings, StoreVoiceChannelSelected storeVoiceChannelSelected, Observable<StoreState> observable) {
|
2021-08-20 02:22:46 +00:00
|
|
|
super(null, 1, null);
|
|
|
|
m.checkNotNullParameter(observationDeck, "observationDeck");
|
|
|
|
m.checkNotNullParameter(storeGuildScheduledEvents, "guildScheduledEventsStore");
|
|
|
|
m.checkNotNullParameter(storeGuilds, "guildsStore");
|
|
|
|
m.checkNotNullParameter(storeChannels, "channelsStore");
|
2021-09-18 07:43:22 +00:00
|
|
|
m.checkNotNullParameter(storePermissions, "permissionsStore");
|
|
|
|
m.checkNotNullParameter(storeUserSettings, "userSettingsStore");
|
2021-09-29 17:50:51 +00:00
|
|
|
m.checkNotNullParameter(storeVoiceChannelSelected, "selectedVoiceChannelStore");
|
2021-08-20 02:22:46 +00:00
|
|
|
m.checkNotNullParameter(observable, "storeStateObservable");
|
|
|
|
this.guildScheduledEventId = j;
|
|
|
|
this.guildScheduledEventsStore = storeGuildScheduledEvents;
|
|
|
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(ObservableExtensionsKt.computationLatest(observable), this, null, 2, null), GuildScheduledEventDetailsViewModel.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new AnonymousClass1(this), 62, (Object) null);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* JADX WARNING: Illegal instructions before constructor call */
|
2021-09-29 17:50:51 +00:00
|
|
|
public /* synthetic */ GuildScheduledEventDetailsViewModel(long j, ObservationDeck observationDeck, StoreGuildScheduledEvents storeGuildScheduledEvents, StoreGuilds storeGuilds, StoreChannels storeChannels, StorePermissions storePermissions, StoreUserSettings storeUserSettings, StoreVoiceChannelSelected storeVoiceChannelSelected, Observable observable, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
|
|
|
this(j, r5, r6, r7, r8, r9, r10, r11, (i & 256) != 0 ? Companion.access$observeStores(Companion, j, r5, r6, r7, r8, r9, r10, r11) : observable);
|
2021-08-20 02:22:46 +00:00
|
|
|
ObservationDeck observationDeck2 = (i & 2) != 0 ? ObservationDeckProvider.get() : observationDeck;
|
|
|
|
StoreGuildScheduledEvents guildScheduledEvents = (i & 4) != 0 ? StoreStream.Companion.getGuildScheduledEvents() : storeGuildScheduledEvents;
|
|
|
|
StoreGuilds guilds = (i & 8) != 0 ? StoreStream.Companion.getGuilds() : storeGuilds;
|
|
|
|
StoreChannels channels = (i & 16) != 0 ? StoreStream.Companion.getChannels() : storeChannels;
|
2021-09-18 07:43:22 +00:00
|
|
|
StorePermissions permissions = (i & 32) != 0 ? StoreStream.Companion.getPermissions() : storePermissions;
|
|
|
|
StoreUserSettings userSettings = (i & 64) != 0 ? StoreStream.Companion.getUserSettings() : storeUserSettings;
|
2021-09-29 17:50:51 +00:00
|
|
|
StoreVoiceChannelSelected voiceChannelSelected = (i & 128) != 0 ? StoreStream.Companion.getVoiceChannelSelected() : storeVoiceChannelSelected;
|
2021-08-20 02:22:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ void access$handleStoreState(GuildScheduledEventDetailsViewModel guildScheduledEventDetailsViewModel, StoreState storeState) {
|
|
|
|
guildScheduledEventDetailsViewModel.handleStoreState(storeState);
|
|
|
|
}
|
|
|
|
|
|
|
|
private final void handleStoreState(StoreState storeState) {
|
|
|
|
Object obj;
|
2021-09-29 17:50:51 +00:00
|
|
|
boolean z2;
|
2021-08-20 02:22:46 +00:00
|
|
|
if (storeState.getGuildScheduledEvent() == null || storeState.getGuild() == null) {
|
|
|
|
obj = ViewState.Invalid.INSTANCE;
|
|
|
|
} else {
|
|
|
|
if (getViewState() == null) {
|
|
|
|
this.guildScheduledEventsStore.fetchGuildScheduledEventUserCounts(storeState.getGuild().getId());
|
|
|
|
}
|
2021-09-29 17:50:51 +00:00
|
|
|
GuildScheduledEventLocationInfo buildLocationInfo = GuildScheduledEventLocationInfo.Companion.buildLocationInfo(storeState.getGuildScheduledEvent(), storeState.getChannel());
|
|
|
|
GuildScheduledEvent guildScheduledEvent = storeState.getGuildScheduledEvent();
|
|
|
|
Guild guild = storeState.getGuild();
|
|
|
|
boolean isRsvped = storeState.isRsvped();
|
|
|
|
Long b = storeState.getGuildScheduledEvent().b();
|
|
|
|
boolean z3 = false;
|
|
|
|
if (b != null) {
|
|
|
|
long longValue = b.longValue();
|
|
|
|
Long selectedVoiceChannelId = storeState.getSelectedVoiceChannelId();
|
|
|
|
if (selectedVoiceChannelId != null && longValue == selectedVoiceChannelId.longValue()) {
|
|
|
|
z3 = true;
|
|
|
|
}
|
|
|
|
z2 = z3;
|
|
|
|
} else {
|
|
|
|
z2 = false;
|
|
|
|
}
|
2021-10-07 06:22:31 +00:00
|
|
|
obj = new ViewState.Initialized(guildScheduledEvent, buildLocationInfo, guild, isRsvped, storeState.getCanShare(), z2, storeState.getCanStartEvent(), storeState.isDeveloperMode(), storeState.getCanConnect());
|
2021-08-20 02:22:46 +00:00
|
|
|
}
|
|
|
|
updateViewState(obj);
|
|
|
|
}
|
|
|
|
|
2021-09-18 07:43:22 +00:00
|
|
|
public final void endEventClicked(Context context, Function0<Unit> function0) {
|
|
|
|
m.checkNotNullParameter(context, "context");
|
|
|
|
m.checkNotNullParameter(function0, "onSuccess");
|
|
|
|
ViewState viewState = getViewState();
|
|
|
|
if (!(viewState instanceof ViewState.Initialized)) {
|
|
|
|
viewState = null;
|
|
|
|
}
|
|
|
|
ViewState.Initialized initialized = (ViewState.Initialized) viewState;
|
|
|
|
if (initialized != null) {
|
|
|
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.restSubscribeOn$default(GuildScheduledEventAPI.INSTANCE.endEvent(initialized.getGuildScheduledEvent().g()), false, 1, null), GuildScheduledEventDetailsViewModel.class, context, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new GuildScheduledEventDetailsViewModel$endEventClicked$$inlined$let$lambda$1(this, context, function0), 60, (Object) null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void onDeleteButtonClicked(Context context, Function0<Unit> function0) {
|
|
|
|
m.checkNotNullParameter(context, "context");
|
|
|
|
m.checkNotNullParameter(function0, "onSuccess");
|
|
|
|
ViewState viewState = getViewState();
|
|
|
|
if (!(viewState instanceof ViewState.Initialized)) {
|
|
|
|
viewState = null;
|
|
|
|
}
|
|
|
|
ViewState.Initialized initialized = (ViewState.Initialized) viewState;
|
|
|
|
if (initialized != null) {
|
|
|
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.restSubscribeOn$default(RestAPI.Companion.getApi().deleteGuildScheduledEvent(initialized.getGuildScheduledEvent().g()), false, 1, null), GuildScheduledEventDetailsViewModel.class, context, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new GuildScheduledEventDetailsViewModel$onDeleteButtonClicked$$inlined$let$lambda$1(this, context, function0), 60, (Object) null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-08 22:11:56 +00:00
|
|
|
public final void onGuildNameClicked() {
|
|
|
|
ViewState viewState = getViewState();
|
|
|
|
if (!(viewState instanceof ViewState.Initialized)) {
|
|
|
|
viewState = null;
|
|
|
|
}
|
|
|
|
ViewState.Initialized initialized = (ViewState.Initialized) viewState;
|
|
|
|
if (initialized != null) {
|
|
|
|
StoreStream.Companion.getGuildSelected().set(initialized.getGuild().getId());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-08-20 02:22:46 +00:00
|
|
|
public final void onRsvpButtonClicked() {
|
|
|
|
ViewState viewState = getViewState();
|
|
|
|
if (!(viewState instanceof ViewState.Initialized)) {
|
|
|
|
viewState = null;
|
|
|
|
}
|
|
|
|
ViewState.Initialized initialized = (ViewState.Initialized) viewState;
|
|
|
|
if (initialized != null) {
|
|
|
|
this.guildScheduledEventsStore.toggleRsvpGuildScheduledEvent(initialized.getGuildScheduledEvent());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|