910 lines
41 KiB
Java
910 lines
41 KiB
Java
package com.discord.widgets.voice.fullscreen;
|
|
|
|
import a0.a.a.b;
|
|
import android.content.Context;
|
|
import androidx.annotation.MainThread;
|
|
import b.d.b.a.a;
|
|
import com.discord.api.channel.Channel;
|
|
import com.discord.api.channel.ChannelUtils;
|
|
import com.discord.api.user.NsfwAllowance;
|
|
import com.discord.app.AppViewModel;
|
|
import com.discord.models.domain.ModelApplicationStream;
|
|
import com.discord.models.embeddedactivities.EmbeddedActivity;
|
|
import com.discord.stores.SelectedChannelAnalyticsLocation;
|
|
import com.discord.stores.StoreApplication;
|
|
import com.discord.stores.StoreApplicationStreamPreviews;
|
|
import com.discord.stores.StoreApplicationStreaming;
|
|
import com.discord.stores.StoreChannels;
|
|
import com.discord.stores.StoreChannelsSelected;
|
|
import com.discord.stores.StoreMediaSettings;
|
|
import com.discord.stores.StoreMentions;
|
|
import com.discord.stores.StoreNavigation;
|
|
import com.discord.stores.StoreStream;
|
|
import com.discord.stores.StoreUser;
|
|
import com.discord.stores.StoreUserSettings;
|
|
import com.discord.stores.StoreVoiceChannelSelected;
|
|
import com.discord.utilities.channel.ChannelSelector;
|
|
import com.discord.utilities.rx.ObservableExtensionsKt;
|
|
import com.discord.utilities.voice.VoiceChannelJoinability;
|
|
import com.discord.widgets.voice.model.CallModel;
|
|
import com.discord.widgets.voice.sheet.CallParticipantsAdapter;
|
|
import d0.t.u;
|
|
import d0.z.d.m;
|
|
import d0.z.d.o;
|
|
import java.util.LinkedHashSet;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Set;
|
|
import kotlin.Unit;
|
|
import kotlin.jvm.functions.Function0;
|
|
import kotlin.jvm.functions.Function1;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import rx.Observable;
|
|
import rx.subjects.PublishSubject;
|
|
/* compiled from: WidgetCallPreviewFullscreenViewModel.kt */
|
|
/* loaded from: classes2.dex */
|
|
public final class WidgetCallPreviewFullscreenViewModel extends AppViewModel<ViewState> {
|
|
public static final Companion Companion = new Companion(null);
|
|
private final PublishSubject<Event> eventSubject;
|
|
private Set<String> fetchedPreviews;
|
|
private final StoreMediaSettings mediaSettingsStore;
|
|
private StoreState mostRecentStoreState;
|
|
private final StoreApplication storeApplication;
|
|
private final StoreApplicationStreamPreviews storeApplicationStreamPreviews;
|
|
private final StoreChannels storeChannels;
|
|
private final StoreChannelsSelected storeChannelsSelected;
|
|
private final StoreMentions storeMentions;
|
|
private final StoreNavigation storeNavigation;
|
|
private final StoreUser storeUser;
|
|
private final StoreUserSettings storeUserSettings;
|
|
private final StoreVoiceChannelSelected storeVoiceChannelSelected;
|
|
private long voiceChannelId;
|
|
|
|
/* compiled from: WidgetCallPreviewFullscreenViewModel.kt */
|
|
/* renamed from: com.discord.widgets.voice.fullscreen.WidgetCallPreviewFullscreenViewModel$1 reason: invalid class name */
|
|
/* loaded from: classes2.dex */
|
|
public static final class AnonymousClass1 extends o implements Function1<StoreState, Unit> {
|
|
public AnonymousClass1() {
|
|
super(1);
|
|
}
|
|
|
|
@Override // kotlin.jvm.functions.Function1
|
|
public /* bridge */ /* synthetic */ Unit invoke(StoreState storeState) {
|
|
invoke2(storeState);
|
|
return Unit.a;
|
|
}
|
|
|
|
/* renamed from: invoke reason: avoid collision after fix types in other method */
|
|
public final void invoke2(StoreState storeState) {
|
|
WidgetCallPreviewFullscreenViewModel widgetCallPreviewFullscreenViewModel = WidgetCallPreviewFullscreenViewModel.this;
|
|
m.checkNotNullExpressionValue(storeState, "it");
|
|
WidgetCallPreviewFullscreenViewModel.access$handleStoreState(widgetCallPreviewFullscreenViewModel, storeState);
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetCallPreviewFullscreenViewModel.kt */
|
|
/* loaded from: classes2.dex */
|
|
public static final class Companion {
|
|
private Companion() {
|
|
}
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
|
|
public static final /* synthetic */ Observable access$observeStoreState(Companion companion, long j, StoreUser storeUser, StoreChannels storeChannels, StoreChannelsSelected storeChannelsSelected, StoreMentions storeMentions, StoreVoiceChannelSelected storeVoiceChannelSelected) {
|
|
return companion.observeStoreState(j, storeUser, storeChannels, storeChannelsSelected, storeMentions, storeVoiceChannelSelected);
|
|
}
|
|
|
|
private final Observable<StoreState> observeStoreState(long j, StoreUser storeUser, StoreChannels storeChannels, StoreChannelsSelected storeChannelsSelected, StoreMentions storeMentions, StoreVoiceChannelSelected storeVoiceChannelSelected) {
|
|
Observable Y = storeChannels.observeChannel(j).Y(new WidgetCallPreviewFullscreenViewModel$Companion$observeStoreState$1(storeUser, storeChannelsSelected, storeMentions, j, storeVoiceChannelSelected));
|
|
m.checkNotNullExpressionValue(Y, "storeChannels.observeCha… }\n }\n }");
|
|
return Y;
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetCallPreviewFullscreenViewModel.kt */
|
|
/* loaded from: classes2.dex */
|
|
public static abstract class Event {
|
|
|
|
/* compiled from: WidgetCallPreviewFullscreenViewModel.kt */
|
|
/* loaded from: classes2.dex */
|
|
public static final class LaunchVideoCall extends Event {
|
|
private final String autoTargetStreamKey;
|
|
private final long channelId;
|
|
|
|
public LaunchVideoCall(long j, String str) {
|
|
super(null);
|
|
this.channelId = j;
|
|
this.autoTargetStreamKey = str;
|
|
}
|
|
|
|
public static /* synthetic */ LaunchVideoCall copy$default(LaunchVideoCall launchVideoCall, long j, String str, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
j = launchVideoCall.channelId;
|
|
}
|
|
if ((i & 2) != 0) {
|
|
str = launchVideoCall.autoTargetStreamKey;
|
|
}
|
|
return launchVideoCall.copy(j, str);
|
|
}
|
|
|
|
public final long component1() {
|
|
return this.channelId;
|
|
}
|
|
|
|
public final String component2() {
|
|
return this.autoTargetStreamKey;
|
|
}
|
|
|
|
public final LaunchVideoCall copy(long j, String str) {
|
|
return new LaunchVideoCall(j, str);
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof LaunchVideoCall)) {
|
|
return false;
|
|
}
|
|
LaunchVideoCall launchVideoCall = (LaunchVideoCall) obj;
|
|
return this.channelId == launchVideoCall.channelId && m.areEqual(this.autoTargetStreamKey, launchVideoCall.autoTargetStreamKey);
|
|
}
|
|
|
|
public final String getAutoTargetStreamKey() {
|
|
return this.autoTargetStreamKey;
|
|
}
|
|
|
|
public final long getChannelId() {
|
|
return this.channelId;
|
|
}
|
|
|
|
public int hashCode() {
|
|
int a = b.a(this.channelId) * 31;
|
|
String str = this.autoTargetStreamKey;
|
|
return a + (str != null ? str.hashCode() : 0);
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder R = a.R("LaunchVideoCall(channelId=");
|
|
R.append(this.channelId);
|
|
R.append(", autoTargetStreamKey=");
|
|
return a.H(R, this.autoTargetStreamKey, ")");
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetCallPreviewFullscreenViewModel.kt */
|
|
/* loaded from: classes2.dex */
|
|
public static final class ShowGuildVideoAtCapacityDialog extends Event {
|
|
public static final ShowGuildVideoAtCapacityDialog INSTANCE = new ShowGuildVideoAtCapacityDialog();
|
|
|
|
private ShowGuildVideoAtCapacityDialog() {
|
|
super(null);
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetCallPreviewFullscreenViewModel.kt */
|
|
/* loaded from: classes2.dex */
|
|
public static final class ShowOverlayNux extends Event {
|
|
public static final ShowOverlayNux INSTANCE = new ShowOverlayNux();
|
|
|
|
private ShowOverlayNux() {
|
|
super(null);
|
|
}
|
|
}
|
|
|
|
private Event() {
|
|
}
|
|
|
|
public /* synthetic */ Event(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetCallPreviewFullscreenViewModel.kt */
|
|
/* loaded from: classes2.dex */
|
|
public static abstract class ParticipantsList {
|
|
|
|
/* compiled from: WidgetCallPreviewFullscreenViewModel.kt */
|
|
/* loaded from: classes2.dex */
|
|
public static final class Empty extends ParticipantsList {
|
|
private final List<CallParticipantsAdapter.ListItem> items;
|
|
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public Empty(List<? extends CallParticipantsAdapter.ListItem> list) {
|
|
super(null);
|
|
m.checkNotNullParameter(list, "items");
|
|
this.items = list;
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public static /* synthetic */ Empty copy$default(Empty empty, List list, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
list = empty.items;
|
|
}
|
|
return empty.copy(list);
|
|
}
|
|
|
|
public final List<CallParticipantsAdapter.ListItem> component1() {
|
|
return this.items;
|
|
}
|
|
|
|
public final Empty copy(List<? extends CallParticipantsAdapter.ListItem> list) {
|
|
m.checkNotNullParameter(list, "items");
|
|
return new Empty(list);
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this != obj) {
|
|
return (obj instanceof Empty) && m.areEqual(this.items, ((Empty) obj).items);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public final List<CallParticipantsAdapter.ListItem> getItems() {
|
|
return this.items;
|
|
}
|
|
|
|
public int hashCode() {
|
|
List<CallParticipantsAdapter.ListItem> list = this.items;
|
|
if (list != null) {
|
|
return list.hashCode();
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
public String toString() {
|
|
return a.K(a.R("Empty(items="), this.items, ")");
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetCallPreviewFullscreenViewModel.kt */
|
|
/* loaded from: classes2.dex */
|
|
public static final class ListItems extends ParticipantsList {
|
|
private final List<CallParticipantsAdapter.ListItem> items;
|
|
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public ListItems(List<? extends CallParticipantsAdapter.ListItem> list) {
|
|
super(null);
|
|
m.checkNotNullParameter(list, "items");
|
|
this.items = list;
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public static /* synthetic */ ListItems copy$default(ListItems listItems, List list, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
list = listItems.items;
|
|
}
|
|
return listItems.copy(list);
|
|
}
|
|
|
|
public final List<CallParticipantsAdapter.ListItem> component1() {
|
|
return this.items;
|
|
}
|
|
|
|
public final ListItems copy(List<? extends CallParticipantsAdapter.ListItem> list) {
|
|
m.checkNotNullParameter(list, "items");
|
|
return new ListItems(list);
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this != obj) {
|
|
return (obj instanceof ListItems) && m.areEqual(this.items, ((ListItems) obj).items);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public final List<CallParticipantsAdapter.ListItem> getItems() {
|
|
return this.items;
|
|
}
|
|
|
|
public int hashCode() {
|
|
List<CallParticipantsAdapter.ListItem> list = this.items;
|
|
if (list != null) {
|
|
return list.hashCode();
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
public String toString() {
|
|
return a.K(a.R("ListItems(items="), this.items, ")");
|
|
}
|
|
}
|
|
|
|
private ParticipantsList() {
|
|
}
|
|
|
|
public /* synthetic */ ParticipantsList(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetCallPreviewFullscreenViewModel.kt */
|
|
/* loaded from: classes2.dex */
|
|
public static abstract class StoreState {
|
|
|
|
/* compiled from: WidgetCallPreviewFullscreenViewModel.kt */
|
|
/* loaded from: classes2.dex */
|
|
public static final class Invalid extends StoreState {
|
|
public static final Invalid INSTANCE = new Invalid();
|
|
|
|
private Invalid() {
|
|
super(null);
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetCallPreviewFullscreenViewModel.kt */
|
|
/* loaded from: classes2.dex */
|
|
public static final class Valid extends StoreState {
|
|
private final CallModel callModel;
|
|
private final boolean isChannelNsfw;
|
|
private final boolean isNsfwUnconsented;
|
|
private final boolean isTextInVoiceEnabled;
|
|
private final NsfwAllowance nsfwAllowed;
|
|
private final Channel selectedTextChannel;
|
|
private final Channel selectedVoiceChannel;
|
|
private final int totalMentionsCount;
|
|
private final long userId;
|
|
private final Channel voiceChannel;
|
|
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
public Valid(long j, Channel channel, Channel channel2, boolean z2, int i, boolean z3, boolean z4, NsfwAllowance nsfwAllowance, CallModel callModel, Channel channel3) {
|
|
super(null);
|
|
m.checkNotNullParameter(channel, "voiceChannel");
|
|
m.checkNotNullParameter(channel2, "selectedTextChannel");
|
|
m.checkNotNullParameter(callModel, "callModel");
|
|
this.userId = j;
|
|
this.voiceChannel = channel;
|
|
this.selectedTextChannel = channel2;
|
|
this.isTextInVoiceEnabled = z2;
|
|
this.totalMentionsCount = i;
|
|
this.isNsfwUnconsented = z3;
|
|
this.isChannelNsfw = z4;
|
|
this.nsfwAllowed = nsfwAllowance;
|
|
this.callModel = callModel;
|
|
this.selectedVoiceChannel = channel3;
|
|
}
|
|
|
|
public static /* synthetic */ Valid copy$default(Valid valid, long j, Channel channel, Channel channel2, boolean z2, int i, boolean z3, boolean z4, NsfwAllowance nsfwAllowance, CallModel callModel, Channel channel3, int i2, Object obj) {
|
|
return valid.copy((i2 & 1) != 0 ? valid.userId : j, (i2 & 2) != 0 ? valid.voiceChannel : channel, (i2 & 4) != 0 ? valid.selectedTextChannel : channel2, (i2 & 8) != 0 ? valid.isTextInVoiceEnabled : z2, (i2 & 16) != 0 ? valid.totalMentionsCount : i, (i2 & 32) != 0 ? valid.isNsfwUnconsented : z3, (i2 & 64) != 0 ? valid.isChannelNsfw : z4, (i2 & 128) != 0 ? valid.nsfwAllowed : nsfwAllowance, (i2 & 256) != 0 ? valid.callModel : callModel, (i2 & 512) != 0 ? valid.selectedVoiceChannel : channel3);
|
|
}
|
|
|
|
public final long component1() {
|
|
return this.userId;
|
|
}
|
|
|
|
public final Channel component10() {
|
|
return this.selectedVoiceChannel;
|
|
}
|
|
|
|
public final Channel component2() {
|
|
return this.voiceChannel;
|
|
}
|
|
|
|
public final Channel component3() {
|
|
return this.selectedTextChannel;
|
|
}
|
|
|
|
public final boolean component4() {
|
|
return this.isTextInVoiceEnabled;
|
|
}
|
|
|
|
public final int component5() {
|
|
return this.totalMentionsCount;
|
|
}
|
|
|
|
public final boolean component6() {
|
|
return this.isNsfwUnconsented;
|
|
}
|
|
|
|
public final boolean component7() {
|
|
return this.isChannelNsfw;
|
|
}
|
|
|
|
public final NsfwAllowance component8() {
|
|
return this.nsfwAllowed;
|
|
}
|
|
|
|
public final CallModel component9() {
|
|
return this.callModel;
|
|
}
|
|
|
|
public final Valid copy(long j, Channel channel, Channel channel2, boolean z2, int i, boolean z3, boolean z4, NsfwAllowance nsfwAllowance, CallModel callModel, Channel channel3) {
|
|
m.checkNotNullParameter(channel, "voiceChannel");
|
|
m.checkNotNullParameter(channel2, "selectedTextChannel");
|
|
m.checkNotNullParameter(callModel, "callModel");
|
|
return new Valid(j, channel, channel2, z2, i, z3, z4, nsfwAllowance, callModel, channel3);
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof Valid)) {
|
|
return false;
|
|
}
|
|
Valid valid = (Valid) obj;
|
|
return this.userId == valid.userId && m.areEqual(this.voiceChannel, valid.voiceChannel) && m.areEqual(this.selectedTextChannel, valid.selectedTextChannel) && this.isTextInVoiceEnabled == valid.isTextInVoiceEnabled && this.totalMentionsCount == valid.totalMentionsCount && this.isNsfwUnconsented == valid.isNsfwUnconsented && this.isChannelNsfw == valid.isChannelNsfw && m.areEqual(this.nsfwAllowed, valid.nsfwAllowed) && m.areEqual(this.callModel, valid.callModel) && m.areEqual(this.selectedVoiceChannel, valid.selectedVoiceChannel);
|
|
}
|
|
|
|
public final CallModel getCallModel() {
|
|
return this.callModel;
|
|
}
|
|
|
|
public final NsfwAllowance getNsfwAllowed() {
|
|
return this.nsfwAllowed;
|
|
}
|
|
|
|
public final Channel getSelectedTextChannel() {
|
|
return this.selectedTextChannel;
|
|
}
|
|
|
|
public final Channel getSelectedVoiceChannel() {
|
|
return this.selectedVoiceChannel;
|
|
}
|
|
|
|
public final int getTotalMentionsCount() {
|
|
return this.totalMentionsCount;
|
|
}
|
|
|
|
public final long getUserId() {
|
|
return this.userId;
|
|
}
|
|
|
|
public final Channel getVoiceChannel() {
|
|
return this.voiceChannel;
|
|
}
|
|
|
|
public int hashCode() {
|
|
int a = b.a(this.userId) * 31;
|
|
Channel channel = this.voiceChannel;
|
|
int i = 0;
|
|
int hashCode = (a + (channel != null ? channel.hashCode() : 0)) * 31;
|
|
Channel channel2 = this.selectedTextChannel;
|
|
int hashCode2 = (hashCode + (channel2 != null ? channel2.hashCode() : 0)) * 31;
|
|
boolean z2 = this.isTextInVoiceEnabled;
|
|
int i2 = 1;
|
|
if (z2) {
|
|
z2 = true;
|
|
}
|
|
int i3 = z2 ? 1 : 0;
|
|
int i4 = z2 ? 1 : 0;
|
|
int i5 = z2 ? 1 : 0;
|
|
int i6 = (((hashCode2 + i3) * 31) + this.totalMentionsCount) * 31;
|
|
boolean z3 = this.isNsfwUnconsented;
|
|
if (z3) {
|
|
z3 = true;
|
|
}
|
|
int i7 = z3 ? 1 : 0;
|
|
int i8 = z3 ? 1 : 0;
|
|
int i9 = z3 ? 1 : 0;
|
|
int i10 = (i6 + i7) * 31;
|
|
boolean z4 = this.isChannelNsfw;
|
|
if (!z4) {
|
|
i2 = z4 ? 1 : 0;
|
|
}
|
|
int i11 = (i10 + i2) * 31;
|
|
NsfwAllowance nsfwAllowance = this.nsfwAllowed;
|
|
int hashCode3 = (i11 + (nsfwAllowance != null ? nsfwAllowance.hashCode() : 0)) * 31;
|
|
CallModel callModel = this.callModel;
|
|
int hashCode4 = (hashCode3 + (callModel != null ? callModel.hashCode() : 0)) * 31;
|
|
Channel channel3 = this.selectedVoiceChannel;
|
|
if (channel3 != null) {
|
|
i = channel3.hashCode();
|
|
}
|
|
return hashCode4 + i;
|
|
}
|
|
|
|
public final boolean isChannelNsfw() {
|
|
return this.isChannelNsfw;
|
|
}
|
|
|
|
public final boolean isNsfwUnconsented() {
|
|
return this.isNsfwUnconsented;
|
|
}
|
|
|
|
public final boolean isTextInVoiceEnabled() {
|
|
return this.isTextInVoiceEnabled;
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder R = a.R("Valid(userId=");
|
|
R.append(this.userId);
|
|
R.append(", voiceChannel=");
|
|
R.append(this.voiceChannel);
|
|
R.append(", selectedTextChannel=");
|
|
R.append(this.selectedTextChannel);
|
|
R.append(", isTextInVoiceEnabled=");
|
|
R.append(this.isTextInVoiceEnabled);
|
|
R.append(", totalMentionsCount=");
|
|
R.append(this.totalMentionsCount);
|
|
R.append(", isNsfwUnconsented=");
|
|
R.append(this.isNsfwUnconsented);
|
|
R.append(", isChannelNsfw=");
|
|
R.append(this.isChannelNsfw);
|
|
R.append(", nsfwAllowed=");
|
|
R.append(this.nsfwAllowed);
|
|
R.append(", callModel=");
|
|
R.append(this.callModel);
|
|
R.append(", selectedVoiceChannel=");
|
|
R.append(this.selectedVoiceChannel);
|
|
R.append(")");
|
|
return R.toString();
|
|
}
|
|
}
|
|
|
|
private StoreState() {
|
|
}
|
|
|
|
public /* synthetic */ StoreState(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetCallPreviewFullscreenViewModel.kt */
|
|
/* loaded from: classes2.dex */
|
|
public static final class ViewState {
|
|
private final boolean isChannelNsfw;
|
|
private final boolean isConnectEnabled;
|
|
private final boolean isNsfwUnconsented;
|
|
private final boolean isTextInVoiceChannelSelected;
|
|
private final NsfwAllowance nsfwAllowed;
|
|
private final ParticipantsList participantsList;
|
|
private final boolean textInVoiceEnabled;
|
|
private final String titleText;
|
|
private final int totalMentionsCount;
|
|
private final Channel voiceChannel;
|
|
|
|
public ViewState(Channel channel, boolean z2, boolean z3, String str, int i, boolean z4, ParticipantsList participantsList, boolean z5, boolean z6, NsfwAllowance nsfwAllowance) {
|
|
m.checkNotNullParameter(channel, "voiceChannel");
|
|
m.checkNotNullParameter(participantsList, "participantsList");
|
|
this.voiceChannel = channel;
|
|
this.isTextInVoiceChannelSelected = z2;
|
|
this.textInVoiceEnabled = z3;
|
|
this.titleText = str;
|
|
this.totalMentionsCount = i;
|
|
this.isConnectEnabled = z4;
|
|
this.participantsList = participantsList;
|
|
this.isNsfwUnconsented = z5;
|
|
this.isChannelNsfw = z6;
|
|
this.nsfwAllowed = nsfwAllowance;
|
|
}
|
|
|
|
public static /* synthetic */ ViewState copy$default(ViewState viewState, Channel channel, boolean z2, boolean z3, String str, int i, boolean z4, ParticipantsList participantsList, boolean z5, boolean z6, NsfwAllowance nsfwAllowance, int i2, Object obj) {
|
|
return viewState.copy((i2 & 1) != 0 ? viewState.voiceChannel : channel, (i2 & 2) != 0 ? viewState.isTextInVoiceChannelSelected : z2, (i2 & 4) != 0 ? viewState.textInVoiceEnabled : z3, (i2 & 8) != 0 ? viewState.titleText : str, (i2 & 16) != 0 ? viewState.totalMentionsCount : i, (i2 & 32) != 0 ? viewState.isConnectEnabled : z4, (i2 & 64) != 0 ? viewState.participantsList : participantsList, (i2 & 128) != 0 ? viewState.isNsfwUnconsented : z5, (i2 & 256) != 0 ? viewState.isChannelNsfw : z6, (i2 & 512) != 0 ? viewState.nsfwAllowed : nsfwAllowance);
|
|
}
|
|
|
|
public final Channel component1() {
|
|
return this.voiceChannel;
|
|
}
|
|
|
|
public final NsfwAllowance component10() {
|
|
return this.nsfwAllowed;
|
|
}
|
|
|
|
public final boolean component2() {
|
|
return this.isTextInVoiceChannelSelected;
|
|
}
|
|
|
|
public final boolean component3() {
|
|
return this.textInVoiceEnabled;
|
|
}
|
|
|
|
public final String component4() {
|
|
return this.titleText;
|
|
}
|
|
|
|
public final int component5() {
|
|
return this.totalMentionsCount;
|
|
}
|
|
|
|
public final boolean component6() {
|
|
return this.isConnectEnabled;
|
|
}
|
|
|
|
public final ParticipantsList component7() {
|
|
return this.participantsList;
|
|
}
|
|
|
|
public final boolean component8() {
|
|
return this.isNsfwUnconsented;
|
|
}
|
|
|
|
public final boolean component9() {
|
|
return this.isChannelNsfw;
|
|
}
|
|
|
|
public final ViewState copy(Channel channel, boolean z2, boolean z3, String str, int i, boolean z4, ParticipantsList participantsList, boolean z5, boolean z6, NsfwAllowance nsfwAllowance) {
|
|
m.checkNotNullParameter(channel, "voiceChannel");
|
|
m.checkNotNullParameter(participantsList, "participantsList");
|
|
return new ViewState(channel, z2, z3, str, i, z4, participantsList, z5, z6, nsfwAllowance);
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof ViewState)) {
|
|
return false;
|
|
}
|
|
ViewState viewState = (ViewState) obj;
|
|
return m.areEqual(this.voiceChannel, viewState.voiceChannel) && this.isTextInVoiceChannelSelected == viewState.isTextInVoiceChannelSelected && this.textInVoiceEnabled == viewState.textInVoiceEnabled && m.areEqual(this.titleText, viewState.titleText) && this.totalMentionsCount == viewState.totalMentionsCount && this.isConnectEnabled == viewState.isConnectEnabled && m.areEqual(this.participantsList, viewState.participantsList) && this.isNsfwUnconsented == viewState.isNsfwUnconsented && this.isChannelNsfw == viewState.isChannelNsfw && m.areEqual(this.nsfwAllowed, viewState.nsfwAllowed);
|
|
}
|
|
|
|
public final NsfwAllowance getNsfwAllowed() {
|
|
return this.nsfwAllowed;
|
|
}
|
|
|
|
public final ParticipantsList getParticipantsList() {
|
|
return this.participantsList;
|
|
}
|
|
|
|
public final boolean getTextInVoiceEnabled() {
|
|
return this.textInVoiceEnabled;
|
|
}
|
|
|
|
public final String getTitleText() {
|
|
return this.titleText;
|
|
}
|
|
|
|
public final int getTotalMentionsCount() {
|
|
return this.totalMentionsCount;
|
|
}
|
|
|
|
public final Channel getVoiceChannel() {
|
|
return this.voiceChannel;
|
|
}
|
|
|
|
public int hashCode() {
|
|
Channel channel = this.voiceChannel;
|
|
int i = 0;
|
|
int hashCode = (channel != null ? channel.hashCode() : 0) * 31;
|
|
boolean z2 = this.isTextInVoiceChannelSelected;
|
|
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.textInVoiceEnabled;
|
|
if (z3) {
|
|
z3 = true;
|
|
}
|
|
int i7 = z3 ? 1 : 0;
|
|
int i8 = z3 ? 1 : 0;
|
|
int i9 = z3 ? 1 : 0;
|
|
int i10 = (i6 + i7) * 31;
|
|
String str = this.titleText;
|
|
int hashCode2 = (((i10 + (str != null ? str.hashCode() : 0)) * 31) + this.totalMentionsCount) * 31;
|
|
boolean z4 = this.isConnectEnabled;
|
|
if (z4) {
|
|
z4 = true;
|
|
}
|
|
int i11 = z4 ? 1 : 0;
|
|
int i12 = z4 ? 1 : 0;
|
|
int i13 = z4 ? 1 : 0;
|
|
int i14 = (hashCode2 + i11) * 31;
|
|
ParticipantsList participantsList = this.participantsList;
|
|
int hashCode3 = (i14 + (participantsList != null ? participantsList.hashCode() : 0)) * 31;
|
|
boolean z5 = this.isNsfwUnconsented;
|
|
if (z5) {
|
|
z5 = true;
|
|
}
|
|
int i15 = z5 ? 1 : 0;
|
|
int i16 = z5 ? 1 : 0;
|
|
int i17 = z5 ? 1 : 0;
|
|
int i18 = (hashCode3 + i15) * 31;
|
|
boolean z6 = this.isChannelNsfw;
|
|
if (!z6) {
|
|
i2 = z6 ? 1 : 0;
|
|
}
|
|
int i19 = (i18 + i2) * 31;
|
|
NsfwAllowance nsfwAllowance = this.nsfwAllowed;
|
|
if (nsfwAllowance != null) {
|
|
i = nsfwAllowance.hashCode();
|
|
}
|
|
return i19 + i;
|
|
}
|
|
|
|
public final boolean isChannelNsfw() {
|
|
return this.isChannelNsfw;
|
|
}
|
|
|
|
public final boolean isConnectEnabled() {
|
|
return this.isConnectEnabled;
|
|
}
|
|
|
|
public final boolean isNsfwUnconsented() {
|
|
return this.isNsfwUnconsented;
|
|
}
|
|
|
|
public final boolean isTextInVoiceChannelSelected() {
|
|
return this.isTextInVoiceChannelSelected;
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder R = a.R("ViewState(voiceChannel=");
|
|
R.append(this.voiceChannel);
|
|
R.append(", isTextInVoiceChannelSelected=");
|
|
R.append(this.isTextInVoiceChannelSelected);
|
|
R.append(", textInVoiceEnabled=");
|
|
R.append(this.textInVoiceEnabled);
|
|
R.append(", titleText=");
|
|
R.append(this.titleText);
|
|
R.append(", totalMentionsCount=");
|
|
R.append(this.totalMentionsCount);
|
|
R.append(", isConnectEnabled=");
|
|
R.append(this.isConnectEnabled);
|
|
R.append(", participantsList=");
|
|
R.append(this.participantsList);
|
|
R.append(", isNsfwUnconsented=");
|
|
R.append(this.isNsfwUnconsented);
|
|
R.append(", isChannelNsfw=");
|
|
R.append(this.isChannelNsfw);
|
|
R.append(", nsfwAllowed=");
|
|
R.append(this.nsfwAllowed);
|
|
R.append(")");
|
|
return R.toString();
|
|
}
|
|
}
|
|
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
public WidgetCallPreviewFullscreenViewModel(long j, StoreChannels storeChannels, StoreMentions storeMentions, StoreNavigation storeNavigation, StoreUserSettings storeUserSettings, StoreVoiceChannelSelected storeVoiceChannelSelected, StoreChannelsSelected storeChannelsSelected, StoreApplicationStreamPreviews storeApplicationStreamPreviews, StoreApplication storeApplication, StoreUser storeUser, Observable<StoreState> observable, StoreMediaSettings storeMediaSettings) {
|
|
super(null, 1, null);
|
|
m.checkNotNullParameter(storeChannels, "storeChannels");
|
|
m.checkNotNullParameter(storeMentions, "storeMentions");
|
|
m.checkNotNullParameter(storeNavigation, "storeNavigation");
|
|
m.checkNotNullParameter(storeUserSettings, "storeUserSettings");
|
|
m.checkNotNullParameter(storeVoiceChannelSelected, "storeVoiceChannelSelected");
|
|
m.checkNotNullParameter(storeChannelsSelected, "storeChannelsSelected");
|
|
m.checkNotNullParameter(storeApplicationStreamPreviews, "storeApplicationStreamPreviews");
|
|
m.checkNotNullParameter(storeApplication, "storeApplication");
|
|
m.checkNotNullParameter(storeUser, "storeUser");
|
|
m.checkNotNullParameter(observable, "storeStateObservable");
|
|
m.checkNotNullParameter(storeMediaSettings, "mediaSettingsStore");
|
|
this.voiceChannelId = j;
|
|
this.storeChannels = storeChannels;
|
|
this.storeMentions = storeMentions;
|
|
this.storeNavigation = storeNavigation;
|
|
this.storeUserSettings = storeUserSettings;
|
|
this.storeVoiceChannelSelected = storeVoiceChannelSelected;
|
|
this.storeChannelsSelected = storeChannelsSelected;
|
|
this.storeApplicationStreamPreviews = storeApplicationStreamPreviews;
|
|
this.storeApplication = storeApplication;
|
|
this.storeUser = storeUser;
|
|
this.mediaSettingsStore = storeMediaSettings;
|
|
this.eventSubject = PublishSubject.k0();
|
|
this.fetchedPreviews = new LinkedHashSet();
|
|
Observable q = ObservableExtensionsKt.ui$default(ObservableExtensionsKt.computationLatest(observable), this, null, 2, null).q();
|
|
m.checkNotNullExpressionValue(q, "storeStateObservable\n … .distinctUntilChanged()");
|
|
ObservableExtensionsKt.appSubscribe$default(q, WidgetCallPreviewFullscreenViewModel.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new AnonymousClass1(), 62, (Object) null);
|
|
}
|
|
|
|
/* JADX WARN: Illegal instructions before constructor call */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
*/
|
|
public /* synthetic */ WidgetCallPreviewFullscreenViewModel(long j, StoreChannels storeChannels, StoreMentions storeMentions, StoreNavigation storeNavigation, StoreUserSettings storeUserSettings, StoreVoiceChannelSelected storeVoiceChannelSelected, StoreChannelsSelected storeChannelsSelected, StoreApplicationStreamPreviews storeApplicationStreamPreviews, StoreApplication storeApplication, StoreUser storeUser, Observable observable, StoreMediaSettings storeMediaSettings, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
|
this(j, r5, r6, r7, r8, r9, r10, r11, r12, r13, (i & 1024) != 0 ? Companion.access$observeStoreState(Companion, j, r13, r5, r10, r6, r9) : observable, (i & 2048) != 0 ? StoreStream.Companion.getMediaSettings() : storeMediaSettings);
|
|
StoreChannels channels = (i & 2) != 0 ? StoreStream.Companion.getChannels() : storeChannels;
|
|
StoreMentions mentions = (i & 4) != 0 ? StoreStream.Companion.getMentions() : storeMentions;
|
|
StoreNavigation navigation = (i & 8) != 0 ? StoreStream.Companion.getNavigation() : storeNavigation;
|
|
StoreUserSettings userSettings = (i & 16) != 0 ? StoreStream.Companion.getUserSettings() : storeUserSettings;
|
|
StoreVoiceChannelSelected voiceChannelSelected = (i & 32) != 0 ? StoreStream.Companion.getVoiceChannelSelected() : storeVoiceChannelSelected;
|
|
StoreChannelsSelected channelsSelected = (i & 64) != 0 ? StoreStream.Companion.getChannelsSelected() : storeChannelsSelected;
|
|
StoreApplicationStreamPreviews applicationStreamPreviews = (i & 128) != 0 ? StoreStream.Companion.getApplicationStreamPreviews() : storeApplicationStreamPreviews;
|
|
StoreApplication application = (i & 256) != 0 ? StoreStream.Companion.getApplication() : storeApplication;
|
|
StoreUser users = (i & 512) != 0 ? StoreStream.Companion.getUsers() : storeUser;
|
|
}
|
|
|
|
public static final /* synthetic */ void access$handleStoreState(WidgetCallPreviewFullscreenViewModel widgetCallPreviewFullscreenViewModel, StoreState storeState) {
|
|
widgetCallPreviewFullscreenViewModel.handleStoreState(storeState);
|
|
}
|
|
|
|
private final void handleStoreState(StoreState storeState) {
|
|
ModelApplicationStream stream;
|
|
if (storeState instanceof StoreState.Valid) {
|
|
this.mostRecentStoreState = storeState;
|
|
StoreState.Valid valid = (StoreState.Valid) storeState;
|
|
Map<Long, EmbeddedActivity> embeddedActivitiesForChannel = valid.getCallModel().getEmbeddedActivitiesForChannel();
|
|
StoreApplicationStreaming.ActiveApplicationStream activeStream = valid.getCallModel().getActiveStream();
|
|
List<CallParticipantsAdapter.ListItem> createConnectedListItems = ParticipantsListItemGenerator.Companion.createConnectedListItems(valid.getCallModel().getParticipants(), (activeStream == null || (stream = activeStream.getStream()) == null) ? null : stream.getEncodedStreamKey(), valid.getVoiceChannel(), valid.getCallModel(), u.toList(embeddedActivitiesForChannel.values()), valid.getCallModel().getApplications());
|
|
Channel selectedVoiceChannel = valid.getSelectedVoiceChannel();
|
|
if (selectedVoiceChannel != null) {
|
|
long h = selectedVoiceChannel.h();
|
|
long j = this.voiceChannelId;
|
|
if (h == j) {
|
|
this.eventSubject.k.onNext(new Event.LaunchVideoCall(j, null));
|
|
return;
|
|
}
|
|
}
|
|
for (Long l : embeddedActivitiesForChannel.keySet()) {
|
|
this.storeApplication.fetchIfNonexisting(l.longValue());
|
|
}
|
|
updateViewState(new ViewState(valid.getVoiceChannel(), ChannelUtils.E(valid.getSelectedTextChannel()), valid.isTextInVoiceEnabled(), ChannelUtils.c(valid.getVoiceChannel()), valid.getTotalMentionsCount(), valid.getCallModel().getVoiceChannelJoinability() != VoiceChannelJoinability.PERMISSIONS_MISSING, ParticipantsListItemGenerator.Companion.refreshStreams(createConnectedListItems, this.fetchedPreviews, this.storeApplicationStreamPreviews) ? new ParticipantsList.ListItems(createConnectedListItems) : new ParticipantsList.Empty(createConnectedListItems), valid.isNsfwUnconsented(), valid.isChannelNsfw(), valid.getNsfwAllowed()));
|
|
}
|
|
}
|
|
|
|
@MainThread
|
|
private final void joinVoiceChannel(long j) {
|
|
this.storeVoiceChannelSelected.selectVoiceChannel(j);
|
|
PublishSubject<Event> publishSubject = this.eventSubject;
|
|
publishSubject.k.onNext(new Event.LaunchVideoCall(this.voiceChannelId, null));
|
|
}
|
|
|
|
public static /* synthetic */ void tryConnectToVoice$default(WidgetCallPreviewFullscreenViewModel widgetCallPreviewFullscreenViewModel, boolean z2, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
z2 = false;
|
|
}
|
|
widgetCallPreviewFullscreenViewModel.tryConnectToVoice(z2);
|
|
}
|
|
|
|
public final Observable<Event> observeEvents() {
|
|
PublishSubject<Event> publishSubject = this.eventSubject;
|
|
m.checkNotNullExpressionValue(publishSubject, "eventSubject");
|
|
return publishSubject;
|
|
}
|
|
|
|
@MainThread
|
|
public final void onStreamPreviewClicked(String str) {
|
|
m.checkNotNullParameter(str, "streamKey");
|
|
StoreState storeState = this.mostRecentStoreState;
|
|
if (!(storeState instanceof StoreState.Valid)) {
|
|
storeState = null;
|
|
}
|
|
StoreState.Valid valid = (StoreState.Valid) storeState;
|
|
if (valid == null) {
|
|
return;
|
|
}
|
|
if (valid.getCallModel().getVoiceChannelJoinability() == VoiceChannelJoinability.GUILD_VIDEO_AT_CAPACITY) {
|
|
PublishSubject<Event> publishSubject = this.eventSubject;
|
|
publishSubject.k.onNext(Event.ShowGuildVideoAtCapacityDialog.INSTANCE);
|
|
return;
|
|
}
|
|
ModelApplicationStream decodeStreamKey = ModelApplicationStream.Companion.decodeStreamKey(str);
|
|
PublishSubject<Event> publishSubject2 = this.eventSubject;
|
|
publishSubject2.k.onNext(new Event.LaunchVideoCall(decodeStreamKey.getChannelId(), str));
|
|
}
|
|
|
|
@MainThread
|
|
public final void onTextInVoiceTapped() {
|
|
ViewState viewState = getViewState();
|
|
ChannelSelector.selectChannel$default(ChannelSelector.Companion.getInstance(), viewState != null ? viewState.getVoiceChannel() : null, null, SelectedChannelAnalyticsLocation.TEXT_IN_VOICE, 2, null);
|
|
StoreNavigation.setNavigationPanelAction$default(this.storeNavigation, StoreNavigation.PanelAction.CLOSE, null, 2, null);
|
|
}
|
|
|
|
public final void selectTextChannelAfterFinish() {
|
|
Channel voiceChannel;
|
|
ViewState viewState = getViewState();
|
|
if (viewState != null && (voiceChannel = viewState.getVoiceChannel()) != null) {
|
|
long f = voiceChannel.f();
|
|
if (viewState.isTextInVoiceChannelSelected()) {
|
|
ChannelSelector.Companion.getInstance().selectPreviousChannel(f);
|
|
}
|
|
}
|
|
}
|
|
|
|
@MainThread
|
|
public final void tryConnectToVoice(boolean z2) {
|
|
StoreState storeState = this.mostRecentStoreState;
|
|
if (storeState instanceof StoreState.Valid) {
|
|
if (((StoreState.Valid) storeState).getCallModel().getVoiceChannelJoinability() == VoiceChannelJoinability.GUILD_VIDEO_AT_CAPACITY) {
|
|
this.eventSubject.k.onNext(Event.ShowGuildVideoAtCapacityDialog.INSTANCE);
|
|
return;
|
|
}
|
|
if (!this.storeUserSettings.getIsMobileOverlayEnabled()) {
|
|
this.eventSubject.k.onNext(Event.ShowOverlayNux.INSTANCE);
|
|
}
|
|
if (z2) {
|
|
this.mediaSettingsStore.setSelfMuted(true);
|
|
}
|
|
joinVoiceChannel(this.voiceChannelId);
|
|
}
|
|
}
|
|
}
|