discord-jadx/app/src/main/java/com/discord/stores/StoreUserProfile$fetchProfi...

129 lines
6.2 KiB
Java

package com.discord.stores;
import android.content.Context;
import com.discord.models.domain.ModelUserProfile;
import com.discord.utilities.error.Error;
import com.discord.utilities.rest.RestAPI;
import com.discord.utilities.rx.ObservableExtensionsKt;
import d0.z.d.m;
import d0.z.d.o;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import rx.Observable;
/* compiled from: StoreUserProfile.kt */
public final class StoreUserProfile$fetchProfile$1 extends o implements Function0<Unit> {
public final /* synthetic */ long $userId;
public final /* synthetic */ StoreUserProfile this$0;
/* compiled from: StoreUserProfile.kt */
/* renamed from: com.discord.stores.StoreUserProfile$fetchProfile$1$1 reason: invalid class name */
public static final class AnonymousClass1 extends o implements Function1<ModelUserProfile, Unit> {
public final /* synthetic */ StoreUserProfile$fetchProfile$1 this$0;
/* compiled from: StoreUserProfile.kt */
/* renamed from: com.discord.stores.StoreUserProfile$fetchProfile$1$1$1 reason: invalid class name */
public static final class AnonymousClass1 extends o implements Function0<Unit> {
public final /* synthetic */ ModelUserProfile $it;
public final /* synthetic */ AnonymousClass1 this$0;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public AnonymousClass1(AnonymousClass1 r1, ModelUserProfile modelUserProfile) {
super(0);
this.this$0 = r1;
this.$it = modelUserProfile;
}
@Override // kotlin.jvm.functions.Function0
/* renamed from: invoke */
public final void mo1invoke() {
ModelUserProfile modelUserProfile = this.$it;
if (modelUserProfile != null) {
StoreUserProfile$fetchProfile$1 storeUserProfile$fetchProfile$1 = this.this$0.this$0;
StoreUserProfile.access$handleUserProfile(storeUserProfile$fetchProfile$1.this$0, modelUserProfile, storeUserProfile$fetchProfile$1.$userId);
}
}
}
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public AnonymousClass1(StoreUserProfile$fetchProfile$1 storeUserProfile$fetchProfile$1) {
super(1);
this.this$0 = storeUserProfile$fetchProfile$1;
}
/* 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(ModelUserProfile modelUserProfile) {
invoke(modelUserProfile);
return Unit.a;
}
public final void invoke(ModelUserProfile modelUserProfile) {
StoreUserProfile.access$getDispatcher$p(this.this$0.this$0).schedule(new AnonymousClass1(this, modelUserProfile));
}
}
/* compiled from: StoreUserProfile.kt */
/* renamed from: com.discord.stores.StoreUserProfile$fetchProfile$1$2 reason: invalid class name */
public static final class AnonymousClass2 extends o implements Function1<Error, Unit> {
public final /* synthetic */ StoreUserProfile$fetchProfile$1 this$0;
/* compiled from: StoreUserProfile.kt */
/* renamed from: com.discord.stores.StoreUserProfile$fetchProfile$1$2$1 reason: invalid class name */
public static final class AnonymousClass1 extends o implements Function0<Unit> {
public final /* synthetic */ AnonymousClass2 this$0;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public AnonymousClass1(AnonymousClass2 r1) {
super(0);
this.this$0 = r1;
}
@Override // kotlin.jvm.functions.Function0
/* renamed from: invoke */
public final void mo1invoke() {
StoreUserProfile$fetchProfile$1 storeUserProfile$fetchProfile$1 = this.this$0.this$0;
StoreUserProfile.access$handleFailure(storeUserProfile$fetchProfile$1.this$0, storeUserProfile$fetchProfile$1.$userId);
}
}
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public AnonymousClass2(StoreUserProfile$fetchProfile$1 storeUserProfile$fetchProfile$1) {
super(1);
this.this$0 = storeUserProfile$fetchProfile$1;
}
/* 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, "it");
StoreUserProfile.access$getDispatcher$p(this.this$0.this$0).schedule(new AnonymousClass1(this));
}
}
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public StoreUserProfile$fetchProfile$1(StoreUserProfile storeUserProfile, long j) {
super(0);
this.this$0 = storeUserProfile;
this.$userId = j;
}
@Override // kotlin.jvm.functions.Function0
/* renamed from: invoke */
public final void mo1invoke() {
if (!StoreUserProfile.access$getProfilesLoading$p(this.this$0).contains(Long.valueOf(this.$userId))) {
StoreUserProfile.access$getProfilesLoading$p(this.this$0).add(Long.valueOf(this.$userId));
Observable r = ObservableExtensionsKt.restSubscribeOn$default(RestAPI.Companion.getApi().userProfileGet(this.$userId), false, 1, null).r();
m.checkNotNullExpressionValue(r, "RestAPI\n .api\n … .distinctUntilChanged()");
ObservableExtensionsKt.appSubscribe$default(r, this.this$0.getClass(), (Context) null, (Function1) null, new AnonymousClass2(this), (Function0) null, (Function0) null, new AnonymousClass1(this), 54, (Object) null);
}
}
}