2021-12-17 21:59:34 +00:00
|
|
|
package b.a.a;
|
2021-07-24 02:37:17 +00:00
|
|
|
|
2022-03-12 00:35:13 +00:00
|
|
|
import android.content.Context;
|
|
|
|
import com.discord.app.AppViewModel;
|
|
|
|
import com.discord.models.user.User;
|
|
|
|
import com.discord.stores.StoreStream;
|
|
|
|
import com.discord.stores.StoreUser;
|
|
|
|
import com.discord.utilities.rest.RestAPI;
|
|
|
|
import com.discord.utilities.rx.ObservableExtensionsKt;
|
2021-11-02 06:38:17 +00:00
|
|
|
import d0.z.d.m;
|
2022-03-12 00:35:13 +00:00
|
|
|
import kotlin.jvm.functions.Function0;
|
2021-07-24 02:37:17 +00:00
|
|
|
import kotlin.jvm.functions.Function1;
|
2022-03-12 00:35:13 +00:00
|
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
|
|
import rx.Observable;
|
2021-07-24 02:37:17 +00:00
|
|
|
import rx.subjects.PublishSubject;
|
|
|
|
/* compiled from: WidgetUrgentMessageDialogViewModel.kt */
|
2022-03-07 09:34:54 +00:00
|
|
|
/* loaded from: classes.dex */
|
2022-03-12 00:35:13 +00:00
|
|
|
public final class x extends AppViewModel<d> {
|
|
|
|
public static final a j = new a(null);
|
|
|
|
public final PublishSubject<b> k;
|
|
|
|
public final RestAPI l;
|
2021-07-24 02:37:17 +00:00
|
|
|
|
2022-03-12 00:35:13 +00:00
|
|
|
/* compiled from: WidgetUrgentMessageDialogViewModel.kt */
|
|
|
|
/* loaded from: classes.dex */
|
|
|
|
public static final class a {
|
|
|
|
public a(DefaultConstructorMarker defaultConstructorMarker) {
|
|
|
|
}
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
|
2022-03-12 00:35:13 +00:00
|
|
|
/* compiled from: WidgetUrgentMessageDialogViewModel.kt */
|
|
|
|
/* loaded from: classes.dex */
|
|
|
|
public static abstract class b {
|
|
|
|
|
|
|
|
/* compiled from: WidgetUrgentMessageDialogViewModel.kt */
|
|
|
|
/* loaded from: classes.dex */
|
|
|
|
public static final class a extends b {
|
|
|
|
public static final a a = new a();
|
|
|
|
|
|
|
|
public a() {
|
|
|
|
super(null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: WidgetUrgentMessageDialogViewModel.kt */
|
|
|
|
/* renamed from: b.a.a.x$b$b reason: collision with other inner class name */
|
|
|
|
/* loaded from: classes.dex */
|
|
|
|
public static final class C0027b extends b {
|
|
|
|
public static final C0027b a = new C0027b();
|
|
|
|
|
|
|
|
public C0027b() {
|
|
|
|
super(null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public b() {
|
|
|
|
}
|
|
|
|
|
|
|
|
public b(DefaultConstructorMarker defaultConstructorMarker) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: WidgetUrgentMessageDialogViewModel.kt */
|
|
|
|
/* loaded from: classes.dex */
|
|
|
|
public static final class c {
|
|
|
|
public final User a;
|
|
|
|
|
|
|
|
public c(User user) {
|
|
|
|
m.checkNotNullParameter(user, "user");
|
|
|
|
this.a = user;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean equals(Object obj) {
|
|
|
|
if (this != obj) {
|
|
|
|
return (obj instanceof c) && m.areEqual(this.a, ((c) obj).a);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int hashCode() {
|
|
|
|
User user = this.a;
|
|
|
|
if (user != null) {
|
|
|
|
return user.hashCode();
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String toString() {
|
2022-03-21 18:52:30 +00:00
|
|
|
StringBuilder R = b.d.b.a.a.R("StoreState(user=");
|
|
|
|
R.append(this.a);
|
|
|
|
R.append(")");
|
|
|
|
return R.toString();
|
2022-03-12 00:35:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: WidgetUrgentMessageDialogViewModel.kt */
|
|
|
|
/* loaded from: classes.dex */
|
|
|
|
public static final class d {
|
|
|
|
public final Integer a;
|
|
|
|
|
|
|
|
/* renamed from: b reason: collision with root package name */
|
|
|
|
public final boolean f50b;
|
|
|
|
|
|
|
|
public d(Integer num, boolean z2) {
|
|
|
|
this.a = num;
|
|
|
|
this.f50b = z2;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean equals(Object obj) {
|
|
|
|
if (this == obj) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (!(obj instanceof d)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
d dVar = (d) obj;
|
|
|
|
return m.areEqual(this.a, dVar.a) && this.f50b == dVar.f50b;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int hashCode() {
|
|
|
|
Integer num = this.a;
|
|
|
|
int hashCode = (num != null ? num.hashCode() : 0) * 31;
|
|
|
|
boolean z2 = this.f50b;
|
|
|
|
if (z2) {
|
|
|
|
z2 = true;
|
|
|
|
}
|
|
|
|
int i = z2 ? 1 : 0;
|
|
|
|
int i2 = z2 ? 1 : 0;
|
|
|
|
int i3 = z2 ? 1 : 0;
|
|
|
|
return hashCode + i;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String toString() {
|
2022-03-21 18:52:30 +00:00
|
|
|
StringBuilder R = b.d.b.a.a.R("ViewState(userFlags=");
|
|
|
|
R.append(this.a);
|
|
|
|
R.append(", isBusy=");
|
|
|
|
return b.d.b.a.a.M(R, this.f50b, ")");
|
2022-03-12 00:35:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public x() {
|
|
|
|
this(null, null, null, 7);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
|
|
|
public x(RestAPI restAPI, StoreUser storeUser, Observable observable, int i) {
|
|
|
|
super(null, 1, null);
|
|
|
|
Observable observable2;
|
|
|
|
RestAPI api = (i & 1) != 0 ? RestAPI.Companion.getApi() : null;
|
|
|
|
StoreUser users = (i & 2) != 0 ? StoreStream.Companion.getUsers() : null;
|
|
|
|
if ((i & 4) != 0) {
|
2022-03-21 18:52:30 +00:00
|
|
|
observable2 = StoreUser.observeMe$default(users, false, 1, null).G(w.j);
|
2022-03-12 00:35:13 +00:00
|
|
|
m.checkNotNullExpressionValue(observable2, "storeUser.observeMe().ma…oreState(user = meUser) }");
|
|
|
|
} else {
|
|
|
|
observable2 = null;
|
|
|
|
}
|
|
|
|
m.checkNotNullParameter(api, "restAPI");
|
|
|
|
m.checkNotNullParameter(users, "storeUser");
|
|
|
|
m.checkNotNullParameter(observable2, "storeObservable");
|
|
|
|
this.l = api;
|
|
|
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(ObservableExtensionsKt.computationLatest(observable2), this, null, 2, null), x.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new v(this), 62, (Object) null);
|
|
|
|
this.k = PublishSubject.k0();
|
2021-07-24 02:37:17 +00:00
|
|
|
}
|
|
|
|
}
|