1815 lines
47 KiB
Smali
1815 lines
47 KiB
Smali
.class public final Lcom/discord/stores/StoreMentions;
|
|
.super Lcom/discord/stores/Store;
|
|
.source "StoreMentions.kt"
|
|
|
|
# interfaces
|
|
.implements Lcom/discord/stores/DispatchHandler;
|
|
|
|
|
|
# instance fields
|
|
.field public final channelGuildIds:Ljava/util/HashMap;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/HashMap<",
|
|
"Ljava/lang/Long;",
|
|
"Ljava/lang/Long;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public final countsEmpty:Ljava/util/Map;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/Long;",
|
|
"Ljava/lang/Integer;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public final countsSubject:Lcom/discord/utilities/persister/Persister;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lcom/discord/utilities/persister/Persister<",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/Long;",
|
|
"Ljava/lang/Integer;",
|
|
">;>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public isDirty:Z
|
|
|
|
.field public final mentionedMessages:Ljava/util/HashMap;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/HashMap<",
|
|
"Ljava/lang/Long;",
|
|
"Lcom/discord/models/domain/ModelMessage;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public myId:J
|
|
|
|
.field public final myRoleIds:Ljava/util/HashMap;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/HashMap<",
|
|
"Ljava/lang/Long;",
|
|
"Ljava/util/List<",
|
|
"Ljava/lang/Long;",
|
|
">;>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public final privateChannels:Ljava/util/HashSet;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/HashSet<",
|
|
"Ljava/lang/Long;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public selectedChannelId:J
|
|
|
|
.field public final serverInitReadStates:Ljava/util/ArrayList;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/ArrayList<",
|
|
"Lcom/discord/models/domain/ModelReadState;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public final storeChannels:Lcom/discord/stores/StoreChannels;
|
|
|
|
.field public final storeMessageAck:Lcom/discord/stores/StoreMessageAck;
|
|
|
|
.field public final storePermissions:Lcom/discord/stores/StorePermissions;
|
|
|
|
.field public final storeUserGuildSettings:Lcom/discord/stores/StoreUserGuildSettings;
|
|
|
|
.field public final storeUserRelationships:Lcom/discord/stores/StoreUserRelationships;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Lcom/discord/stores/StoreUserRelationships;Lcom/discord/stores/StorePermissions;Lcom/discord/stores/StoreMessageAck;Lcom/discord/stores/StoreUserGuildSettings;Lcom/discord/stores/StoreChannels;)V
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_4
|
|
|
|
if-eqz p2, :cond_3
|
|
|
|
if-eqz p3, :cond_2
|
|
|
|
if-eqz p4, :cond_1
|
|
|
|
if-eqz p5, :cond_0
|
|
|
|
invoke-direct {p0}, Lcom/discord/stores/Store;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreMentions;->storeUserRelationships:Lcom/discord/stores/StoreUserRelationships;
|
|
|
|
iput-object p2, p0, Lcom/discord/stores/StoreMentions;->storePermissions:Lcom/discord/stores/StorePermissions;
|
|
|
|
iput-object p3, p0, Lcom/discord/stores/StoreMentions;->storeMessageAck:Lcom/discord/stores/StoreMessageAck;
|
|
|
|
iput-object p4, p0, Lcom/discord/stores/StoreMentions;->storeUserGuildSettings:Lcom/discord/stores/StoreUserGuildSettings;
|
|
|
|
iput-object p5, p0, Lcom/discord/stores/StoreMentions;->storeChannels:Lcom/discord/stores/StoreChannels;
|
|
|
|
new-instance p1, Ljava/util/HashMap;
|
|
|
|
invoke-direct {p1}, Ljava/util/HashMap;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreMentions;->countsEmpty:Ljava/util/Map;
|
|
|
|
new-instance p1, Lcom/discord/utilities/persister/Persister;
|
|
|
|
iget-object p2, p0, Lcom/discord/stores/StoreMentions;->countsEmpty:Ljava/util/Map;
|
|
|
|
const-string p3, "CHANNEL_MENTION_COUNTS_V6"
|
|
|
|
invoke-direct {p1, p3, p2}, Lcom/discord/utilities/persister/Persister;-><init>(Ljava/lang/String;Ljava/lang/Object;)V
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreMentions;->countsSubject:Lcom/discord/utilities/persister/Persister;
|
|
|
|
new-instance p1, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {p1}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreMentions;->serverInitReadStates:Ljava/util/ArrayList;
|
|
|
|
new-instance p1, Ljava/util/HashMap;
|
|
|
|
invoke-direct {p1}, Ljava/util/HashMap;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreMentions;->mentionedMessages:Ljava/util/HashMap;
|
|
|
|
new-instance p1, Ljava/util/HashSet;
|
|
|
|
invoke-direct {p1}, Ljava/util/HashSet;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreMentions;->privateChannels:Ljava/util/HashSet;
|
|
|
|
new-instance p1, Ljava/util/HashMap;
|
|
|
|
invoke-direct {p1}, Ljava/util/HashMap;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreMentions;->myRoleIds:Ljava/util/HashMap;
|
|
|
|
new-instance p1, Ljava/util/HashMap;
|
|
|
|
invoke-direct {p1}, Ljava/util/HashMap;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreMentions;->channelGuildIds:Ljava/util/HashMap;
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "storeChannels"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_1
|
|
const-string p1, "storeUserGuildSettings"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_2
|
|
const-string p1, "storeMessageAck"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_3
|
|
const-string p1, "storePermissions"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_4
|
|
const-string p1, "storeUserRelationships"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public static final synthetic access$getStoreChannels$p(Lcom/discord/stores/StoreMentions;)Lcom/discord/stores/StoreChannels;
|
|
.locals 0
|
|
|
|
iget-object p0, p0, Lcom/discord/stores/StoreMentions;->storeChannels:Lcom/discord/stores/StoreChannels;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private final computeMentionCounts()Ljava/util/Map;
|
|
.locals 12
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/Long;",
|
|
"Ljava/lang/Integer;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMentions;->serverInitReadStates:Ljava/util/ArrayList;
|
|
|
|
invoke-virtual {v0}, Ljava/util/ArrayList;->isEmpty()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMentions;->mentionedMessages:Ljava/util/HashMap;
|
|
|
|
invoke-virtual {v0}, Ljava/util/HashMap;->isEmpty()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMentions;->countsEmpty:Ljava/util/Map;
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
new-instance v0, Ljava/util/HashMap;
|
|
|
|
invoke-direct {v0}, Ljava/util/HashMap;-><init>()V
|
|
|
|
iget-object v1, p0, Lcom/discord/stores/StoreMentions;->storeMessageAck:Lcom/discord/stores/StoreMessageAck;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/stores/StoreMessageAck;->getAcks$app_productionDiscordExternalRelease()Ljava/util/HashMap;
|
|
|
|
move-result-object v1
|
|
|
|
iget-object v2, p0, Lcom/discord/stores/StoreMentions;->serverInitReadStates:Ljava/util/ArrayList;
|
|
|
|
invoke-virtual {v2}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v2
|
|
|
|
:cond_1
|
|
:goto_0
|
|
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v3
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x1
|
|
|
|
if-eqz v3, :cond_4
|
|
|
|
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
check-cast v3, Lcom/discord/models/domain/ModelReadState;
|
|
|
|
invoke-virtual {v3}, Lcom/discord/models/domain/ModelReadState;->component1()J
|
|
|
|
move-result-wide v6
|
|
|
|
invoke-virtual {v3}, Lcom/discord/models/domain/ModelReadState;->component2()J
|
|
|
|
move-result-wide v8
|
|
|
|
invoke-virtual {v3}, Lcom/discord/models/domain/ModelReadState;->component3()I
|
|
|
|
move-result v3
|
|
|
|
if-lt v3, v5, :cond_1
|
|
|
|
invoke-direct {p0, v6, v7}, Lcom/discord/stores/StoreMentions;->isMentionableChannel(J)Z
|
|
|
|
move-result v5
|
|
|
|
if-nez v5, :cond_2
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-virtual {v1, v5}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v5
|
|
|
|
check-cast v5, Lcom/discord/stores/StoreMessageAck$Ack;
|
|
|
|
if-eqz v5, :cond_1
|
|
|
|
invoke-virtual {v5}, Lcom/discord/stores/StoreMessageAck$Ack;->component1()J
|
|
|
|
move-result-wide v10
|
|
|
|
cmp-long v5, v10, v8
|
|
|
|
if-gtz v5, :cond_1
|
|
|
|
invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v6
|
|
|
|
invoke-virtual {v0, v6}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v6
|
|
|
|
check-cast v6, Ljava/lang/Integer;
|
|
|
|
if-eqz v6, :cond_3
|
|
|
|
goto :goto_1
|
|
|
|
:cond_3
|
|
invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v6
|
|
|
|
:goto_1
|
|
invoke-virtual {v6}, Ljava/lang/Integer;->intValue()I
|
|
|
|
move-result v4
|
|
|
|
add-int/2addr v4, v3
|
|
|
|
invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-interface {v0, v5, v3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_4
|
|
iget-object v2, p0, Lcom/discord/stores/StoreMentions;->mentionedMessages:Ljava/util/HashMap;
|
|
|
|
invoke-virtual {v2}, Ljava/util/HashMap;->values()Ljava/util/Collection;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-interface {v2}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v2
|
|
|
|
:cond_5
|
|
:goto_2
|
|
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_a
|
|
|
|
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
check-cast v3, Lcom/discord/models/domain/ModelMessage;
|
|
|
|
const-string v6, "message"
|
|
|
|
invoke-static {v3, v6}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v3}, Lcom/discord/models/domain/ModelMessage;->getChannelId()J
|
|
|
|
move-result-wide v6
|
|
|
|
invoke-virtual {v3}, Lcom/discord/models/domain/ModelMessage;->getAuthor()Lcom/discord/models/domain/ModelUser;
|
|
|
|
move-result-object v8
|
|
|
|
const-string v9, "message.author"
|
|
|
|
invoke-static {v8, v9}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v8}, Lcom/discord/models/domain/ModelUser;->getId()J
|
|
|
|
move-result-wide v8
|
|
|
|
iget-object v10, p0, Lcom/discord/stores/StoreMentions;->storeUserRelationships:Lcom/discord/stores/StoreUserRelationships;
|
|
|
|
invoke-virtual {v10}, Lcom/discord/stores/StoreUserRelationships;->getRelationships()Ljava/util/Map;
|
|
|
|
move-result-object v10
|
|
|
|
invoke-static {v8, v9}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v8
|
|
|
|
invoke-interface {v10, v8}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v8
|
|
|
|
check-cast v8, Ljava/lang/Integer;
|
|
|
|
const/4 v9, 0x2
|
|
|
|
invoke-static {v8, v9}, Lcom/discord/models/domain/ModelUserRelationship;->isType(Ljava/lang/Integer;I)Z
|
|
|
|
move-result v8
|
|
|
|
if-nez v8, :cond_5
|
|
|
|
invoke-direct {p0, v6, v7}, Lcom/discord/stores/StoreMentions;->isMentionableChannel(J)Z
|
|
|
|
move-result v8
|
|
|
|
if-nez v8, :cond_6
|
|
|
|
goto :goto_2
|
|
|
|
:cond_6
|
|
invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v8
|
|
|
|
invoke-virtual {v1, v8}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v8
|
|
|
|
check-cast v8, Lcom/discord/stores/StoreMessageAck$Ack;
|
|
|
|
if-eqz v8, :cond_8
|
|
|
|
invoke-virtual {v8}, Lcom/discord/stores/StoreMessageAck$Ack;->component1()J
|
|
|
|
move-result-wide v8
|
|
|
|
invoke-virtual {v3}, Lcom/discord/models/domain/ModelMessage;->getId()J
|
|
|
|
move-result-wide v10
|
|
|
|
cmp-long v3, v8, v10
|
|
|
|
if-gez v3, :cond_7
|
|
|
|
goto :goto_3
|
|
|
|
:cond_7
|
|
const/4 v3, 0x0
|
|
|
|
goto :goto_4
|
|
|
|
:cond_8
|
|
:goto_3
|
|
const/4 v3, 0x1
|
|
|
|
:goto_4
|
|
if-eqz v3, :cond_5
|
|
|
|
invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v6
|
|
|
|
invoke-virtual {v0, v6}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v6
|
|
|
|
check-cast v6, Ljava/lang/Integer;
|
|
|
|
if-eqz v6, :cond_9
|
|
|
|
goto :goto_5
|
|
|
|
:cond_9
|
|
invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v6
|
|
|
|
:goto_5
|
|
invoke-virtual {v6}, Ljava/lang/Integer;->intValue()I
|
|
|
|
move-result v6
|
|
|
|
add-int/2addr v6, v5
|
|
|
|
invoke-static {v6}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v6
|
|
|
|
invoke-interface {v0, v3, v6}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
goto :goto_2
|
|
|
|
:cond_a
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private final hasMention(Lcom/discord/models/domain/ModelMessage;)Z
|
|
.locals 11
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMentions;->channelGuildIds:Ljava/util/HashMap;
|
|
|
|
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-virtual {v0, v1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Ljava/lang/Long;
|
|
|
|
const-wide/16 v1, 0x0
|
|
|
|
invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v3
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
move-object v0, v3
|
|
|
|
:goto_0
|
|
const-string v4, "channelGuildIds[channelId] ?: 0"
|
|
|
|
invoke-static {v0, v4}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Long;->longValue()J
|
|
|
|
move-result-wide v4
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessage;->getAuthor()Lcom/discord/models/domain/ModelUser;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v6, "author"
|
|
|
|
invoke-static {v0, v6}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelUser;->getId()J
|
|
|
|
move-result-wide v6
|
|
|
|
iget-wide v8, p0, Lcom/discord/stores/StoreMentions;->myId:J
|
|
|
|
const/4 v0, 0x0
|
|
|
|
cmp-long v10, v6, v8
|
|
|
|
if-eqz v10, :cond_c
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessage;->getEditedTimestamp()J
|
|
|
|
move-result-wide v6
|
|
|
|
cmp-long v8, v6, v1
|
|
|
|
if-lez v8, :cond_1
|
|
|
|
goto/16 :goto_3
|
|
|
|
:cond_1
|
|
iget-object v1, p0, Lcom/discord/stores/StoreMentions;->storeUserGuildSettings:Lcom/discord/stores/StoreUserGuildSettings;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/stores/StoreUserGuildSettings;->getGuildSettings$app_productionDiscordExternalRelease()Ljava/util/Map;
|
|
|
|
move-result-object v1
|
|
|
|
iget-object v2, p0, Lcom/discord/stores/StoreMentions;->privateChannels:Ljava/util/HashSet;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessage;->getChannelId()J
|
|
|
|
move-result-wide v6
|
|
|
|
invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v6
|
|
|
|
invoke-virtual {v2, v6}, Ljava/util/HashSet;->contains(Ljava/lang/Object;)Z
|
|
|
|
move-result v2
|
|
|
|
const/4 v6, 0x1
|
|
|
|
if-eqz v2, :cond_3
|
|
|
|
invoke-interface {v1, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Lcom/discord/models/domain/ModelNotificationSettings;
|
|
|
|
if-eqz v2, :cond_2
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessage;->getChannelId()J
|
|
|
|
move-result-wide v7
|
|
|
|
invoke-virtual {v2, v7, v8}, Lcom/discord/models/domain/ModelNotificationSettings;->getChannelOverride(J)Lcom/discord/models/domain/ModelNotificationSettings$ChannelOverride;
|
|
|
|
move-result-object v2
|
|
|
|
if-eqz v2, :cond_2
|
|
|
|
invoke-virtual {v2}, Lcom/discord/models/domain/ModelNotificationSettings$ChannelOverride;->isMuted()Z
|
|
|
|
move-result v2
|
|
|
|
if-eq v2, v6, :cond_3
|
|
|
|
:cond_2
|
|
return v6
|
|
|
|
:cond_3
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessage;->getMentions()Ljava/util/List;
|
|
|
|
move-result-object v2
|
|
|
|
const-string v3, "mentions"
|
|
|
|
invoke-static {v2, v3}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-interface {v2}, Ljava/util/Collection;->isEmpty()Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_5
|
|
|
|
:cond_4
|
|
const/4 v2, 0x0
|
|
|
|
goto :goto_2
|
|
|
|
:cond_5
|
|
invoke-interface {v2}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v2
|
|
|
|
:cond_6
|
|
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_4
|
|
|
|
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
check-cast v3, Lcom/discord/models/domain/ModelUser;
|
|
|
|
const-string v7, "it"
|
|
|
|
invoke-static {v3, v7}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v3}, Lcom/discord/models/domain/ModelUser;->getId()J
|
|
|
|
move-result-wide v7
|
|
|
|
iget-wide v9, p0, Lcom/discord/stores/StoreMentions;->myId:J
|
|
|
|
cmp-long v3, v7, v9
|
|
|
|
if-nez v3, :cond_7
|
|
|
|
const/4 v3, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_7
|
|
const/4 v3, 0x0
|
|
|
|
:goto_1
|
|
if-eqz v3, :cond_6
|
|
|
|
const/4 v2, 0x1
|
|
|
|
:goto_2
|
|
if-eqz v2, :cond_8
|
|
|
|
return v6
|
|
|
|
:cond_8
|
|
invoke-static {v4, v5}, 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 v2
|
|
|
|
check-cast v2, Lcom/discord/models/domain/ModelNotificationSettings;
|
|
|
|
if-eqz v2, :cond_9
|
|
|
|
invoke-virtual {v2}, Lcom/discord/models/domain/ModelNotificationSettings;->isSuppressRoles()Z
|
|
|
|
move-result v2
|
|
|
|
if-eq v2, v6, :cond_a
|
|
|
|
:cond_9
|
|
iget-object v2, p0, Lcom/discord/stores/StoreMentions;->myRoleIds:Ljava/util/HashMap;
|
|
|
|
invoke-static {v4, v5}, 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/List;
|
|
|
|
if-eqz v2, :cond_a
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessage;->getMentionRoles()Ljava/util/List;
|
|
|
|
move-result-object v3
|
|
|
|
if-eqz v3, :cond_a
|
|
|
|
invoke-interface {v3}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v7
|
|
|
|
if-eqz v7, :cond_a
|
|
|
|
invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Ljava/lang/Long;
|
|
|
|
invoke-interface {v2, p1}, Ljava/util/List;->contains(Ljava/lang/Object;)Z
|
|
|
|
move-result p1
|
|
|
|
return p1
|
|
|
|
:cond_a
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessage;->isMentionEveryone()Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_c
|
|
|
|
invoke-static {v4, v5}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-interface {v1, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Lcom/discord/models/domain/ModelNotificationSettings;
|
|
|
|
if-eqz p1, :cond_b
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelNotificationSettings;->isSuppressEveryone()Z
|
|
|
|
move-result p1
|
|
|
|
if-eq p1, v6, :cond_c
|
|
|
|
:cond_b
|
|
const/4 v0, 0x1
|
|
|
|
:cond_c
|
|
:goto_3
|
|
return v0
|
|
.end method
|
|
|
|
.method private final isMentionableChannel(J)Z
|
|
.locals 5
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMentions;->storeMessageAck:Lcom/discord/stores/StoreMessageAck;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreMessageAck;->getAcks$app_productionDiscordExternalRelease()Ljava/util/HashMap;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/discord/stores/StoreMessageAck$Ack;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreMessageAck$Ack;->isLockedAck()Z
|
|
|
|
move-result v0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
iget-wide v2, p0, Lcom/discord/stores/StoreMentions;->selectedChannelId:J
|
|
|
|
cmp-long v4, p1, v2
|
|
|
|
if-nez v4, :cond_1
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
return v1
|
|
|
|
:cond_1
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMentions;->storePermissions:Lcom/discord/stores/StorePermissions;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StorePermissions;->getPermissionsForChannels$app_productionDiscordExternalRelease()Ljava/util/Map;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-interface {v0, v2}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Ljava/lang/Integer;
|
|
|
|
iget-object v2, p0, Lcom/discord/stores/StoreMentions;->privateChannels:Ljava/util/HashSet;
|
|
|
|
invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v2, p1}, Ljava/util/HashSet;->contains(Ljava/lang/Object;)Z
|
|
|
|
move-result p1
|
|
|
|
if-nez p1, :cond_2
|
|
|
|
const/16 p1, 0x400
|
|
|
|
invoke-static {p1, v0}, Lcom/discord/utilities/permissions/PermissionUtils;->can(ILjava/lang/Integer;)Z
|
|
|
|
move-result p1
|
|
|
|
if-nez p1, :cond_2
|
|
|
|
return v1
|
|
|
|
:cond_2
|
|
const/4 p1, 0x1
|
|
|
|
return p1
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final getCounts()Lrx/Observable;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Lrx/Observable<",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/Long;",
|
|
"Ljava/lang/Integer;",
|
|
">;>;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMentions;->countsSubject:Lcom/discord/utilities/persister/Persister;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/utilities/persister/Persister;->getObservable()Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lrx/Observable;->q()Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "countsSubject\n \u2026 .distinctUntilChanged()"
|
|
|
|
invoke-static {v0, v1}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-static {v0}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->computationLatest(Lrx/Observable;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final getTotal()Lrx/Observable;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Lrx/Observable<",
|
|
"Ljava/lang/Integer;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
invoke-virtual {p0}, Lcom/discord/stores/StoreMentions;->getCounts()Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v1, Lcom/discord/stores/StoreMentions$getTotal$1;->INSTANCE:Lcom/discord/stores/StoreMentions$getTotal$1;
|
|
|
|
invoke-virtual {v0, v1}, Lrx/Observable;->C(Lr0/k/b;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "getCounts()\n .map { it.values.sum() }"
|
|
|
|
invoke-static {v0, v1}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final handleChannelCreated(Lcom/discord/models/domain/ModelChannel;)V
|
|
.locals 4
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMentions;->channelGuildIds:Ljava/util/HashMap;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelChannel;->getId()J
|
|
|
|
move-result-wide v1
|
|
|
|
invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelChannel;->getGuildId()Ljava/lang/Long;
|
|
|
|
move-result-object v2
|
|
|
|
const-string v3, "channel.guildId"
|
|
|
|
invoke-static {v2, v3}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-interface {v0, v1, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelChannel;->isPrivate()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelChannel;->isManaged()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMentions;->privateChannels:Ljava/util/HashSet;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelChannel;->getId()J
|
|
|
|
move-result-wide v1
|
|
|
|
invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v0, p1}, Ljava/util/HashSet;->add(Ljava/lang/Object;)Z
|
|
|
|
:cond_0
|
|
return-void
|
|
|
|
:cond_1
|
|
const-string p1, "channel"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final handleChannelSelected(J)V
|
|
.locals 0
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
iput-wide p1, p0, Lcom/discord/stores/StoreMentions;->selectedChannelId:J
|
|
|
|
const/4 p1, 0x1
|
|
|
|
iput-boolean p1, p0, Lcom/discord/stores/StoreMentions;->isDirty:Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final handleConnectionOpen(Lcom/discord/models/domain/ModelPayload;)V
|
|
.locals 8
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_8
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMentions;->privateChannels:Ljava/util/HashSet;
|
|
|
|
invoke-virtual {v0}, Ljava/util/HashSet;->clear()V
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMentions;->mentionedMessages:Ljava/util/HashMap;
|
|
|
|
invoke-virtual {v0}, Ljava/util/HashMap;->clear()V
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMentions;->channelGuildIds:Ljava/util/HashMap;
|
|
|
|
invoke-virtual {v0}, Ljava/util/HashMap;->clear()V
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMentions;->myRoleIds:Ljava/util/HashMap;
|
|
|
|
invoke-virtual {v0}, Ljava/util/HashMap;->clear()V
|
|
|
|
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}, Lj0/n/c/h;->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/StoreMentions;->myId:J
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelPayload;->getGuilds()Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v0
|
|
|
|
:goto_0
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Lcom/discord/models/domain/ModelGuild;
|
|
|
|
const-string v2, "guild"
|
|
|
|
invoke-static {v1, v2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p0, v1}, Lcom/discord/stores/StoreMentions;->handleGuildAdd(Lcom/discord/models/domain/ModelGuild;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMentions;->privateChannels:Ljava/util/HashSet;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelPayload;->getPrivateChannels()Ljava/util/List;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "payload.privateChannels"
|
|
|
|
invoke-static {v1, v2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
new-instance v2, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
invoke-interface {v1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v1
|
|
|
|
:cond_1
|
|
:goto_1
|
|
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v3
|
|
|
|
const/4 v4, 0x1
|
|
|
|
const-string v5, "it"
|
|
|
|
if-eqz v3, :cond_2
|
|
|
|
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
move-object v6, v3
|
|
|
|
check-cast v6, Lcom/discord/models/domain/ModelChannel;
|
|
|
|
invoke-static {v6, v5}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v6}, Lcom/discord/models/domain/ModelChannel;->isManaged()Z
|
|
|
|
move-result v5
|
|
|
|
xor-int/2addr v4, v5
|
|
|
|
if-eqz v4, :cond_1
|
|
|
|
invoke-interface {v2, v3}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
new-instance v1, Ljava/util/ArrayList;
|
|
|
|
const/16 v3, 0xa
|
|
|
|
invoke-static {v2, v3}, Lf/i/a/b/i1/e;->collectionSizeOrDefault(Ljava/lang/Iterable;I)I
|
|
|
|
move-result v6
|
|
|
|
invoke-direct {v1, v6}, Ljava/util/ArrayList;-><init>(I)V
|
|
|
|
invoke-interface {v2}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v2
|
|
|
|
:goto_2
|
|
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v6
|
|
|
|
if-eqz v6, :cond_3
|
|
|
|
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v6
|
|
|
|
check-cast v6, Lcom/discord/models/domain/ModelChannel;
|
|
|
|
invoke-static {v6, v5}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v6}, Lcom/discord/models/domain/ModelChannel;->getId()J
|
|
|
|
move-result-wide v6
|
|
|
|
invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v6
|
|
|
|
invoke-interface {v1, v6}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_2
|
|
|
|
:cond_3
|
|
invoke-virtual {v0, v1}, Ljava/util/HashSet;->addAll(Ljava/util/Collection;)Z
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelPayload;->getReadState()Lcom/discord/models/domain/ModelPayload$VersionedReadStates;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "payload.readState"
|
|
|
|
invoke-static {v0, v1}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelPayload$VersionedModel;->isPartial()Z
|
|
|
|
move-result v0
|
|
|
|
const-string v2, "payload.readState.entries"
|
|
|
|
if-nez v0, :cond_4
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMentions;->serverInitReadStates:Ljava/util/ArrayList;
|
|
|
|
invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V
|
|
|
|
goto :goto_4
|
|
|
|
:cond_4
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelPayload;->getReadState()Lcom/discord/models/domain/ModelPayload$VersionedReadStates;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0, v1}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelPayload$VersionedModel;->getEntries()Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0, v2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
new-instance v5, Ljava/util/ArrayList;
|
|
|
|
invoke-static {v0, v3}, Lf/i/a/b/i1/e;->collectionSizeOrDefault(Ljava/lang/Iterable;I)I
|
|
|
|
move-result v3
|
|
|
|
invoke-direct {v5, v3}, Ljava/util/ArrayList;-><init>(I)V
|
|
|
|
invoke-interface {v0}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v0
|
|
|
|
:goto_3
|
|
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
|
|
|
|
check-cast v3, Lcom/discord/models/domain/ModelReadState;
|
|
|
|
invoke-virtual {v3}, Lcom/discord/models/domain/ModelReadState;->getChannelId()J
|
|
|
|
move-result-wide v6
|
|
|
|
invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-interface {v5, v3}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_3
|
|
|
|
:cond_5
|
|
invoke-static {v5}, Lj0/i/l;->toHashSet(Ljava/lang/Iterable;)Ljava/util/HashSet;
|
|
|
|
move-result-object v0
|
|
|
|
iget-object v3, p0, Lcom/discord/stores/StoreMentions;->serverInitReadStates:Ljava/util/ArrayList;
|
|
|
|
new-instance v5, Lcom/discord/stores/StoreMentions$handleConnectionOpen$3;
|
|
|
|
invoke-direct {v5, v0}, Lcom/discord/stores/StoreMentions$handleConnectionOpen$3;-><init>(Ljava/util/HashSet;)V
|
|
|
|
invoke-static {v3, v5}, Lf/i/a/b/i1/e;->removeAll(Ljava/util/List;Lkotlin/jvm/functions/Function1;)Z
|
|
|
|
:goto_4
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMentions;->serverInitReadStates:Ljava/util/ArrayList;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelPayload;->getReadState()Lcom/discord/models/domain/ModelPayload$VersionedReadStates;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-static {p1, v1}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelPayload$VersionedModel;->getEntries()Ljava/util/List;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-static {p1, v2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
new-instance v1, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
invoke-interface {p1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p1
|
|
|
|
:cond_6
|
|
:goto_5
|
|
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_7
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
move-object v3, v2
|
|
|
|
check-cast v3, Lcom/discord/models/domain/ModelReadState;
|
|
|
|
invoke-virtual {v3}, Lcom/discord/models/domain/ModelReadState;->isMentioned()Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_6
|
|
|
|
invoke-interface {v1, v2}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_5
|
|
|
|
:cond_7
|
|
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->addAll(Ljava/util/Collection;)Z
|
|
|
|
iget-object p1, p0, Lcom/discord/stores/StoreMentions;->serverInitReadStates:Ljava/util/ArrayList;
|
|
|
|
new-instance v0, Lcom/discord/stores/StoreMentions$handleConnectionOpen$5;
|
|
|
|
invoke-direct {v0, p0}, Lcom/discord/stores/StoreMentions$handleConnectionOpen$5;-><init>(Lcom/discord/stores/StoreMentions;)V
|
|
|
|
invoke-static {p1, v0}, Lf/i/a/b/i1/e;->removeAll(Ljava/util/List;Lkotlin/jvm/functions/Function1;)Z
|
|
|
|
iput-boolean v4, p0, Lcom/discord/stores/StoreMentions;->isDirty:Z
|
|
|
|
return-void
|
|
|
|
:cond_8
|
|
const-string p1, "payload"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final handleGuildAdd(Lcom/discord/models/domain/ModelGuild;)V
|
|
.locals 5
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelGuild;->getMembers()Ljava/util/Map;
|
|
|
|
move-result-object v0
|
|
|
|
iget-wide v1, p0, Lcom/discord/stores/StoreMentions;->myId:J
|
|
|
|
invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-interface {v0, v1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/discord/models/domain/ModelGuildMember;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object v1, p0, Lcom/discord/stores/StoreMentions;->myRoleIds:Ljava/util/HashMap;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelGuild;->getId()J
|
|
|
|
move-result-wide v2
|
|
|
|
invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelGuildMember;->getRoles()Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v3, "roles"
|
|
|
|
invoke-static {v0, v3}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-interface {v1, v2, v0}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
:cond_0
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelGuild;->getChannels()Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v0
|
|
|
|
:goto_0
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Lcom/discord/models/domain/ModelChannel;
|
|
|
|
iget-object v2, p0, Lcom/discord/stores/StoreMentions;->channelGuildIds:Ljava/util/HashMap;
|
|
|
|
const-string v3, "channel"
|
|
|
|
invoke-static {v1, v3}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v1}, Lcom/discord/models/domain/ModelChannel;->getId()J
|
|
|
|
move-result-wide v3
|
|
|
|
invoke-static {v3, v4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelGuild;->getId()J
|
|
|
|
move-result-wide v3
|
|
|
|
invoke-static {v3, v4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-interface {v2, v1, v3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
return-void
|
|
|
|
:cond_2
|
|
const-string p1, "guild"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.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/StoreMentions;->myId:J
|
|
|
|
cmp-long v4, v0, v2
|
|
|
|
if-nez v4, :cond_0
|
|
|
|
iget-object v2, p0, Lcom/discord/stores/StoreMentions;->myRoleIds:Ljava/util/HashMap;
|
|
|
|
invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelGuildMember;->getRoles()Ljava/util/List;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v1, "member.roles"
|
|
|
|
invoke-static {p1, v1}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-interface {v2, v0, p1}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
:cond_0
|
|
return-void
|
|
|
|
:cond_1
|
|
const-string p1, "member"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final handleMessageAck(Lcom/discord/models/domain/ModelReadState;)V
|
|
.locals 2
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMentions;->serverInitReadStates:Ljava/util/ArrayList;
|
|
|
|
new-instance v1, Lcom/discord/stores/StoreMentions$handleMessageAck$1;
|
|
|
|
invoke-direct {v1, p1}, Lcom/discord/stores/StoreMentions$handleMessageAck$1;-><init>(Lcom/discord/models/domain/ModelReadState;)V
|
|
|
|
invoke-static {v0, v1}, Lf/i/a/b/i1/e;->removeAll(Ljava/util/List;Lkotlin/jvm/functions/Function1;)Z
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMentions;->serverInitReadStates:Ljava/util/ArrayList;
|
|
|
|
invoke-virtual {v0, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
|
|
|
const/4 p1, 0x1
|
|
|
|
iput-boolean p1, p0, Lcom/discord/stores/StoreMentions;->isDirty:Z
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "readState"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final handleMessageCreateOrUpdate(Lcom/discord/models/domain/ModelMessage;)V
|
|
.locals 3
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/stores/StoreMentions;->hasMention(Lcom/discord/models/domain/ModelMessage;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMentions;->mentionedMessages:Ljava/util/HashMap;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessage;->getId()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, p1}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
const/4 p1, 0x1
|
|
|
|
iput-boolean p1, p0, Lcom/discord/stores/StoreMentions;->isDirty:Z
|
|
|
|
:cond_0
|
|
return-void
|
|
|
|
:cond_1
|
|
const-string p1, "message"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final handleMessageDeleted(Lcom/discord/models/domain/ModelMessageDelete;)V
|
|
.locals 3
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMentions;->privateChannels:Ljava/util/HashSet;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessageDelete;->getChannelId()J
|
|
|
|
move-result-wide v1
|
|
|
|
invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Ljava/util/HashSet;->contains(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessageDelete;->getMessageIds()Ljava/util/List;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "messageDeleteBulk.messageIds"
|
|
|
|
invoke-static {p1, v0}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-interface {p1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p1
|
|
|
|
:goto_0
|
|
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Ljava/lang/Long;
|
|
|
|
iget-object v1, p0, Lcom/discord/stores/StoreMentions;->mentionedMessages:Ljava/util/HashMap;
|
|
|
|
const-string v2, "it"
|
|
|
|
invoke-static {v0, v2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-interface {v1, v0}, Ljava/util/Map;->remove(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p1, 0x1
|
|
|
|
iput-boolean p1, p0, Lcom/discord/stores/StoreMentions;->isDirty:Z
|
|
|
|
:cond_1
|
|
return-void
|
|
|
|
:cond_2
|
|
const-string p1, "messageDeleteBulk"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public onDispatchEnded()V
|
|
.locals 5
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
iget-boolean v0, p0, Lcom/discord/stores/StoreMentions;->isDirty:Z
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
invoke-direct {p0}, Lcom/discord/stores/StoreMentions;->computeMentionCounts()Ljava/util/Map;
|
|
|
|
move-result-object v0
|
|
|
|
iget-object v1, p0, Lcom/discord/stores/StoreMentions;->countsSubject:Lcom/discord/utilities/persister/Persister;
|
|
|
|
const/4 v2, 0x2
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
invoke-static {v1, v0, v4, v2, v3}, Lcom/discord/utilities/persister/Persister;->set$default(Lcom/discord/utilities/persister/Persister;Ljava/lang/Object;ZILjava/lang/Object;)Ljava/lang/Object;
|
|
|
|
iput-boolean v4, p0, Lcom/discord/stores/StoreMentions;->isDirty:Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final processMarkUnread$app_productionDiscordExternalRelease(JLjava/util/List;)I
|
|
.locals 5
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(J",
|
|
"Ljava/util/List<",
|
|
"+",
|
|
"Lcom/discord/models/domain/ModelMessage;",
|
|
">;)I"
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p3, :cond_2
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-interface {p3}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p3
|
|
|
|
:cond_0
|
|
:goto_0
|
|
invoke-interface {p3}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
invoke-interface {p3}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Lcom/discord/models/domain/ModelMessage;
|
|
|
|
iget-object v2, p0, Lcom/discord/stores/StoreMentions;->mentionedMessages:Ljava/util/HashMap;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/models/domain/ModelMessage;->getId()J
|
|
|
|
move-result-wide v3
|
|
|
|
invoke-static {v3, v4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v2, v3}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z
|
|
|
|
move-result v2
|
|
|
|
if-nez v2, :cond_0
|
|
|
|
invoke-direct {p0, v1}, Lcom/discord/stores/StoreMentions;->hasMention(Lcom/discord/models/domain/ModelMessage;)Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
iget-object v2, p0, Lcom/discord/stores/StoreMentions;->mentionedMessages:Ljava/util/HashMap;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/models/domain/ModelMessage;->getId()J
|
|
|
|
move-result-wide v3
|
|
|
|
invoke-static {v3, v4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-interface {v2, v3, v1}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
add-int/lit8 v0, v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
iget-object p3, p0, Lcom/discord/stores/StoreMentions;->serverInitReadStates:Ljava/util/ArrayList;
|
|
|
|
new-instance v1, Lcom/discord/stores/StoreMentions$processMarkUnread$1;
|
|
|
|
invoke-direct {v1, p1, p2}, Lcom/discord/stores/StoreMentions$processMarkUnread$1;-><init>(J)V
|
|
|
|
invoke-static {p3, v1}, Lf/i/a/b/i1/e;->removeAll(Ljava/util/List;Lkotlin/jvm/functions/Function1;)Z
|
|
|
|
const/4 p1, 0x1
|
|
|
|
iput-boolean p1, p0, Lcom/discord/stores/StoreMentions;->isDirty:Z
|
|
|
|
return v0
|
|
|
|
:cond_2
|
|
const-string p1, "messagesAfter"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|