discord-jadx/app/src/main/java/com/discord/utilities/embed/InviteEmbedModel.java

207 lines
10 KiB
Java

package com.discord.utilities.embed;
import c.d.b.a.a;
import com.airbnb.lottie.parser.AnimatableValueParser;
import com.discord.api.channel.Channel;
import com.discord.api.stageinstance.RecommendedStageInstance;
import com.discord.api.stageinstance.StageInstance;
import com.discord.models.domain.ModelInvite;
import com.discord.stores.StoreInstantInvites;
import com.discord.stores.StoreRequestedStageChannels;
import com.discord.stores.StoreStream;
import d0.z.d.m;
import java.util.Map;
import kotlin.jvm.internal.DefaultConstructorMarker;
import rx.Observable;
import rx.functions.Func4;
/* compiled from: InviteEmbedModel.kt */
public final class InviteEmbedModel {
public static final Companion Companion = new Companion(null);
private final Map<Long, Channel> channels;
private final Map<String, StoreInstantInvites.InviteState> invites;
private final Map<Long, StoreRequestedStageChannels.StageInstanceState> requestedInstances;
private final Map<Long, StageInstance> stageInstances;
/* compiled from: InviteEmbedModel.kt */
public static final class Companion {
private Companion() {
}
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
/* JADX DEBUG: Multi-variable search result rejected for r0v0, resolved type: com.discord.utilities.embed.InviteEmbedModel$Companion */
/* JADX WARN: Multi-variable type inference failed */
public static /* synthetic */ Observable observe$default(Companion companion, Observable observable, Observable observable2, Observable observable3, Observable observable4, int i, Object obj) {
Observable<Map<Long, Channel>> observable5 = observable;
if ((i & 1) != 0) {
observable5 = StoreStream.Companion.getChannels().observeGuildAndPrivateChannels();
}
Observable<Map<String, StoreInstantInvites.InviteState>> observable6 = observable2;
if ((i & 2) != 0) {
observable6 = StoreStream.Companion.getInstantInvites().observeKnownInvites();
}
Observable<Map<Long, StageInstance>> observable7 = observable3;
if ((i & 4) != 0) {
observable7 = StoreStream.Companion.getStageInstances().observeStageInstances();
}
Observable<Map<Long, StoreRequestedStageChannels.StageInstanceState>> observable8 = observable4;
if ((i & 8) != 0) {
observable8 = StoreStream.Companion.getRequestedStageChannels().observeRequestedStageChannels();
}
return companion.observe(observable5, observable6, observable7, observable8);
}
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARNING: Unknown variable types count: 1 */
public final Observable<InviteEmbedModel> observe(Observable<Map<Long, Channel>> observable, Observable<Map<String, StoreInstantInvites.InviteState>> observable2, Observable<Map<Long, StageInstance>> observable3, Observable<Map<Long, StoreRequestedStageChannels.StageInstanceState>> observable4) {
m.checkNotNullParameter(observable, "channelsObservable");
m.checkNotNullParameter(observable2, "knownInvitesObservable");
m.checkNotNullParameter(observable3, "stageInstancesObservable");
m.checkNotNullParameter(observable4, "requestedStageInstances");
InviteEmbedModel$Companion$observe$1 inviteEmbedModel$Companion$observe$1 = InviteEmbedModel$Companion$observe$1.INSTANCE;
if (inviteEmbedModel$Companion$observe$1 != null) {
inviteEmbedModel$Companion$observe$1 = new InviteEmbedModel$sam$rx_functions_Func4$0(inviteEmbedModel$Companion$observe$1);
}
Observable<InviteEmbedModel> h = Observable.h(observable, observable2, observable3, observable4, (Func4) inviteEmbedModel$Companion$observe$1);
m.checkNotNullExpressionValue(h, "Observable.combineLatest… ::InviteEmbedModel\n )");
return h;
}
}
/* JADX DEBUG: Multi-variable search result rejected for r3v0, resolved type: java.util.Map<java.lang.String, ? extends com.discord.stores.StoreInstantInvites$InviteState> */
/* JADX WARN: Multi-variable type inference failed */
public InviteEmbedModel(Map<Long, Channel> map, Map<String, ? extends StoreInstantInvites.InviteState> map2, Map<Long, StageInstance> map3, Map<Long, StoreRequestedStageChannels.StageInstanceState> map4) {
m.checkNotNullParameter(map, "channels");
m.checkNotNullParameter(map2, "invites");
m.checkNotNullParameter(map3, "stageInstances");
m.checkNotNullParameter(map4, "requestedInstances");
this.channels = map;
this.invites = map2;
this.stageInstances = map3;
this.requestedInstances = map4;
}
private final Map<Long, Channel> component1() {
return this.channels;
}
private final Map<String, StoreInstantInvites.InviteState> component2() {
return this.invites;
}
private final Map<Long, StageInstance> component3() {
return this.stageInstances;
}
private final Map<Long, StoreRequestedStageChannels.StageInstanceState> component4() {
return this.requestedInstances;
}
/* JADX DEBUG: Multi-variable search result rejected for r0v0, resolved type: com.discord.utilities.embed.InviteEmbedModel */
/* JADX WARN: Multi-variable type inference failed */
public static /* synthetic */ InviteEmbedModel copy$default(InviteEmbedModel inviteEmbedModel, Map map, Map map2, Map map3, Map map4, int i, Object obj) {
if ((i & 1) != 0) {
map = inviteEmbedModel.channels;
}
if ((i & 2) != 0) {
map2 = inviteEmbedModel.invites;
}
if ((i & 4) != 0) {
map3 = inviteEmbedModel.stageInstances;
}
if ((i & 8) != 0) {
map4 = inviteEmbedModel.requestedInstances;
}
return inviteEmbedModel.copy(map, map2, map3, map4);
}
public final InviteEmbedModel copy(Map<Long, Channel> map, Map<String, ? extends StoreInstantInvites.InviteState> map2, Map<Long, StageInstance> map3, Map<Long, StoreRequestedStageChannels.StageInstanceState> map4) {
m.checkNotNullParameter(map, "channels");
m.checkNotNullParameter(map2, "invites");
m.checkNotNullParameter(map3, "stageInstances");
m.checkNotNullParameter(map4, "requestedInstances");
return new InviteEmbedModel(map, map2, map3, map4);
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof InviteEmbedModel)) {
return false;
}
InviteEmbedModel inviteEmbedModel = (InviteEmbedModel) obj;
return m.areEqual(this.channels, inviteEmbedModel.channels) && m.areEqual(this.invites, inviteEmbedModel.invites) && m.areEqual(this.stageInstances, inviteEmbedModel.stageInstances) && m.areEqual(this.requestedInstances, inviteEmbedModel.requestedInstances);
}
public final ModelInvite getResolvedInvite(String str) {
m.checkNotNullParameter(str, "inviteCode");
StoreInstantInvites.InviteState inviteState = this.invites.get(str);
if (!(inviteState instanceof StoreInstantInvites.InviteState.Resolved)) {
inviteState = null;
}
StoreInstantInvites.InviteState.Resolved resolved = (StoreInstantInvites.InviteState.Resolved) inviteState;
if (resolved != null) {
return resolved.getInvite();
}
return null;
}
public int hashCode() {
Map<Long, Channel> map = this.channels;
int i = 0;
int hashCode = (map != null ? map.hashCode() : 0) * 31;
Map<String, StoreInstantInvites.InviteState> map2 = this.invites;
int hashCode2 = (hashCode + (map2 != null ? map2.hashCode() : 0)) * 31;
Map<Long, StageInstance> map3 = this.stageInstances;
int hashCode3 = (hashCode2 + (map3 != null ? map3.hashCode() : 0)) * 31;
Map<Long, StoreRequestedStageChannels.StageInstanceState> map4 = this.requestedInstances;
if (map4 != null) {
i = map4.hashCode();
}
return hashCode3 + i;
}
public final ModelInvite resolveInviteCodeForPublicStage(String str) {
RecommendedStageInstance stageInstance;
StageInstance b;
m.checkNotNullParameter(str, "inviteCode");
ModelInvite resolvedInvite = getResolvedInvite(str);
if (resolvedInvite != null) {
Channel channel = resolvedInvite.getChannel();
m.checkNotNullExpressionValue(channel, "invite.channel");
if (!AnimatableValueParser.v1(channel)) {
return null;
}
StageInstance stageInstance2 = this.stageInstances.get(Long.valueOf(resolvedInvite.getChannel().h()));
if (stageInstance2 != null && AnimatableValueParser.t1(stageInstance2)) {
return resolvedInvite;
}
if (this.channels.get(Long.valueOf(resolvedInvite.getChannel().h())) != null) {
return null;
}
StoreRequestedStageChannels.StageInstanceState stageInstanceState = this.requestedInstances.get(Long.valueOf(resolvedInvite.getChannel().h()));
if (stageInstanceState != null && (stageInstance = stageInstanceState.getStageInstance()) != null && (b = stageInstance.b()) != null && AnimatableValueParser.t1(b)) {
return resolvedInvite;
}
if (stageInstanceState == null || stageInstanceState.isError()) {
StoreStream.Companion.getRequestedStageChannels().enqueueStageChannelFetch(resolvedInvite.getChannel().h());
}
}
return null;
}
public String toString() {
StringBuilder L = a.L("InviteEmbedModel(channels=");
L.append(this.channels);
L.append(", invites=");
L.append(this.invites);
L.append(", stageInstances=");
L.append(this.stageInstances);
L.append(", requestedInstances=");
return a.F(L, this.requestedInstances, ")");
}
}