847 lines
25 KiB
Smali
847 lines
25 KiB
Smali
.class public final Lcom/discord/stores/StoreUserRelationships;
|
|
.super Ljava/lang/Object;
|
|
.source "StoreUserRelationships.kt"
|
|
|
|
# interfaces
|
|
.implements Lcom/discord/stores/DispatchHandler;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field public final dispatcher:Lcom/discord/stores/Dispatcher;
|
|
|
|
.field public isDirty:Z
|
|
|
|
.field public final relationshipsCache:Lcom/discord/utilities/persister/Persister;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lcom/discord/utilities/persister/Persister<",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/Long;",
|
|
"Ljava/lang/Integer;",
|
|
">;>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public relationshipsState:Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState;
|
|
|
|
.field public final stream:Lcom/discord/stores/StoreStream;
|
|
|
|
.field public final userRelationshipsSubject:Lrx/subjects/BehaviorSubject;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lrx/subjects/BehaviorSubject<",
|
|
"Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Lcom/discord/stores/StoreStream;Lcom/discord/stores/Dispatcher;)V
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreUserRelationships;->stream:Lcom/discord/stores/StoreStream;
|
|
|
|
iput-object p2, p0, Lcom/discord/stores/StoreUserRelationships;->dispatcher:Lcom/discord/stores/Dispatcher;
|
|
|
|
sget-object p1, Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState$Unloaded;->INSTANCE:Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState$Unloaded;
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreUserRelationships;->relationshipsState:Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState;
|
|
|
|
new-instance p1, Lcom/discord/utilities/persister/Persister;
|
|
|
|
invoke-static {}, Lcom/discord/stores/StoreUserRelationshipsKt;->access$getUNLOADED_RELATIONSHIPS_SENTINEL$p()Ljava/util/HashMap;
|
|
|
|
move-result-object p2
|
|
|
|
const-string v0, "STORE_USER_RELATIONSHIPS_V8"
|
|
|
|
invoke-direct {p1, v0, p2}, Lcom/discord/utilities/persister/Persister;-><init>(Ljava/lang/String;Ljava/lang/Object;)V
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreUserRelationships;->relationshipsCache:Lcom/discord/utilities/persister/Persister;
|
|
|
|
sget-object p1, Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState$Unloaded;->INSTANCE:Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState$Unloaded;
|
|
|
|
invoke-static {p1}, Lrx/subjects/BehaviorSubject;->f0(Ljava/lang/Object;)Lrx/subjects/BehaviorSubject;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreUserRelationships;->userRelationshipsSubject:Lrx/subjects/BehaviorSubject;
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "dispatcher"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_1
|
|
const-string p1, "stream"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public static final synthetic access$getDispatcher$p(Lcom/discord/stores/StoreUserRelationships;)Lcom/discord/stores/Dispatcher;
|
|
.locals 0
|
|
|
|
iget-object p0, p0, Lcom/discord/stores/StoreUserRelationships;->dispatcher:Lcom/discord/stores/Dispatcher;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static final synthetic access$getStream$p(Lcom/discord/stores/StoreUserRelationships;)Lcom/discord/stores/StoreStream;
|
|
.locals 0
|
|
|
|
iget-object p0, p0, Lcom/discord/stores/StoreUserRelationships;->stream:Lcom/discord/stores/StoreStream;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private final ensureRelationshipLoaded()Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState$Loaded;
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreUserRelationships;->relationshipsState:Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState;
|
|
|
|
instance-of v1, v0, Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState$Loaded;
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
:cond_0
|
|
check-cast v0, Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState$Loaded;
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
new-instance v0, Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState$Loaded;
|
|
|
|
sget-object v1, Lj0/i/p;->d:Lj0/i/p;
|
|
|
|
invoke-direct {v0, v1}, Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState$Loaded;-><init>(Ljava/util/Map;)V
|
|
|
|
:goto_0
|
|
iput-object v0, p0, Lcom/discord/stores/StoreUserRelationships;->relationshipsState:Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final getRelationships()Ljava/util/Map;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/Long;",
|
|
"Ljava/lang/Integer;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreUserRelationships;->relationshipsState:Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState;
|
|
|
|
instance-of v1, v0, Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState$Loaded;
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
:cond_0
|
|
check-cast v0, Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState$Loaded;
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState$Loaded;->getRelationships()Ljava/util/Map;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
sget-object v0, Lj0/i/p;->d:Lj0/i/p;
|
|
|
|
:goto_0
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final handleConnectionOpen(Lcom/discord/models/domain/ModelPayload;)V
|
|
.locals 5
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelPayload;->getRelationships()Ljava/util/List;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "payload\n .relationships"
|
|
|
|
invoke-static {p1, v0}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const/16 v0, 0xa
|
|
|
|
invoke-static {p1, v0}, Lf/i/a/b/i1/e;->collectionSizeOrDefault(Ljava/lang/Iterable;I)I
|
|
|
|
move-result v0
|
|
|
|
invoke-static {v0}, Lf/i/a/b/i1/e;->mapCapacity(I)I
|
|
|
|
move-result v0
|
|
|
|
const/16 v1, 0x10
|
|
|
|
if-ge v0, v1, :cond_0
|
|
|
|
const/16 v0, 0x10
|
|
|
|
:cond_0
|
|
new-instance v1, Ljava/util/LinkedHashMap;
|
|
|
|
invoke-direct {v1, v0}, Ljava/util/LinkedHashMap;-><init>(I)V
|
|
|
|
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_1
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/discord/models/domain/ModelUserRelationship;
|
|
|
|
const-string v2, "it"
|
|
|
|
invoke-static {v0, v2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelUserRelationship;->getId()J
|
|
|
|
move-result-wide v3
|
|
|
|
invoke-static {v3, v4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-static {v0, v2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelUserRelationship;->getType()I
|
|
|
|
move-result v0
|
|
|
|
invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {v1, v3, v0}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
new-instance p1, Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState$Loaded;
|
|
|
|
invoke-direct {p1, v1}, Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState$Loaded;-><init>(Ljava/util/Map;)V
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreUserRelationships;->relationshipsState:Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState;
|
|
|
|
const/4 p1, 0x1
|
|
|
|
iput-boolean p1, p0, Lcom/discord/stores/StoreUserRelationships;->isDirty:Z
|
|
|
|
return-void
|
|
|
|
:cond_2
|
|
const-string p1, "payload"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final handlePreLogout()V
|
|
.locals 1
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
sget-object v0, Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState$Unloaded;->INSTANCE:Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState$Unloaded;
|
|
|
|
iput-object v0, p0, Lcom/discord/stores/StoreUserRelationships;->relationshipsState:Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState;
|
|
|
|
const/4 v0, 0x1
|
|
|
|
iput-boolean v0, p0, Lcom/discord/stores/StoreUserRelationships;->isDirty:Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final handleRelationshipAdd(Lcom/discord/models/domain/ModelUserRelationship;)V
|
|
.locals 3
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
invoke-direct {p0}, Lcom/discord/stores/StoreUserRelationships;->ensureRelationshipLoaded()Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState$Loaded;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState$Loaded;->getRelationships()Ljava/util/Map;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Lj0/i/u;->toMutableMap(Ljava/util/Map;)Ljava/util/Map;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelUserRelationship;->getId()J
|
|
|
|
move-result-wide v1
|
|
|
|
invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v1
|
|
|
|
move-object v2, v0
|
|
|
|
check-cast v2, Ljava/util/LinkedHashMap;
|
|
|
|
invoke-virtual {v2, v1}, Ljava/util/LinkedHashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Ljava/lang/Integer;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelUserRelationship;->getType()I
|
|
|
|
move-result v2
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-virtual {v1}, Ljava/lang/Integer;->intValue()I
|
|
|
|
move-result v1
|
|
|
|
if-eq v1, v2, :cond_1
|
|
|
|
:goto_0
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelUserRelationship;->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/ModelUserRelationship;->getType()I
|
|
|
|
move-result p1
|
|
|
|
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object p1
|
|
|
|
move-object v2, v0
|
|
|
|
check-cast v2, Ljava/util/HashMap;
|
|
|
|
invoke-virtual {v2, v1, p1}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
new-instance p1, Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState$Loaded;
|
|
|
|
invoke-direct {p1, v0}, Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState$Loaded;-><init>(Ljava/util/Map;)V
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreUserRelationships;->relationshipsState:Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState;
|
|
|
|
const/4 p1, 0x1
|
|
|
|
iput-boolean p1, p0, Lcom/discord/stores/StoreUserRelationships;->isDirty:Z
|
|
|
|
:cond_1
|
|
return-void
|
|
|
|
:cond_2
|
|
const-string p1, "relationship"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final handleRelationshipRemove(Lcom/discord/models/domain/ModelUserRelationship;)V
|
|
.locals 3
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
invoke-direct {p0}, Lcom/discord/stores/StoreUserRelationships;->ensureRelationshipLoaded()Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState$Loaded;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState$Loaded;->getRelationships()Ljava/util/Map;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Lj0/i/u;->toMutableMap(Ljava/util/Map;)Ljava/util/Map;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelUserRelationship;->getId()J
|
|
|
|
move-result-wide v1
|
|
|
|
invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object p1
|
|
|
|
move-object v1, v0
|
|
|
|
check-cast v1, Ljava/util/HashMap;
|
|
|
|
invoke-virtual {v1, p1}, Ljava/util/HashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
const/4 v1, 0x1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
const/4 p1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p1, 0x0
|
|
|
|
:goto_0
|
|
if-eqz p1, :cond_1
|
|
|
|
new-instance p1, Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState$Loaded;
|
|
|
|
invoke-direct {p1, v0}, Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState$Loaded;-><init>(Ljava/util/Map;)V
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreUserRelationships;->relationshipsState:Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState;
|
|
|
|
iput-boolean v1, p0, Lcom/discord/stores/StoreUserRelationships;->isDirty:Z
|
|
|
|
:cond_1
|
|
return-void
|
|
|
|
:cond_2
|
|
const-string p1, "relationship"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final init()V
|
|
.locals 3
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreUserRelationships;->relationshipsCache:Lcom/discord/utilities/persister/Persister;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/utilities/persister/Persister;->get()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Ljava/util/Map;
|
|
|
|
invoke-static {}, Lcom/discord/stores/StoreUserRelationshipsKt;->access$getUNLOADED_RELATIONSHIPS_SENTINEL$p()Ljava/util/HashMap;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v0, v1}, Lj0/n/c/h;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x1
|
|
|
|
xor-int/2addr v1, v2
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
new-instance v1, Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState$Loaded;
|
|
|
|
invoke-direct {v1, v0}, Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState$Loaded;-><init>(Ljava/util/Map;)V
|
|
|
|
iput-object v1, p0, Lcom/discord/stores/StoreUserRelationships;->relationshipsState:Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState;
|
|
|
|
iput-boolean v2, p0, Lcom/discord/stores/StoreUserRelationships;->isDirty:Z
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public final observe()Lrx/Observable;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Lrx/Observable<",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/Long;",
|
|
"Ljava/lang/Integer;",
|
|
">;>;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreUserRelationships;->userRelationshipsSubject:Lrx/subjects/BehaviorSubject;
|
|
|
|
const-string v1, "userRelationshipsSubject"
|
|
|
|
invoke-static {v0, v1}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-static {v0}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->computationBuffered(Lrx/Observable;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v1, Lcom/discord/stores/StoreUserRelationships$observe$1;->INSTANCE:Lcom/discord/stores/StoreUserRelationships$observe$1;
|
|
|
|
invoke-virtual {v0, v1}, Lrx/Observable;->C(Lr0/k/b;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "userRelationshipsSubject\u2026 }\n }"
|
|
|
|
invoke-static {v0, v1}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final observe(J)Lrx/Observable;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(J)",
|
|
"Lrx/Observable<",
|
|
"Ljava/lang/Integer;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
invoke-virtual {p0}, Lcom/discord/stores/StoreUserRelationships;->observe()Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v1, Lcom/discord/stores/StoreUserRelationships$observe$3;
|
|
|
|
invoke-direct {v1, p1, p2}, Lcom/discord/stores/StoreUserRelationships$observe$3;-><init>(J)V
|
|
|
|
invoke-virtual {v0, v1}, Lrx/Observable;->C(Lr0/k/b;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "observe()\n .map\u2026> relationships[userId] }"
|
|
|
|
invoke-static {p1, p2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public final observe(Ljava/util/Collection;)Lrx/Observable;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/Collection<",
|
|
"Ljava/lang/Long;",
|
|
">;)",
|
|
"Lrx/Observable<",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/Long;",
|
|
"Ljava/lang/Integer;",
|
|
">;>;"
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-virtual {p0}, Lcom/discord/stores/StoreUserRelationships;->observe()Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v1, Lcom/discord/stores/StoreUserRelationships$observe$2;
|
|
|
|
invoke-direct {v1, p1}, Lcom/discord/stores/StoreUserRelationships$observe$2;-><init>(Ljava/util/Collection;)V
|
|
|
|
invoke-virtual {v0, v1}, Lrx/Observable;->C(Lr0/k/b;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Lrx/Observable;->q()Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "observe()\n .map\u2026 .distinctUntilChanged()"
|
|
|
|
invoke-static {p1, v0}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
|
|
:cond_0
|
|
const-string p1, "userIds"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final observeForType(I)Lrx/Observable;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(I)",
|
|
"Lrx/Observable<",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/Long;",
|
|
"Ljava/lang/Integer;",
|
|
">;>;"
|
|
}
|
|
.end annotation
|
|
|
|
invoke-virtual {p0}, Lcom/discord/stores/StoreUserRelationships;->observe()Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v1, Lcom/discord/stores/StoreUserRelationships$observeForType$1;
|
|
|
|
invoke-direct {v1, p1}, Lcom/discord/stores/StoreUserRelationships$observeForType$1;-><init>(I)V
|
|
|
|
invoke-virtual {v0, v1}, Lrx/Observable;->C(Lr0/k/b;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Lrx/Observable;->q()Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "observe()\n .map\u2026 .distinctUntilChanged()"
|
|
|
|
invoke-static {p1, v0}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public final observePendingCount()Lrx/Observable;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Lrx/Observable<",
|
|
"Ljava/lang/Integer;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
invoke-virtual {p0}, Lcom/discord/stores/StoreUserRelationships;->observe()Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v1, Lcom/discord/stores/StoreUserRelationships$observePendingCount$1;->INSTANCE:Lcom/discord/stores/StoreUserRelationships$observePendingCount$1;
|
|
|
|
invoke-virtual {v0, v1}, Lrx/Observable;->C(Lr0/k/b;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lrx/Observable;->q()Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "observe()\n .map\u2026 .distinctUntilChanged()"
|
|
|
|
invoke-static {v0, v1}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final observeUserRelationshipsState()Lrx/Observable;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Lrx/Observable<",
|
|
"Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreUserRelationships;->userRelationshipsSubject:Lrx/subjects/BehaviorSubject;
|
|
|
|
const-string v1, "userRelationshipsSubject"
|
|
|
|
invoke-static {v0, v1}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public onDispatchEnded()V
|
|
.locals 5
|
|
|
|
iget-boolean v0, p0, Lcom/discord/stores/StoreUserRelationships;->isDirty:Z
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreUserRelationships;->relationshipsState:Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState;
|
|
|
|
instance-of v2, v0, Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState$Loaded;
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
new-instance v2, Ljava/util/HashMap;
|
|
|
|
check-cast v0, Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState$Loaded;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState$Loaded;->getRelationships()Ljava/util/Map;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {v2, v0}, Ljava/util/HashMap;-><init>(Ljava/util/Map;)V
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreUserRelationships;->relationshipsCache:Lcom/discord/utilities/persister/Persister;
|
|
|
|
const/4 v3, 0x2
|
|
|
|
const/4 v4, 0x0
|
|
|
|
invoke-static {v0, v2, v1, v3, v4}, Lcom/discord/utilities/persister/Persister;->set$default(Lcom/discord/utilities/persister/Persister;Ljava/lang/Object;ZILjava/lang/Object;)Ljava/lang/Object;
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreUserRelationships;->userRelationshipsSubject:Lrx/subjects/BehaviorSubject;
|
|
|
|
new-instance v3, Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState$Loaded;
|
|
|
|
invoke-direct {v3, v2}, Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState$Loaded;-><init>(Ljava/util/Map;)V
|
|
|
|
invoke-virtual {v0, v3}, Lrx/subjects/BehaviorSubject;->onNext(Ljava/lang/Object;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Lcom/discord/stores/StoreUserRelationships;->relationshipsCache:Lcom/discord/utilities/persister/Persister;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/utilities/persister/Persister;->clear()Ljava/lang/Object;
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreUserRelationships;->userRelationshipsSubject:Lrx/subjects/BehaviorSubject;
|
|
|
|
sget-object v2, Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState$Unloaded;->INSTANCE:Lcom/discord/stores/StoreUserRelationships$UserRelationshipsState$Unloaded;
|
|
|
|
invoke-virtual {v0, v2}, Lrx/subjects/BehaviorSubject;->onNext(Ljava/lang/Object;)V
|
|
|
|
:cond_1
|
|
:goto_0
|
|
iput-boolean v1, p0, Lcom/discord/stores/StoreUserRelationships;->isDirty:Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final requestAllRelationships()V
|
|
.locals 9
|
|
|
|
sget-object v0, Lcom/discord/utilities/rest/RestAPI;->Companion:Lcom/discord/utilities/rest/RestAPI$Companion;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/utilities/rest/RestAPI$Companion;->getApi()Lcom/discord/utilities/rest/RestAPI;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lcom/discord/utilities/rest/RestAPI;->getRelationships()Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/4 v2, 0x1
|
|
|
|
invoke-static {v1, v2}, Lf/a/b/r;->f(ZI)Lrx/Observable$c;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Lrx/Observable;->k(Lrx/Observable$c;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v1, Lcom/discord/stores/StoreUserRelationships$requestAllRelationships$1;->INSTANCE:Lcom/discord/stores/StoreUserRelationships$requestAllRelationships$1;
|
|
|
|
invoke-virtual {v0, v1}, Lrx/Observable;->I(Lr0/k/b;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v5, Lcom/discord/stores/StoreUserRelationships$requestAllRelationships$2;
|
|
|
|
invoke-direct {v5, p0}, Lcom/discord/stores/StoreUserRelationships$requestAllRelationships$2;-><init>(Lcom/discord/stores/StoreUserRelationships;)V
|
|
|
|
const/16 v1, 0x3c
|
|
|
|
and-int/lit8 v2, v1, 0x4
|
|
|
|
and-int/lit8 v2, v1, 0x8
|
|
|
|
and-int/lit8 v2, v1, 0x10
|
|
|
|
and-int/lit8 v1, v1, 0x20
|
|
|
|
new-instance v8, Lf/a/b/d0;
|
|
|
|
const/4 v7, 0x0
|
|
|
|
const-string v3, "requestAllRelationships"
|
|
|
|
move-object v1, v8
|
|
|
|
move-object v2, v7
|
|
|
|
move-object v4, v7
|
|
|
|
move-object v6, v7
|
|
|
|
invoke-direct/range {v1 .. v7}, Lf/a/b/d0;-><init>(Landroid/content/Context;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)V
|
|
|
|
invoke-virtual {v0, v8}, Lrx/Observable;->k(Lrx/Observable$c;)Lrx/Observable;
|
|
|
|
return-void
|
|
.end method
|