discord-jadx/app/src/main/java/com/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ad...

119 lines
6.1 KiB
Java
Raw Normal View History

2021-08-03 07:33:18 +00:00
package com.discord.widgets.user.usersheet;
import com.discord.R;
2022-01-17 16:24:26 +00:00
import com.discord.app.AppFragment;
import com.discord.utilities.captcha.CaptchaErrorBody;
2021-08-03 07:33:18 +00:00
import com.discord.utilities.error.Error;
import com.discord.utilities.rest.RestAPIAbortMessages;
2022-01-17 16:24:26 +00:00
import com.discord.widgets.captcha.WidgetCaptchaBottomSheet;
import com.discord.widgets.captcha.WidgetCaptchaKt;
2021-11-02 06:38:17 +00:00
import d0.z.d.m;
import d0.z.d.o;
2021-08-03 07:33:18 +00:00
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
2022-01-17 16:24:26 +00:00
import kotlin.jvm.functions.Function2;
2021-08-03 07:33:18 +00:00
/* compiled from: WidgetUserSheetViewModel.kt */
public final class WidgetUserSheetViewModel$addRelationship$2 extends o implements Function1<Error, Unit> {
2022-01-17 16:24:26 +00:00
public final /* synthetic */ int $successMessageStringRes;
public final /* synthetic */ Integer $type;
2021-08-03 07:33:18 +00:00
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;
2022-01-17 16:24:26 +00:00
/* 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);
}
}
2021-08-03 07:33:18 +00:00
/* 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 */
2021-11-02 06:38:17 +00:00
public final void mo1invoke() {
2022-01-17 16:24:26 +00:00
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;
}
2021-08-03 07:33:18 +00:00
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 */
2021-11-02 06:38:17 +00:00
public final Boolean mo1invoke() {
WidgetUserSheetViewModel.access$emitShowToastEvent(this.this$0.this$0, R.string.default_failure_to_perform_action_message);
2021-08-03 07:33:18 +00:00
return null;
}
}
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
2022-01-17 16:24:26 +00:00
public WidgetUserSheetViewModel$addRelationship$2(WidgetUserSheetViewModel widgetUserSheetViewModel, Integer num, String str, int i) {
2021-08-03 07:33:18 +00:00
super(1);
this.this$0 = widgetUserSheetViewModel;
2022-01-17 16:24:26 +00:00
this.$type = num;
2021-08-03 07:33:18 +00:00
this.$username = str;
2022-01-17 16:24:26 +00:00
this.$successMessageStringRes = i;
2021-08-03 07:33:18 +00:00
}
/* 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));
}
}