394 lines
10 KiB
Smali
394 lines
10 KiB
Smali
.class public final Lcom/discord/stores/StoreGuildMemberCounts;
|
|
.super Lcom/discord/stores/Store;
|
|
.source "StoreGuildMemberCounts.kt"
|
|
|
|
# interfaces
|
|
.implements Lcom/discord/stores/DispatchHandler;
|
|
|
|
|
|
# instance fields
|
|
.field private final guildMemberCounts:Ljava/util/HashMap;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/HashMap<",
|
|
"Ljava/lang/Long;",
|
|
"Ljava/lang/Integer;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private final guildMemberCountsPublisher:Lrx/subjects/BehaviorSubject;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lrx/subjects/BehaviorSubject<",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/Long;",
|
|
"Ljava/lang/Integer;",
|
|
">;>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private isDirty:Z
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 1
|
|
|
|
invoke-direct {p0}, Lcom/discord/stores/Store;-><init>()V
|
|
|
|
new-instance v0, Ljava/util/HashMap;
|
|
|
|
invoke-direct {v0}, Ljava/util/HashMap;-><init>()V
|
|
|
|
iput-object v0, p0, Lcom/discord/stores/StoreGuildMemberCounts;->guildMemberCounts:Ljava/util/HashMap;
|
|
|
|
invoke-static {}, Lkotlin/a/ab;->emptyMap()Ljava/util/Map;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Lrx/subjects/BehaviorSubject;->bL(Ljava/lang/Object;)Lrx/subjects/BehaviorSubject;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Lcom/discord/stores/StoreGuildMemberCounts;->guildMemberCountsPublisher:Lrx/subjects/BehaviorSubject;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final getApproximateMemberCount(J)Lrx/Observable;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(J)",
|
|
"Lrx/Observable<",
|
|
"Ljava/lang/Integer;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreGuildMemberCounts;->guildMemberCountsPublisher:Lrx/subjects/BehaviorSubject;
|
|
|
|
new-instance v1, Lcom/discord/stores/StoreGuildMemberCounts$getApproximateMemberCount$1;
|
|
|
|
invoke-direct {v1, p1, p2}, Lcom/discord/stores/StoreGuildMemberCounts$getApproximateMemberCount$1;-><init>(J)V
|
|
|
|
check-cast v1, Lrx/functions/b;
|
|
|
|
invoke-virtual {v0, v1}, Lrx/subjects/BehaviorSubject;->e(Lrx/functions/b;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Lrx/Observable;->Fo()Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "guildMemberCountsPublish\u2026 .distinctUntilChanged()"
|
|
|
|
invoke-static {p1, p2}, Lkotlin/jvm/internal/k;->g(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public final getGuildMemberCounts$app_productionExternalRelease()Ljava/util/HashMap;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Ljava/util/HashMap<",
|
|
"Ljava/lang/Long;",
|
|
"Ljava/lang/Integer;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreGuildMemberCounts;->guildMemberCounts:Ljava/util/HashMap;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final handleConnectionOpen(Lcom/discord/models/domain/ModelPayload;)V
|
|
.locals 4
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
const-string v0, "payload"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/k;->h(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelPayload;->getGuilds()Ljava/util/List;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
check-cast p1, Ljava/lang/Iterable;
|
|
|
|
invoke-interface {p1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p1
|
|
|
|
:goto_0
|
|
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/discord/models/domain/ModelGuild;
|
|
|
|
iget-object v1, p0, Lcom/discord/stores/StoreGuildMemberCounts;->guildMemberCounts:Ljava/util/HashMap;
|
|
|
|
check-cast v1, Ljava/util/Map;
|
|
|
|
const-string v2, "guild"
|
|
|
|
invoke-static {v0, v2}, Lkotlin/jvm/internal/k;->g(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelGuild;->getId()J
|
|
|
|
move-result-wide v2
|
|
|
|
invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelGuild;->getMemberCount()I
|
|
|
|
move-result v0
|
|
|
|
invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {v1, v2, v0}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p1, 0x1
|
|
|
|
iput-boolean p1, p0, Lcom/discord/stores/StoreGuildMemberCounts;->isDirty:Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final handleGuildCreate(Lcom/discord/models/domain/ModelGuild;)V
|
|
.locals 3
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
const-string v0, "guild"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/k;->h(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreGuildMemberCounts;->guildMemberCounts:Ljava/util/HashMap;
|
|
|
|
check-cast v0, Ljava/util/Map;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelGuild;->getId()J
|
|
|
|
move-result-wide v1
|
|
|
|
invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelGuild;->getMemberCount()I
|
|
|
|
move-result p1
|
|
|
|
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-interface {v0, v1, p1}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
const/4 p1, 0x1
|
|
|
|
iput-boolean p1, p0, Lcom/discord/stores/StoreGuildMemberCounts;->isDirty:Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final handleGuildDelete(J)V
|
|
.locals 1
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreGuildMemberCounts;->guildMemberCounts:Ljava/util/HashMap;
|
|
|
|
invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v0, p1}, Ljava/util/HashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
if-nez p1, :cond_1
|
|
|
|
iget-boolean p1, p0, Lcom/discord/stores/StoreGuildMemberCounts;->isDirty:Z
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p1, 0x0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
:goto_0
|
|
const/4 p1, 0x1
|
|
|
|
:goto_1
|
|
iput-boolean p1, p0, Lcom/discord/stores/StoreGuildMemberCounts;->isDirty:Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final handleGuildMemberAdd(Lcom/discord/models/domain/ModelGuildMember;)V
|
|
.locals 4
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
const-string v0, "member"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/k;->h(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreGuildMemberCounts;->guildMemberCounts:Ljava/util/HashMap;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelGuildMember;->getGuildId()J
|
|
|
|
move-result-wide v1
|
|
|
|
invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Ljava/lang/Integer;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object v1, p0, Lcom/discord/stores/StoreGuildMemberCounts;->guildMemberCounts:Ljava/util/HashMap;
|
|
|
|
check-cast v1, Ljava/util/Map;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelGuildMember;->getGuildId()J
|
|
|
|
move-result-wide v2
|
|
|
|
invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I
|
|
|
|
move-result v0
|
|
|
|
const/4 v2, 0x1
|
|
|
|
add-int/2addr v0, v2
|
|
|
|
invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {v1, p1, v0}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
iput-boolean v2, p0, Lcom/discord/stores/StoreGuildMemberCounts;->isDirty:Z
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public final handleGuildMemberRemove(J)V
|
|
.locals 2
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreGuildMemberCounts;->guildMemberCounts:Ljava/util/HashMap;
|
|
|
|
invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Ljava/lang/Integer;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object v1, p0, Lcom/discord/stores/StoreGuildMemberCounts;->guildMemberCounts:Ljava/util/HashMap;
|
|
|
|
check-cast v1, Ljava/util/Map;
|
|
|
|
invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I
|
|
|
|
move-result p2
|
|
|
|
const/4 v0, 0x1
|
|
|
|
sub-int/2addr p2, v0
|
|
|
|
invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-interface {v1, p1, p2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
iput-boolean v0, p0, Lcom/discord/stores/StoreGuildMemberCounts;->isDirty:Z
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public final onDispatchEnded()V
|
|
.locals 3
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
iget-boolean v0, p0, Lcom/discord/stores/StoreGuildMemberCounts;->isDirty:Z
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreGuildMemberCounts;->guildMemberCountsPublisher:Lrx/subjects/BehaviorSubject;
|
|
|
|
new-instance v1, Ljava/util/HashMap;
|
|
|
|
iget-object v2, p0, Lcom/discord/stores/StoreGuildMemberCounts;->guildMemberCounts:Ljava/util/HashMap;
|
|
|
|
check-cast v2, Ljava/util/Map;
|
|
|
|
invoke-direct {v1, v2}, Ljava/util/HashMap;-><init>(Ljava/util/Map;)V
|
|
|
|
invoke-virtual {v0, v1}, Lrx/subjects/BehaviorSubject;->onNext(Ljava/lang/Object;)V
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
iput-boolean v0, p0, Lcom/discord/stores/StoreGuildMemberCounts;->isDirty:Z
|
|
|
|
return-void
|
|
.end method
|