2020-05-17 12:40:10 +00:00
|
|
|
.class public final Lcom/discord/gateway/GatewayDiscovery;
|
|
|
|
.super Ljava/lang/Object;
|
|
|
|
.source "GatewayDiscovery.kt"
|
|
|
|
|
|
|
|
|
|
|
|
# annotations
|
|
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
|
|
value = {
|
|
|
|
Lcom/discord/gateway/GatewayDiscovery$Cache;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
|
|
|
|
# instance fields
|
|
|
|
.field public final backoff:Lcom/discord/utilities/networking/Backoff;
|
|
|
|
|
|
|
|
.field public gatewayUrl:Ljava/lang/String;
|
|
|
|
|
|
|
|
.field public gatewayUrlDiscoverySubscription:Lrx/Subscription;
|
|
|
|
|
|
|
|
.field public final gatewayUrlProvider:Lrx/Observable;
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"Lrx/Observable<",
|
|
|
|
"Ljava/lang/String;",
|
|
|
|
">;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
.end field
|
|
|
|
|
|
|
|
.field public final log:Lkotlin/jvm/functions/Function1;
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"Lkotlin/jvm/functions/Function1<",
|
|
|
|
"Ljava/lang/String;",
|
|
|
|
"Lkotlin/Unit;",
|
|
|
|
">;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
.end field
|
|
|
|
|
|
|
|
.field public final scheduler:Lrx/Scheduler;
|
|
|
|
|
|
|
|
|
|
|
|
# direct methods
|
|
|
|
.method public constructor <init>(Landroid/content/Context;Lrx/Scheduler;Lcom/discord/utilities/networking/Backoff;Lkotlin/jvm/functions/Function1;Lrx/Observable;)V
|
|
|
|
.locals 1
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"(",
|
|
|
|
"Landroid/content/Context;",
|
|
|
|
"Lrx/Scheduler;",
|
|
|
|
"Lcom/discord/utilities/networking/Backoff;",
|
|
|
|
"Lkotlin/jvm/functions/Function1<",
|
|
|
|
"-",
|
|
|
|
"Ljava/lang/String;",
|
|
|
|
"Lkotlin/Unit;",
|
|
|
|
">;",
|
|
|
|
"Lrx/Observable<",
|
|
|
|
"Ljava/lang/String;",
|
|
|
|
">;)V"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
2020-09-16 23:45:23 +00:00
|
|
|
const-string v0, "context"
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-10-05 23:18:16 +00:00
|
|
|
invoke-static {p1, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-09-16 23:45:23 +00:00
|
|
|
const-string v0, "scheduler"
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-10-05 23:18:16 +00:00
|
|
|
invoke-static {p2, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-09-16 23:45:23 +00:00
|
|
|
const-string v0, "backoff"
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-10-05 23:18:16 +00:00
|
|
|
invoke-static {p3, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-09-16 23:45:23 +00:00
|
|
|
|
|
|
|
const-string v0, "log"
|
|
|
|
|
2020-10-05 23:18:16 +00:00
|
|
|
invoke-static {p4, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-09-16 23:45:23 +00:00
|
|
|
|
|
|
|
const-string v0, "gatewayUrlProvider"
|
|
|
|
|
2020-10-05 23:18:16 +00:00
|
|
|
invoke-static {p5, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
|
|
|
|
iput-object p2, p0, Lcom/discord/gateway/GatewayDiscovery;->scheduler:Lrx/Scheduler;
|
|
|
|
|
|
|
|
iput-object p3, p0, Lcom/discord/gateway/GatewayDiscovery;->backoff:Lcom/discord/utilities/networking/Backoff;
|
|
|
|
|
|
|
|
iput-object p4, p0, Lcom/discord/gateway/GatewayDiscovery;->log:Lkotlin/jvm/functions/Function1;
|
|
|
|
|
|
|
|
iput-object p5, p0, Lcom/discord/gateway/GatewayDiscovery;->gatewayUrlProvider:Lrx/Observable;
|
|
|
|
|
|
|
|
sget-object p2, Lcom/discord/gateway/GatewayDiscovery$Cache;->INSTANCE:Lcom/discord/gateway/GatewayDiscovery$Cache;
|
|
|
|
|
|
|
|
invoke-virtual {p2, p1}, Lcom/discord/gateway/GatewayDiscovery$Cache;->init(Landroid/content/Context;)V
|
|
|
|
|
|
|
|
sget-object p1, Lcom/discord/gateway/GatewayDiscovery$Cache;->INSTANCE:Lcom/discord/gateway/GatewayDiscovery$Cache;
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/gateway/GatewayDiscovery$Cache;->getGatewayUrl()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
iput-object p1, p0, Lcom/discord/gateway/GatewayDiscovery;->gatewayUrl:Ljava/lang/String;
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static final synthetic access$getGatewayUrl$p(Lcom/discord/gateway/GatewayDiscovery;)Ljava/lang/String;
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iget-object p0, p0, Lcom/discord/gateway/GatewayDiscovery;->gatewayUrl:Ljava/lang/String;
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static final synthetic access$getLog$p(Lcom/discord/gateway/GatewayDiscovery;)Lkotlin/jvm/functions/Function1;
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iget-object p0, p0, Lcom/discord/gateway/GatewayDiscovery;->log:Lkotlin/jvm/functions/Function1;
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static final synthetic access$setGatewayUrl$p(Lcom/discord/gateway/GatewayDiscovery;Ljava/lang/String;)V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iput-object p1, p0, Lcom/discord/gateway/GatewayDiscovery;->gatewayUrl:Ljava/lang/String;
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
|
|
|
|
# virtual methods
|
|
|
|
.method public final discoverGatewayUrl(Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)V
|
|
|
|
.locals 3
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"(",
|
|
|
|
"Lkotlin/jvm/functions/Function1<",
|
|
|
|
"-",
|
|
|
|
"Ljava/lang/String;",
|
|
|
|
"Lkotlin/Unit;",
|
|
|
|
">;",
|
|
|
|
"Lkotlin/jvm/functions/Function1<",
|
|
|
|
"-",
|
|
|
|
"Ljava/lang/Throwable;",
|
|
|
|
"Lkotlin/Unit;",
|
|
|
|
">;)V"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
2020-09-16 23:45:23 +00:00
|
|
|
const-string v0, "onSuccess"
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-10-05 23:18:16 +00:00
|
|
|
invoke-static {p1, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
2020-09-16 23:45:23 +00:00
|
|
|
const-string v0, "onFailure"
|
|
|
|
|
2020-10-05 23:18:16 +00:00
|
|
|
invoke-static {p2, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/gateway/GatewayDiscovery;->backoff:Lcom/discord/utilities/networking/Backoff;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Lcom/discord/utilities/networking/Backoff;->hasReachedFailureThreshold()Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/gateway/GatewayDiscovery;->gatewayUrl:Ljava/lang/String;
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
iget-object p2, p0, Lcom/discord/gateway/GatewayDiscovery;->log:Lkotlin/jvm/functions/Function1;
|
|
|
|
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
|
|
|
|
const-string v2, "Using sticky gateway url: "
|
|
|
|
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
invoke-interface {p2, v1}, Lkotlin/jvm/functions/Function1;->invoke(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
invoke-interface {p1, v0}, Lkotlin/jvm/functions/Function1;->invoke(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
iget-object v0, p0, Lcom/discord/gateway/GatewayDiscovery;->log:Lkotlin/jvm/functions/Function1;
|
|
|
|
|
|
|
|
const-string v1, "Discovering gateway url."
|
|
|
|
|
|
|
|
invoke-interface {v0, v1}, Lkotlin/jvm/functions/Function1;->invoke(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
new-instance v0, Lcom/discord/gateway/GatewayDiscovery$discoverGatewayUrl$1;
|
|
|
|
|
|
|
|
invoke-direct {v0, p0, p2}, Lcom/discord/gateway/GatewayDiscovery$discoverGatewayUrl$1;-><init>(Lcom/discord/gateway/GatewayDiscovery;Lkotlin/jvm/functions/Function1;)V
|
|
|
|
|
|
|
|
new-instance p2, Lcom/discord/gateway/GatewayDiscovery$discoverGatewayUrl$2;
|
|
|
|
|
|
|
|
invoke-direct {p2, p0, v0, p1}, Lcom/discord/gateway/GatewayDiscovery$discoverGatewayUrl$2;-><init>(Lcom/discord/gateway/GatewayDiscovery;Lcom/discord/gateway/GatewayDiscovery$discoverGatewayUrl$1;Lkotlin/jvm/functions/Function1;)V
|
|
|
|
|
|
|
|
iget-object p1, p0, Lcom/discord/gateway/GatewayDiscovery;->gatewayUrlDiscoverySubscription:Lrx/Subscription;
|
|
|
|
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
|
|
|
|
invoke-interface {p1}, Lrx/Subscription;->unsubscribe()V
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
iget-object p1, p0, Lcom/discord/gateway/GatewayDiscovery;->gatewayUrlProvider:Lrx/Observable;
|
|
|
|
|
|
|
|
iget-object v1, p0, Lcom/discord/gateway/GatewayDiscovery;->scheduler:Lrx/Scheduler;
|
|
|
|
|
2020-10-05 23:18:16 +00:00
|
|
|
invoke-virtual {p1, v1}, Lrx/Observable;->G(Lrx/Scheduler;)Lrx/Observable;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
new-instance v1, Lcom/discord/gateway/GatewayDiscovery$discoverGatewayUrl$3;
|
|
|
|
|
|
|
|
invoke-direct {v1, p2}, Lcom/discord/gateway/GatewayDiscovery$discoverGatewayUrl$3;-><init>(Lcom/discord/gateway/GatewayDiscovery$discoverGatewayUrl$2;)V
|
|
|
|
|
|
|
|
new-instance p2, Lcom/discord/gateway/GatewayDiscovery$sam$rx_functions_Action1$0;
|
|
|
|
|
|
|
|
invoke-direct {p2, v1}, Lcom/discord/gateway/GatewayDiscovery$sam$rx_functions_Action1$0;-><init>(Lkotlin/jvm/functions/Function1;)V
|
|
|
|
|
|
|
|
new-instance v1, Lcom/discord/gateway/GatewayDiscovery$discoverGatewayUrl$4;
|
|
|
|
|
|
|
|
invoke-direct {v1, v0}, Lcom/discord/gateway/GatewayDiscovery$discoverGatewayUrl$4;-><init>(Lcom/discord/gateway/GatewayDiscovery$discoverGatewayUrl$1;)V
|
|
|
|
|
|
|
|
new-instance v0, Lcom/discord/gateway/GatewayDiscovery$sam$rx_functions_Action1$0;
|
|
|
|
|
|
|
|
invoke-direct {v0, v1}, Lcom/discord/gateway/GatewayDiscovery$sam$rx_functions_Action1$0;-><init>(Lkotlin/jvm/functions/Function1;)V
|
|
|
|
|
2020-10-05 23:18:16 +00:00
|
|
|
invoke-virtual {p1, p2, v0}, Lrx/Observable;->S(Lrx/functions/Action1;Lrx/functions/Action1;)Lrx/Subscription;
|
2020-05-17 12:40:10 +00:00
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
iput-object p1, p0, Lcom/discord/gateway/GatewayDiscovery;->gatewayUrlDiscoverySubscription:Lrx/Subscription;
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|