119 lines
6.1 KiB
Java
119 lines
6.1 KiB
Java
package com.discord.widgets.user.usersheet;
|
|
|
|
import com.discord.R;
|
|
import com.discord.app.AppFragment;
|
|
import com.discord.utilities.captcha.CaptchaErrorBody;
|
|
import com.discord.utilities.error.Error;
|
|
import com.discord.utilities.rest.RestAPIAbortMessages;
|
|
import com.discord.widgets.captcha.WidgetCaptchaBottomSheet;
|
|
import com.discord.widgets.captcha.WidgetCaptchaKt;
|
|
import d0.z.d.m;
|
|
import d0.z.d.o;
|
|
import kotlin.Unit;
|
|
import kotlin.jvm.functions.Function0;
|
|
import kotlin.jvm.functions.Function1;
|
|
import kotlin.jvm.functions.Function2;
|
|
/* compiled from: WidgetUserSheetViewModel.kt */
|
|
public final class WidgetUserSheetViewModel$addRelationship$2 extends o implements Function1<Error, Unit> {
|
|
public final /* synthetic */ int $successMessageStringRes;
|
|
public final /* synthetic */ Integer $type;
|
|
public final /* synthetic */ String $username;
|
|
public final /* synthetic */ WidgetUserSheetViewModel this$0;
|
|
|
|
/* compiled from: WidgetUserSheetViewModel.kt */
|
|
/* renamed from: com.discord.widgets.user.usersheet.WidgetUserSheetViewModel$addRelationship$2$1 reason: invalid class name */
|
|
public static final class AnonymousClass1 extends o implements Function0<Unit> {
|
|
public final /* synthetic */ Error $error;
|
|
public final /* synthetic */ WidgetUserSheetViewModel$addRelationship$2 this$0;
|
|
|
|
/* compiled from: WidgetUserSheetViewModel.kt */
|
|
/* renamed from: com.discord.widgets.user.usersheet.WidgetUserSheetViewModel$addRelationship$2$1$1 reason: invalid class name */
|
|
public static final class AnonymousClass1 extends o implements Function2<AppFragment, String, Unit> {
|
|
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) {
|
|
super(2);
|
|
this.this$0 = r1;
|
|
}
|
|
|
|
/* 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, java.lang.Object] */
|
|
@Override // kotlin.jvm.functions.Function2
|
|
public /* bridge */ /* synthetic */ Unit invoke(AppFragment appFragment, String str) {
|
|
invoke(appFragment, str);
|
|
return Unit.a;
|
|
}
|
|
|
|
public final void invoke(AppFragment appFragment, String str) {
|
|
m.checkNotNullParameter(appFragment, "<anonymous parameter 0>");
|
|
m.checkNotNullParameter(str, "captchaToken");
|
|
WidgetUserSheetViewModel$addRelationship$2 widgetUserSheetViewModel$addRelationship$2 = this.this$0.this$0;
|
|
widgetUserSheetViewModel$addRelationship$2.this$0.addRelationship(widgetUserSheetViewModel$addRelationship$2.$type, widgetUserSheetViewModel$addRelationship$2.$username, widgetUserSheetViewModel$addRelationship$2.$successMessageStringRes, str);
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public AnonymousClass1(WidgetUserSheetViewModel$addRelationship$2 widgetUserSheetViewModel$addRelationship$2, Error error) {
|
|
super(0);
|
|
this.this$0 = widgetUserSheetViewModel$addRelationship$2;
|
|
this.$error = error;
|
|
}
|
|
|
|
@Override // kotlin.jvm.functions.Function0
|
|
/* renamed from: invoke */
|
|
public final void mo1invoke() {
|
|
if (WidgetCaptchaKt.isCaptchaError(this.$error)) {
|
|
WidgetCaptchaBottomSheet.Companion.enqueue$default(WidgetCaptchaBottomSheet.Companion, "Add Friend Captcha", new AnonymousClass1(this), null, CaptchaErrorBody.Companion.createFromError(this.$error), 4, null);
|
|
return;
|
|
}
|
|
WidgetUserSheetViewModel widgetUserSheetViewModel = this.this$0.this$0;
|
|
Error.Response response = this.$error.getResponse();
|
|
m.checkNotNullExpressionValue(response, "error.response");
|
|
WidgetUserSheetViewModel.access$emitShowFriendRequestAbortToast(widgetUserSheetViewModel, response.getCode(), this.this$0.$username);
|
|
}
|
|
}
|
|
|
|
/* compiled from: WidgetUserSheetViewModel.kt */
|
|
/* renamed from: com.discord.widgets.user.usersheet.WidgetUserSheetViewModel$addRelationship$2$2 reason: invalid class name */
|
|
public static final class AnonymousClass2 extends o implements Function0<Boolean> {
|
|
public final /* synthetic */ WidgetUserSheetViewModel$addRelationship$2 this$0;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public AnonymousClass2(WidgetUserSheetViewModel$addRelationship$2 widgetUserSheetViewModel$addRelationship$2) {
|
|
super(0);
|
|
this.this$0 = widgetUserSheetViewModel$addRelationship$2;
|
|
}
|
|
|
|
/* Return type fixed from 'boolean' to match base method */
|
|
@Override // kotlin.jvm.functions.Function0
|
|
/* renamed from: invoke */
|
|
public final Boolean mo1invoke() {
|
|
WidgetUserSheetViewModel.access$emitShowToastEvent(this.this$0.this$0, R.string.default_failure_to_perform_action_message);
|
|
return null;
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public WidgetUserSheetViewModel$addRelationship$2(WidgetUserSheetViewModel widgetUserSheetViewModel, Integer num, String str, int i) {
|
|
super(1);
|
|
this.this$0 = widgetUserSheetViewModel;
|
|
this.$type = num;
|
|
this.$username = str;
|
|
this.$successMessageStringRes = i;
|
|
}
|
|
|
|
/* 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");
|
|
RestAPIAbortMessages.INSTANCE.handleAbortCodeOrDefault(error, new AnonymousClass1(this, error), new AnonymousClass2(this));
|
|
}
|
|
}
|