1531 lines
43 KiB
Smali
1531 lines
43 KiB
Smali
|
.class public Lcom/discord/stores/StoreUser;
|
||
|
.super Ljava/lang/Object;
|
||
|
.source "StoreUser.java"
|
||
|
|
||
|
|
||
|
# annotations
|
||
|
.annotation system Ldalvik/annotation/MemberClasses;
|
||
|
value = {
|
||
|
Lcom/discord/stores/StoreUser$Actions;
|
||
|
}
|
||
|
.end annotation
|
||
|
|
||
|
|
||
|
# instance fields
|
||
|
.field me:Lcom/discord/models/domain/ModelUser$Me;
|
||
|
|
||
|
.field private final meIdPublisher:Lcom/discord/utilities/mg_preference/MGPreferenceRx;
|
||
|
.annotation system Ldalvik/annotation/Signature;
|
||
|
value = {
|
||
|
"Lcom/discord/utilities/mg_preference/MGPreferenceRx",
|
||
|
"<",
|
||
|
"Ljava/lang/Long;",
|
||
|
">;"
|
||
|
}
|
||
|
.end annotation
|
||
|
.end field
|
||
|
|
||
|
.field private final mePublisher:Lcom/discord/utilities/mg_preference/MGPreferenceRx;
|
||
|
.annotation system Ldalvik/annotation/Signature;
|
||
|
value = {
|
||
|
"Lcom/discord/utilities/mg_preference/MGPreferenceRx",
|
||
|
"<",
|
||
|
"Lcom/discord/models/domain/ModelUser;",
|
||
|
">;"
|
||
|
}
|
||
|
.end annotation
|
||
|
.end field
|
||
|
|
||
|
.field final users:Ljava/util/Map;
|
||
|
.annotation system Ldalvik/annotation/Signature;
|
||
|
value = {
|
||
|
"Ljava/util/Map",
|
||
|
"<",
|
||
|
"Ljava/lang/Long;",
|
||
|
"Lcom/discord/models/domain/ModelUser;",
|
||
|
">;"
|
||
|
}
|
||
|
.end annotation
|
||
|
.end field
|
||
|
|
||
|
.field private final usersPublisher:Lcom/discord/utilities/mg_preference/MGPreferenceRx;
|
||
|
.annotation system Ldalvik/annotation/Signature;
|
||
|
value = {
|
||
|
"Lcom/discord/utilities/mg_preference/MGPreferenceRx",
|
||
|
"<",
|
||
|
"Ljava/util/Map",
|
||
|
"<",
|
||
|
"Ljava/lang/Long;",
|
||
|
"Lcom/discord/models/domain/ModelUser;",
|
||
|
">;>;"
|
||
|
}
|
||
|
.end annotation
|
||
|
.end field
|
||
|
|
||
|
|
||
|
# direct methods
|
||
|
.method public constructor <init>()V
|
||
|
.locals 3
|
||
|
|
||
|
.prologue
|
||
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
||
|
|
||
|
const/4 v0, 0x0
|
||
|
|
||
|
iput-object v0, p0, Lcom/discord/stores/StoreUser;->me:Lcom/discord/models/domain/ModelUser$Me;
|
||
|
|
||
|
const-string v0, "STORE_USERS_ME_V4"
|
||
|
|
||
|
invoke-static {v0}, Lcom/discord/utilities/mg_preference/MGPreferenceRx;->create(Ljava/lang/String;)Lcom/discord/utilities/mg_preference/MGPreferenceRx;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
iput-object v0, p0, Lcom/discord/stores/StoreUser;->mePublisher:Lcom/discord/utilities/mg_preference/MGPreferenceRx;
|
||
|
|
||
|
const-string v0, "STORE_USERS_ME_ID_V3"
|
||
|
|
||
|
invoke-static {v0}, Lcom/discord/utilities/mg_preference/MGPreferenceRx;->create(Ljava/lang/String;)Lcom/discord/utilities/mg_preference/MGPreferenceRx;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
iput-object v0, p0, Lcom/discord/stores/StoreUser;->meIdPublisher:Lcom/discord/utilities/mg_preference/MGPreferenceRx;
|
||
|
|
||
|
new-instance v0, Ljava/util/HashMap;
|
||
|
|
||
|
invoke-direct {v0}, Ljava/util/HashMap;-><init>()V
|
||
|
|
||
|
iput-object v0, p0, Lcom/discord/stores/StoreUser;->users:Ljava/util/Map;
|
||
|
|
||
|
const-string v0, "STORE_USERS_MAP_V4"
|
||
|
|
||
|
new-instance v1, Ljava/util/HashMap;
|
||
|
|
||
|
invoke-direct {v1}, Ljava/util/HashMap;-><init>()V
|
||
|
|
||
|
const/16 v2, 0x7530
|
||
|
|
||
|
invoke-static {v0, v1, v2}, Lcom/discord/utilities/mg_preference/MGPreferenceRx;->create(Ljava/lang/String;Ljava/lang/Object;I)Lcom/discord/utilities/mg_preference/MGPreferenceRx;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
iput-object v0, p0, Lcom/discord/stores/StoreUser;->usersPublisher:Lcom/discord/utilities/mg_preference/MGPreferenceRx;
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method static synthetic access$lambda$0(Ljava/util/Collection;Lcom/annimon/stream/Stream;)Ljava/util/Map;
|
||
|
.locals 1
|
||
|
|
||
|
invoke-static {p0, p1}, Lcom/discord/stores/StoreUser;->lambda$get$180(Ljava/util/Collection;Lcom/annimon/stream/Stream;)Ljava/util/Map;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
return-object v0
|
||
|
.end method
|
||
|
|
||
|
.method static synthetic access$lambda$1(JLjava/util/Map;)Lcom/discord/models/domain/ModelUser;
|
||
|
.locals 2
|
||
|
|
||
|
invoke-static {p0, p1, p2}, Lcom/discord/stores/StoreUser;->lambda$getUser$181(JLjava/util/Map;)Lcom/discord/models/domain/ModelUser;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
return-object v0
|
||
|
.end method
|
||
|
|
||
|
.method static synthetic access$lambda$2(Ljava/util/Collection;Lcom/discord/models/domain/ModelUser;)Z
|
||
|
.locals 1
|
||
|
|
||
|
invoke-static {p0, p1}, Lcom/discord/stores/StoreUser;->lambda$null$179(Ljava/util/Collection;Lcom/discord/models/domain/ModelUser;)Z
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
return v0
|
||
|
.end method
|
||
|
|
||
|
.method private static synthetic lambda$get$180(Ljava/util/Collection;Lcom/annimon/stream/Stream;)Ljava/util/Map;
|
||
|
.locals 2
|
||
|
.param p1, "stream" # Lcom/annimon/stream/Stream;
|
||
|
|
||
|
.prologue
|
||
|
invoke-static {p0}, Lcom/discord/stores/StoreUser$$Lambda$5;->lambdaFactory$(Ljava/util/Collection;)Lcom/annimon/stream/function/Predicate;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-virtual {p1, v0}, Lcom/annimon/stream/Stream;->filter(Lcom/annimon/stream/function/Predicate;)Lcom/annimon/stream/Stream;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-static {}, Lcom/discord/stores/StoreUser$$Lambda$6;->lambdaFactory$()Lcom/annimon/stream/function/Function;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
invoke-static {v1}, Lcom/discord/utilities/app/AppCollectors;->toMap(Lcom/annimon/stream/function/Function;)Lcom/annimon/stream/Collector;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
invoke-virtual {v0, v1}, Lcom/annimon/stream/Stream;->collect(Lcom/annimon/stream/Collector;)Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
check-cast v0, Ljava/util/Map;
|
||
|
|
||
|
return-object v0
|
||
|
.end method
|
||
|
|
||
|
.method private static synthetic lambda$getUser$181(JLjava/util/Map;)Lcom/discord/models/domain/ModelUser;
|
||
|
.locals 2
|
||
|
.param p2, "user" # Ljava/util/Map;
|
||
|
|
||
|
.prologue
|
||
|
invoke-static {p0, p1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-interface {p2, v0}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
check-cast v0, Lcom/discord/models/domain/ModelUser;
|
||
|
|
||
|
return-object v0
|
||
|
.end method
|
||
|
|
||
|
.method private static synthetic lambda$null$179(Ljava/util/Collection;Lcom/discord/models/domain/ModelUser;)Z
|
||
|
.locals 2
|
||
|
.param p1, "user" # Lcom/discord/models/domain/ModelUser;
|
||
|
|
||
|
.prologue
|
||
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelUser;->getId()J
|
||
|
|
||
|
move-result-wide v0
|
||
|
|
||
|
invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-interface {p0, v0}, Ljava/util/Collection;->contains(Ljava/lang/Object;)Z
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
return v0
|
||
|
.end method
|
||
|
|
||
|
.method private updateMe()V
|
||
|
.locals 4
|
||
|
|
||
|
.prologue
|
||
|
iget-object v0, p0, Lcom/discord/stores/StoreUser;->mePublisher:Lcom/discord/utilities/mg_preference/MGPreferenceRx;
|
||
|
|
||
|
iget-object v1, p0, Lcom/discord/stores/StoreUser;->me:Lcom/discord/models/domain/ModelUser$Me;
|
||
|
|
||
|
invoke-virtual {v0, v1}, Lcom/discord/utilities/mg_preference/MGPreferenceRx;->set(Ljava/lang/Object;)V
|
||
|
|
||
|
iget-object v0, p0, Lcom/discord/stores/StoreUser;->meIdPublisher:Lcom/discord/utilities/mg_preference/MGPreferenceRx;
|
||
|
|
||
|
iget-object v1, p0, Lcom/discord/stores/StoreUser;->me:Lcom/discord/models/domain/ModelUser$Me;
|
||
|
|
||
|
invoke-virtual {v1}, Lcom/discord/models/domain/ModelUser$Me;->getId()J
|
||
|
|
||
|
move-result-wide v2
|
||
|
|
||
|
invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
invoke-virtual {v0, v1}, Lcom/discord/utilities/mg_preference/MGPreferenceRx;->set(Ljava/lang/Object;)V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method private updateUsers(Z)V
|
||
|
.locals 3
|
||
|
.param p1, "updated" # Z
|
||
|
|
||
|
.prologue
|
||
|
if-eqz p1, :cond_0
|
||
|
|
||
|
iget-object v0, p0, Lcom/discord/stores/StoreUser;->usersPublisher:Lcom/discord/utilities/mg_preference/MGPreferenceRx;
|
||
|
|
||
|
new-instance v1, Ljava/util/HashMap;
|
||
|
|
||
|
iget-object v2, p0, Lcom/discord/stores/StoreUser;->users:Ljava/util/Map;
|
||
|
|
||
|
invoke-direct {v1, v2}, Ljava/util/HashMap;-><init>(Ljava/util/Map;)V
|
||
|
|
||
|
invoke-virtual {v0, v1}, Lcom/discord/utilities/mg_preference/MGPreferenceRx;->set(Ljava/lang/Object;)V
|
||
|
|
||
|
:cond_0
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
|
||
|
# virtual methods
|
||
|
.method public get(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;",
|
||
|
"Lcom/discord/models/domain/ModelUser;",
|
||
|
">;>;"
|
||
|
}
|
||
|
.end annotation
|
||
|
|
||
|
.prologue
|
||
|
.local p1, "userIds":Ljava/util/Collection;, "Ljava/util/Collection<Ljava/lang/Long;>;"
|
||
|
invoke-virtual {p0}, Lcom/discord/stores/StoreUser;->getAll()Lrx/Observable;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-static {}, Lcom/discord/stores/StoreUser$$Lambda$1;->lambdaFactory$()Lrx/functions/Func1;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
invoke-virtual {v0, v1}, Lrx/Observable;->map(Lrx/functions/Func1;)Lrx/Observable;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-static {}, Lcom/discord/stores/StoreUser$$Lambda$2;->lambdaFactory$()Lrx/functions/Func1;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
invoke-virtual {v0, v1}, Lrx/Observable;->map(Lrx/functions/Func1;)Lrx/Observable;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-static {p1}, Lcom/discord/stores/StoreUser$$Lambda$3;->lambdaFactory$(Ljava/util/Collection;)Lrx/functions/Func1;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
invoke-virtual {v0, v1}, Lrx/Observable;->map(Lrx/functions/Func1;)Lrx/Observable;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-virtual {v0}, Lrx/Observable;->distinctUntilChanged()Lrx/Observable;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
return-object v0
|
||
|
.end method
|
||
|
|
||
|
.method public getAll()Lrx/Observable;
|
||
|
.locals 1
|
||
|
.annotation system Ldalvik/annotation/Signature;
|
||
|
value = {
|
||
|
"()",
|
||
|
"Lrx/Observable",
|
||
|
"<",
|
||
|
"Ljava/util/Map",
|
||
|
"<",
|
||
|
"Ljava/lang/Long;",
|
||
|
"Lcom/discord/models/domain/ModelUser;",
|
||
|
">;>;"
|
||
|
}
|
||
|
.end annotation
|
||
|
|
||
|
.prologue
|
||
|
iget-object v0, p0, Lcom/discord/stores/StoreUser;->usersPublisher:Lcom/discord/utilities/mg_preference/MGPreferenceRx;
|
||
|
|
||
|
invoke-virtual {v0}, Lcom/discord/utilities/mg_preference/MGPreferenceRx;->get()Lrx/Observable;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
return-object v0
|
||
|
.end method
|
||
|
|
||
|
.method public getMe()Lrx/Observable;
|
||
|
.locals 2
|
||
|
.annotation system Ldalvik/annotation/Signature;
|
||
|
value = {
|
||
|
"()",
|
||
|
"Lrx/Observable",
|
||
|
"<",
|
||
|
"Lcom/discord/models/domain/ModelUser;",
|
||
|
">;"
|
||
|
}
|
||
|
.end annotation
|
||
|
|
||
|
.prologue
|
||
|
iget-object v0, p0, Lcom/discord/stores/StoreUser;->mePublisher:Lcom/discord/utilities/mg_preference/MGPreferenceRx;
|
||
|
|
||
|
const/4 v1, 0x0
|
||
|
|
||
|
invoke-virtual {v0, v1}, Lcom/discord/utilities/mg_preference/MGPreferenceRx;->get(Z)Lrx/Observable;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-static {}, Lcom/discord/utilities/app/AppTransformers;->computationDistinctUntilChanged()Lrx/Observable$Transformer;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
invoke-virtual {v0, v1}, Lrx/Observable;->compose(Lrx/Observable$Transformer;)Lrx/Observable;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
return-object v0
|
||
|
.end method
|
||
|
|
||
|
.method public getMeId()Lrx/Observable;
|
||
|
.locals 2
|
||
|
.annotation system Ldalvik/annotation/Signature;
|
||
|
value = {
|
||
|
"()",
|
||
|
"Lrx/Observable",
|
||
|
"<",
|
||
|
"Ljava/lang/Long;",
|
||
|
">;"
|
||
|
}
|
||
|
.end annotation
|
||
|
|
||
|
.prologue
|
||
|
iget-object v0, p0, Lcom/discord/stores/StoreUser;->meIdPublisher:Lcom/discord/utilities/mg_preference/MGPreferenceRx;
|
||
|
|
||
|
const/4 v1, 0x0
|
||
|
|
||
|
invoke-virtual {v0, v1}, Lcom/discord/utilities/mg_preference/MGPreferenceRx;->get(Z)Lrx/Observable;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-static {}, Lcom/discord/utilities/app/AppTransformers;->computationDistinctUntilChanged()Lrx/Observable$Transformer;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
invoke-virtual {v0, v1}, Lrx/Observable;->compose(Lrx/Observable$Transformer;)Lrx/Observable;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
return-object v0
|
||
|
.end method
|
||
|
|
||
|
.method public getUser(J)Lrx/Observable;
|
||
|
.locals 3
|
||
|
.param p1, "userId" # J
|
||
|
.annotation system Ldalvik/annotation/Signature;
|
||
|
value = {
|
||
|
"(J)",
|
||
|
"Lrx/Observable",
|
||
|
"<",
|
||
|
"Lcom/discord/models/domain/ModelUser;",
|
||
|
">;"
|
||
|
}
|
||
|
.end annotation
|
||
|
|
||
|
.prologue
|
||
|
invoke-virtual {p0}, Lcom/discord/stores/StoreUser;->getAll()Lrx/Observable;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-static {p1, p2}, Lcom/discord/stores/StoreUser$$Lambda$4;->lambdaFactory$(J)Lrx/functions/Func1;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
invoke-virtual {v0, v1}, Lrx/Observable;->map(Lrx/functions/Func1;)Lrx/Observable;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-virtual {v0}, Lrx/Observable;->distinctUntilChanged()Lrx/Observable;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
return-object v0
|
||
|
.end method
|
||
|
|
||
|
.method handleChannelCreated(Lcom/discord/models/domain/ModelChannel;)V
|
||
|
.locals 4
|
||
|
.param p1, "channel" # Lcom/discord/models/domain/ModelChannel;
|
||
|
|
||
|
.prologue
|
||
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelChannel;->getRecipient()Lcom/discord/models/domain/ModelUser;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.local v0, "user":Lcom/discord/models/domain/ModelUser;
|
||
|
if-nez v0, :cond_1
|
||
|
|
||
|
:cond_0
|
||
|
:goto_0
|
||
|
return-void
|
||
|
|
||
|
:cond_1
|
||
|
iget-object v1, p0, Lcom/discord/stores/StoreUser;->users:Ljava/util/Map;
|
||
|
|
||
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelUser;->getId()J
|
||
|
|
||
|
move-result-wide v2
|
||
|
|
||
|
invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
invoke-interface {v1, v2}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
invoke-virtual {v0, v1}, Lcom/discord/models/domain/ModelUser;->equals(Ljava/lang/Object;)Z
|
||
|
|
||
|
move-result v1
|
||
|
|
||
|
if-nez v1, :cond_0
|
||
|
|
||
|
iget-object v1, p0, Lcom/discord/stores/StoreUser;->users:Ljava/util/Map;
|
||
|
|
||
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelUser;->getId()J
|
||
|
|
||
|
move-result-wide v2
|
||
|
|
||
|
invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
invoke-interface {v1, v2, v0}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
||
|
|
||
|
const/4 v1, 0x1
|
||
|
|
||
|
invoke-direct {p0, v1}, Lcom/discord/stores/StoreUser;->updateUsers(Z)V
|
||
|
|
||
|
goto :goto_0
|
||
|
.end method
|
||
|
|
||
|
.method handleConnectionOpen(Lcom/discord/models/domain/ModelPayload;)V
|
||
|
.locals 10
|
||
|
.param p1, "payload" # Lcom/discord/models/domain/ModelPayload;
|
||
|
|
||
|
.prologue
|
||
|
iget-object v4, p0, Lcom/discord/stores/StoreUser;->users:Ljava/util/Map;
|
||
|
|
||
|
invoke-interface {v4}, Ljava/util/Map;->clear()V
|
||
|
|
||
|
new-instance v4, Lcom/discord/models/domain/ModelUser$Me;
|
||
|
|
||
|
invoke-direct {v4}, Lcom/discord/models/domain/ModelUser$Me;-><init>()V
|
||
|
|
||
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelPayload;->getMe()Lcom/discord/models/domain/ModelUser;
|
||
|
|
||
|
move-result-object v5
|
||
|
|
||
|
invoke-virtual {v4, v5}, Lcom/discord/models/domain/ModelUser$Me;->merge(Lcom/discord/models/domain/ModelUser;)Lcom/discord/models/domain/ModelUser$Me;
|
||
|
|
||
|
move-result-object v4
|
||
|
|
||
|
iput-object v4, p0, Lcom/discord/stores/StoreUser;->me:Lcom/discord/models/domain/ModelUser$Me;
|
||
|
|
||
|
iget-object v4, p0, Lcom/discord/stores/StoreUser;->users:Ljava/util/Map;
|
||
|
|
||
|
iget-object v5, p0, Lcom/discord/stores/StoreUser;->me:Lcom/discord/models/domain/ModelUser$Me;
|
||
|
|
||
|
invoke-virtual {v5}, Lcom/discord/models/domain/ModelUser$Me;->getId()J
|
||
|
|
||
|
move-result-wide v6
|
||
|
|
||
|
invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||
|
|
||
|
move-result-object v5
|
||
|
|
||
|
iget-object v6, p0, Lcom/discord/stores/StoreUser;->me:Lcom/discord/models/domain/ModelUser$Me;
|
||
|
|
||
|
invoke-interface {v4, v5, v6}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
||
|
|
||
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelPayload;->getPrivateChannels()Ljava/util/List;
|
||
|
|
||
|
move-result-object v4
|
||
|
|
||
|
invoke-interface {v4}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
||
|
|
||
|
move-result-object v4
|
||
|
|
||
|
:cond_0
|
||
|
:goto_0
|
||
|
invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z
|
||
|
|
||
|
move-result v5
|
||
|
|
||
|
if-eqz v5, :cond_1
|
||
|
|
||
|
invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
check-cast v0, Lcom/discord/models/domain/ModelChannel;
|
||
|
|
||
|
.local v0, "channel":Lcom/discord/models/domain/ModelChannel;
|
||
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelChannel;->getRecipient()Lcom/discord/models/domain/ModelUser;
|
||
|
|
||
|
move-result-object v5
|
||
|
|
||
|
if-eqz v5, :cond_0
|
||
|
|
||
|
iget-object v5, p0, Lcom/discord/stores/StoreUser;->users:Ljava/util/Map;
|
||
|
|
||
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelChannel;->getRecipient()Lcom/discord/models/domain/ModelUser;
|
||
|
|
||
|
move-result-object v6
|
||
|
|
||
|
invoke-virtual {v6}, Lcom/discord/models/domain/ModelUser;->getId()J
|
||
|
|
||
|
move-result-wide v6
|
||
|
|
||
|
invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||
|
|
||
|
move-result-object v6
|
||
|
|
||
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelChannel;->getRecipient()Lcom/discord/models/domain/ModelUser;
|
||
|
|
||
|
move-result-object v7
|
||
|
|
||
|
invoke-interface {v5, v6, v7}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
.end local v0 # "channel":Lcom/discord/models/domain/ModelChannel;
|
||
|
:cond_1
|
||
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelPayload;->getRelationships()Ljava/util/List;
|
||
|
|
||
|
move-result-object v4
|
||
|
|
||
|
invoke-interface {v4}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
||
|
|
||
|
move-result-object v4
|
||
|
|
||
|
:cond_2
|
||
|
:goto_1
|
||
|
invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z
|
||
|
|
||
|
move-result v5
|
||
|
|
||
|
if-eqz v5, :cond_3
|
||
|
|
||
|
invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v3
|
||
|
|
||
|
check-cast v3, Lcom/discord/models/domain/ModelUserRelationship;
|
||
|
|
||
|
.local v3, "relationship":Lcom/discord/models/domain/ModelUserRelationship;
|
||
|
invoke-virtual {v3}, Lcom/discord/models/domain/ModelUserRelationship;->getUser()Lcom/discord/models/domain/ModelUser;
|
||
|
|
||
|
move-result-object v5
|
||
|
|
||
|
if-eqz v5, :cond_2
|
||
|
|
||
|
iget-object v5, p0, Lcom/discord/stores/StoreUser;->users:Ljava/util/Map;
|
||
|
|
||
|
invoke-virtual {v3}, Lcom/discord/models/domain/ModelUserRelationship;->getUser()Lcom/discord/models/domain/ModelUser;
|
||
|
|
||
|
move-result-object v6
|
||
|
|
||
|
invoke-virtual {v6}, Lcom/discord/models/domain/ModelUser;->getId()J
|
||
|
|
||
|
move-result-wide v6
|
||
|
|
||
|
invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||
|
|
||
|
move-result-object v6
|
||
|
|
||
|
invoke-virtual {v3}, Lcom/discord/models/domain/ModelUserRelationship;->getUser()Lcom/discord/models/domain/ModelUser;
|
||
|
|
||
|
move-result-object v7
|
||
|
|
||
|
invoke-interface {v5, v6, v7}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
||
|
|
||
|
goto :goto_1
|
||
|
|
||
|
.end local v3 # "relationship":Lcom/discord/models/domain/ModelUserRelationship;
|
||
|
:cond_3
|
||
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelPayload;->getGuilds()Ljava/util/List;
|
||
|
|
||
|
move-result-object v4
|
||
|
|
||
|
invoke-interface {v4}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
||
|
|
||
|
move-result-object v4
|
||
|
|
||
|
:cond_4
|
||
|
invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z
|
||
|
|
||
|
move-result v5
|
||
|
|
||
|
if-eqz v5, :cond_6
|
||
|
|
||
|
invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
check-cast v1, Lcom/discord/models/domain/ModelGuild;
|
||
|
|
||
|
.local v1, "guild":Lcom/discord/models/domain/ModelGuild;
|
||
|
invoke-virtual {v1}, Lcom/discord/models/domain/ModelGuild;->getMembers()Ljava/util/List;
|
||
|
|
||
|
move-result-object v5
|
||
|
|
||
|
if-eqz v5, :cond_4
|
||
|
|
||
|
invoke-virtual {v1}, Lcom/discord/models/domain/ModelGuild;->getMembers()Ljava/util/List;
|
||
|
|
||
|
move-result-object v5
|
||
|
|
||
|
invoke-interface {v5}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
||
|
|
||
|
move-result-object v5
|
||
|
|
||
|
:cond_5
|
||
|
:goto_2
|
||
|
invoke-interface {v5}, Ljava/util/Iterator;->hasNext()Z
|
||
|
|
||
|
move-result v6
|
||
|
|
||
|
if-eqz v6, :cond_4
|
||
|
|
||
|
invoke-interface {v5}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
check-cast v2, Lcom/discord/models/domain/ModelGuildMember;
|
||
|
|
||
|
.local v2, "member":Lcom/discord/models/domain/ModelGuildMember;
|
||
|
invoke-virtual {v2}, Lcom/discord/models/domain/ModelGuildMember;->getUser()Lcom/discord/models/domain/ModelUser;
|
||
|
|
||
|
move-result-object v6
|
||
|
|
||
|
if-eqz v6, :cond_5
|
||
|
|
||
|
iget-object v6, p0, Lcom/discord/stores/StoreUser;->users:Ljava/util/Map;
|
||
|
|
||
|
invoke-virtual {v2}, Lcom/discord/models/domain/ModelGuildMember;->getUser()Lcom/discord/models/domain/ModelUser;
|
||
|
|
||
|
move-result-object v7
|
||
|
|
||
|
invoke-virtual {v7}, Lcom/discord/models/domain/ModelUser;->getId()J
|
||
|
|
||
|
move-result-wide v8
|
||
|
|
||
|
invoke-static {v8, v9}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||
|
|
||
|
move-result-object v7
|
||
|
|
||
|
invoke-virtual {v2}, Lcom/discord/models/domain/ModelGuildMember;->getUser()Lcom/discord/models/domain/ModelUser;
|
||
|
|
||
|
move-result-object v8
|
||
|
|
||
|
invoke-interface {v6, v7, v8}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
||
|
|
||
|
goto :goto_2
|
||
|
|
||
|
.end local v1 # "guild":Lcom/discord/models/domain/ModelGuild;
|
||
|
.end local v2 # "member":Lcom/discord/models/domain/ModelGuildMember;
|
||
|
:cond_6
|
||
|
new-instance v4, Ljava/lang/StringBuilder;
|
||
|
|
||
|
invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
|
||
|
|
||
|
const-string v5, "Discovered "
|
||
|
|
||
|
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||
|
|
||
|
move-result-object v4
|
||
|
|
||
|
iget-object v5, p0, Lcom/discord/stores/StoreUser;->users:Ljava/util/Map;
|
||
|
|
||
|
invoke-interface {v5}, Ljava/util/Map;->size()I
|
||
|
|
||
|
move-result v5
|
||
|
|
||
|
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
||
|
|
||
|
move-result-object v4
|
||
|
|
||
|
const-string v5, " initial users."
|
||
|
|
||
|
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||
|
|
||
|
move-result-object v4
|
||
|
|
||
|
invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v4
|
||
|
|
||
|
invoke-static {v4}, Lcom/discord/utilities/app/AppLog;->i(Ljava/lang/String;)V
|
||
|
|
||
|
iget-object v4, p0, Lcom/discord/stores/StoreUser;->me:Lcom/discord/models/domain/ModelUser$Me;
|
||
|
|
||
|
invoke-static {v4}, Lcom/discord/utilities/app/AppLog;->setUser(Lcom/discord/models/domain/ModelUser;)V
|
||
|
|
||
|
const/4 v4, 0x1
|
||
|
|
||
|
invoke-direct {p0, v4}, Lcom/discord/stores/StoreUser;->updateUsers(Z)V
|
||
|
|
||
|
invoke-direct {p0}, Lcom/discord/stores/StoreUser;->updateMe()V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method handleGuildAddOrSync(Lcom/discord/models/domain/ModelGuild;)V
|
||
|
.locals 8
|
||
|
.param p1, "guild" # Lcom/discord/models/domain/ModelGuild;
|
||
|
|
||
|
.prologue
|
||
|
const/4 v1, 0x0
|
||
|
|
||
|
.local v1, "updated":Z
|
||
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelGuild;->getMembersMap()Ljava/util/Map;
|
||
|
|
||
|
move-result-object v3
|
||
|
|
||
|
invoke-interface {v3}, Ljava/util/Map;->values()Ljava/util/Collection;
|
||
|
|
||
|
move-result-object v3
|
||
|
|
||
|
invoke-interface {v3}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;
|
||
|
|
||
|
move-result-object v3
|
||
|
|
||
|
:cond_0
|
||
|
:goto_0
|
||
|
invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z
|
||
|
|
||
|
move-result v4
|
||
|
|
||
|
if-eqz v4, :cond_2
|
||
|
|
||
|
invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
check-cast v0, Lcom/discord/models/domain/ModelGuildMember;
|
||
|
|
||
|
.local v0, "member":Lcom/discord/models/domain/ModelGuildMember;
|
||
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelGuildMember;->getUser()Lcom/discord/models/domain/ModelUser;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
.local v2, "user":Lcom/discord/models/domain/ModelUser;
|
||
|
if-nez v2, :cond_1
|
||
|
|
||
|
.end local v0 # "member":Lcom/discord/models/domain/ModelGuildMember;
|
||
|
.end local v2 # "user":Lcom/discord/models/domain/ModelUser;
|
||
|
:goto_1
|
||
|
return-void
|
||
|
|
||
|
.restart local v0 # "member":Lcom/discord/models/domain/ModelGuildMember;
|
||
|
.restart local v2 # "user":Lcom/discord/models/domain/ModelUser;
|
||
|
:cond_1
|
||
|
iget-object v4, p0, Lcom/discord/stores/StoreUser;->users:Ljava/util/Map;
|
||
|
|
||
|
invoke-virtual {v2}, Lcom/discord/models/domain/ModelUser;->getId()J
|
||
|
|
||
|
move-result-wide v6
|
||
|
|
||
|
invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||
|
|
||
|
move-result-object v5
|
||
|
|
||
|
invoke-interface {v4, v5}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v4
|
||
|
|
||
|
invoke-virtual {v2, v4}, Lcom/discord/models/domain/ModelUser;->equals(Ljava/lang/Object;)Z
|
||
|
|
||
|
move-result v4
|
||
|
|
||
|
if-nez v4, :cond_0
|
||
|
|
||
|
iget-object v4, p0, Lcom/discord/stores/StoreUser;->users:Ljava/util/Map;
|
||
|
|
||
|
invoke-virtual {v2}, Lcom/discord/models/domain/ModelUser;->getId()J
|
||
|
|
||
|
move-result-wide v6
|
||
|
|
||
|
invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||
|
|
||
|
move-result-object v5
|
||
|
|
||
|
invoke-interface {v4, v5, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
||
|
|
||
|
const/4 v1, 0x1
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
.end local v0 # "member":Lcom/discord/models/domain/ModelGuildMember;
|
||
|
.end local v2 # "user":Lcom/discord/models/domain/ModelUser;
|
||
|
:cond_2
|
||
|
invoke-direct {p0, v1}, Lcom/discord/stores/StoreUser;->updateUsers(Z)V
|
||
|
|
||
|
goto :goto_1
|
||
|
.end method
|
||
|
|
||
|
.method handleGuildMemberAdd(Ljava/util/List;)V
|
||
|
.locals 10
|
||
|
.annotation system Ldalvik/annotation/Signature;
|
||
|
value = {
|
||
|
"(",
|
||
|
"Ljava/util/List",
|
||
|
"<",
|
||
|
"Lcom/discord/models/domain/ModelGuildMember$Chunk;",
|
||
|
">;)V"
|
||
|
}
|
||
|
.end annotation
|
||
|
|
||
|
.prologue
|
||
|
.local p1, "chunks":Ljava/util/List;, "Ljava/util/List<Lcom/discord/models/domain/ModelGuildMember$Chunk;>;"
|
||
|
const/4 v2, 0x0
|
||
|
|
||
|
.local v2, "updated":Z
|
||
|
invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
||
|
|
||
|
move-result-object v4
|
||
|
|
||
|
:cond_0
|
||
|
invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z
|
||
|
|
||
|
move-result v5
|
||
|
|
||
|
if-eqz v5, :cond_3
|
||
|
|
||
|
invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
check-cast v0, Lcom/discord/models/domain/ModelGuildMember$Chunk;
|
||
|
|
||
|
.local v0, "chunk":Lcom/discord/models/domain/ModelGuildMember$Chunk;
|
||
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelGuildMember$Chunk;->getMembers()Ljava/util/List;
|
||
|
|
||
|
move-result-object v5
|
||
|
|
||
|
invoke-interface {v5}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
||
|
|
||
|
move-result-object v5
|
||
|
|
||
|
:cond_1
|
||
|
:goto_0
|
||
|
invoke-interface {v5}, Ljava/util/Iterator;->hasNext()Z
|
||
|
|
||
|
move-result v6
|
||
|
|
||
|
if-eqz v6, :cond_0
|
||
|
|
||
|
invoke-interface {v5}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
check-cast v1, Lcom/discord/models/domain/ModelGuildMember;
|
||
|
|
||
|
.local v1, "member":Lcom/discord/models/domain/ModelGuildMember;
|
||
|
invoke-virtual {v1}, Lcom/discord/models/domain/ModelGuildMember;->getUser()Lcom/discord/models/domain/ModelUser;
|
||
|
|
||
|
move-result-object v3
|
||
|
|
||
|
.local v3, "user":Lcom/discord/models/domain/ModelUser;
|
||
|
if-nez v3, :cond_2
|
||
|
|
||
|
.end local v0 # "chunk":Lcom/discord/models/domain/ModelGuildMember$Chunk;
|
||
|
.end local v1 # "member":Lcom/discord/models/domain/ModelGuildMember;
|
||
|
.end local v3 # "user":Lcom/discord/models/domain/ModelUser;
|
||
|
:goto_1
|
||
|
return-void
|
||
|
|
||
|
.restart local v0 # "chunk":Lcom/discord/models/domain/ModelGuildMember$Chunk;
|
||
|
.restart local v1 # "member":Lcom/discord/models/domain/ModelGuildMember;
|
||
|
.restart local v3 # "user":Lcom/discord/models/domain/ModelUser;
|
||
|
:cond_2
|
||
|
iget-object v6, p0, Lcom/discord/stores/StoreUser;->users:Ljava/util/Map;
|
||
|
|
||
|
invoke-virtual {v3}, Lcom/discord/models/domain/ModelUser;->getId()J
|
||
|
|
||
|
move-result-wide v8
|
||
|
|
||
|
invoke-static {v8, v9}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||
|
|
||
|
move-result-object v7
|
||
|
|
||
|
invoke-interface {v6, v7}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v6
|
||
|
|
||
|
invoke-virtual {v3, v6}, Lcom/discord/models/domain/ModelUser;->equals(Ljava/lang/Object;)Z
|
||
|
|
||
|
move-result v6
|
||
|
|
||
|
if-nez v6, :cond_1
|
||
|
|
||
|
iget-object v6, p0, Lcom/discord/stores/StoreUser;->users:Ljava/util/Map;
|
||
|
|
||
|
invoke-virtual {v3}, Lcom/discord/models/domain/ModelUser;->getId()J
|
||
|
|
||
|
move-result-wide v8
|
||
|
|
||
|
invoke-static {v8, v9}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||
|
|
||
|
move-result-object v7
|
||
|
|
||
|
invoke-interface {v6, v7, v3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
||
|
|
||
|
const/4 v2, 0x1
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
.end local v0 # "chunk":Lcom/discord/models/domain/ModelGuildMember$Chunk;
|
||
|
.end local v1 # "member":Lcom/discord/models/domain/ModelGuildMember;
|
||
|
.end local v3 # "user":Lcom/discord/models/domain/ModelUser;
|
||
|
:cond_3
|
||
|
invoke-direct {p0, v2}, Lcom/discord/stores/StoreUser;->updateUsers(Z)V
|
||
|
|
||
|
goto :goto_1
|
||
|
.end method
|
||
|
|
||
|
.method handleMessageCreateOrUpdate(Ljava/util/List;)V
|
||
|
.locals 8
|
||
|
.annotation system Ldalvik/annotation/Signature;
|
||
|
value = {
|
||
|
"(",
|
||
|
"Ljava/util/List",
|
||
|
"<",
|
||
|
"Lcom/discord/models/domain/ModelMessage;",
|
||
|
">;)V"
|
||
|
}
|
||
|
.end annotation
|
||
|
|
||
|
.prologue
|
||
|
.local p1, "messages":Ljava/util/List;, "Ljava/util/List<Lcom/discord/models/domain/ModelMessage;>;"
|
||
|
const/4 v1, 0x0
|
||
|
|
||
|
.local v1, "updated":Z
|
||
|
invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
||
|
|
||
|
move-result-object v3
|
||
|
|
||
|
:cond_0
|
||
|
invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z
|
||
|
|
||
|
move-result v4
|
||
|
|
||
|
if-eqz v4, :cond_2
|
||
|
|
||
|
invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
check-cast v0, Lcom/discord/models/domain/ModelMessage;
|
||
|
|
||
|
.local v0, "message":Lcom/discord/models/domain/ModelMessage;
|
||
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelMessage;->hasMentions()Z
|
||
|
|
||
|
move-result v4
|
||
|
|
||
|
if-eqz v4, :cond_0
|
||
|
|
||
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelMessage;->getMentions()Ljava/util/List;
|
||
|
|
||
|
move-result-object v4
|
||
|
|
||
|
invoke-interface {v4}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
||
|
|
||
|
move-result-object v4
|
||
|
|
||
|
:cond_1
|
||
|
:goto_0
|
||
|
invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z
|
||
|
|
||
|
move-result v5
|
||
|
|
||
|
if-eqz v5, :cond_0
|
||
|
|
||
|
invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
check-cast v2, Lcom/discord/models/domain/ModelUser;
|
||
|
|
||
|
.local v2, "user":Lcom/discord/models/domain/ModelUser;
|
||
|
iget-object v5, p0, Lcom/discord/stores/StoreUser;->users:Ljava/util/Map;
|
||
|
|
||
|
invoke-virtual {v2}, Lcom/discord/models/domain/ModelUser;->getId()J
|
||
|
|
||
|
move-result-wide v6
|
||
|
|
||
|
invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||
|
|
||
|
move-result-object v6
|
||
|
|
||
|
invoke-interface {v5, v6}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v5
|
||
|
|
||
|
invoke-virtual {v2, v5}, Lcom/discord/models/domain/ModelUser;->equals(Ljava/lang/Object;)Z
|
||
|
|
||
|
move-result v5
|
||
|
|
||
|
if-nez v5, :cond_1
|
||
|
|
||
|
iget-object v5, p0, Lcom/discord/stores/StoreUser;->users:Ljava/util/Map;
|
||
|
|
||
|
invoke-virtual {v2}, Lcom/discord/models/domain/ModelUser;->getId()J
|
||
|
|
||
|
move-result-wide v6
|
||
|
|
||
|
invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||
|
|
||
|
move-result-object v6
|
||
|
|
||
|
invoke-interface {v5, v6, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
||
|
|
||
|
const/4 v1, 0x1
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
.end local v0 # "message":Lcom/discord/models/domain/ModelMessage;
|
||
|
.end local v2 # "user":Lcom/discord/models/domain/ModelUser;
|
||
|
:cond_2
|
||
|
invoke-direct {p0, v1}, Lcom/discord/stores/StoreUser;->updateUsers(Z)V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method handleMessagesLoaded(Ljava/util/List;)V
|
||
|
.locals 10
|
||
|
.annotation system Ldalvik/annotation/Signature;
|
||
|
value = {
|
||
|
"(",
|
||
|
"Ljava/util/List",
|
||
|
"<",
|
||
|
"Lcom/discord/models/domain/ModelMessage$Chunk;",
|
||
|
">;)V"
|
||
|
}
|
||
|
.end annotation
|
||
|
|
||
|
.prologue
|
||
|
.local p1, "chunks":Ljava/util/List;, "Ljava/util/List<Lcom/discord/models/domain/ModelMessage$Chunk;>;"
|
||
|
const/4 v2, 0x0
|
||
|
|
||
|
.local v2, "updated":Z
|
||
|
invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
||
|
|
||
|
move-result-object v4
|
||
|
|
||
|
:cond_0
|
||
|
invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z
|
||
|
|
||
|
move-result v5
|
||
|
|
||
|
if-eqz v5, :cond_3
|
||
|
|
||
|
invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
check-cast v0, Lcom/discord/models/domain/ModelMessage$Chunk;
|
||
|
|
||
|
.local v0, "chunk":Lcom/discord/models/domain/ModelMessage$Chunk;
|
||
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelMessage$Chunk;->getMessages()Ljava/util/List;
|
||
|
|
||
|
move-result-object v5
|
||
|
|
||
|
invoke-interface {v5}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
||
|
|
||
|
move-result-object v5
|
||
|
|
||
|
:cond_1
|
||
|
invoke-interface {v5}, Ljava/util/Iterator;->hasNext()Z
|
||
|
|
||
|
move-result v6
|
||
|
|
||
|
if-eqz v6, :cond_0
|
||
|
|
||
|
invoke-interface {v5}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
check-cast v1, Lcom/discord/models/domain/ModelMessage;
|
||
|
|
||
|
.local v1, "message":Lcom/discord/models/domain/ModelMessage;
|
||
|
invoke-virtual {v1}, Lcom/discord/models/domain/ModelMessage;->hasMentions()Z
|
||
|
|
||
|
move-result v6
|
||
|
|
||
|
if-eqz v6, :cond_1
|
||
|
|
||
|
invoke-virtual {v1}, Lcom/discord/models/domain/ModelMessage;->getMentions()Ljava/util/List;
|
||
|
|
||
|
move-result-object v6
|
||
|
|
||
|
invoke-interface {v6}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
||
|
|
||
|
move-result-object v6
|
||
|
|
||
|
:cond_2
|
||
|
:goto_0
|
||
|
invoke-interface {v6}, Ljava/util/Iterator;->hasNext()Z
|
||
|
|
||
|
move-result v7
|
||
|
|
||
|
if-eqz v7, :cond_1
|
||
|
|
||
|
invoke-interface {v6}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v3
|
||
|
|
||
|
check-cast v3, Lcom/discord/models/domain/ModelUser;
|
||
|
|
||
|
.local v3, "user":Lcom/discord/models/domain/ModelUser;
|
||
|
iget-object v7, p0, Lcom/discord/stores/StoreUser;->users:Ljava/util/Map;
|
||
|
|
||
|
invoke-virtual {v3}, Lcom/discord/models/domain/ModelUser;->getId()J
|
||
|
|
||
|
move-result-wide v8
|
||
|
|
||
|
invoke-static {v8, v9}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||
|
|
||
|
move-result-object v8
|
||
|
|
||
|
invoke-interface {v7, v8}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v7
|
||
|
|
||
|
invoke-virtual {v3, v7}, Lcom/discord/models/domain/ModelUser;->equals(Ljava/lang/Object;)Z
|
||
|
|
||
|
move-result v7
|
||
|
|
||
|
if-nez v7, :cond_2
|
||
|
|
||
|
iget-object v7, p0, Lcom/discord/stores/StoreUser;->users:Ljava/util/Map;
|
||
|
|
||
|
invoke-virtual {v3}, Lcom/discord/models/domain/ModelUser;->getId()J
|
||
|
|
||
|
move-result-wide v8
|
||
|
|
||
|
invoke-static {v8, v9}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||
|
|
||
|
move-result-object v8
|
||
|
|
||
|
invoke-interface {v7, v8, v3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
||
|
|
||
|
const/4 v2, 0x1
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
.end local v0 # "chunk":Lcom/discord/models/domain/ModelMessage$Chunk;
|
||
|
.end local v1 # "message":Lcom/discord/models/domain/ModelMessage;
|
||
|
.end local v3 # "user":Lcom/discord/models/domain/ModelUser;
|
||
|
:cond_3
|
||
|
invoke-direct {p0, v2}, Lcom/discord/stores/StoreUser;->updateUsers(Z)V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method handlePresenceUpdate(Ljava/util/List;)V
|
||
|
.locals 8
|
||
|
.annotation system Ldalvik/annotation/Signature;
|
||
|
value = {
|
||
|
"(",
|
||
|
"Ljava/util/List",
|
||
|
"<",
|
||
|
"Lcom/discord/models/domain/ModelPresence;",
|
||
|
">;)V"
|
||
|
}
|
||
|
.end annotation
|
||
|
|
||
|
.prologue
|
||
|
.local p1, "presencesList":Ljava/util/List;, "Ljava/util/List<Lcom/discord/models/domain/ModelPresence;>;"
|
||
|
const/4 v1, 0x0
|
||
|
|
||
|
.local v1, "updated":Z
|
||
|
invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
||
|
|
||
|
move-result-object v3
|
||
|
|
||
|
:cond_0
|
||
|
:goto_0
|
||
|
invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z
|
||
|
|
||
|
move-result v4
|
||
|
|
||
|
if-eqz v4, :cond_1
|
||
|
|
||
|
invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
check-cast v0, Lcom/discord/models/domain/ModelPresence;
|
||
|
|
||
|
.local v0, "presence":Lcom/discord/models/domain/ModelPresence;
|
||
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelPresence;->getUser()Lcom/discord/models/domain/ModelUser;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
.local v2, "user":Lcom/discord/models/domain/ModelUser;
|
||
|
if-eqz v2, :cond_0
|
||
|
|
||
|
invoke-virtual {v2}, Lcom/discord/models/domain/ModelUser;->getUsername()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v4
|
||
|
|
||
|
if-eqz v4, :cond_0
|
||
|
|
||
|
iget-object v4, p0, Lcom/discord/stores/StoreUser;->users:Ljava/util/Map;
|
||
|
|
||
|
invoke-virtual {v2}, Lcom/discord/models/domain/ModelUser;->getId()J
|
||
|
|
||
|
move-result-wide v6
|
||
|
|
||
|
invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||
|
|
||
|
move-result-object v5
|
||
|
|
||
|
invoke-interface {v4, v5}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v4
|
||
|
|
||
|
invoke-virtual {v2, v4}, Lcom/discord/models/domain/ModelUser;->equals(Ljava/lang/Object;)Z
|
||
|
|
||
|
move-result v4
|
||
|
|
||
|
if-nez v4, :cond_0
|
||
|
|
||
|
iget-object v4, p0, Lcom/discord/stores/StoreUser;->users:Ljava/util/Map;
|
||
|
|
||
|
invoke-virtual {v2}, Lcom/discord/models/domain/ModelUser;->getId()J
|
||
|
|
||
|
move-result-wide v6
|
||
|
|
||
|
invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||
|
|
||
|
move-result-object v5
|
||
|
|
||
|
invoke-interface {v4, v5, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
||
|
|
||
|
const/4 v1, 0x1
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
.end local v0 # "presence":Lcom/discord/models/domain/ModelPresence;
|
||
|
.end local v2 # "user":Lcom/discord/models/domain/ModelUser;
|
||
|
:cond_1
|
||
|
invoke-direct {p0, v1}, Lcom/discord/stores/StoreUser;->updateUsers(Z)V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method handleUserRelationshipAdd(Ljava/util/List;)V
|
||
|
.locals 8
|
||
|
.annotation system Ldalvik/annotation/Signature;
|
||
|
value = {
|
||
|
"(",
|
||
|
"Ljava/util/List",
|
||
|
"<",
|
||
|
"Lcom/discord/models/domain/ModelUserRelationship;",
|
||
|
">;)V"
|
||
|
}
|
||
|
.end annotation
|
||
|
|
||
|
.prologue
|
||
|
.local p1, "relationships":Ljava/util/List;, "Ljava/util/List<Lcom/discord/models/domain/ModelUserRelationship;>;"
|
||
|
const/4 v1, 0x0
|
||
|
|
||
|
.local v1, "updated":Z
|
||
|
invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
||
|
|
||
|
move-result-object v3
|
||
|
|
||
|
:cond_0
|
||
|
:goto_0
|
||
|
invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z
|
||
|
|
||
|
move-result v4
|
||
|
|
||
|
if-eqz v4, :cond_1
|
||
|
|
||
|
invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
check-cast v0, Lcom/discord/models/domain/ModelUserRelationship;
|
||
|
|
||
|
.local v0, "relationship":Lcom/discord/models/domain/ModelUserRelationship;
|
||
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelUserRelationship;->getUser()Lcom/discord/models/domain/ModelUser;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
.local v2, "user":Lcom/discord/models/domain/ModelUser;
|
||
|
if-eqz v2, :cond_0
|
||
|
|
||
|
iget-object v4, p0, Lcom/discord/stores/StoreUser;->users:Ljava/util/Map;
|
||
|
|
||
|
invoke-virtual {v2}, Lcom/discord/models/domain/ModelUser;->getId()J
|
||
|
|
||
|
move-result-wide v6
|
||
|
|
||
|
invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||
|
|
||
|
move-result-object v5
|
||
|
|
||
|
invoke-interface {v4, v5}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v4
|
||
|
|
||
|
invoke-virtual {v2, v4}, Lcom/discord/models/domain/ModelUser;->equals(Ljava/lang/Object;)Z
|
||
|
|
||
|
move-result v4
|
||
|
|
||
|
if-nez v4, :cond_0
|
||
|
|
||
|
iget-object v4, p0, Lcom/discord/stores/StoreUser;->users:Ljava/util/Map;
|
||
|
|
||
|
invoke-virtual {v2}, Lcom/discord/models/domain/ModelUser;->getId()J
|
||
|
|
||
|
move-result-wide v6
|
||
|
|
||
|
invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||
|
|
||
|
move-result-object v5
|
||
|
|
||
|
invoke-interface {v4, v5, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
||
|
|
||
|
const/4 v1, 0x1
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
.end local v0 # "relationship":Lcom/discord/models/domain/ModelUserRelationship;
|
||
|
.end local v2 # "user":Lcom/discord/models/domain/ModelUser;
|
||
|
:cond_1
|
||
|
invoke-direct {p0, v1}, Lcom/discord/stores/StoreUser;->updateUsers(Z)V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method handleUserUpdated(Ljava/util/List;)V
|
||
|
.locals 10
|
||
|
.annotation system Ldalvik/annotation/Signature;
|
||
|
value = {
|
||
|
"(",
|
||
|
"Ljava/util/List",
|
||
|
"<",
|
||
|
"Ljava/util/List",
|
||
|
"<",
|
||
|
"Lcom/discord/models/domain/ModelUser;",
|
||
|
">;>;)V"
|
||
|
}
|
||
|
.end annotation
|
||
|
|
||
|
.prologue
|
||
|
.local p1, "userList":Ljava/util/List;, "Ljava/util/List<Ljava/util/List<Lcom/discord/models/domain/ModelUser;>;>;"
|
||
|
const/4 v0, 0x0
|
||
|
|
||
|
.local v0, "updated":Z
|
||
|
invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
||
|
|
||
|
move-result-object v3
|
||
|
|
||
|
:cond_0
|
||
|
invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z
|
||
|
|
||
|
move-result v4
|
||
|
|
||
|
if-eqz v4, :cond_3
|
||
|
|
||
|
invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
check-cast v2, Ljava/util/List;
|
||
|
|
||
|
.local v2, "userSubList":Ljava/util/List;, "Ljava/util/List<Lcom/discord/models/domain/ModelUser;>;"
|
||
|
invoke-interface {v2}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
||
|
|
||
|
move-result-object v4
|
||
|
|
||
|
:cond_1
|
||
|
:goto_0
|
||
|
invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z
|
||
|
|
||
|
move-result v5
|
||
|
|
||
|
if-eqz v5, :cond_0
|
||
|
|
||
|
invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
check-cast v1, Lcom/discord/models/domain/ModelUser;
|
||
|
|
||
|
.local v1, "user":Lcom/discord/models/domain/ModelUser;
|
||
|
iget-object v5, p0, Lcom/discord/stores/StoreUser;->users:Ljava/util/Map;
|
||
|
|
||
|
invoke-virtual {v1}, Lcom/discord/models/domain/ModelUser;->getId()J
|
||
|
|
||
|
move-result-wide v6
|
||
|
|
||
|
invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||
|
|
||
|
move-result-object v6
|
||
|
|
||
|
invoke-interface {v5, v6}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v5
|
||
|
|
||
|
invoke-virtual {v1, v5}, Lcom/discord/models/domain/ModelUser;->equals(Ljava/lang/Object;)Z
|
||
|
|
||
|
move-result v5
|
||
|
|
||
|
if-nez v5, :cond_2
|
||
|
|
||
|
iget-object v5, p0, Lcom/discord/stores/StoreUser;->users:Ljava/util/Map;
|
||
|
|
||
|
invoke-virtual {v1}, Lcom/discord/models/domain/ModelUser;->getId()J
|
||
|
|
||
|
move-result-wide v6
|
||
|
|
||
|
invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||
|
|
||
|
move-result-object v6
|
||
|
|
||
|
invoke-interface {v5, v6, v1}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
||
|
|
||
|
const/4 v0, 0x1
|
||
|
|
||
|
:cond_2
|
||
|
iget-object v5, p0, Lcom/discord/stores/StoreUser;->me:Lcom/discord/models/domain/ModelUser$Me;
|
||
|
|
||
|
if-eqz v5, :cond_1
|
||
|
|
||
|
iget-object v5, p0, Lcom/discord/stores/StoreUser;->me:Lcom/discord/models/domain/ModelUser$Me;
|
||
|
|
||
|
invoke-virtual {v5}, Lcom/discord/models/domain/ModelUser$Me;->getId()J
|
||
|
|
||
|
move-result-wide v6
|
||
|
|
||
|
invoke-virtual {v1}, Lcom/discord/models/domain/ModelUser;->getId()J
|
||
|
|
||
|
move-result-wide v8
|
||
|
|
||
|
cmp-long v5, v6, v8
|
||
|
|
||
|
if-nez v5, :cond_1
|
||
|
|
||
|
iget-object v5, p0, Lcom/discord/stores/StoreUser;->me:Lcom/discord/models/domain/ModelUser$Me;
|
||
|
|
||
|
invoke-virtual {v5, v1}, Lcom/discord/models/domain/ModelUser$Me;->merge(Lcom/discord/models/domain/ModelUser;)Lcom/discord/models/domain/ModelUser$Me;
|
||
|
|
||
|
move-result-object v5
|
||
|
|
||
|
iput-object v5, p0, Lcom/discord/stores/StoreUser;->me:Lcom/discord/models/domain/ModelUser$Me;
|
||
|
|
||
|
invoke-direct {p0}, Lcom/discord/stores/StoreUser;->updateMe()V
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
.end local v1 # "user":Lcom/discord/models/domain/ModelUser;
|
||
|
.end local v2 # "userSubList":Ljava/util/List;, "Ljava/util/List<Lcom/discord/models/domain/ModelUser;>;"
|
||
|
:cond_3
|
||
|
invoke-direct {p0, v0}, Lcom/discord/stores/StoreUser;->updateUsers(Z)V
|
||
|
|
||
|
return-void
|
||
|
.end method
|