893 lines
24 KiB
Smali
893 lines
24 KiB
Smali
|
.class public final Lcom/discord/stores/StoreEmojiCustom;
|
||
|
.super Lcom/discord/stores/Store;
|
||
|
.source "StoreEmojiCustom.kt"
|
||
|
|
||
|
# interfaces
|
||
|
.implements Lcom/discord/stores/DispatchHandler;
|
||
|
|
||
|
|
||
|
# annotations
|
||
|
.annotation system Ldalvik/annotation/MemberClasses;
|
||
|
value = {
|
||
|
Lcom/discord/stores/StoreEmojiCustom$Companion;
|
||
|
}
|
||
|
.end annotation
|
||
|
|
||
|
|
||
|
# static fields
|
||
|
.field public static final Companion:Lcom/discord/stores/StoreEmojiCustom$Companion;
|
||
|
|
||
|
.field public static final NO_ROLE:J
|
||
|
|
||
|
|
||
|
# instance fields
|
||
|
.field public final allGuildEmojis:Ljava/util/HashMap;
|
||
|
.annotation system Ldalvik/annotation/Signature;
|
||
|
value = {
|
||
|
"Ljava/util/HashMap<",
|
||
|
"Ljava/lang/Long;",
|
||
|
"Ljava/util/Map<",
|
||
|
"Ljava/lang/Long;",
|
||
|
"Lcom/discord/models/domain/emoji/ModelEmojiCustom;",
|
||
|
">;>;"
|
||
|
}
|
||
|
.end annotation
|
||
|
.end field
|
||
|
|
||
|
.field public final availableGuildEmojis:Ljava/util/HashMap;
|
||
|
.annotation system Ldalvik/annotation/Signature;
|
||
|
value = {
|
||
|
"Ljava/util/HashMap<",
|
||
|
"Ljava/lang/Long;",
|
||
|
"Ljava/util/Map<",
|
||
|
"Ljava/lang/Long;",
|
||
|
"Ljava/util/Map<",
|
||
|
"Ljava/lang/Long;",
|
||
|
"Lcom/discord/models/domain/emoji/ModelEmojiCustom;",
|
||
|
">;>;>;"
|
||
|
}
|
||
|
.end annotation
|
||
|
.end field
|
||
|
|
||
|
.field public final availableGuildEmojisPublisher:Lcom/discord/utilities/persister/Persister;
|
||
|
.annotation system Ldalvik/annotation/Signature;
|
||
|
value = {
|
||
|
"Lcom/discord/utilities/persister/Persister<",
|
||
|
"Ljava/util/Map<",
|
||
|
"Ljava/lang/Long;",
|
||
|
"Ljava/util/Map<",
|
||
|
"Ljava/lang/Long;",
|
||
|
"Lcom/discord/models/domain/emoji/ModelEmojiCustom;",
|
||
|
">;>;>;"
|
||
|
}
|
||
|
.end annotation
|
||
|
.end field
|
||
|
|
||
|
.field public final collector:Lcom/discord/stores/StoreStream;
|
||
|
|
||
|
.field public isDirty:Z
|
||
|
|
||
|
.field public me:J
|
||
|
|
||
|
|
||
|
# direct methods
|
||
|
.method public static constructor <clinit>()V
|
||
|
.locals 2
|
||
|
|
||
|
new-instance v0, Lcom/discord/stores/StoreEmojiCustom$Companion;
|
||
|
|
||
|
const/4 v1, 0x0
|
||
|
|
||
|
invoke-direct {v0, v1}, Lcom/discord/stores/StoreEmojiCustom$Companion;-><init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||
|
|
||
|
sput-object v0, Lcom/discord/stores/StoreEmojiCustom;->Companion:Lcom/discord/stores/StoreEmojiCustom$Companion;
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public constructor <init>(Lcom/discord/stores/StoreStream;)V
|
||
|
.locals 2
|
||
|
|
||
|
if-eqz p1, :cond_0
|
||
|
|
||
|
invoke-direct {p0}, Lcom/discord/stores/Store;-><init>()V
|
||
|
|
||
|
iput-object p1, p0, Lcom/discord/stores/StoreEmojiCustom;->collector:Lcom/discord/stores/StoreStream;
|
||
|
|
||
|
new-instance p1, Ljava/util/HashMap;
|
||
|
|
||
|
invoke-direct {p1}, Ljava/util/HashMap;-><init>()V
|
||
|
|
||
|
iput-object p1, p0, Lcom/discord/stores/StoreEmojiCustom;->allGuildEmojis:Ljava/util/HashMap;
|
||
|
|
||
|
new-instance p1, Lcom/discord/utilities/persister/Persister;
|
||
|
|
||
|
new-instance v0, Ljava/util/HashMap;
|
||
|
|
||
|
invoke-direct {v0}, Ljava/util/HashMap;-><init>()V
|
||
|
|
||
|
const-string v1, "STORE_EMOJI_AVAILABLE_V4"
|
||
|
|
||
|
invoke-direct {p1, v1, v0}, Lcom/discord/utilities/persister/Persister;-><init>(Ljava/lang/String;Ljava/lang/Object;)V
|
||
|
|
||
|
iput-object p1, p0, Lcom/discord/stores/StoreEmojiCustom;->availableGuildEmojisPublisher:Lcom/discord/utilities/persister/Persister;
|
||
|
|
||
|
new-instance p1, Ljava/util/HashMap;
|
||
|
|
||
|
invoke-direct {p1}, Ljava/util/HashMap;-><init>()V
|
||
|
|
||
|
iput-object p1, p0, Lcom/discord/stores/StoreEmojiCustom;->availableGuildEmojis:Ljava/util/HashMap;
|
||
|
|
||
|
return-void
|
||
|
|
||
|
:cond_0
|
||
|
const-string p1, "collector"
|
||
|
|
||
|
invoke-static {p1}, Ly/v/b/j;->a(Ljava/lang/String;)V
|
||
|
|
||
|
const/4 p1, 0x0
|
||
|
|
||
|
throw p1
|
||
|
.end method
|
||
|
|
||
|
.method public static final synthetic access$isDirty$p(Lcom/discord/stores/StoreEmojiCustom;)Z
|
||
|
.locals 0
|
||
|
|
||
|
iget-boolean p0, p0, Lcom/discord/stores/StoreEmojiCustom;->isDirty:Z
|
||
|
|
||
|
return p0
|
||
|
.end method
|
||
|
|
||
|
.method public static final synthetic access$setDirty$p(Lcom/discord/stores/StoreEmojiCustom;Z)V
|
||
|
.locals 0
|
||
|
|
||
|
iput-boolean p1, p0, Lcom/discord/stores/StoreEmojiCustom;->isDirty:Z
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method private final updateAvailableGuildEmojis(JLjava/util/List;Ljava/util/Collection;)V
|
||
|
.locals 5
|
||
|
.annotation system Ldalvik/annotation/Signature;
|
||
|
value = {
|
||
|
"(J",
|
||
|
"Ljava/util/List<",
|
||
|
"Ljava/lang/Long;",
|
||
|
">;",
|
||
|
"Ljava/util/Collection<",
|
||
|
"+",
|
||
|
"Lcom/discord/models/domain/emoji/ModelEmojiCustom;",
|
||
|
">;)V"
|
||
|
}
|
||
|
.end annotation
|
||
|
|
||
|
iget-object v0, p0, Lcom/discord/stores/StoreEmojiCustom;->availableGuildEmojis:Ljava/util/HashMap;
|
||
|
|
||
|
invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||
|
|
||
|
move-result-object p1
|
||
|
|
||
|
invoke-interface {v0, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
||
|
|
||
|
move-result-object p2
|
||
|
|
||
|
if-nez p2, :cond_0
|
||
|
|
||
|
new-instance p2, Ljava/util/HashMap;
|
||
|
|
||
|
invoke-direct {p2}, Ljava/util/HashMap;-><init>()V
|
||
|
|
||
|
invoke-interface {v0, p1, p2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
||
|
|
||
|
:cond_0
|
||
|
check-cast p2, Ljava/util/Map;
|
||
|
|
||
|
invoke-interface {p2}, Ljava/util/Map;->clear()V
|
||
|
|
||
|
new-instance p1, Lcom/discord/stores/StoreEmojiCustom$updateAvailableGuildEmojis$1;
|
||
|
|
||
|
invoke-direct {p1, p0, p2}, Lcom/discord/stores/StoreEmojiCustom$updateAvailableGuildEmojis$1;-><init>(Lcom/discord/stores/StoreEmojiCustom;Ljava/util/Map;)V
|
||
|
|
||
|
invoke-interface {p4}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;
|
||
|
|
||
|
move-result-object p2
|
||
|
|
||
|
:cond_1
|
||
|
:goto_0
|
||
|
invoke-interface {p2}, Ljava/util/Iterator;->hasNext()Z
|
||
|
|
||
|
move-result p4
|
||
|
|
||
|
if-eqz p4, :cond_5
|
||
|
|
||
|
invoke-interface {p2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
||
|
|
||
|
move-result-object p4
|
||
|
|
||
|
check-cast p4, Lcom/discord/models/domain/emoji/ModelEmojiCustom;
|
||
|
|
||
|
invoke-virtual {p4}, Lcom/discord/models/domain/emoji/ModelEmojiCustom;->getRoles()Ljava/util/List;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-interface {v0}, Ljava/util/List;->isEmpty()Z
|
||
|
|
||
|
move-result v1
|
||
|
|
||
|
if-eqz v1, :cond_2
|
||
|
|
||
|
const-wide/16 v0, 0x0
|
||
|
|
||
|
invoke-virtual {p1, v0, v1, p4}, Lcom/discord/stores/StoreEmojiCustom$updateAvailableGuildEmojis$1;->invoke(JLcom/discord/models/domain/emoji/ModelEmojiCustom;)V
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
:cond_2
|
||
|
invoke-interface {p3}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
:cond_3
|
||
|
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
|
||
|
|
||
|
move-result v2
|
||
|
|
||
|
if-eqz v2, :cond_4
|
||
|
|
||
|
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
move-object v3, v2
|
||
|
|
||
|
check-cast v3, Ljava/lang/Number;
|
||
|
|
||
|
invoke-virtual {v3}, Ljava/lang/Number;->longValue()J
|
||
|
|
||
|
move-result-wide v3
|
||
|
|
||
|
invoke-static {v3, v4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||
|
|
||
|
move-result-object v3
|
||
|
|
||
|
invoke-interface {v0, v3}, Ljava/util/List;->contains(Ljava/lang/Object;)Z
|
||
|
|
||
|
move-result v3
|
||
|
|
||
|
if-eqz v3, :cond_3
|
||
|
|
||
|
goto :goto_1
|
||
|
|
||
|
:cond_4
|
||
|
const/4 v2, 0x0
|
||
|
|
||
|
:goto_1
|
||
|
check-cast v2, Ljava/lang/Long;
|
||
|
|
||
|
if-eqz v2, :cond_1
|
||
|
|
||
|
invoke-virtual {v2}, Ljava/lang/Number;->longValue()J
|
||
|
|
||
|
move-result-wide v0
|
||
|
|
||
|
invoke-virtual {p1, v0, v1, p4}, Lcom/discord/stores/StoreEmojiCustom$updateAvailableGuildEmojis$1;->invoke(JLcom/discord/models/domain/emoji/ModelEmojiCustom;)V
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
:cond_5
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method private final updateGlobalEmojis(JLjava/util/Collection;)V
|
||
|
.locals 4
|
||
|
.annotation system Ldalvik/annotation/Signature;
|
||
|
value = {
|
||
|
"(J",
|
||
|
"Ljava/util/Collection<",
|
||
|
"+",
|
||
|
"Lcom/discord/models/domain/emoji/ModelEmojiCustom;",
|
||
|
">;)V"
|
||
|
}
|
||
|
.end annotation
|
||
|
|
||
|
invoke-interface {p3}, Ljava/util/Collection;->isEmpty()Z
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
if-eqz v0, :cond_0
|
||
|
|
||
|
iget-object p3, p0, Lcom/discord/stores/StoreEmojiCustom;->allGuildEmojis:Ljava/util/HashMap;
|
||
|
|
||
|
invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||
|
|
||
|
move-result-object p1
|
||
|
|
||
|
invoke-virtual {p3, p1}, Ljava/util/HashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;
|
||
|
|
||
|
goto :goto_1
|
||
|
|
||
|
:cond_0
|
||
|
iget-object v0, p0, Lcom/discord/stores/StoreEmojiCustom;->allGuildEmojis:Ljava/util/HashMap;
|
||
|
|
||
|
invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||
|
|
||
|
move-result-object p1
|
||
|
|
||
|
const/16 p2, 0xa
|
||
|
|
||
|
invoke-static {p3, p2}, Lf/o/a/j/a;->collectionSizeOrDefault(Ljava/lang/Iterable;I)I
|
||
|
|
||
|
move-result p2
|
||
|
|
||
|
invoke-static {p2}, Ly/q/m;->mapCapacity(I)I
|
||
|
|
||
|
move-result p2
|
||
|
|
||
|
const/16 v1, 0x10
|
||
|
|
||
|
if-ge p2, v1, :cond_1
|
||
|
|
||
|
const/16 p2, 0x10
|
||
|
|
||
|
:cond_1
|
||
|
new-instance v1, Ljava/util/LinkedHashMap;
|
||
|
|
||
|
invoke-direct {v1, p2}, Ljava/util/LinkedHashMap;-><init>(I)V
|
||
|
|
||
|
invoke-interface {p3}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
||
|
|
||
|
move-result-object p2
|
||
|
|
||
|
:goto_0
|
||
|
invoke-interface {p2}, Ljava/util/Iterator;->hasNext()Z
|
||
|
|
||
|
move-result p3
|
||
|
|
||
|
if-eqz p3, :cond_2
|
||
|
|
||
|
invoke-interface {p2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
||
|
|
||
|
move-result-object p3
|
||
|
|
||
|
move-object v2, p3
|
||
|
|
||
|
check-cast v2, Lcom/discord/models/domain/emoji/ModelEmojiCustom;
|
||
|
|
||
|
invoke-virtual {v2}, Lcom/discord/models/domain/emoji/ModelEmojiCustom;->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, p3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
:cond_2
|
||
|
invoke-interface {v0, p1, v1}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
||
|
|
||
|
:goto_1
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
|
||
|
# virtual methods
|
||
|
.method public final getAllGuildEmojis$app_productionDiscordExternalRelease()Ljava/util/HashMap;
|
||
|
.locals 1
|
||
|
.annotation system Ldalvik/annotation/Signature;
|
||
|
value = {
|
||
|
"()",
|
||
|
"Ljava/util/HashMap<",
|
||
|
"Ljava/lang/Long;",
|
||
|
"Ljava/util/Map<",
|
||
|
"Ljava/lang/Long;",
|
||
|
"Lcom/discord/models/domain/emoji/ModelEmojiCustom;",
|
||
|
">;>;"
|
||
|
}
|
||
|
.end annotation
|
||
|
|
||
|
iget-object v0, p0, Lcom/discord/stores/StoreEmojiCustom;->allGuildEmojis:Ljava/util/HashMap;
|
||
|
|
||
|
return-object v0
|
||
|
.end method
|
||
|
|
||
|
.method public final getCollector()Lcom/discord/stores/StoreStream;
|
||
|
.locals 1
|
||
|
|
||
|
iget-object v0, p0, Lcom/discord/stores/StoreEmojiCustom;->collector:Lcom/discord/stores/StoreStream;
|
||
|
|
||
|
return-object v0
|
||
|
.end method
|
||
|
|
||
|
.method public final getGuildEmoji()Lrx/Observable;
|
||
|
.locals 2
|
||
|
.annotation system Ldalvik/annotation/Signature;
|
||
|
value = {
|
||
|
"()",
|
||
|
"Lrx/Observable<",
|
||
|
"Ljava/util/Map<",
|
||
|
"Ljava/lang/Long;",
|
||
|
"Ljava/util/Map<",
|
||
|
"Ljava/lang/Long;",
|
||
|
"Lcom/discord/models/domain/emoji/ModelEmojiCustom;",
|
||
|
">;>;>;"
|
||
|
}
|
||
|
.end annotation
|
||
|
|
||
|
iget-object v0, p0, Lcom/discord/stores/StoreEmojiCustom;->availableGuildEmojisPublisher:Lcom/discord/utilities/persister/Persister;
|
||
|
|
||
|
invoke-virtual {v0}, Lcom/discord/utilities/persister/Persister;->getObservable()Lrx/Observable;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-static {v0}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->computationLatest(Lrx/Observable;)Lrx/Observable;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-virtual {v0}, Lrx/Observable;->a()Lrx/Observable;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
const-string v1, "availableGuildEmojisPubl\u2026 .distinctUntilChanged()"
|
||
|
|
||
|
invoke-static {v0, v1}, Ly/v/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
||
|
|
||
|
return-object v0
|
||
|
.end method
|
||
|
|
||
|
.method public final handleConnectionOpen(Lcom/discord/models/domain/ModelPayload;)V
|
||
|
.locals 2
|
||
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
||
|
.end annotation
|
||
|
|
||
|
if-eqz p1, :cond_1
|
||
|
|
||
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelPayload;->getMe()Lcom/discord/models/domain/ModelUser;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
const-string v1, "payload.me"
|
||
|
|
||
|
invoke-static {v0, v1}, Ly/v/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
||
|
|
||
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelUser;->getId()J
|
||
|
|
||
|
move-result-wide v0
|
||
|
|
||
|
iput-wide v0, p0, Lcom/discord/stores/StoreEmojiCustom;->me:J
|
||
|
|
||
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelPayload;->getGuilds()Ljava/util/List;
|
||
|
|
||
|
move-result-object p1
|
||
|
|
||
|
invoke-interface {p1}, Ljava/util/List;->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;
|
||
|
|
||
|
const-string v1, "guild"
|
||
|
|
||
|
invoke-static {v0, v1}, Ly/v/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
||
|
|
||
|
invoke-virtual {p0, v0}, Lcom/discord/stores/StoreEmojiCustom;->handleGuildAdd(Lcom/discord/models/domain/ModelGuild;)Lkotlin/Unit;
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
:cond_0
|
||
|
return-void
|
||
|
|
||
|
:cond_1
|
||
|
const-string p1, "payload"
|
||
|
|
||
|
invoke-static {p1}, Ly/v/b/j;->a(Ljava/lang/String;)V
|
||
|
|
||
|
const/4 p1, 0x0
|
||
|
|
||
|
throw p1
|
||
|
.end method
|
||
|
|
||
|
.method public final handleEmojiUpdate(Lcom/discord/models/domain/emoji/ModelEmojiCustom$Update;)V
|
||
|
.locals 5
|
||
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
||
|
.end annotation
|
||
|
|
||
|
if-eqz p1, :cond_1
|
||
|
|
||
|
invoke-virtual {p1}, Lcom/discord/models/domain/emoji/ModelEmojiCustom$Update;->getGuildId()J
|
||
|
|
||
|
move-result-wide v0
|
||
|
|
||
|
iget-object v2, p0, Lcom/discord/stores/StoreEmojiCustom;->collector:Lcom/discord/stores/StoreStream;
|
||
|
|
||
|
invoke-virtual {v2}, Lcom/discord/stores/StoreStream;->getGuilds$app_productionDiscordExternalRelease()Lcom/discord/stores/StoreGuilds;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
invoke-virtual {v2}, Lcom/discord/stores/StoreGuilds;->getGuildMembersComputedInternal$app_productionDiscordExternalRelease()Ljava/util/Map;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||
|
|
||
|
move-result-object v3
|
||
|
|
||
|
invoke-interface {v2, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
check-cast v2, Ljava/util/Map;
|
||
|
|
||
|
if-eqz v2, :cond_0
|
||
|
|
||
|
iget-wide v3, p0, Lcom/discord/stores/StoreEmojiCustom;->me:J
|
||
|
|
||
|
invoke-static {v3, v4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||
|
|
||
|
move-result-object v3
|
||
|
|
||
|
invoke-interface {v2, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
check-cast v2, Lcom/discord/models/domain/ModelGuildMember$Computed;
|
||
|
|
||
|
if-eqz v2, :cond_0
|
||
|
|
||
|
invoke-virtual {p1}, Lcom/discord/models/domain/emoji/ModelEmojiCustom$Update;->getEmojis()Ljava/util/List;
|
||
|
|
||
|
move-result-object v3
|
||
|
|
||
|
const-string v4, "emojiUpdate.emojis"
|
||
|
|
||
|
invoke-static {v3, v4}, Ly/v/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
||
|
|
||
|
invoke-direct {p0, v0, v1, v3}, Lcom/discord/stores/StoreEmojiCustom;->updateGlobalEmojis(JLjava/util/Collection;)V
|
||
|
|
||
|
invoke-virtual {v2}, Lcom/discord/models/domain/ModelGuildMember$Computed;->getRoles()Ljava/util/List;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
const-string v3, "selfMember.roles"
|
||
|
|
||
|
invoke-static {v2, v3}, Ly/v/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
||
|
|
||
|
invoke-virtual {p1}, Lcom/discord/models/domain/emoji/ModelEmojiCustom$Update;->getEmojis()Ljava/util/List;
|
||
|
|
||
|
move-result-object p1
|
||
|
|
||
|
invoke-static {p1, v4}, Ly/v/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
||
|
|
||
|
invoke-direct {p0, v0, v1, v2, p1}, Lcom/discord/stores/StoreEmojiCustom;->updateAvailableGuildEmojis(JLjava/util/List;Ljava/util/Collection;)V
|
||
|
|
||
|
:cond_0
|
||
|
return-void
|
||
|
|
||
|
:cond_1
|
||
|
const-string p1, "emojiUpdate"
|
||
|
|
||
|
invoke-static {p1}, Ly/v/b/j;->a(Ljava/lang/String;)V
|
||
|
|
||
|
const/4 p1, 0x0
|
||
|
|
||
|
throw p1
|
||
|
.end method
|
||
|
|
||
|
.method public final handleGuildAdd(Lcom/discord/models/domain/ModelGuild;)Lkotlin/Unit;
|
||
|
.locals 4
|
||
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
||
|
.end annotation
|
||
|
|
||
|
const/4 v0, 0x0
|
||
|
|
||
|
if-eqz p1, :cond_1
|
||
|
|
||
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelGuild;->getMembers()Ljava/util/Map;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
iget-wide v2, p0, Lcom/discord/stores/StoreEmojiCustom;->me:J
|
||
|
|
||
|
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
|
||
|
|
||
|
check-cast v1, Lcom/discord/models/domain/ModelGuildMember;
|
||
|
|
||
|
if-eqz v1, :cond_0
|
||
|
|
||
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelGuild;->getId()J
|
||
|
|
||
|
move-result-wide v2
|
||
|
|
||
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelGuild;->getEmojis()Ljava/util/List;
|
||
|
|
||
|
move-result-object p1
|
||
|
|
||
|
const-string v0, "emojis"
|
||
|
|
||
|
invoke-static {p1, v0}, Ly/v/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
||
|
|
||
|
invoke-direct {p0, v2, v3, p1}, Lcom/discord/stores/StoreEmojiCustom;->updateGlobalEmojis(JLjava/util/Collection;)V
|
||
|
|
||
|
invoke-virtual {v1}, Lcom/discord/models/domain/ModelGuildMember;->getRoles()Ljava/util/List;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
const-string v1, "selfMember.roles"
|
||
|
|
||
|
invoke-static {v0, v1}, Ly/v/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
||
|
|
||
|
invoke-direct {p0, v2, v3, v0, p1}, Lcom/discord/stores/StoreEmojiCustom;->updateAvailableGuildEmojis(JLjava/util/List;Ljava/util/Collection;)V
|
||
|
|
||
|
sget-object v0, Lkotlin/Unit;->a:Lkotlin/Unit;
|
||
|
|
||
|
:cond_0
|
||
|
return-object v0
|
||
|
|
||
|
:cond_1
|
||
|
const-string p1, "guild"
|
||
|
|
||
|
invoke-static {p1}, Ly/v/b/j;->a(Ljava/lang/String;)V
|
||
|
|
||
|
throw v0
|
||
|
.end method
|
||
|
|
||
|
.method public final handleGuildMemberAdd(Lcom/discord/models/domain/ModelGuildMember;)V
|
||
|
.locals 5
|
||
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
||
|
.end annotation
|
||
|
|
||
|
if-eqz p1, :cond_1
|
||
|
|
||
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelGuildMember;->getUser()Lcom/discord/models/domain/ModelUser;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
if-eqz v0, :cond_0
|
||
|
|
||
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelUser;->getId()J
|
||
|
|
||
|
move-result-wide v0
|
||
|
|
||
|
iget-wide v2, p0, Lcom/discord/stores/StoreEmojiCustom;->me:J
|
||
|
|
||
|
cmp-long v4, v0, v2
|
||
|
|
||
|
if-nez v4, :cond_0
|
||
|
|
||
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelGuildMember;->getGuildId()J
|
||
|
|
||
|
move-result-wide v0
|
||
|
|
||
|
iget-object v2, p0, Lcom/discord/stores/StoreEmojiCustom;->allGuildEmojis:Ljava/util/HashMap;
|
||
|
|
||
|
invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||
|
|
||
|
move-result-object v3
|
||
|
|
||
|
invoke-virtual {v2, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
check-cast v2, Ljava/util/Map;
|
||
|
|
||
|
if-eqz v2, :cond_0
|
||
|
|
||
|
invoke-interface {v2}, Ljava/util/Map;->values()Ljava/util/Collection;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
if-eqz v2, :cond_0
|
||
|
|
||
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelGuildMember;->getRoles()Ljava/util/List;
|
||
|
|
||
|
move-result-object p1
|
||
|
|
||
|
const-string v3, "member.roles"
|
||
|
|
||
|
invoke-static {p1, v3}, Ly/v/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
||
|
|
||
|
invoke-direct {p0, v0, v1, p1, v2}, Lcom/discord/stores/StoreEmojiCustom;->updateAvailableGuildEmojis(JLjava/util/List;Ljava/util/Collection;)V
|
||
|
|
||
|
:cond_0
|
||
|
return-void
|
||
|
|
||
|
:cond_1
|
||
|
const-string p1, "member"
|
||
|
|
||
|
invoke-static {p1}, Ly/v/b/j;->a(Ljava/lang/String;)V
|
||
|
|
||
|
const/4 p1, 0x0
|
||
|
|
||
|
throw p1
|
||
|
.end method
|
||
|
|
||
|
.method public final handleGuildRemove(Lcom/discord/models/domain/ModelGuild;)V
|
||
|
.locals 3
|
||
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
||
|
.end annotation
|
||
|
|
||
|
if-eqz p1, :cond_2
|
||
|
|
||
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelGuild;->getId()J
|
||
|
|
||
|
move-result-wide v0
|
||
|
|
||
|
iget-object p1, p0, Lcom/discord/stores/StoreEmojiCustom;->availableGuildEmojis:Ljava/util/HashMap;
|
||
|
|
||
|
invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
invoke-interface {p1, v2}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z
|
||
|
|
||
|
move-result p1
|
||
|
|
||
|
if-eqz p1, :cond_0
|
||
|
|
||
|
iget-object p1, p0, Lcom/discord/stores/StoreEmojiCustom;->availableGuildEmojis:Ljava/util/HashMap;
|
||
|
|
||
|
invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
invoke-virtual {p1, v2}, Ljava/util/HashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;
|
||
|
|
||
|
const/4 p1, 0x1
|
||
|
|
||
|
iput-boolean p1, p0, Lcom/discord/stores/StoreEmojiCustom;->isDirty:Z
|
||
|
|
||
|
:cond_0
|
||
|
iget-object p1, p0, Lcom/discord/stores/StoreEmojiCustom;->allGuildEmojis:Ljava/util/HashMap;
|
||
|
|
||
|
invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
invoke-interface {p1, v2}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z
|
||
|
|
||
|
move-result p1
|
||
|
|
||
|
if-eqz p1, :cond_1
|
||
|
|
||
|
iget-object p1, p0, Lcom/discord/stores/StoreEmojiCustom;->allGuildEmojis:Ljava/util/HashMap;
|
||
|
|
||
|
invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-virtual {p1, v0}, Ljava/util/HashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;
|
||
|
|
||
|
:cond_1
|
||
|
return-void
|
||
|
|
||
|
:cond_2
|
||
|
const-string p1, "guild"
|
||
|
|
||
|
invoke-static {p1}, Ly/v/b/j;->a(Ljava/lang/String;)V
|
||
|
|
||
|
const/4 p1, 0x0
|
||
|
|
||
|
throw p1
|
||
|
.end method
|
||
|
|
||
|
.method public onDispatchEnded()V
|
||
|
.locals 7
|
||
|
|
||
|
iget-boolean v0, p0, Lcom/discord/stores/StoreEmojiCustom;->isDirty:Z
|
||
|
|
||
|
const/4 v1, 0x0
|
||
|
|
||
|
if-eqz v0, :cond_2
|
||
|
|
||
|
new-instance v0, Ljava/util/HashMap;
|
||
|
|
||
|
invoke-direct {v0}, Ljava/util/HashMap;-><init>()V
|
||
|
|
||
|
iget-object v2, p0, Lcom/discord/stores/StoreEmojiCustom;->availableGuildEmojis:Ljava/util/HashMap;
|
||
|
|
||
|
invoke-interface {v2}, Ljava/util/Map;->entrySet()Ljava/util/Set;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
invoke-interface {v2}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
:cond_0
|
||
|
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
|
||
|
|
||
|
move-result v3
|
||
|
|
||
|
if-eqz v3, :cond_1
|
||
|
|
||
|
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v3
|
||
|
|
||
|
check-cast v3, Ljava/util/Map$Entry;
|
||
|
|
||
|
invoke-interface {v3}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v4
|
||
|
|
||
|
check-cast v4, Ljava/lang/Number;
|
||
|
|
||
|
invoke-virtual {v4}, Ljava/lang/Number;->longValue()J
|
||
|
|
||
|
move-result-wide v4
|
||
|
|
||
|
invoke-interface {v3}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v3
|
||
|
|
||
|
check-cast v3, Ljava/util/Map;
|
||
|
|
||
|
new-instance v6, Ljava/util/HashMap;
|
||
|
|
||
|
invoke-direct {v6}, Ljava/util/HashMap;-><init>()V
|
||
|
|
||
|
invoke-static {v4, v5}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
||
|
|
||
|
move-result-object v4
|
||
|
|
||
|
invoke-interface {v0, v4, v6}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
||
|
|
||
|
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
|
||
|
|
||
|
:goto_0
|
||
|
invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z
|
||
|
|
||
|
move-result v4
|
||
|
|
||
|
if-eqz v4, :cond_0
|
||
|
|
||
|
invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v4
|
||
|
|
||
|
check-cast v4, Ljava/util/Map;
|
||
|
|
||
|
invoke-interface {v6, v4}, Ljava/util/Map;->putAll(Ljava/util/Map;)V
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
:cond_1
|
||
|
iget-object v2, p0, Lcom/discord/stores/StoreEmojiCustom;->availableGuildEmojisPublisher:Lcom/discord/utilities/persister/Persister;
|
||
|
|
||
|
const/4 v3, 0x2
|
||
|
|
||
|
const/4 v4, 0x0
|
||
|
|
||
|
invoke-static {v2, v0, v1, v3, v4}, Lcom/discord/utilities/persister/Persister;->set$default(Lcom/discord/utilities/persister/Persister;Ljava/lang/Object;ZILjava/lang/Object;)Ljava/lang/Object;
|
||
|
|
||
|
:cond_2
|
||
|
iput-boolean v1, p0, Lcom/discord/stores/StoreEmojiCustom;->isDirty:Z
|
||
|
|
||
|
return-void
|
||
|
.end method
|