2021-06-27 20:44:35 +00:00
|
|
|
package com.discord.stores;
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
import androidx.fragment.app.FragmentManager;
|
|
|
|
import com.discord.app.AppComponent;
|
|
|
|
import com.discord.models.domain.ModelCall;
|
|
|
|
import com.discord.utilities.error.Error;
|
|
|
|
import com.discord.utilities.rest.RestAPI;
|
|
|
|
import com.discord.utilities.rx.ObservableExtensionsKt;
|
|
|
|
import com.discord.widgets.voice.call.WidgetCallFailed;
|
|
|
|
import d0.z.d.m;
|
|
|
|
import d0.z.d.o;
|
|
|
|
import j0.k.b;
|
|
|
|
import j0.l.e.j;
|
|
|
|
import kotlin.Unit;
|
|
|
|
import kotlin.jvm.functions.Function0;
|
|
|
|
import kotlin.jvm.functions.Function1;
|
|
|
|
import rx.Observable;
|
|
|
|
/* compiled from: StoreCalls.kt */
|
|
|
|
public final class StoreCalls$call$2 extends o implements Function1<Long, Unit> {
|
|
|
|
public final /* synthetic */ AppComponent $appComponent;
|
|
|
|
public final /* synthetic */ long $channelId;
|
|
|
|
public final /* synthetic */ Context $context;
|
|
|
|
public final /* synthetic */ StoreCalls$call$1 $doCall$1;
|
|
|
|
public final /* synthetic */ FragmentManager $fragmentManager;
|
|
|
|
public final /* synthetic */ Function0 $onError;
|
|
|
|
public final /* synthetic */ StoreCalls this$0;
|
|
|
|
|
|
|
|
/* compiled from: StoreCalls.kt */
|
|
|
|
/* renamed from: com.discord.stores.StoreCalls$call$2$1 reason: invalid class name */
|
|
|
|
public static final class AnonymousClass1<T, R> implements b<Integer, Observable<? extends Boolean>> {
|
|
|
|
public final /* synthetic */ StoreCalls$call$2 this$0;
|
|
|
|
|
|
|
|
/* compiled from: StoreCalls.kt */
|
|
|
|
/* renamed from: com.discord.stores.StoreCalls$call$2$1$1 reason: invalid class name */
|
|
|
|
public static final class AnonymousClass1<T, R> implements b<ModelCall.Ringable, Boolean> {
|
|
|
|
public static final AnonymousClass1 INSTANCE = new AnonymousClass1();
|
|
|
|
|
|
|
|
public final Boolean call(ModelCall.Ringable ringable) {
|
|
|
|
m.checkNotNullExpressionValue(ringable, "it");
|
|
|
|
return Boolean.valueOf(ringable.isRingable());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public AnonymousClass1(StoreCalls$call$2 storeCalls$call$2) {
|
|
|
|
this.this$0 = storeCalls$call$2;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Observable<? extends Boolean> call(Integer num) {
|
2021-07-03 23:36:06 +00:00
|
|
|
return (num != null && num.intValue() == 1) ? new j(Boolean.TRUE) : ObservableExtensionsKt.restSubscribeOn$default(RestAPI.Companion.getApi().call(this.this$0.$channelId), false, 1, null).F(AnonymousClass1.INSTANCE);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: StoreCalls.kt */
|
|
|
|
/* renamed from: com.discord.stores.StoreCalls$call$2$2 reason: invalid class name */
|
|
|
|
public static final class AnonymousClass2 extends o implements Function1<Boolean, Unit> {
|
|
|
|
public final /* synthetic */ StoreCalls$call$2 this$0;
|
|
|
|
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
|
|
public AnonymousClass2(StoreCalls$call$2 storeCalls$call$2) {
|
|
|
|
super(1);
|
|
|
|
this.this$0 = storeCalls$call$2;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 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] */
|
|
|
|
@Override // kotlin.jvm.functions.Function1
|
|
|
|
public /* bridge */ /* synthetic */ Unit invoke(Boolean bool) {
|
|
|
|
invoke(bool);
|
|
|
|
return Unit.a;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void invoke(Boolean bool) {
|
|
|
|
StoreCalls$call$1 storeCalls$call$1 = this.this$0.$doCall$1;
|
|
|
|
m.checkNotNullExpressionValue(bool, "isRingable");
|
|
|
|
storeCalls$call$1.invoke(bool.booleanValue());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: StoreCalls.kt */
|
|
|
|
/* renamed from: com.discord.stores.StoreCalls$call$2$3 reason: invalid class name */
|
|
|
|
public static final class AnonymousClass3 extends o implements Function1<Error, Unit> {
|
|
|
|
public final /* synthetic */ long $userId;
|
|
|
|
public final /* synthetic */ StoreCalls$call$2 this$0;
|
|
|
|
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
|
|
public AnonymousClass3(StoreCalls$call$2 storeCalls$call$2, long j) {
|
|
|
|
super(1);
|
|
|
|
this.this$0 = storeCalls$call$2;
|
|
|
|
this.$userId = j;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 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] */
|
|
|
|
@Override // kotlin.jvm.functions.Function1
|
|
|
|
public /* bridge */ /* synthetic */ Unit invoke(Error error) {
|
|
|
|
invoke(error);
|
|
|
|
return Unit.a;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void invoke(Error error) {
|
|
|
|
m.checkNotNullParameter(error, "error");
|
|
|
|
Function0 function0 = this.this$0.$onError;
|
|
|
|
if (function0 != null) {
|
|
|
|
Unit unit = (Unit) function0.mo1invoke();
|
|
|
|
}
|
|
|
|
Error.Response response = error.getResponse();
|
|
|
|
m.checkNotNullExpressionValue(response, "error.response");
|
|
|
|
if (response.getCode() == 50013) {
|
|
|
|
error.setShowErrorToasts(false);
|
|
|
|
WidgetCallFailed.Companion.show(this.this$0.$fragmentManager, this.$userId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
|
|
public StoreCalls$call$2(StoreCalls storeCalls, long j, AppComponent appComponent, Context context, StoreCalls$call$1 storeCalls$call$1, Function0 function0, FragmentManager fragmentManager) {
|
|
|
|
super(1);
|
|
|
|
this.this$0 = storeCalls;
|
|
|
|
this.$channelId = j;
|
|
|
|
this.$appComponent = appComponent;
|
|
|
|
this.$context = context;
|
|
|
|
this.$doCall$1 = storeCalls$call$1;
|
|
|
|
this.$onError = function0;
|
|
|
|
this.$fragmentManager = fragmentManager;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 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] */
|
|
|
|
@Override // kotlin.jvm.functions.Function1
|
|
|
|
public /* bridge */ /* synthetic */ Unit invoke(Long l) {
|
|
|
|
invoke(l.longValue());
|
|
|
|
return Unit.a;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void invoke(long j) {
|
2021-07-03 23:36:06 +00:00
|
|
|
Observable<R> z2 = StoreStream.Companion.getUserRelationships().observe(j).z(new AnonymousClass1(this));
|
|
|
|
m.checkNotNullExpressionValue(z2, "StoreStream\n .g… }\n }");
|
|
|
|
Observable ui$default = ObservableExtensionsKt.ui$default(ObservableExtensionsKt.takeSingleUntilTimeout$default(z2, 0, false, 3, null), this.$appComponent, null, 2, null);
|
2021-06-27 20:44:35 +00:00
|
|
|
Context context = this.$context;
|
|
|
|
ObservableExtensionsKt.appSubscribe$default(ui$default, this.this$0.getClass(), context, (Function1) null, new AnonymousClass3(this, j), (Function0) null, (Function0) null, new AnonymousClass2(this), 52, (Object) null);
|
|
|
|
}
|
|
|
|
}
|