2021-08-03 07:33:18 +00:00
|
|
|
package com.discord.widgets.emoji;
|
|
|
|
|
2021-10-15 06:18:26 +00:00
|
|
|
import c0.z.d.m;
|
2021-08-03 07:33:18 +00:00
|
|
|
import com.discord.api.guild.GuildFeature;
|
|
|
|
import com.discord.models.guild.Guild;
|
|
|
|
import com.discord.utilities.rest.RestAPI;
|
|
|
|
import com.discord.utilities.textprocessing.node.EmojiNode;
|
|
|
|
import com.discord.widgets.emoji.EmojiSheetViewModel;
|
2021-10-15 06:18:26 +00:00
|
|
|
import i0.k.b;
|
|
|
|
import i0.l.e.j;
|
2021-08-03 07:33:18 +00:00
|
|
|
import retrofit2.HttpException;
|
|
|
|
import rx.Observable;
|
|
|
|
/* compiled from: EmojiSheetViewModel.kt */
|
|
|
|
public final class EmojiSheetViewModel$Companion$getGuildForCustomEmoji$2<T, R> implements b<Guild, Observable<? extends EmojiSheetViewModel.Companion.CustomEmojGuildInfo>> {
|
|
|
|
public final /* synthetic */ EmojiNode.EmojiIdAndType.Custom $emoji;
|
|
|
|
public final /* synthetic */ RestAPI $restAPI;
|
|
|
|
|
|
|
|
/* compiled from: EmojiSheetViewModel.kt */
|
|
|
|
/* renamed from: com.discord.widgets.emoji.EmojiSheetViewModel$Companion$getGuildForCustomEmoji$2$1 reason: invalid class name */
|
|
|
|
public static final class AnonymousClass1<T, R> implements b<com.discord.api.guild.Guild, Guild> {
|
|
|
|
public static final AnonymousClass1 INSTANCE = new AnonymousClass1();
|
|
|
|
|
|
|
|
public final Guild call(com.discord.api.guild.Guild guild) {
|
|
|
|
m.checkNotNullExpressionValue(guild, "it");
|
|
|
|
return new Guild(guild);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: EmojiSheetViewModel.kt */
|
|
|
|
/* renamed from: com.discord.widgets.emoji.EmojiSheetViewModel$Companion$getGuildForCustomEmoji$2$2 reason: invalid class name */
|
|
|
|
public static final class AnonymousClass2<T, R> implements b<Guild, EmojiSheetViewModel.Companion.CustomEmojGuildInfo> {
|
|
|
|
public static final AnonymousClass2 INSTANCE = new AnonymousClass2();
|
|
|
|
|
|
|
|
public final EmojiSheetViewModel.Companion.CustomEmojGuildInfo call(Guild guild) {
|
|
|
|
m.checkNotNullExpressionValue(guild, "responseGuild");
|
|
|
|
return new EmojiSheetViewModel.Companion.CustomEmojGuildInfo.Known(guild, true, true, Integer.valueOf(guild.getApproximatePresenceCount()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: EmojiSheetViewModel.kt */
|
|
|
|
/* renamed from: com.discord.widgets.emoji.EmojiSheetViewModel$Companion$getGuildForCustomEmoji$2$3 reason: invalid class name */
|
|
|
|
public static final class AnonymousClass3<T, R> implements b<Throwable, EmojiSheetViewModel.Companion.CustomEmojGuildInfo> {
|
|
|
|
public final /* synthetic */ Guild $localGuild;
|
|
|
|
|
|
|
|
public AnonymousClass3(Guild guild) {
|
|
|
|
this.$localGuild = guild;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final EmojiSheetViewModel.Companion.CustomEmojGuildInfo call(Throwable th) {
|
|
|
|
return (!(th instanceof HttpException) || ((HttpException) th).a() != 404) ? EmojiSheetViewModel.Companion.CustomEmojGuildInfo.Unknown.INSTANCE : new EmojiSheetViewModel.Companion.CustomEmojGuildInfo.Known(this.$localGuild, false, true, null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: EmojiSheetViewModel.kt */
|
|
|
|
/* renamed from: com.discord.widgets.emoji.EmojiSheetViewModel$Companion$getGuildForCustomEmoji$2$4 reason: invalid class name */
|
|
|
|
public static final class AnonymousClass4<T, R> implements b<com.discord.api.guild.Guild, Guild> {
|
|
|
|
public static final AnonymousClass4 INSTANCE = new AnonymousClass4();
|
|
|
|
|
|
|
|
public final Guild call(com.discord.api.guild.Guild guild) {
|
|
|
|
m.checkNotNullExpressionValue(guild, "it");
|
|
|
|
return new Guild(guild);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: EmojiSheetViewModel.kt */
|
|
|
|
/* renamed from: com.discord.widgets.emoji.EmojiSheetViewModel$Companion$getGuildForCustomEmoji$2$5 reason: invalid class name */
|
|
|
|
public static final class AnonymousClass5<T, R> implements b<Guild, EmojiSheetViewModel.Companion.CustomEmojGuildInfo> {
|
|
|
|
public static final AnonymousClass5 INSTANCE = new AnonymousClass5();
|
|
|
|
|
|
|
|
public final EmojiSheetViewModel.Companion.CustomEmojGuildInfo call(Guild guild) {
|
|
|
|
m.checkNotNullExpressionValue(guild, "responseGuild");
|
|
|
|
return new EmojiSheetViewModel.Companion.CustomEmojGuildInfo.Known(guild, true, false, Integer.valueOf(guild.getApproximatePresenceCount()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: EmojiSheetViewModel.kt */
|
|
|
|
/* renamed from: com.discord.widgets.emoji.EmojiSheetViewModel$Companion$getGuildForCustomEmoji$2$6 reason: invalid class name */
|
|
|
|
public static final class AnonymousClass6<T, R> implements b<Throwable, EmojiSheetViewModel.Companion.CustomEmojGuildInfo> {
|
|
|
|
public static final AnonymousClass6 INSTANCE = new AnonymousClass6();
|
|
|
|
|
|
|
|
public final EmojiSheetViewModel.Companion.CustomEmojGuildInfo call(Throwable th) {
|
|
|
|
return EmojiSheetViewModel.Companion.CustomEmojGuildInfo.Unknown.INSTANCE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public EmojiSheetViewModel$Companion$getGuildForCustomEmoji$2(RestAPI restAPI, EmojiNode.EmojiIdAndType.Custom custom) {
|
|
|
|
this.$restAPI = restAPI;
|
|
|
|
this.$emoji = custom;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Observable<? extends EmojiSheetViewModel.Companion.CustomEmojGuildInfo> call(Guild guild) {
|
2021-10-22 06:43:45 +00:00
|
|
|
return guild != null ? guild.getFeatures().contains(GuildFeature.DISCOVERABLE) ? this.$restAPI.getEmojiGuild(this.$emoji.getId()).F(AnonymousClass1.INSTANCE).F(AnonymousClass2.INSTANCE).L(new AnonymousClass3(guild)) : new j(new EmojiSheetViewModel.Companion.CustomEmojGuildInfo.Known(guild, false, true, null)) : this.$restAPI.getEmojiGuild(this.$emoji.getId()).F(AnonymousClass4.INSTANCE).F(AnonymousClass5.INSTANCE).L(AnonymousClass6.INSTANCE);
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
}
|