discord-jadx/app/src/main/java/com/discord/widgets/user/usersheet/WidgetUserSheetViewModelSto...

206 lines
11 KiB
Java

package com.discord.widgets.user.usersheet;
import c.d.b.a.a;
import com.discord.api.channel.Channel;
import com.discord.models.user.MeUser;
import com.discord.models.user.User;
import com.discord.stores.StoreChannels;
import com.discord.stores.StoreGuilds;
import com.discord.stores.StoreMediaSettings;
import com.discord.stores.StorePermissions;
import com.discord.stores.StoreStageChannels;
import com.discord.stores.StoreStream;
import com.discord.stores.StoreUser;
import com.discord.stores.StoreUserNotes;
import com.discord.stores.StoreUserPresence;
import com.discord.stores.StoreUserProfile;
import com.discord.stores.StoreUserRelationships;
import com.discord.stores.StoreVoiceChannelSelected;
import com.discord.stores.StoreVoiceStates;
import com.discord.utilities.rx.LeadingEdgeThrottle;
import com.discord.utilities.streams.StreamContextService;
import com.discord.widgets.user.usersheet.WidgetUserSheetViewModel;
import d0.z.d.m;
import j0.l.a.r;
import j0.l.e.j;
import java.util.concurrent.TimeUnit;
import rx.Observable;
import rx.Scheduler;
import rx.functions.Func4;
/* compiled from: WidgetUserSheetViewModelStoreState.kt */
public final class WidgetUserSheetViewModelStoreState {
public static final WidgetUserSheetViewModelStoreState INSTANCE = new WidgetUserSheetViewModelStoreState();
/* compiled from: WidgetUserSheetViewModelStoreState.kt */
public static final class BootstrapData {
private final Channel channel;
/* renamed from: me reason: collision with root package name */
private final MeUser f2155me;
private final Channel selectedVoiceChannel;
private final User user;
public BootstrapData(User user, MeUser meUser, Channel channel, Channel channel2) {
m.checkNotNullParameter(meUser, "me");
this.user = user;
this.f2155me = meUser;
this.channel = channel;
this.selectedVoiceChannel = channel2;
}
public static /* synthetic */ BootstrapData copy$default(BootstrapData bootstrapData, User user, MeUser meUser, Channel channel, Channel channel2, int i, Object obj) {
if ((i & 1) != 0) {
user = bootstrapData.user;
}
if ((i & 2) != 0) {
meUser = bootstrapData.f2155me;
}
if ((i & 4) != 0) {
channel = bootstrapData.channel;
}
if ((i & 8) != 0) {
channel2 = bootstrapData.selectedVoiceChannel;
}
return bootstrapData.copy(user, meUser, channel, channel2);
}
public final User component1() {
return this.user;
}
public final MeUser component2() {
return this.f2155me;
}
public final Channel component3() {
return this.channel;
}
public final Channel component4() {
return this.selectedVoiceChannel;
}
public final BootstrapData copy(User user, MeUser meUser, Channel channel, Channel channel2) {
m.checkNotNullParameter(meUser, "me");
return new BootstrapData(user, meUser, channel, channel2);
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof BootstrapData)) {
return false;
}
BootstrapData bootstrapData = (BootstrapData) obj;
return m.areEqual(this.user, bootstrapData.user) && m.areEqual(this.f2155me, bootstrapData.f2155me) && m.areEqual(this.channel, bootstrapData.channel) && m.areEqual(this.selectedVoiceChannel, bootstrapData.selectedVoiceChannel);
}
public final Channel getChannel() {
return this.channel;
}
public final MeUser getMe() {
return this.f2155me;
}
public final Channel getSelectedVoiceChannel() {
return this.selectedVoiceChannel;
}
public final User getUser() {
return this.user;
}
public int hashCode() {
User user = this.user;
int i = 0;
int hashCode = (user != null ? user.hashCode() : 0) * 31;
MeUser meUser = this.f2155me;
int hashCode2 = (hashCode + (meUser != null ? meUser.hashCode() : 0)) * 31;
Channel channel = this.channel;
int hashCode3 = (hashCode2 + (channel != null ? channel.hashCode() : 0)) * 31;
Channel channel2 = this.selectedVoiceChannel;
if (channel2 != null) {
i = channel2.hashCode();
}
return hashCode3 + i;
}
public String toString() {
StringBuilder L = a.L("BootstrapData(user=");
L.append(this.user);
L.append(", me=");
L.append(this.f2155me);
L.append(", channel=");
L.append(this.channel);
L.append(", selectedVoiceChannel=");
L.append(this.selectedVoiceChannel);
L.append(")");
return L.toString();
}
}
private WidgetUserSheetViewModelStoreState() {
}
public static /* synthetic */ Observable observeStoreState$default(WidgetUserSheetViewModelStoreState widgetUserSheetViewModelStoreState, long j, Long l, StoreUser storeUser, StoreChannels storeChannels, StoreVoiceChannelSelected storeVoiceChannelSelected, StoreUserProfile storeUserProfile, StoreUserRelationships storeUserRelationships, StoreVoiceStates storeVoiceStates, StoreGuilds storeGuilds, StoreMediaSettings storeMediaSettings, StoreUserPresence storeUserPresence, StorePermissions storePermissions, StoreUserNotes storeUserNotes, StoreStageChannels storeStageChannels, StreamContextService streamContextService, Scheduler scheduler, int i, Object obj) {
Scheduler scheduler2;
StoreUser users = (i & 4) != 0 ? StoreStream.Companion.getUsers() : storeUser;
StoreChannels channels = (i & 8) != 0 ? StoreStream.Companion.getChannels() : storeChannels;
StoreVoiceChannelSelected voiceChannelSelected = (i & 16) != 0 ? StoreStream.Companion.getVoiceChannelSelected() : storeVoiceChannelSelected;
StoreUserProfile userProfile = (i & 32) != 0 ? StoreStream.Companion.getUserProfile() : storeUserProfile;
StoreUserRelationships userRelationships = (i & 64) != 0 ? StoreStream.Companion.getUserRelationships() : storeUserRelationships;
StoreVoiceStates voiceStates = (i & 128) != 0 ? StoreStream.Companion.getVoiceStates() : storeVoiceStates;
StoreGuilds guilds = (i & 256) != 0 ? StoreStream.Companion.getGuilds() : storeGuilds;
StoreMediaSettings mediaSettings = (i & 512) != 0 ? StoreStream.Companion.getMediaSettings() : storeMediaSettings;
StoreUserPresence presences = (i & 1024) != 0 ? StoreStream.Companion.getPresences() : storeUserPresence;
StorePermissions permissions = (i & 2048) != 0 ? StoreStream.Companion.getPermissions() : storePermissions;
StoreUserNotes usersNotes = (i & 4096) != 0 ? StoreStream.Companion.getUsersNotes() : storeUserNotes;
StoreStageChannels stageChannels = (i & 8192) != 0 ? StoreStream.Companion.getStageChannels() : storeStageChannels;
StreamContextService streamContextService2 = (i & 16384) != 0 ? new StreamContextService(null, null, null, null, null, null, null, null, 255, null) : streamContextService;
if ((i & 32768) != 0) {
Scheduler a = j0.p.a.a();
m.checkNotNullExpressionValue(a, "Schedulers.computation()");
scheduler2 = a;
} else {
scheduler2 = scheduler;
}
return widgetUserSheetViewModelStoreState.observeStoreState(j, l, users, channels, voiceChannelSelected, userProfile, userRelationships, voiceStates, guilds, mediaSettings, presences, permissions, usersNotes, stageChannels, streamContextService2, scheduler2);
}
/* JADX WARN: Multi-variable type inference failed */
/* JADX DEBUG: Type inference failed for r0v4. Raw type applied. Possible types: rx.Observable$a<T>, rx.Observable$a */
/* JADX WARNING: Unknown variable types count: 1 */
public final Observable<WidgetUserSheetViewModel.StoreState> observeStoreState(long j, Long l, StoreUser storeUser, StoreChannels storeChannels, StoreVoiceChannelSelected storeVoiceChannelSelected, StoreUserProfile storeUserProfile, StoreUserRelationships storeUserRelationships, StoreVoiceStates storeVoiceStates, StoreGuilds storeGuilds, StoreMediaSettings storeMediaSettings, StoreUserPresence storeUserPresence, StorePermissions storePermissions, StoreUserNotes storeUserNotes, StoreStageChannels storeStageChannels, StreamContextService streamContextService, Scheduler scheduler) {
Observable<Channel> observable;
m.checkNotNullParameter(storeUser, "storeUser");
m.checkNotNullParameter(storeChannels, "storeChannels");
m.checkNotNullParameter(storeVoiceChannelSelected, "storeVoiceChannelSelected");
m.checkNotNullParameter(storeUserProfile, "storeUserProfile");
m.checkNotNullParameter(storeUserRelationships, "storeUserRelationships");
m.checkNotNullParameter(storeVoiceStates, "storeVoiceStates");
m.checkNotNullParameter(storeGuilds, "storeGuilds");
m.checkNotNullParameter(storeMediaSettings, "storeMediaSettings");
m.checkNotNullParameter(storeUserPresence, "storeUserPresence");
m.checkNotNullParameter(storePermissions, "storePermissions");
m.checkNotNullParameter(storeUserNotes, "storeUserNotes");
m.checkNotNullParameter(storeStageChannels, "storeStageChannels");
m.checkNotNullParameter(streamContextService, "streamContextService");
m.checkNotNullParameter(scheduler, "storeStateRxScheduler");
Observable<User> observeUser = storeUser.observeUser(j);
Observable observeMe$default = StoreUser.observeMe$default(storeUser, false, 1, null);
if (l == null || (observable = storeChannels.observeChannel(l.longValue())) == null) {
observable = new j<>(null);
}
Observable<Channel> observeSelectedChannel = storeVoiceChannelSelected.observeSelectedChannel();
WidgetUserSheetViewModelStoreState$observeStoreState$2 widgetUserSheetViewModelStoreState$observeStoreState$2 = WidgetUserSheetViewModelStoreState$observeStoreState$2.INSTANCE;
if (widgetUserSheetViewModelStoreState$observeStoreState$2 != null) {
widgetUserSheetViewModelStoreState$observeStoreState$2 = new WidgetUserSheetViewModelStoreState$sam$rx_functions_Func4$0(widgetUserSheetViewModelStoreState$observeStoreState$2);
}
Observable<WidgetUserSheetViewModel.StoreState> s2 = Observable.i0(new r(Observable.h(observeUser, observeMe$default, observable, observeSelectedChannel, (Func4) widgetUserSheetViewModelStoreState$observeStoreState$2).Z(new WidgetUserSheetViewModelStoreState$observeStoreState$3(storeGuilds, storeVoiceStates, storeUserPresence, storePermissions, streamContextService, storeStageChannels, storeMediaSettings, storeUserProfile, storeUserRelationships, storeUserNotes)).i, new LeadingEdgeThrottle(250, TimeUnit.MILLISECONDS, scheduler))).s();
m.checkNotNullExpressionValue(s2, "Observable\n .co… .distinctUntilChanged()");
return s2;
}
}