discord-jadx/app/src/main/java/com/discord/widgets/chat/input/ChatInputViewModel$Companio...

114 lines
9.0 KiB
Java

package com.discord.widgets.chat.input;
import com.airbnb.lottie.parser.AnimatableValueParser;
import com.discord.api.channel.Channel;
import com.discord.api.guild.GuildVerificationLevel;
import com.discord.api.guildjoinrequest.GuildJoinRequest;
import com.discord.models.guild.Guild;
import com.discord.models.member.GuildMember;
import com.discord.models.user.MeUser;
import com.discord.models.user.User;
import com.discord.stores.StoreChannelsSelected;
import com.discord.stores.StoreChat;
import com.discord.stores.StoreGuildJoinRequest;
import com.discord.stores.StoreGuilds;
import com.discord.stores.StoreLurking;
import com.discord.stores.StorePendingReplies;
import com.discord.stores.StorePermissions;
import com.discord.stores.StoreSlowMode;
import com.discord.stores.StoreThreadDraft;
import com.discord.stores.StoreUser;
import com.discord.stores.StoreUserRelationships;
import com.discord.utilities.rx.ObservableCombineLatestOverloadsKt;
import com.discord.utilities.rx.ObservableExtensionsKt;
import com.discord.widgets.chat.input.ChatInputViewModel;
import com.discord.widgets.chat.input.sticker.StickerPickerNfxManager;
import d0.z.d.m;
import d0.z.d.o;
import j0.k.b;
import j0.l.e.j;
import kotlin.jvm.functions.Function13;
import rx.Observable;
/* compiled from: ChatInputViewModel.kt */
public final class ChatInputViewModel$Companion$observeStoreState$1<T, R> implements b<StoreChannelsSelected.ResolvedSelectedChannel, Observable<? extends ChatInputViewModel.StoreState>> {
public final /* synthetic */ StickerPickerNfxManager $stickerPickerNfxManager;
public final /* synthetic */ StoreChat $storeChat;
public final /* synthetic */ StoreGuildJoinRequest $storeGuildJoinRequest;
public final /* synthetic */ StoreGuilds $storeGuilds;
public final /* synthetic */ StoreLurking $storeLurking;
public final /* synthetic */ StorePendingReplies $storePendingReplies;
public final /* synthetic */ StorePermissions $storePermissions;
public final /* synthetic */ StoreSlowMode $storeSlowMode;
public final /* synthetic */ StoreThreadDraft $storeThreadDraft;
public final /* synthetic */ StoreUserRelationships $storeUserRelationships;
public final /* synthetic */ StoreUser $storeUsers;
/* compiled from: ChatInputViewModel.kt */
/* renamed from: com.discord.widgets.chat.input.ChatInputViewModel$Companion$observeStoreState$1$1 reason: invalid class name */
public static final class AnonymousClass1 extends o implements Function13<MeUser, StoreChat.EditingMessage, Integer, Long, GuildVerificationLevel, Boolean, Boolean, Guild, Boolean, ChatInputViewModel.StoreState.Loaded.PendingReply, GuildMember, GuildJoinRequest, StoreThreadDraft.ThreadDraftState, ChatInputViewModel.StoreState.Loaded> {
public final /* synthetic */ Channel $channel;
public final /* synthetic */ StoreChannelsSelected.ResolvedSelectedChannel $selectedChannel;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public AnonymousClass1(Channel channel, StoreChannelsSelected.ResolvedSelectedChannel resolvedSelectedChannel) {
super(13);
this.$channel = channel;
this.$selectedChannel = resolvedSelectedChannel;
}
public final ChatInputViewModel.StoreState.Loaded invoke(MeUser meUser, StoreChat.EditingMessage editingMessage, Integer num, Long l, GuildVerificationLevel guildVerificationLevel, boolean z2, Boolean bool, Guild guild, boolean z3, ChatInputViewModel.StoreState.Loaded.PendingReply pendingReply, GuildMember guildMember, GuildJoinRequest guildJoinRequest, StoreThreadDraft.ThreadDraftState threadDraftState) {
m.checkNotNullParameter(meUser, "me");
m.checkNotNullParameter(guildVerificationLevel, "verificationLevelTriggered");
m.checkNotNullParameter(threadDraftState, "threadDraftState");
Channel channel = this.$channel;
m.checkNotNullExpressionValue(bool, "isOnCooldown");
boolean booleanValue = bool.booleanValue();
StoreChannelsSelected.ResolvedSelectedChannel resolvedSelectedChannel = this.$selectedChannel;
if (!(resolvedSelectedChannel instanceof StoreChannelsSelected.ResolvedSelectedChannel.ThreadDraft)) {
resolvedSelectedChannel = null;
}
return new ChatInputViewModel.StoreState.Loaded(channel, meUser, editingMessage, num, l, guildVerificationLevel, z2, booleanValue, guild, z3, pendingReply, (StoreChannelsSelected.ResolvedSelectedChannel.ThreadDraft) resolvedSelectedChannel, guildMember, guildJoinRequest, threadDraftState);
}
/* 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, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object] */
@Override // kotlin.jvm.functions.Function13
public /* bridge */ /* synthetic */ ChatInputViewModel.StoreState.Loaded invoke(MeUser meUser, StoreChat.EditingMessage editingMessage, Integer num, Long l, GuildVerificationLevel guildVerificationLevel, Boolean bool, Boolean bool2, Guild guild, Boolean bool3, ChatInputViewModel.StoreState.Loaded.PendingReply pendingReply, GuildMember guildMember, GuildJoinRequest guildJoinRequest, StoreThreadDraft.ThreadDraftState threadDraftState) {
return invoke(meUser, editingMessage, num, l, guildVerificationLevel, bool.booleanValue(), bool2, guild, bool3.booleanValue(), pendingReply, guildMember, guildJoinRequest, threadDraftState);
}
}
public ChatInputViewModel$Companion$observeStoreState$1(StoreUser storeUser, StoreChat storeChat, StoreUserRelationships storeUserRelationships, StorePermissions storePermissions, StoreGuilds storeGuilds, StoreLurking storeLurking, StoreSlowMode storeSlowMode, StickerPickerNfxManager stickerPickerNfxManager, StorePendingReplies storePendingReplies, StoreGuildJoinRequest storeGuildJoinRequest, StoreThreadDraft storeThreadDraft) {
this.$storeUsers = storeUser;
this.$storeChat = storeChat;
this.$storeUserRelationships = storeUserRelationships;
this.$storePermissions = storePermissions;
this.$storeGuilds = storeGuilds;
this.$storeLurking = storeLurking;
this.$storeSlowMode = storeSlowMode;
this.$stickerPickerNfxManager = stickerPickerNfxManager;
this.$storePendingReplies = storePendingReplies;
this.$storeGuildJoinRequest = storeGuildJoinRequest;
this.$storeThreadDraft = storeThreadDraft;
}
public final Observable<? extends ChatInputViewModel.StoreState> call(StoreChannelsSelected.ResolvedSelectedChannel resolvedSelectedChannel) {
Channel channelOrParent = resolvedSelectedChannel.getChannelOrParent();
if (channelOrParent == null) {
return new j(ChatInputViewModel.StoreState.Loading.INSTANCE);
}
Observable<MeUser> observeMe = this.$storeUsers.observeMe(true);
Observable computationBuffered = ObservableExtensionsKt.computationBuffered(this.$storeChat.observeEditingMessage());
StoreUserRelationships storeUserRelationships = this.$storeUserRelationships;
User v0 = AnimatableValueParser.v0(channelOrParent);
Observable<Integer> observe = storeUserRelationships.observe(v0 != null ? v0.getId() : 0);
Observable<Long> observePermissionsForChannel = this.$storePermissions.observePermissionsForChannel(channelOrParent.h());
ChatInputViewModel.Companion companion = ChatInputViewModel.Companion;
Observable access$getVerificationLevelTriggeredObservable = ChatInputViewModel.Companion.access$getVerificationLevelTriggeredObservable(companion, channelOrParent.f(), this.$storeGuilds, this.$storeUsers);
Observable<Boolean> isLurkingObs = this.$storeLurking.isLurkingObs(channelOrParent.f());
Observable access$getIsOnCooldownObservable = ChatInputViewModel.Companion.access$getIsOnCooldownObservable(companion, channelOrParent.h(), this.$storeSlowMode);
m.checkNotNullExpressionValue(access$getIsOnCooldownObservable, "getIsOnCooldownObservabl…hannel.id, storeSlowMode)");
return ObservableCombineLatestOverloadsKt.combineLatest(observeMe, computationBuffered, observe, observePermissionsForChannel, access$getVerificationLevelTriggeredObservable, isLurkingObs, access$getIsOnCooldownObservable, this.$storeGuilds.observeFromChannelId(channelOrParent.h()), this.$stickerPickerNfxManager.observeCanShowStickerPickerNfx(), ChatInputViewModel.Companion.access$getPendingReplyStateObservable(companion, channelOrParent.h(), this.$storePendingReplies), this.$storeGuilds.observeComputedMember(channelOrParent.f(), this.$storeUsers.getMe().getId()), this.$storeGuildJoinRequest.observeGuildJoinRequest(channelOrParent.f()), this.$storeThreadDraft.observeDraftState(), new AnonymousClass1(channelOrParent, resolvedSelectedChannel));
}
}