2021-08-03 07:33:18 +00:00
|
|
|
package com.discord.widgets.friends;
|
|
|
|
|
|
|
|
import android.content.Context;
|
2021-10-15 06:18:26 +00:00
|
|
|
import c0.z.d.m;
|
|
|
|
import c0.z.d.o;
|
2021-08-09 22:51:56 +00:00
|
|
|
import com.discord.R;
|
2021-08-03 07:33:18 +00:00
|
|
|
import com.discord.utilities.error.Error;
|
|
|
|
import com.discord.utilities.rest.RestAPIAbortMessages;
|
|
|
|
import com.discord.utilities.user.UserUtils;
|
|
|
|
import kotlin.Unit;
|
|
|
|
import kotlin.jvm.functions.Function0;
|
|
|
|
import rx.functions.Action1;
|
|
|
|
/* compiled from: WidgetFriendsAddById.kt */
|
|
|
|
public final class WidgetFriendsAddById$sendFriendRequest$2<T> implements Action1<Error> {
|
|
|
|
public final /* synthetic */ int $discriminator;
|
|
|
|
public final /* synthetic */ String $username;
|
|
|
|
public final /* synthetic */ WidgetFriendsAddById this$0;
|
|
|
|
|
|
|
|
/* compiled from: WidgetFriendsAddById.kt */
|
|
|
|
/* renamed from: com.discord.widgets.friends.WidgetFriendsAddById$sendFriendRequest$2$1 reason: invalid class name */
|
|
|
|
public static final class AnonymousClass1 extends o implements Function0<Unit> {
|
|
|
|
public final /* synthetic */ Error $error;
|
|
|
|
public final /* synthetic */ WidgetFriendsAddById$sendFriendRequest$2 this$0;
|
|
|
|
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
|
|
public AnonymousClass1(WidgetFriendsAddById$sendFriendRequest$2 widgetFriendsAddById$sendFriendRequest$2, Error error) {
|
|
|
|
super(0);
|
|
|
|
this.this$0 = widgetFriendsAddById$sendFriendRequest$2;
|
|
|
|
this.$error = error;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // kotlin.jvm.functions.Function0
|
|
|
|
/* renamed from: invoke */
|
2021-10-15 06:18:26 +00:00
|
|
|
public final void mo17invoke() {
|
2021-08-09 22:51:56 +00:00
|
|
|
WidgetFriendsAddById.access$getBinding$p(this.this$0.this$0).e.setErrorTextAppearance(R.style.TextAppearance_Error);
|
2021-08-03 07:33:18 +00:00
|
|
|
RestAPIAbortMessages.ResponseResolver responseResolver = RestAPIAbortMessages.ResponseResolver.INSTANCE;
|
|
|
|
Context context = this.this$0.this$0.getContext();
|
|
|
|
Error error = this.$error;
|
|
|
|
m.checkNotNullExpressionValue(error, "error");
|
|
|
|
Error.Response response = error.getResponse();
|
|
|
|
m.checkNotNullExpressionValue(response, "error.response");
|
|
|
|
int code = response.getCode();
|
|
|
|
WidgetFriendsAddById.access$setInputEditError(this.this$0.this$0, String.valueOf(responseResolver.getRelationshipResponse(context, code, this.this$0.$username + UserUtils.INSTANCE.padDiscriminator(this.this$0.$discriminator))));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public WidgetFriendsAddById$sendFriendRequest$2(WidgetFriendsAddById widgetFriendsAddById, String str, int i) {
|
|
|
|
this.this$0 = widgetFriendsAddById;
|
|
|
|
this.$username = str;
|
|
|
|
this.$discriminator = i;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void call(Error error) {
|
|
|
|
RestAPIAbortMessages restAPIAbortMessages = RestAPIAbortMessages.INSTANCE;
|
|
|
|
m.checkNotNullExpressionValue(error, "error");
|
|
|
|
RestAPIAbortMessages.handleAbortCodeOrDefault$default(restAPIAbortMessages, error, new AnonymousClass1(this, error), null, 4, null);
|
|
|
|
}
|
|
|
|
}
|