2020-10-13 20:45:03 +00:00
|
|
|
.class public final Lcom/discord/stores/StoreMessageReplies;
|
|
|
|
.super Lcom/discord/stores/StoreV2;
|
|
|
|
.source "StoreMessageReplies.kt"
|
|
|
|
|
|
|
|
|
|
|
|
# annotations
|
|
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
|
|
value = {
|
|
|
|
Lcom/discord/stores/StoreMessageReplies$MessageState;,
|
|
|
|
Lcom/discord/stores/StoreMessageReplies$MessageCache;,
|
|
|
|
Lcom/discord/stores/StoreMessageReplies$Companion;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
|
|
|
|
# static fields
|
|
|
|
.field public static final Companion:Lcom/discord/stores/StoreMessageReplies$Companion;
|
|
|
|
|
|
|
|
.field public static final NO_RESULTS:Ljava/util/Map;
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"Ljava/util/Map<",
|
|
|
|
"Ljava/lang/Long;",
|
|
|
|
"Lcom/discord/stores/StoreMessageReplies$MessageState;",
|
|
|
|
">;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
.end field
|
|
|
|
|
|
|
|
|
|
|
|
# instance fields
|
|
|
|
.field public final channelMap:Ljava/util/HashMap;
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"Ljava/util/HashMap<",
|
|
|
|
"Ljava/lang/Long;",
|
|
|
|
"Ljava/util/Set<",
|
|
|
|
"Ljava/lang/Long;",
|
|
|
|
">;>;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
.end field
|
|
|
|
|
|
|
|
.field public final dispatcher:Lcom/discord/stores/Dispatcher;
|
|
|
|
|
|
|
|
.field public final observationDeck:Lcom/discord/stores/updates/ObservationDeck;
|
|
|
|
|
|
|
|
.field public final repliedMessagesCache:Lcom/discord/stores/StoreMessageReplies$MessageCache;
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"Lcom/discord/stores/StoreMessageReplies$MessageCache<",
|
|
|
|
"Ljava/lang/Long;",
|
|
|
|
"Lcom/discord/stores/StoreMessageReplies$MessageState;",
|
|
|
|
">;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
.end field
|
|
|
|
|
|
|
|
.field public repliedMessagesCacheSnapshot:Ljava/util/Map;
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"Ljava/util/Map<",
|
|
|
|
"Ljava/lang/Long;",
|
|
|
|
"+",
|
|
|
|
"Ljava/util/Map<",
|
|
|
|
"Ljava/lang/Long;",
|
|
|
|
"+",
|
|
|
|
"Lcom/discord/stores/StoreMessageReplies$MessageState;",
|
|
|
|
">;>;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
.end field
|
|
|
|
|
|
|
|
.field public final storeMessages:Lcom/discord/stores/StoreMessages;
|
|
|
|
|
|
|
|
.field public subscribedChannels:Ljava/util/Set;
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"Ljava/util/Set<",
|
|
|
|
"Ljava/lang/Long;",
|
|
|
|
">;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
.end field
|
|
|
|
|
|
|
|
|
|
|
|
# direct methods
|
|
|
|
.method public static constructor <clinit>()V
|
|
|
|
.locals 2
|
|
|
|
|
|
|
|
new-instance v0, Lcom/discord/stores/StoreMessageReplies$Companion;
|
|
|
|
|
|
|
|
const/4 v1, 0x0
|
|
|
|
|
|
|
|
invoke-direct {v0, v1}, Lcom/discord/stores/StoreMessageReplies$Companion;-><init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
|
|
|
|
sput-object v0, Lcom/discord/stores/StoreMessageReplies;->Companion:Lcom/discord/stores/StoreMessageReplies$Companion;
|
|
|
|
|
|
|
|
sget-object v0, Lc0/i/m;->d:Lc0/i/m;
|
|
|
|
|
|
|
|
sput-object v0, Lcom/discord/stores/StoreMessageReplies;->NO_RESULTS:Ljava/util/Map;
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public constructor <init>(Lcom/discord/stores/Dispatcher;Lcom/discord/stores/StoreMessages;Lcom/discord/stores/updates/ObservationDeck;)V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
const-string v0, "dispatcher"
|
|
|
|
|
|
|
|
invoke-static {p1, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
|
2020-10-19 23:59:54 +00:00
|
|
|
const-string/jumbo v0, "storeMessages"
|
2020-10-13 20:45:03 +00:00
|
|
|
|
|
|
|
invoke-static {p2, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
|
|
|
|
const-string v0, "observationDeck"
|
|
|
|
|
|
|
|
invoke-static {p3, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lcom/discord/stores/StoreV2;-><init>()V
|
|
|
|
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreMessageReplies;->dispatcher:Lcom/discord/stores/Dispatcher;
|
|
|
|
|
|
|
|
iput-object p2, p0, Lcom/discord/stores/StoreMessageReplies;->storeMessages:Lcom/discord/stores/StoreMessages;
|
|
|
|
|
|
|
|
iput-object p3, p0, Lcom/discord/stores/StoreMessageReplies;->observationDeck:Lcom/discord/stores/updates/ObservationDeck;
|
|
|
|
|
|
|
|
new-instance p1, Lcom/discord/stores/StoreMessageReplies$MessageCache;
|
|
|
|
|
|
|
|
invoke-direct {p1}, Lcom/discord/stores/StoreMessageReplies$MessageCache;-><init>()V
|
|
|
|
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreMessageReplies;->repliedMessagesCache:Lcom/discord/stores/StoreMessageReplies$MessageCache;
|
|
|
|
|
|
|
|
new-instance p1, Ljava/util/HashMap;
|
|
|
|
|
|
|
|
invoke-direct {p1}, Ljava/util/HashMap;-><init>()V
|
|
|
|
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreMessageReplies;->channelMap:Ljava/util/HashMap;
|
|
|
|
|
|
|
|
sget-object p1, Lc0/i/n;->d:Lc0/i/n;
|
|
|
|
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreMessageReplies;->subscribedChannels:Ljava/util/Set;
|
|
|
|
|
|
|
|
sget-object p1, Lc0/i/m;->d:Lc0/i/m;
|
|
|
|
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreMessageReplies;->repliedMessagesCacheSnapshot:Ljava/util/Map;
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public synthetic constructor <init>(Lcom/discord/stores/Dispatcher;Lcom/discord/stores/StoreMessages;Lcom/discord/stores/updates/ObservationDeck;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
and-int/lit8 p4, p4, 0x4
|
|
|
|
|
|
|
|
if-eqz p4, :cond_0
|
|
|
|
|
|
|
|
invoke-static {}, Lcom/discord/stores/updates/ObservationDeckProvider;->get()Lcom/discord/stores/updates/ObservationDeck;
|
|
|
|
|
|
|
|
move-result-object p3
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-direct {p0, p1, p2, p3}, Lcom/discord/stores/StoreMessageReplies;-><init>(Lcom/discord/stores/Dispatcher;Lcom/discord/stores/StoreMessages;Lcom/discord/stores/updates/ObservationDeck;)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static final synthetic access$getCachedMessages(Lcom/discord/stores/StoreMessageReplies;)Ljava/util/Map;
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lcom/discord/stores/StoreMessageReplies;->getCachedMessages()Ljava/util/Map;
|
|
|
|
|
|
|
|
move-result-object p0
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static final synthetic access$getNO_RESULTS$cp()Ljava/util/Map;
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
sget-object v0, Lcom/discord/stores/StoreMessageReplies;->NO_RESULTS:Ljava/util/Map;
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private final deleteMessage(JJ)Z
|
|
|
|
.locals 7
|
|
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMessageReplies;->repliedMessagesCache:Lcom/discord/stores/StoreMessageReplies$MessageCache;
|
|
|
|
|
|
|
|
invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Ljava/util/LinkedHashMap;->containsKey(Ljava/lang/Object;)Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
sget-object v6, Lcom/discord/stores/StoreMessageReplies$MessageState$Deleted;->INSTANCE:Lcom/discord/stores/StoreMessageReplies$MessageState$Deleted;
|
|
|
|
|
|
|
|
move-object v1, p0
|
|
|
|
|
|
|
|
move-wide v2, p1
|
|
|
|
|
|
|
|
move-wide v4, p3
|
|
|
|
|
|
|
|
invoke-direct/range {v1 .. v6}, Lcom/discord/stores/StoreMessageReplies;->updateCache(JJLcom/discord/stores/StoreMessageReplies$MessageState;)V
|
|
|
|
|
|
|
|
const/4 p1, 0x1
|
|
|
|
|
|
|
|
return p1
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const/4 p1, 0x0
|
|
|
|
|
|
|
|
return p1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private final getCachedMessages()Ljava/util/Map;
|
|
|
|
.locals 1
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"()",
|
|
|
|
"Ljava/util/Map<",
|
|
|
|
"Ljava/lang/Long;",
|
|
|
|
"Ljava/util/Map<",
|
|
|
|
"Ljava/lang/Long;",
|
|
|
|
"Lcom/discord/stores/StoreMessageReplies$MessageState;",
|
|
|
|
">;>;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMessageReplies;->repliedMessagesCacheSnapshot:Ljava/util/Map;
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private final markUpdatedAndSubscribedChannelsAsChanged(Ljava/util/Set;)V
|
|
|
|
.locals 2
|
|
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"(",
|
|
|
|
"Ljava/util/Set<",
|
|
|
|
"Ljava/lang/Long;",
|
|
|
|
">;)V"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMessageReplies;->subscribedChannels:Ljava/util/Set;
|
|
|
|
|
|
|
|
const-string v1, "$this$intersect"
|
|
|
|
|
|
|
|
invoke-static {p1, v1}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
|
|
|
|
const-string v1, "other"
|
|
|
|
|
|
|
|
invoke-static {v0, v1}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
|
|
|
|
invoke-static {p1}, Lc0/i/f;->toMutableSet(Ljava/lang/Iterable;)Ljava/util/Set;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
const-string v1, "$this$retainAll"
|
|
|
|
|
|
|
|
invoke-static {p1, v1}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
|
|
|
|
const-string v1, "elements"
|
|
|
|
|
|
|
|
invoke-static {v0, v1}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
|
|
|
|
invoke-static {v0, p1}, Lf/h/a/f/f/n/f;->convertToSetForSetOperationWith(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/Collection;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-static {p1}, Lc0/n/c/w;->asMutableCollection(Ljava/lang/Object;)Ljava/util/Collection;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
invoke-interface {v1, v0}, Ljava/util/Collection;->retainAll(Ljava/util/Collection;)Z
|
|
|
|
|
|
|
|
invoke-interface {p1}, Ljava/util/Set;->isEmpty()Z
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-virtual {p0}, Lcom/discord/stores/StoreV2;->markChanged()V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private final processMessage(Lcom/discord/models/domain/ModelMessage;)Ljava/util/Set;
|
|
|
|
.locals 10
|
|
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"(",
|
|
|
|
"Lcom/discord/models/domain/ModelMessage;",
|
|
|
|
")",
|
|
|
|
"Ljava/util/Set<",
|
|
|
|
"Ljava/lang/Long;",
|
|
|
|
">;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
new-instance v0, Ljava/util/LinkedHashSet;
|
|
|
|
|
|
|
|
invoke-direct {v0}, Ljava/util/LinkedHashSet;-><init>()V
|
|
|
|
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/stores/StoreMessageReplies;->updateExistingMessage(Lcom/discord/models/domain/ModelMessage;)Ljava/util/Set;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
invoke-interface {v0, v1}, Ljava/util/Set;->addAll(Ljava/util/Collection;)Z
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessage;->getType()I
|
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
|
|
|
const/16 v2, 0x13
|
|
|
|
|
|
|
|
if-ne v1, v2, :cond_2
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessage;->getMessageReference()Lcom/discord/models/domain/ModelMessage$MessageReference;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
|
|
|
|
const-string v2, "message.messageReference ?: return updated"
|
|
|
|
|
|
|
|
invoke-static {v1, v2}, Lc0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessage;->getReferencedMessage()Lcom/discord/models/domain/ModelMessage;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Lcom/discord/models/domain/ModelMessage$MessageReference;->getChannelId()Ljava/lang/Long;
|
|
|
|
|
|
|
|
move-result-object v3
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Lcom/discord/models/domain/ModelMessage$MessageReference;->getMessageId()Ljava/lang/Long;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
|
|
|
|
invoke-virtual {v2}, Lcom/discord/models/domain/ModelMessage;->getId()J
|
|
|
|
|
|
|
|
move-result-wide v5
|
|
|
|
|
|
|
|
invoke-virtual {v2}, Lcom/discord/models/domain/ModelMessage;->getChannelId()J
|
|
|
|
|
|
|
|
move-result-wide v7
|
|
|
|
|
|
|
|
new-instance v9, Lcom/discord/stores/StoreMessageReplies$MessageState$Loaded;
|
|
|
|
|
|
|
|
invoke-direct {v9, v2}, Lcom/discord/stores/StoreMessageReplies$MessageState$Loaded;-><init>(Lcom/discord/models/domain/ModelMessage;)V
|
|
|
|
|
|
|
|
move-object v4, p0
|
|
|
|
|
|
|
|
invoke-direct/range {v4 .. v9}, Lcom/discord/stores/StoreMessageReplies;->updateCache(JJLcom/discord/stores/StoreMessageReplies$MessageState;)V
|
|
|
|
|
2020-10-27 04:20:34 +00:00
|
|
|
invoke-virtual {v2}, Lcom/discord/models/domain/ModelMessage;->getChannelId()J
|
2020-10-13 20:45:03 +00:00
|
|
|
|
|
|
|
move-result-wide v1
|
|
|
|
|
|
|
|
invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
invoke-interface {v0, v1}, Ljava/util/Set;->add(Ljava/lang/Object;)Z
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
if-eqz v3, :cond_2
|
|
|
|
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
|
|
|
|
invoke-interface {v0, v3}, Ljava/util/Set;->add(Ljava/lang/Object;)Z
|
|
|
|
|
|
|
|
iget-object v2, p0, Lcom/discord/stores/StoreMessageReplies;->storeMessages:Lcom/discord/stores/StoreMessages;
|
|
|
|
|
|
|
|
invoke-virtual {v3}, Ljava/lang/Long;->longValue()J
|
|
|
|
|
|
|
|
move-result-wide v4
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Ljava/lang/Long;->longValue()J
|
|
|
|
|
|
|
|
move-result-wide v6
|
|
|
|
|
|
|
|
invoke-virtual {v2, v4, v5, v6, v7}, Lcom/discord/stores/StoreMessages;->getMessage(JJ)Lcom/discord/models/domain/ModelMessage;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
|
|
|
|
invoke-virtual {v2}, Lcom/discord/models/domain/ModelMessage;->getId()J
|
|
|
|
|
|
|
|
move-result-wide v3
|
|
|
|
|
|
|
|
invoke-virtual {v2}, Lcom/discord/models/domain/ModelMessage;->getChannelId()J
|
|
|
|
|
|
|
|
move-result-wide v5
|
|
|
|
|
|
|
|
new-instance v7, Lcom/discord/stores/StoreMessageReplies$MessageState$Loaded;
|
|
|
|
|
|
|
|
invoke-direct {v7, v2}, Lcom/discord/stores/StoreMessageReplies$MessageState$Loaded;-><init>(Lcom/discord/models/domain/ModelMessage;)V
|
|
|
|
|
|
|
|
move-object v2, p0
|
|
|
|
|
|
|
|
invoke-direct/range {v2 .. v7}, Lcom/discord/stores/StoreMessageReplies;->updateCache(JJLcom/discord/stores/StoreMessageReplies$MessageState;)V
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
invoke-virtual {v1}, Ljava/lang/Long;->longValue()J
|
|
|
|
|
|
|
|
move-result-wide v4
|
|
|
|
|
|
|
|
invoke-virtual {v3}, Ljava/lang/Long;->longValue()J
|
|
|
|
|
|
|
|
move-result-wide v6
|
|
|
|
|
|
|
|
sget-object v1, Lcom/discord/stores/StoreMessageReplies$MessageState$Unloaded;->INSTANCE:Lcom/discord/stores/StoreMessageReplies$MessageState$Unloaded;
|
|
|
|
|
|
|
|
move-object v2, p0
|
|
|
|
|
|
|
|
move-wide v3, v4
|
|
|
|
|
|
|
|
move-wide v5, v6
|
|
|
|
|
|
|
|
move-object v7, v1
|
|
|
|
|
|
|
|
invoke-direct/range {v2 .. v7}, Lcom/discord/stores/StoreMessageReplies;->updateCache(JJLcom/discord/stores/StoreMessageReplies$MessageState;)V
|
|
|
|
|
|
|
|
nop
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
:goto_0
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private final updateCache(JJLcom/discord/stores/StoreMessageReplies$MessageState;)V
|
|
|
|
.locals 2
|
|
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMessageReplies;->repliedMessagesCache:Lcom/discord/stores/StoreMessageReplies$MessageCache;
|
|
|
|
|
|
|
|
invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
invoke-interface {v0, v1, p5}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
iget-object p5, p0, Lcom/discord/stores/StoreMessageReplies;->channelMap:Ljava/util/HashMap;
|
|
|
|
|
|
|
|
invoke-static {p3, p4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
|
2020-10-27 04:20:34 +00:00
|
|
|
move-result-object v0
|
2020-10-13 20:45:03 +00:00
|
|
|
|
|
|
|
invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
|
2020-10-27 04:20:34 +00:00
|
|
|
move-result-object p1
|
2020-10-13 20:45:03 +00:00
|
|
|
|
2020-10-27 04:20:34 +00:00
|
|
|
invoke-static {p1}, Lf/h/a/f/f/n/f;->setOf(Ljava/lang/Object;)Ljava/util/Set;
|
2020-10-13 20:45:03 +00:00
|
|
|
|
2020-10-27 04:20:34 +00:00
|
|
|
move-result-object p1
|
2020-10-13 20:45:03 +00:00
|
|
|
|
2020-10-27 04:20:34 +00:00
|
|
|
iget-object p2, p0, Lcom/discord/stores/StoreMessageReplies;->channelMap:Ljava/util/HashMap;
|
2020-10-13 20:45:03 +00:00
|
|
|
|
2020-10-27 04:20:34 +00:00
|
|
|
invoke-static {p3, p4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
2020-10-13 20:45:03 +00:00
|
|
|
|
2020-10-27 04:20:34 +00:00
|
|
|
move-result-object p3
|
2020-10-13 20:45:03 +00:00
|
|
|
|
2020-10-27 04:20:34 +00:00
|
|
|
invoke-virtual {p2, p3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
2020-10-13 20:45:03 +00:00
|
|
|
|
2020-10-27 04:20:34 +00:00
|
|
|
move-result-object p2
|
2020-10-13 20:45:03 +00:00
|
|
|
|
2020-10-27 04:20:34 +00:00
|
|
|
check-cast p2, Ljava/util/Set;
|
2020-10-13 20:45:03 +00:00
|
|
|
|
2020-10-27 04:20:34 +00:00
|
|
|
if-eqz p2, :cond_0
|
2020-10-13 20:45:03 +00:00
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
2020-10-27 04:20:34 +00:00
|
|
|
sget-object p2, Lc0/i/n;->d:Lc0/i/n;
|
2020-10-13 20:45:03 +00:00
|
|
|
|
|
|
|
:goto_0
|
2020-10-27 04:20:34 +00:00
|
|
|
invoke-static {p1, p2}, Lc0/i/f;->union(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/Set;
|
2020-10-13 20:45:03 +00:00
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
2020-10-27 04:20:34 +00:00
|
|
|
invoke-interface {p5, v0, p1}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
2020-10-13 20:45:03 +00:00
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private final updateExistingMessage(Lcom/discord/models/domain/ModelMessage;)Ljava/util/Set;
|
|
|
|
.locals 8
|
|
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"(",
|
|
|
|
"Lcom/discord/models/domain/ModelMessage;",
|
|
|
|
")",
|
|
|
|
"Ljava/util/Set<",
|
|
|
|
"Ljava/lang/Long;",
|
|
|
|
">;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
new-instance v0, Ljava/util/LinkedHashSet;
|
|
|
|
|
|
|
|
invoke-direct {v0}, Ljava/util/LinkedHashSet;-><init>()V
|
|
|
|
|
|
|
|
iget-object v1, p0, Lcom/discord/stores/StoreMessageReplies;->repliedMessagesCache:Lcom/discord/stores/StoreMessageReplies$MessageCache;
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessage;->getId()J
|
|
|
|
|
|
|
|
move-result-wide v2
|
|
|
|
|
|
|
|
invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
invoke-virtual {v1, v2}, Ljava/util/LinkedHashMap;->containsKey(Ljava/lang/Object;)Z
|
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessage;->getChannelId()J
|
|
|
|
|
|
|
|
move-result-wide v1
|
|
|
|
|
|
|
|
invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
invoke-interface {v0, v1}, Ljava/util/Set;->add(Ljava/lang/Object;)Z
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessage;->getId()J
|
|
|
|
|
|
|
|
move-result-wide v3
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessage;->getChannelId()J
|
|
|
|
|
|
|
|
move-result-wide v5
|
|
|
|
|
|
|
|
new-instance v7, Lcom/discord/stores/StoreMessageReplies$MessageState$Loaded;
|
|
|
|
|
|
|
|
invoke-direct {v7, p1}, Lcom/discord/stores/StoreMessageReplies$MessageState$Loaded;-><init>(Lcom/discord/models/domain/ModelMessage;)V
|
|
|
|
|
|
|
|
move-object v2, p0
|
|
|
|
|
|
|
|
invoke-direct/range {v2 .. v7}, Lcom/discord/stores/StoreMessageReplies;->updateCache(JJLcom/discord/stores/StoreMessageReplies$MessageState;)V
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
|
|
|
|
# virtual methods
|
|
|
|
.method public final handleChannelChanged(J)V
|
|
|
|
.locals 0
|
|
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
invoke-virtual {p0, p1, p2}, Lcom/discord/stores/StoreMessageReplies;->watchChannelIfNotAlreadySubscribed(J)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final handleLoadMessages(Ljava/util/Collection;)V
|
|
|
|
.locals 2
|
|
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"(",
|
|
|
|
"Ljava/util/Collection<",
|
|
|
|
"+",
|
|
|
|
"Lcom/discord/models/domain/ModelMessage;",
|
|
|
|
">;)V"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
const-string v0, "messages"
|
|
|
|
|
|
|
|
invoke-static {p1, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
|
|
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()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 v1
|
|
|
|
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
check-cast v1, Lcom/discord/models/domain/ModelMessage;
|
|
|
|
|
|
|
|
invoke-direct {p0, v1}, Lcom/discord/stores/StoreMessageReplies;->processMessage(Lcom/discord/models/domain/ModelMessage;)Ljava/util/Set;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
invoke-static {v0, v1}, Lf/h/a/f/f/n/f;->addAll(Ljava/util/Collection;Ljava/lang/Iterable;)Z
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-static {v0}, Lc0/i/f;->toSet(Ljava/lang/Iterable;)Ljava/util/Set;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/stores/StoreMessageReplies;->markUpdatedAndSubscribedChannelsAsChanged(Ljava/util/Set;)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final handleMessageCreate(Lcom/discord/models/domain/ModelMessage;)V
|
|
|
|
.locals 1
|
|
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
const-string v0, "message"
|
|
|
|
|
|
|
|
invoke-static {p1, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/stores/StoreMessageReplies;->processMessage(Lcom/discord/models/domain/ModelMessage;)Ljava/util/Set;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/stores/StoreMessageReplies;->markUpdatedAndSubscribedChannelsAsChanged(Ljava/util/Set;)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final handleMessageDelete(Lcom/discord/models/domain/ModelMessageDelete;)V
|
|
|
|
.locals 6
|
|
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
const-string v0, "messageDeleteBulk"
|
|
|
|
|
|
|
|
invoke-static {p1, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessageDelete;->getMessageIds()Ljava/util/List;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
const-string v1, "messageDeleteBulk.messageIds"
|
|
|
|
|
|
|
|
invoke-static {v0, v1}, Lc0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
|
|
|
|
new-instance v1, Ljava/util/ArrayList;
|
|
|
|
|
|
|
|
const/16 v2, 0xa
|
|
|
|
|
|
|
|
invoke-static {v0, v2}, Lf/h/a/f/f/n/f;->collectionSizeOrDefault(Ljava/lang/Iterable;I)I
|
|
|
|
|
|
|
|
move-result v2
|
|
|
|
|
|
|
|
invoke-direct {v1, v2}, Ljava/util/ArrayList;-><init>(I)V
|
|
|
|
|
|
|
|
invoke-interface {v0}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
|
|
|
|
move-result v2
|
|
|
|
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
check-cast v2, Ljava/lang/Long;
|
|
|
|
|
|
|
|
const-string v3, "messageId"
|
|
|
|
|
|
|
|
invoke-static {v2, v3}, Lc0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
|
|
|
|
invoke-virtual {v2}, Ljava/lang/Long;->longValue()J
|
|
|
|
|
|
|
|
move-result-wide v2
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessageDelete;->getChannelId()J
|
|
|
|
|
|
|
|
move-result-wide v4
|
|
|
|
|
|
|
|
invoke-direct {p0, v2, v3, v4, v5}, Lcom/discord/stores/StoreMessageReplies;->deleteMessage(JJ)Z
|
|
|
|
|
|
|
|
move-result v2
|
|
|
|
|
|
|
|
invoke-static {v2}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
invoke-interface {v1, v2}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-interface {v1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
|
|
|
if-nez v1, :cond_1
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
goto :goto_4
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
:goto_1
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
|
|
|
|
move-result v2
|
|
|
|
|
|
|
|
if-eqz v2, :cond_4
|
|
|
|
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
check-cast v2, Ljava/lang/Boolean;
|
|
|
|
|
|
|
|
invoke-virtual {v2}, Ljava/lang/Boolean;->booleanValue()Z
|
|
|
|
|
|
|
|
move-result v2
|
|
|
|
|
|
|
|
check-cast v1, Ljava/lang/Boolean;
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Ljava/lang/Boolean;->booleanValue()Z
|
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
|
|
|
if-nez v1, :cond_3
|
|
|
|
|
|
|
|
if-eqz v2, :cond_2
|
|
|
|
|
|
|
|
goto :goto_2
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
const/4 v1, 0x0
|
|
|
|
|
|
|
|
goto :goto_3
|
|
|
|
|
|
|
|
:cond_3
|
|
|
|
:goto_2
|
|
|
|
const/4 v1, 0x1
|
|
|
|
|
|
|
|
:goto_3
|
|
|
|
invoke-static {v1}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:cond_4
|
|
|
|
move-object v0, v1
|
|
|
|
|
|
|
|
:goto_4
|
|
|
|
check-cast v0, Ljava/lang/Boolean;
|
|
|
|
|
|
|
|
sget-object v1, Ljava/lang/Boolean;->TRUE:Ljava/lang/Boolean;
|
|
|
|
|
|
|
|
invoke-static {v0, v1}, Lc0/n/c/j;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_5
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessageDelete;->getChannelId()J
|
|
|
|
|
|
|
|
move-result-wide v0
|
|
|
|
|
|
|
|
invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-static {p1}, Lf/h/a/f/f/n/f;->setOf(Ljava/lang/Object;)Ljava/util/Set;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/stores/StoreMessageReplies;->markUpdatedAndSubscribedChannelsAsChanged(Ljava/util/Set;)V
|
|
|
|
|
|
|
|
:cond_5
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final handleMessageUpdate(Lcom/discord/models/domain/ModelMessage;)V
|
|
|
|
.locals 1
|
|
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
const-string v0, "message"
|
|
|
|
|
|
|
|
invoke-static {p1, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/stores/StoreMessageReplies;->updateExistingMessage(Lcom/discord/models/domain/ModelMessage;)Ljava/util/Set;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/stores/StoreMessageReplies;->markUpdatedAndSubscribedChannelsAsChanged(Ljava/util/Set;)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final observeMessageReferencesForChannel(J)Lrx/Observable;
|
|
|
|
.locals 8
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"(J)",
|
|
|
|
"Lrx/Observable<",
|
|
|
|
"Ljava/util/Map<",
|
|
|
|
"Ljava/lang/Long;",
|
|
|
|
"Lcom/discord/stores/StoreMessageReplies$MessageState;",
|
|
|
|
">;>;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMessageReplies;->observationDeck:Lcom/discord/stores/updates/ObservationDeck;
|
|
|
|
|
|
|
|
const/4 v1, 0x1
|
|
|
|
|
|
|
|
new-array v1, v1, [Lcom/discord/stores/updates/ObservationDeck$UpdateSource;
|
|
|
|
|
|
|
|
const/4 v2, 0x0
|
|
|
|
|
|
|
|
aput-object p0, v1, v2
|
|
|
|
|
|
|
|
new-instance v5, Lcom/discord/stores/StoreMessageReplies$observeMessageReferencesForChannel$1;
|
|
|
|
|
|
|
|
invoke-direct {v5, p0, p1, p2}, Lcom/discord/stores/StoreMessageReplies$observeMessageReferencesForChannel$1;-><init>(Lcom/discord/stores/StoreMessageReplies;J)V
|
|
|
|
|
|
|
|
const/4 v3, 0x0
|
|
|
|
|
|
|
|
const/4 v4, 0x0
|
|
|
|
|
|
|
|
const/16 v6, 0xe
|
|
|
|
|
|
|
|
const/4 v7, 0x0
|
|
|
|
|
|
|
|
invoke-static/range {v0 .. v7}, Lcom/discord/stores/updates/ObservationDeck;->connectRx$default(Lcom/discord/stores/updates/ObservationDeck;[Lcom/discord/stores/updates/ObservationDeck$UpdateSource;ZLrx/Emitter$BackpressureMode;Ljava/lang/String;Lkotlin/jvm/functions/Function0;ILjava/lang/Object;)Lrx/Observable;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
return-object p1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public snapshotData()V
|
|
|
|
.locals 11
|
|
|
|
|
|
|
|
invoke-super {p0}, Lcom/discord/stores/StoreV2;->snapshotData()V
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMessageReplies;->subscribedChannels:Ljava/util/Set;
|
|
|
|
|
|
|
|
new-instance v1, Ljava/util/LinkedHashMap;
|
|
|
|
|
|
|
|
const/16 v2, 0xa
|
|
|
|
|
|
|
|
invoke-static {v0, v2}, Lf/h/a/f/f/n/f;->collectionSizeOrDefault(Ljava/lang/Iterable;I)I
|
|
|
|
|
|
|
|
move-result v3
|
|
|
|
|
|
|
|
invoke-static {v3}, Lf/h/a/f/f/n/f;->mapCapacity(I)I
|
|
|
|
|
|
|
|
move-result v3
|
|
|
|
|
|
|
|
const/16 v4, 0x10
|
|
|
|
|
|
|
|
if-ge v3, v4, :cond_0
|
|
|
|
|
|
|
|
const/16 v3, 0x10
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-direct {v1, v3}, Ljava/util/LinkedHashMap;-><init>(I)V
|
|
|
|
|
|
|
|
invoke-interface {v0}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
|
|
|
|
move-result v3
|
|
|
|
|
|
|
|
if-eqz v3, :cond_5
|
|
|
|
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v3
|
|
|
|
|
|
|
|
move-object v5, v3
|
|
|
|
|
|
|
|
check-cast v5, Ljava/lang/Number;
|
|
|
|
|
|
|
|
invoke-virtual {v5}, Ljava/lang/Number;->longValue()J
|
|
|
|
|
|
|
|
move-result-wide v5
|
|
|
|
|
|
|
|
iget-object v7, p0, Lcom/discord/stores/StoreMessageReplies;->channelMap:Ljava/util/HashMap;
|
|
|
|
|
|
|
|
invoke-static {v5, v6}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
|
|
|
|
move-result-object v5
|
|
|
|
|
|
|
|
invoke-virtual {v7, v5}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v5
|
|
|
|
|
|
|
|
check-cast v5, Ljava/util/Set;
|
|
|
|
|
|
|
|
if-eqz v5, :cond_1
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
sget-object v5, Lc0/i/n;->d:Lc0/i/n;
|
|
|
|
|
|
|
|
:goto_1
|
|
|
|
new-instance v6, Ljava/util/LinkedHashMap;
|
|
|
|
|
|
|
|
invoke-static {v5, v2}, Lf/h/a/f/f/n/f;->collectionSizeOrDefault(Ljava/lang/Iterable;I)I
|
|
|
|
|
|
|
|
move-result v7
|
|
|
|
|
|
|
|
invoke-static {v7}, Lf/h/a/f/f/n/f;->mapCapacity(I)I
|
|
|
|
|
|
|
|
move-result v7
|
|
|
|
|
|
|
|
if-ge v7, v4, :cond_2
|
|
|
|
|
|
|
|
const/16 v7, 0x10
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
invoke-direct {v6, v7}, Ljava/util/LinkedHashMap;-><init>(I)V
|
|
|
|
|
|
|
|
invoke-interface {v5}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
|
|
|
|
move-result-object v5
|
|
|
|
|
|
|
|
:goto_2
|
|
|
|
invoke-interface {v5}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
|
|
|
|
move-result v7
|
|
|
|
|
|
|
|
if-eqz v7, :cond_4
|
|
|
|
|
|
|
|
invoke-interface {v5}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v7
|
|
|
|
|
|
|
|
move-object v8, v7
|
|
|
|
|
|
|
|
check-cast v8, Ljava/lang/Number;
|
|
|
|
|
|
|
|
invoke-virtual {v8}, Ljava/lang/Number;->longValue()J
|
|
|
|
|
|
|
|
move-result-wide v8
|
|
|
|
|
|
|
|
iget-object v10, p0, Lcom/discord/stores/StoreMessageReplies;->repliedMessagesCache:Lcom/discord/stores/StoreMessageReplies$MessageCache;
|
|
|
|
|
|
|
|
invoke-static {v8, v9}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
|
|
|
|
move-result-object v8
|
|
|
|
|
|
|
|
invoke-virtual {v10, v8}, Ljava/util/LinkedHashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v8
|
|
|
|
|
|
|
|
check-cast v8, Lcom/discord/stores/StoreMessageReplies$MessageState;
|
|
|
|
|
|
|
|
if-eqz v8, :cond_3
|
|
|
|
|
|
|
|
goto :goto_3
|
|
|
|
|
|
|
|
:cond_3
|
|
|
|
sget-object v8, Lcom/discord/stores/StoreMessageReplies$MessageState$Unloaded;->INSTANCE:Lcom/discord/stores/StoreMessageReplies$MessageState$Unloaded;
|
|
|
|
|
|
|
|
:goto_3
|
|
|
|
invoke-interface {v6, v7, v8}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
goto :goto_2
|
|
|
|
|
|
|
|
:cond_4
|
|
|
|
invoke-interface {v1, v3, v6}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_5
|
|
|
|
iput-object v1, p0, Lcom/discord/stores/StoreMessageReplies;->repliedMessagesCacheSnapshot:Ljava/util/Map;
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final watchChannelIfNotAlreadySubscribed(J)V
|
|
|
|
.locals 2
|
|
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMessageReplies;->subscribedChannels:Ljava/util/Set;
|
|
|
|
|
|
|
|
invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
invoke-interface {v0, v1}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMessageReplies;->subscribedChannels:Ljava/util/Set;
|
|
|
|
|
|
|
|
invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-static {p1}, Lf/h/a/f/f/n/f;->setOf(Ljava/lang/Object;)Ljava/util/Set;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-static {v0, p1}, Lc0/i/f;->union(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/Set;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreMessageReplies;->subscribedChannels:Ljava/util/Set;
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Lcom/discord/stores/StoreV2;->markChanged()V
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
return-void
|
|
|
|
.end method
|