discord-jadx/app/src/main/java/com/discord/gateway/GatewaySocket$close$1.java

57 lines
2.2 KiB
Java

package com.discord.gateway;
import com.discord.utilities.websocket.WebSocket;
import d0.z.d.o;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
/* compiled from: GatewaySocket.kt */
public final class GatewaySocket$close$1 extends o implements Function0<Unit> {
public final /* synthetic */ boolean $clean;
public final /* synthetic */ GatewaySocket this$0;
/* compiled from: GatewaySocket.kt */
/* renamed from: com.discord.gateway.GatewaySocket$close$1$1 reason: invalid class name */
public static final class AnonymousClass1 extends o implements Function1<WebSocket, Unit> {
public final /* synthetic */ int $code;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public AnonymousClass1(int i) {
super(1);
this.$code = 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(WebSocket webSocket) {
invoke(webSocket);
return Unit.a;
}
public final void invoke(WebSocket webSocket) {
if (webSocket != null) {
WebSocket.disconnect$default(webSocket, this.$code, null, 2, null);
}
}
}
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public GatewaySocket$close$1(GatewaySocket gatewaySocket, boolean z2) {
super(0);
this.this$0 = gatewaySocket;
this.$clean = z2;
}
@Override // kotlin.jvm.functions.Function0
/* renamed from: invoke */
public final void mo1invoke() {
if (GatewaySocket.access$getConnectionState$p(this.this$0) != 0) {
int i = this.$clean ? 1000 : 4000;
GatewaySocket.access$cleanup(this.this$0, new AnonymousClass1(i));
GatewaySocket.access$setConnectionState$p(this.this$0, 0);
GatewaySocket.access$reset(this.this$0, this.$clean, i, "Disconnect requested by client");
}
}
}