2021-07-03 23:36:06 +00:00
|
|
|
package com.discord.widgets.stickers;
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
import androidx.annotation.MainThread;
|
|
|
|
import c.d.b.a.a;
|
|
|
|
import com.discord.api.premium.PremiumTier;
|
|
|
|
import com.discord.api.sticker.Sticker;
|
|
|
|
import com.discord.app.AppViewModel;
|
|
|
|
import com.discord.models.guild.Guild;
|
|
|
|
import com.discord.models.user.MeUser;
|
|
|
|
import com.discord.stores.StoreChannelsSelected;
|
|
|
|
import com.discord.stores.StoreGuilds;
|
|
|
|
import com.discord.stores.StoreStream;
|
|
|
|
import com.discord.stores.StoreUser;
|
|
|
|
import com.discord.utilities.rest.RestAPI;
|
|
|
|
import com.discord.utilities.rx.ObservableExtensionsKt;
|
|
|
|
import d0.z.d.m;
|
|
|
|
import d0.z.d.o;
|
|
|
|
import java.util.Map;
|
|
|
|
import kotlin.Unit;
|
|
|
|
import kotlin.jvm.functions.Function0;
|
|
|
|
import kotlin.jvm.functions.Function1;
|
|
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
|
|
import rx.Observable;
|
|
|
|
/* compiled from: GuildStickerSheetViewModel.kt */
|
|
|
|
public final class GuildStickerSheetViewModel extends AppViewModel<ViewState> {
|
|
|
|
public static final Companion Companion = new Companion(null);
|
|
|
|
private final RestAPI restAPI;
|
|
|
|
private final Sticker sticker;
|
|
|
|
private final StoreUser storeUser;
|
|
|
|
|
|
|
|
/* compiled from: GuildStickerSheetViewModel.kt */
|
|
|
|
/* renamed from: com.discord.widgets.stickers.GuildStickerSheetViewModel$1 reason: invalid class name */
|
|
|
|
public static final class AnonymousClass1 extends o implements Function1<StoreState, Unit> {
|
|
|
|
public final /* synthetic */ GuildStickerSheetViewModel this$0;
|
|
|
|
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
|
|
public AnonymousClass1(GuildStickerSheetViewModel guildStickerSheetViewModel) {
|
|
|
|
super(1);
|
|
|
|
this.this$0 = guildStickerSheetViewModel;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return type fixed from 'java.lang.Object' to match base method */
|
|
|
|
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
|
|
|
|
@Override // kotlin.jvm.functions.Function1
|
|
|
|
public /* bridge */ /* synthetic */ Unit invoke(StoreState storeState) {
|
|
|
|
invoke(storeState);
|
|
|
|
return Unit.a;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void invoke(StoreState storeState) {
|
|
|
|
m.checkNotNullParameter(storeState, "storeState");
|
|
|
|
GuildStickerSheetViewModel.access$handleStoreState(this.this$0, storeState);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: GuildStickerSheetViewModel.kt */
|
|
|
|
public static final class Companion {
|
|
|
|
|
|
|
|
/* compiled from: GuildStickerSheetViewModel.kt */
|
|
|
|
public static abstract class GuildStickerGuildInfo {
|
|
|
|
|
|
|
|
/* compiled from: GuildStickerSheetViewModel.kt */
|
|
|
|
public static final class Known extends GuildStickerGuildInfo {
|
|
|
|
private final Integer approximateOnline;
|
|
|
|
private final Guild guild;
|
|
|
|
private final boolean isPublic;
|
|
|
|
private final boolean isUserInGuild;
|
|
|
|
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
|
|
public Known(Guild guild, boolean z2, boolean z3, Integer num) {
|
|
|
|
super(null);
|
|
|
|
m.checkNotNullParameter(guild, "guild");
|
|
|
|
this.guild = guild;
|
|
|
|
this.isPublic = z2;
|
|
|
|
this.isUserInGuild = z3;
|
|
|
|
this.approximateOnline = num;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ Known copy$default(Known known, Guild guild, boolean z2, boolean z3, Integer num, int i, Object obj) {
|
|
|
|
if ((i & 1) != 0) {
|
|
|
|
guild = known.guild;
|
|
|
|
}
|
|
|
|
if ((i & 2) != 0) {
|
|
|
|
z2 = known.isPublic();
|
|
|
|
}
|
|
|
|
if ((i & 4) != 0) {
|
|
|
|
z3 = known.isUserInGuild();
|
|
|
|
}
|
|
|
|
if ((i & 8) != 0) {
|
|
|
|
num = known.approximateOnline;
|
|
|
|
}
|
|
|
|
return known.copy(guild, z2, z3, num);
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Guild component1() {
|
|
|
|
return this.guild;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean component2() {
|
|
|
|
return isPublic();
|
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean component3() {
|
|
|
|
return isUserInGuild();
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Integer component4() {
|
|
|
|
return this.approximateOnline;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Known copy(Guild guild, boolean z2, boolean z3, Integer num) {
|
|
|
|
m.checkNotNullParameter(guild, "guild");
|
|
|
|
return new Known(guild, z2, z3, num);
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean equals(Object obj) {
|
|
|
|
if (this == obj) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (!(obj instanceof Known)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
Known known = (Known) obj;
|
|
|
|
return m.areEqual(this.guild, known.guild) && isPublic() == known.isPublic() && isUserInGuild() == known.isUserInGuild() && m.areEqual(this.approximateOnline, known.approximateOnline);
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Integer getApproximateOnline() {
|
|
|
|
return this.approximateOnline;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Guild getGuild() {
|
|
|
|
return this.guild;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
|
|
/* JADX WARNING: Unknown variable types count: 1 */
|
|
|
|
public int hashCode() {
|
|
|
|
Guild guild = this.guild;
|
|
|
|
int i = 0;
|
|
|
|
int hashCode = (guild != null ? guild.hashCode() : 0) * 31;
|
|
|
|
boolean isPublic = isPublic();
|
|
|
|
?? r3 = 1;
|
|
|
|
if (isPublic) {
|
|
|
|
isPublic = true;
|
|
|
|
}
|
|
|
|
int i2 = isPublic ? 1 : 0;
|
|
|
|
int i3 = isPublic ? 1 : 0;
|
|
|
|
int i4 = isPublic ? 1 : 0;
|
|
|
|
int i5 = (hashCode + i2) * 31;
|
|
|
|
boolean isUserInGuild = isUserInGuild();
|
|
|
|
if (!isUserInGuild) {
|
|
|
|
r3 = isUserInGuild;
|
|
|
|
}
|
|
|
|
int i6 = (i5 + (r3 == true ? 1 : 0)) * 31;
|
|
|
|
Integer num = this.approximateOnline;
|
|
|
|
if (num != null) {
|
|
|
|
i = num.hashCode();
|
|
|
|
}
|
|
|
|
return i6 + i;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // com.discord.widgets.stickers.GuildStickerSheetViewModel.Companion.GuildStickerGuildInfo
|
|
|
|
public boolean isPublic() {
|
|
|
|
return this.isPublic;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // com.discord.widgets.stickers.GuildStickerSheetViewModel.Companion.GuildStickerGuildInfo
|
|
|
|
public boolean isUserInGuild() {
|
|
|
|
return this.isUserInGuild;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String toString() {
|
|
|
|
StringBuilder L = a.L("Known(guild=");
|
|
|
|
L.append(this.guild);
|
|
|
|
L.append(", isPublic=");
|
|
|
|
L.append(isPublic());
|
|
|
|
L.append(", isUserInGuild=");
|
|
|
|
L.append(isUserInGuild());
|
|
|
|
L.append(", approximateOnline=");
|
2021-07-13 20:23:20 +00:00
|
|
|
return a.A(L, this.approximateOnline, ")");
|
2021-07-03 23:36:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: GuildStickerSheetViewModel.kt */
|
|
|
|
public static final class Unknown extends GuildStickerGuildInfo {
|
|
|
|
public static final Unknown INSTANCE = new Unknown();
|
|
|
|
private static final boolean isPublic = false;
|
|
|
|
private static final boolean isUserInGuild = false;
|
|
|
|
|
|
|
|
private Unknown() {
|
|
|
|
super(null);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // com.discord.widgets.stickers.GuildStickerSheetViewModel.Companion.GuildStickerGuildInfo
|
|
|
|
public boolean isPublic() {
|
|
|
|
return isPublic;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // com.discord.widgets.stickers.GuildStickerSheetViewModel.Companion.GuildStickerGuildInfo
|
|
|
|
public boolean isUserInGuild() {
|
|
|
|
return isUserInGuild;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private GuildStickerGuildInfo() {
|
|
|
|
}
|
|
|
|
|
|
|
|
public /* synthetic */ GuildStickerGuildInfo(DefaultConstructorMarker defaultConstructorMarker) {
|
|
|
|
this();
|
|
|
|
}
|
|
|
|
|
|
|
|
public abstract boolean isPublic();
|
|
|
|
|
|
|
|
public abstract boolean isUserInGuild();
|
|
|
|
}
|
|
|
|
|
|
|
|
private Companion() {
|
|
|
|
}
|
|
|
|
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
|
|
this();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ Observable access$observeStoreState(Companion companion, RestAPI restAPI, Sticker sticker, StoreUser storeUser, StoreChannelsSelected storeChannelsSelected, StoreGuilds storeGuilds) {
|
|
|
|
return companion.observeStoreState(restAPI, sticker, storeUser, storeChannelsSelected, storeGuilds);
|
|
|
|
}
|
|
|
|
|
|
|
|
private final Observable<GuildStickerGuildInfo> getGuildForGuildSticker(RestAPI restAPI, Sticker sticker, StoreGuilds storeGuilds) {
|
|
|
|
Observable<GuildStickerGuildInfo> z2 = Observable.C(new GuildStickerSheetViewModel$Companion$getGuildForGuildSticker$1(storeGuilds, sticker)).z(new GuildStickerSheetViewModel$Companion$getGuildForGuildSticker$2(restAPI, sticker));
|
|
|
|
m.checkNotNullExpressionValue(z2, "Observable.fromCallable … }\n }\n }");
|
|
|
|
return z2;
|
|
|
|
}
|
|
|
|
|
|
|
|
private final Observable<StoreState> observeStoreState(RestAPI restAPI, Sticker sticker, StoreUser storeUser, StoreChannelsSelected storeChannelsSelected, StoreGuilds storeGuilds) {
|
|
|
|
Observable<StoreState> h = Observable.h(getGuildForGuildSticker(restAPI, sticker, storeGuilds), StoreUser.observeMe$default(storeUser, false, 1, null), storeChannelsSelected.observeSelectedChannel(), storeGuilds.observeGuilds(), GuildStickerSheetViewModel$Companion$observeStoreState$1.INSTANCE);
|
|
|
|
m.checkNotNullExpressionValue(h, "Observable.combineLatest…erGuildInfo\n )\n }");
|
|
|
|
return h;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: GuildStickerSheetViewModel.kt */
|
|
|
|
public static final class StoreState {
|
|
|
|
private final Long currentGuildId;
|
|
|
|
private final Companion.GuildStickerGuildInfo guildStickerGuildInfo;
|
|
|
|
private final MeUser meUser;
|
|
|
|
private final Map<Long, Guild> userGuilds;
|
|
|
|
|
|
|
|
public StoreState(MeUser meUser, Long l, Map<Long, Guild> map, Companion.GuildStickerGuildInfo guildStickerGuildInfo) {
|
|
|
|
m.checkNotNullParameter(meUser, "meUser");
|
|
|
|
m.checkNotNullParameter(map, "userGuilds");
|
|
|
|
m.checkNotNullParameter(guildStickerGuildInfo, "guildStickerGuildInfo");
|
|
|
|
this.meUser = meUser;
|
|
|
|
this.currentGuildId = l;
|
|
|
|
this.userGuilds = map;
|
|
|
|
this.guildStickerGuildInfo = guildStickerGuildInfo;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* JADX DEBUG: Multi-variable search result rejected for r0v0, resolved type: com.discord.widgets.stickers.GuildStickerSheetViewModel$StoreState */
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
|
|
public static /* synthetic */ StoreState copy$default(StoreState storeState, MeUser meUser, Long l, Map map, Companion.GuildStickerGuildInfo guildStickerGuildInfo, int i, Object obj) {
|
|
|
|
if ((i & 1) != 0) {
|
|
|
|
meUser = storeState.meUser;
|
|
|
|
}
|
|
|
|
if ((i & 2) != 0) {
|
|
|
|
l = storeState.currentGuildId;
|
|
|
|
}
|
|
|
|
if ((i & 4) != 0) {
|
|
|
|
map = storeState.userGuilds;
|
|
|
|
}
|
|
|
|
if ((i & 8) != 0) {
|
|
|
|
guildStickerGuildInfo = storeState.guildStickerGuildInfo;
|
|
|
|
}
|
|
|
|
return storeState.copy(meUser, l, map, guildStickerGuildInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
public final MeUser component1() {
|
|
|
|
return this.meUser;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Long component2() {
|
|
|
|
return this.currentGuildId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Map<Long, Guild> component3() {
|
|
|
|
return this.userGuilds;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Companion.GuildStickerGuildInfo component4() {
|
|
|
|
return this.guildStickerGuildInfo;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final StoreState copy(MeUser meUser, Long l, Map<Long, Guild> map, Companion.GuildStickerGuildInfo guildStickerGuildInfo) {
|
|
|
|
m.checkNotNullParameter(meUser, "meUser");
|
|
|
|
m.checkNotNullParameter(map, "userGuilds");
|
|
|
|
m.checkNotNullParameter(guildStickerGuildInfo, "guildStickerGuildInfo");
|
|
|
|
return new StoreState(meUser, l, map, guildStickerGuildInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean equals(Object obj) {
|
|
|
|
if (this == obj) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (!(obj instanceof StoreState)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
StoreState storeState = (StoreState) obj;
|
|
|
|
return m.areEqual(this.meUser, storeState.meUser) && m.areEqual(this.currentGuildId, storeState.currentGuildId) && m.areEqual(this.userGuilds, storeState.userGuilds) && m.areEqual(this.guildStickerGuildInfo, storeState.guildStickerGuildInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Long getCurrentGuildId() {
|
|
|
|
return this.currentGuildId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Companion.GuildStickerGuildInfo getGuildStickerGuildInfo() {
|
|
|
|
return this.guildStickerGuildInfo;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final MeUser getMeUser() {
|
|
|
|
return this.meUser;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Map<Long, Guild> getUserGuilds() {
|
|
|
|
return this.userGuilds;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int hashCode() {
|
|
|
|
MeUser meUser = this.meUser;
|
|
|
|
int i = 0;
|
|
|
|
int hashCode = (meUser != null ? meUser.hashCode() : 0) * 31;
|
|
|
|
Long l = this.currentGuildId;
|
|
|
|
int hashCode2 = (hashCode + (l != null ? l.hashCode() : 0)) * 31;
|
|
|
|
Map<Long, Guild> map = this.userGuilds;
|
|
|
|
int hashCode3 = (hashCode2 + (map != null ? map.hashCode() : 0)) * 31;
|
|
|
|
Companion.GuildStickerGuildInfo guildStickerGuildInfo = this.guildStickerGuildInfo;
|
|
|
|
if (guildStickerGuildInfo != null) {
|
|
|
|
i = guildStickerGuildInfo.hashCode();
|
|
|
|
}
|
|
|
|
return hashCode3 + i;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String toString() {
|
|
|
|
StringBuilder L = a.L("StoreState(meUser=");
|
|
|
|
L.append(this.meUser);
|
|
|
|
L.append(", currentGuildId=");
|
|
|
|
L.append(this.currentGuildId);
|
|
|
|
L.append(", userGuilds=");
|
|
|
|
L.append(this.userGuilds);
|
|
|
|
L.append(", guildStickerGuildInfo=");
|
|
|
|
L.append(this.guildStickerGuildInfo);
|
|
|
|
L.append(")");
|
|
|
|
return L.toString();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: GuildStickerSheetViewModel.kt */
|
|
|
|
public static abstract class ViewState {
|
|
|
|
|
|
|
|
/* compiled from: GuildStickerSheetViewModel.kt */
|
|
|
|
public static final class Dismiss extends ViewState {
|
|
|
|
public static final Dismiss INSTANCE = new Dismiss();
|
|
|
|
|
|
|
|
private Dismiss() {
|
|
|
|
super(null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: GuildStickerSheetViewModel.kt */
|
|
|
|
public static final class Loaded extends ViewState {
|
|
|
|
private final Companion.GuildStickerGuildInfo guildStickerGuildInfo;
|
|
|
|
private final boolean isCurrentGuild;
|
|
|
|
private final boolean isUserPremium;
|
|
|
|
private final Sticker sticker;
|
|
|
|
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
|
|
public Loaded(Sticker sticker, boolean z2, boolean z3, Companion.GuildStickerGuildInfo guildStickerGuildInfo) {
|
|
|
|
super(null);
|
|
|
|
m.checkNotNullParameter(sticker, "sticker");
|
|
|
|
m.checkNotNullParameter(guildStickerGuildInfo, "guildStickerGuildInfo");
|
|
|
|
this.sticker = sticker;
|
|
|
|
this.isUserPremium = z2;
|
|
|
|
this.isCurrentGuild = z3;
|
|
|
|
this.guildStickerGuildInfo = guildStickerGuildInfo;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ Loaded copy$default(Loaded loaded, Sticker sticker, boolean z2, boolean z3, Companion.GuildStickerGuildInfo guildStickerGuildInfo, int i, Object obj) {
|
|
|
|
if ((i & 1) != 0) {
|
|
|
|
sticker = loaded.sticker;
|
|
|
|
}
|
|
|
|
if ((i & 2) != 0) {
|
|
|
|
z2 = loaded.isUserPremium;
|
|
|
|
}
|
|
|
|
if ((i & 4) != 0) {
|
|
|
|
z3 = loaded.isCurrentGuild;
|
|
|
|
}
|
|
|
|
if ((i & 8) != 0) {
|
|
|
|
guildStickerGuildInfo = loaded.guildStickerGuildInfo;
|
|
|
|
}
|
|
|
|
return loaded.copy(sticker, z2, z3, guildStickerGuildInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Sticker component1() {
|
|
|
|
return this.sticker;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean component2() {
|
|
|
|
return this.isUserPremium;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean component3() {
|
|
|
|
return this.isCurrentGuild;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Companion.GuildStickerGuildInfo component4() {
|
|
|
|
return this.guildStickerGuildInfo;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Loaded copy(Sticker sticker, boolean z2, boolean z3, Companion.GuildStickerGuildInfo guildStickerGuildInfo) {
|
|
|
|
m.checkNotNullParameter(sticker, "sticker");
|
|
|
|
m.checkNotNullParameter(guildStickerGuildInfo, "guildStickerGuildInfo");
|
|
|
|
return new Loaded(sticker, z2, z3, guildStickerGuildInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean equals(Object obj) {
|
|
|
|
if (this == obj) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (!(obj instanceof Loaded)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
Loaded loaded = (Loaded) obj;
|
|
|
|
return m.areEqual(this.sticker, loaded.sticker) && this.isUserPremium == loaded.isUserPremium && this.isCurrentGuild == loaded.isCurrentGuild && m.areEqual(this.guildStickerGuildInfo, loaded.guildStickerGuildInfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Companion.GuildStickerGuildInfo getGuildStickerGuildInfo() {
|
|
|
|
return this.guildStickerGuildInfo;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Sticker getSticker() {
|
|
|
|
return this.sticker;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int hashCode() {
|
|
|
|
Sticker sticker = this.sticker;
|
|
|
|
int i = 0;
|
|
|
|
int hashCode = (sticker != null ? sticker.hashCode() : 0) * 31;
|
|
|
|
boolean z2 = this.isUserPremium;
|
|
|
|
int i2 = 1;
|
|
|
|
if (z2) {
|
|
|
|
z2 = true;
|
|
|
|
}
|
|
|
|
int i3 = z2 ? 1 : 0;
|
|
|
|
int i4 = z2 ? 1 : 0;
|
|
|
|
int i5 = z2 ? 1 : 0;
|
|
|
|
int i6 = (hashCode + i3) * 31;
|
|
|
|
boolean z3 = this.isCurrentGuild;
|
|
|
|
if (!z3) {
|
|
|
|
i2 = z3 ? 1 : 0;
|
|
|
|
}
|
|
|
|
int i7 = (i6 + i2) * 31;
|
|
|
|
Companion.GuildStickerGuildInfo guildStickerGuildInfo = this.guildStickerGuildInfo;
|
|
|
|
if (guildStickerGuildInfo != null) {
|
|
|
|
i = guildStickerGuildInfo.hashCode();
|
|
|
|
}
|
|
|
|
return i7 + i;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean isCurrentGuild() {
|
|
|
|
return this.isCurrentGuild;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean isUserPremium() {
|
|
|
|
return this.isUserPremium;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String toString() {
|
|
|
|
StringBuilder L = a.L("Loaded(sticker=");
|
|
|
|
L.append(this.sticker);
|
|
|
|
L.append(", isUserPremium=");
|
|
|
|
L.append(this.isUserPremium);
|
|
|
|
L.append(", isCurrentGuild=");
|
|
|
|
L.append(this.isCurrentGuild);
|
|
|
|
L.append(", guildStickerGuildInfo=");
|
|
|
|
L.append(this.guildStickerGuildInfo);
|
|
|
|
L.append(")");
|
|
|
|
return L.toString();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: GuildStickerSheetViewModel.kt */
|
|
|
|
public static final class Loading extends ViewState {
|
|
|
|
public static final Loading INSTANCE = new Loading();
|
|
|
|
|
|
|
|
private Loading() {
|
|
|
|
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) */
|
|
|
|
public GuildStickerSheetViewModel(Sticker sticker, RestAPI restAPI, StoreUser storeUser, StoreChannelsSelected storeChannelsSelected, StoreGuilds storeGuilds, Observable<StoreState> observable) {
|
|
|
|
super(ViewState.Loading.INSTANCE);
|
|
|
|
m.checkNotNullParameter(sticker, "sticker");
|
|
|
|
m.checkNotNullParameter(restAPI, "restAPI");
|
|
|
|
m.checkNotNullParameter(storeUser, "storeUser");
|
|
|
|
m.checkNotNullParameter(storeChannelsSelected, "storeChannelsSelected");
|
|
|
|
m.checkNotNullParameter(storeGuilds, "storeGuilds");
|
|
|
|
m.checkNotNullParameter(observable, "storeStateObservable");
|
|
|
|
this.sticker = sticker;
|
|
|
|
this.restAPI = restAPI;
|
|
|
|
this.storeUser = storeUser;
|
|
|
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(ObservableExtensionsKt.computationLatest(observable), this, null, 2, null), GuildStickerSheetViewModel.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 */ GuildStickerSheetViewModel(Sticker sticker, RestAPI restAPI, StoreUser storeUser, StoreChannelsSelected storeChannelsSelected, StoreGuilds storeGuilds, Observable observable, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
|
|
|
this(sticker, restAPI, storeUser, storeChannelsSelected, storeGuilds, (i & 32) != 0 ? Companion.access$observeStoreState(Companion, restAPI, sticker, storeUser, storeChannelsSelected, storeGuilds) : observable);
|
|
|
|
restAPI = (i & 2) != 0 ? RestAPI.Companion.getApi() : restAPI;
|
|
|
|
storeUser = (i & 4) != 0 ? StoreStream.Companion.getUsers() : storeUser;
|
|
|
|
storeChannelsSelected = (i & 8) != 0 ? StoreStream.Companion.getChannelsSelected() : storeChannelsSelected;
|
|
|
|
storeGuilds = (i & 16) != 0 ? StoreStream.Companion.getGuilds() : storeGuilds;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ void access$handleStoreState(GuildStickerSheetViewModel guildStickerSheetViewModel, StoreState storeState) {
|
|
|
|
guildStickerSheetViewModel.handleStoreState(storeState);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ void access$updateViewState(GuildStickerSheetViewModel guildStickerSheetViewModel, ViewState viewState) {
|
|
|
|
guildStickerSheetViewModel.updateViewState(viewState);
|
|
|
|
}
|
|
|
|
|
|
|
|
@MainThread
|
|
|
|
private final void handleStoreState(StoreState storeState) {
|
|
|
|
updateViewState(new ViewState.Loaded(this.sticker, storeState.getMeUser().getPremiumTier() == PremiumTier.TIER_2, m.areEqual(storeState.getCurrentGuildId(), this.sticker.g()), storeState.getGuildStickerGuildInfo()));
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void joinGuild(Guild guild) {
|
|
|
|
m.checkNotNullParameter(guild, "guild");
|
|
|
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui(ObservableExtensionsKt.restSubscribeOn$default(this.restAPI.joinGuild(guild.getId(), false, null), false, 1, null)), GuildStickerSheetViewModel.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new GuildStickerSheetViewModel$joinGuild$1(this), 62, (Object) null);
|
|
|
|
}
|
|
|
|
}
|