2020-08-04 06:02:43 +00:00
|
|
|
.class public final Lcom/discord/stores/StoreLocalMessagesHolder;
|
|
|
|
.super Ljava/lang/Object;
|
|
|
|
.source "StoreLocalMessagesHolder.kt"
|
|
|
|
|
|
|
|
|
|
|
|
# instance fields
|
|
|
|
.field public cacheEnabled:Z
|
|
|
|
|
|
|
|
.field public cacheSnapshot:Ljava/util/Map;
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"Ljava/util/Map<",
|
|
|
|
"Ljava/lang/Long;",
|
|
|
|
"+",
|
|
|
|
"Ljava/util/List<",
|
|
|
|
"+",
|
|
|
|
"Lcom/discord/models/domain/ModelMessage;",
|
|
|
|
">;>;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
.end field
|
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
.field public final gson:Lcom/google/gson/Gson;
|
|
|
|
|
2020-08-04 06:02:43 +00:00
|
|
|
.field public final messages:Ljava/util/HashMap;
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"Ljava/util/HashMap<",
|
|
|
|
"Ljava/lang/Long;",
|
|
|
|
"Ljava/util/TreeMap<",
|
|
|
|
"Ljava/lang/Long;",
|
|
|
|
"Lcom/discord/models/domain/ModelMessage;",
|
|
|
|
">;>;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
.end field
|
|
|
|
|
|
|
|
.field public final messagesPublisher:Lrx/subjects/Subject;
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"Lrx/subjects/Subject<",
|
|
|
|
"Ljava/util/Map<",
|
|
|
|
"Ljava/lang/Long;",
|
|
|
|
"Ljava/util/List<",
|
|
|
|
"Lcom/discord/models/domain/ModelMessage;",
|
|
|
|
">;>;",
|
|
|
|
"Ljava/util/Map<",
|
|
|
|
"Ljava/lang/Long;",
|
|
|
|
"Ljava/util/List<",
|
|
|
|
"Lcom/discord/models/domain/ModelMessage;",
|
|
|
|
">;>;>;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
.end field
|
|
|
|
|
|
|
|
.field public messagesSnapshot:Ljava/util/Map;
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"Ljava/util/Map<",
|
|
|
|
"Ljava/lang/Long;",
|
|
|
|
"+",
|
|
|
|
"Ljava/util/List<",
|
|
|
|
"+",
|
|
|
|
"Lcom/discord/models/domain/ModelMessage;",
|
|
|
|
">;>;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
.end field
|
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
.field public sharedPreferences:Landroid/content/SharedPreferences;
|
|
|
|
|
2020-08-04 06:02:43 +00:00
|
|
|
.field public final updatedChannels:Ljava/util/Set;
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"Ljava/util/Set<",
|
|
|
|
"Ljava/lang/Long;",
|
|
|
|
">;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
.end field
|
|
|
|
|
|
|
|
|
|
|
|
# direct methods
|
|
|
|
.method public constructor <init>()V
|
2020-08-20 22:29:33 +00:00
|
|
|
.locals 21
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
move-object/from16 v0, p0
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
invoke-direct/range {p0 .. p0}, Ljava/lang/Object;-><init>()V
|
2020-08-18 03:20:31 +00:00
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
new-instance v1, Ljava/util/HashMap;
|
|
|
|
|
|
|
|
invoke-direct {v1}, Ljava/util/HashMap;-><init>()V
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
iput-object v1, v0, Lcom/discord/stores/StoreLocalMessagesHolder;->messages:Ljava/util/HashMap;
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
new-instance v1, Lrx/subjects/SerializedSubject;
|
2020-08-04 06:02:43 +00:00
|
|
|
|
|
|
|
invoke-static {}, Lrx/subjects/BehaviorSubject;->g0()Lrx/subjects/BehaviorSubject;
|
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
move-result-object v2
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
invoke-direct {v1, v2}, Lrx/subjects/SerializedSubject;-><init>(Lrx/subjects/Subject;)V
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
iput-object v1, v0, Lcom/discord/stores/StoreLocalMessagesHolder;->messagesPublisher:Lrx/subjects/Subject;
|
2020-08-18 03:20:31 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
sget-object v1, Lk0/i/o;->d:Lk0/i/o;
|
2020-08-18 03:20:31 +00:00
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
iput-object v1, v0, Lcom/discord/stores/StoreLocalMessagesHolder;->messagesSnapshot:Ljava/util/Map;
|
2020-08-18 03:20:31 +00:00
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
iput-object v1, v0, Lcom/discord/stores/StoreLocalMessagesHolder;->cacheSnapshot:Ljava/util/Map;
|
|
|
|
|
|
|
|
new-instance v1, Ljava/util/HashSet;
|
|
|
|
|
|
|
|
invoke-direct {v1}, Ljava/util/HashSet;-><init>()V
|
|
|
|
|
|
|
|
iput-object v1, v0, Lcom/discord/stores/StoreLocalMessagesHolder;->updatedChannels:Ljava/util/Set;
|
|
|
|
|
|
|
|
sget-object v3, Lf/h/d/u/o;->i:Lf/h/d/u/o;
|
|
|
|
|
|
|
|
sget-object v13, Lf/h/d/r;->d:Lf/h/d/r;
|
|
|
|
|
|
|
|
sget-object v4, Lf/h/d/c;->d:Lf/h/d/c;
|
|
|
|
|
|
|
|
new-instance v5, Ljava/util/HashMap;
|
|
|
|
|
|
|
|
invoke-direct {v5}, Ljava/util/HashMap;-><init>()V
|
|
|
|
|
|
|
|
new-instance v1, Ljava/util/ArrayList;
|
|
|
|
|
|
|
|
invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
|
|
|
|
new-instance v15, Ljava/util/ArrayList;
|
|
|
|
|
|
|
|
invoke-direct {v15}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
|
|
|
|
const/4 v12, 0x0
|
|
|
|
|
|
|
|
const/16 v16, 0x2
|
2020-08-18 03:20:31 +00:00
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
const/4 v9, 0x1
|
2020-08-18 03:20:31 +00:00
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
new-instance v11, Ljava/util/ArrayList;
|
2020-08-18 03:20:31 +00:00
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
invoke-interface {v1}, Ljava/util/List;->size()I
|
|
|
|
|
|
|
|
move-result v2
|
|
|
|
|
|
|
|
invoke-interface {v15}, Ljava/util/List;->size()I
|
|
|
|
|
|
|
|
move-result v6
|
|
|
|
|
|
|
|
add-int/2addr v6, v2
|
|
|
|
|
|
|
|
add-int/lit8 v6, v6, 0x3
|
|
|
|
|
|
|
|
invoke-direct {v11, v6}, Ljava/util/ArrayList;-><init>(I)V
|
|
|
|
|
|
|
|
invoke-virtual {v11, v1}, Ljava/util/ArrayList;->addAll(Ljava/util/Collection;)Z
|
|
|
|
|
|
|
|
invoke-static {v11}, Ljava/util/Collections;->reverse(Ljava/util/List;)V
|
|
|
|
|
|
|
|
new-instance v2, Ljava/util/ArrayList;
|
|
|
|
|
|
|
|
invoke-direct {v2, v15}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V
|
|
|
|
|
|
|
|
invoke-static {v2}, Ljava/util/Collections;->reverse(Ljava/util/List;)V
|
|
|
|
|
|
|
|
invoke-virtual {v11, v2}, Ljava/util/ArrayList;->addAll(Ljava/util/Collection;)Z
|
|
|
|
|
|
|
|
new-instance v10, Lcom/google/gson/Gson;
|
|
|
|
|
|
|
|
move-object v2, v10
|
|
|
|
|
|
|
|
const/4 v14, 0x0
|
|
|
|
|
|
|
|
move v6, v12
|
|
|
|
|
|
|
|
move v7, v12
|
|
|
|
|
|
|
|
move v8, v12
|
|
|
|
|
|
|
|
move-object/from16 v20, v10
|
|
|
|
|
|
|
|
move v10, v12
|
|
|
|
|
|
|
|
move-object/from16 v19, v11
|
|
|
|
|
|
|
|
move v11, v12
|
|
|
|
|
|
|
|
move-object/from16 v18, v15
|
|
|
|
|
|
|
|
move/from16 v15, v16
|
|
|
|
|
|
|
|
move-object/from16 v17, v1
|
|
|
|
|
|
|
|
invoke-direct/range {v2 .. v19}, Lcom/google/gson/Gson;-><init>(Lf/h/d/u/o;Lf/h/d/d;Ljava/util/Map;ZZZZZZZLf/h/d/r;Ljava/lang/String;IILjava/util/List;Ljava/util/List;Ljava/util/List;)V
|
|
|
|
|
|
|
|
move-object/from16 v1, v20
|
|
|
|
|
|
|
|
iput-object v1, v0, Lcom/discord/stores/StoreLocalMessagesHolder;->gson:Lcom/google/gson/Gson;
|
2020-08-04 06:02:43 +00:00
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static synthetic init$default(Lcom/discord/stores/StoreLocalMessagesHolder;ZILjava/lang/Object;)V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
const/4 p3, 0x1
|
|
|
|
|
|
|
|
and-int/2addr p2, p3
|
|
|
|
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
|
|
|
|
const/4 p1, 0x1
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-virtual {p0, p1}, Lcom/discord/stores/StoreLocalMessagesHolder;->init(Z)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private final messageCacheTryPersist()V
|
|
|
|
.locals 5
|
|
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
iget-boolean v0, p0, Lcom/discord/stores/StoreLocalMessagesHolder;->cacheEnabled:Z
|
|
|
|
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
new-instance v0, Ljava/util/HashMap;
|
|
|
|
|
|
|
|
invoke-direct {v0}, Ljava/util/HashMap;-><init>()V
|
|
|
|
|
|
|
|
iget-object v1, p0, Lcom/discord/stores/StoreLocalMessagesHolder;->messages:Ljava/util/HashMap;
|
|
|
|
|
|
|
|
invoke-interface {v1}, Ljava/util/Map;->entrySet()Ljava/util/Set;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
invoke-interface {v1}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
|
|
|
|
move-result v2
|
|
|
|
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
|
|
|
|
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
check-cast v2, Ljava/util/Map$Entry;
|
|
|
|
|
|
|
|
invoke-interface {v2}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v3
|
|
|
|
|
|
|
|
invoke-interface {v2}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
check-cast v2, Ljava/util/TreeMap;
|
|
|
|
|
|
|
|
invoke-virtual {v2}, Ljava/util/TreeMap;->values()Ljava/util/Collection;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
const-string v4, "entry.value.values"
|
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-static {v2, v4}, Lk0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-static {v2}, Lk0/i/l;->toList(Ljava/lang/Iterable;)Ljava/util/List;
|
2020-08-04 06:02:43 +00:00
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
invoke-interface {v0, v3, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
iget-object v1, p0, Lcom/discord/stores/StoreLocalMessagesHolder;->cacheSnapshot:Ljava/util/Map;
|
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-static {v1, v0}, Lk0/n/c/h;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
|
2020-08-04 06:02:43 +00:00
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
|
|
|
xor-int/lit8 v1, v1, 0x1
|
|
|
|
|
|
|
|
if-eqz v1, :cond_3
|
|
|
|
|
|
|
|
iput-object v0, p0, Lcom/discord/stores/StoreLocalMessagesHolder;->cacheSnapshot:Ljava/util/Map;
|
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
iget-object v1, p0, Lcom/discord/stores/StoreLocalMessagesHolder;->gson:Lcom/google/gson/Gson;
|
2020-08-18 03:20:31 +00:00
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
invoke-virtual {v1, v0}, Lcom/google/gson/Gson;->k(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
iget-object v1, p0, Lcom/discord/stores/StoreLocalMessagesHolder;->sharedPreferences:Landroid/content/SharedPreferences;
|
2020-08-04 06:02:43 +00:00
|
|
|
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
invoke-interface {v1}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
const-string v2, "STORE_LOCAL_MESSAGES_CACHE"
|
2020-08-18 03:20:31 +00:00
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
invoke-interface {v1, v2, v0}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->apply()V
|
2020-08-04 06:02:43 +00:00
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:cond_2
|
2020-08-20 22:29:33 +00:00
|
|
|
const-string v0, "sharedPreferences"
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-static {v0}, Lk0/n/c/h;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
throw v0
|
2020-08-04 06:02:43 +00:00
|
|
|
|
|
|
|
:cond_3
|
|
|
|
:goto_1
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private final publishIfUpdated(Z)V
|
|
|
|
.locals 6
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreLocalMessagesHolder;->updatedChannels:Ljava/util/Set;
|
|
|
|
|
|
|
|
invoke-interface {v0}, Ljava/util/Set;->isEmpty()Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
new-instance p1, Ljava/util/HashMap;
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreLocalMessagesHolder;->messagesSnapshot:Ljava/util/Map;
|
|
|
|
|
|
|
|
invoke-direct {p1, v0}, Ljava/util/HashMap;-><init>(Ljava/util/Map;)V
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreLocalMessagesHolder;->updatedChannels:Ljava/util/Set;
|
|
|
|
|
|
|
|
invoke-interface {v0}, Ljava/util/Set;->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_2
|
|
|
|
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
check-cast v1, Ljava/lang/Number;
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Ljava/lang/Number;->longValue()J
|
|
|
|
|
|
|
|
move-result-wide v1
|
|
|
|
|
|
|
|
invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
|
|
|
|
move-result-object v3
|
|
|
|
|
|
|
|
new-instance v4, Ljava/util/ArrayList;
|
|
|
|
|
|
|
|
iget-object v5, p0, Lcom/discord/stores/StoreLocalMessagesHolder;->messages:Ljava/util/HashMap;
|
|
|
|
|
|
|
|
invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
invoke-virtual {v5, v1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
check-cast v1, Ljava/util/TreeMap;
|
|
|
|
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Ljava/util/TreeMap;->values()Ljava/util/Collection;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:cond_1
|
2020-09-08 08:16:32 +00:00
|
|
|
sget-object v1, Lk0/i/n;->d:Lk0/i/n;
|
2020-08-04 06:02:43 +00:00
|
|
|
|
|
|
|
:goto_1
|
|
|
|
invoke-direct {v4, v1}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V
|
|
|
|
|
|
|
|
invoke-interface {p1, v3, v4}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreLocalMessagesHolder;->updatedChannels:Ljava/util/Set;
|
|
|
|
|
|
|
|
invoke-interface {v0}, Ljava/util/Set;->clear()V
|
|
|
|
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreLocalMessagesHolder;->messagesSnapshot:Ljava/util/Map;
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreLocalMessagesHolder;->messagesPublisher:Lrx/subjects/Subject;
|
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
invoke-interface {v0, p1}, Ls0/g;->onNext(Ljava/lang/Object;)V
|
2020-08-04 06:02:43 +00:00
|
|
|
|
|
|
|
invoke-direct {p0}, Lcom/discord/stores/StoreLocalMessagesHolder;->messageCacheTryPersist()V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static synthetic publishIfUpdated$default(Lcom/discord/stores/StoreLocalMessagesHolder;ZILjava/lang/Object;)V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
and-int/lit8 p2, p2, 0x1
|
|
|
|
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
|
|
|
|
const/4 p1, 0x0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/stores/StoreLocalMessagesHolder;->publishIfUpdated(Z)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
|
|
|
|
# virtual methods
|
|
|
|
.method public final addMessage(Lcom/discord/models/domain/ModelMessage;)V
|
2020-09-08 08:16:32 +00:00
|
|
|
.locals 6
|
2020-08-04 06:02:43 +00:00
|
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
|
|
.end annotation
|
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
const/4 v0, 0x0
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
if-eqz p1, :cond_1
|
2020-08-04 06:02:43 +00:00
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessage;->getChannelId()J
|
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
move-result-wide v1
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
iget-object v3, p0, Lcom/discord/stores/StoreLocalMessagesHolder;->messages:Ljava/util/HashMap;
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
move-result-object v4
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-virtual {v3, v4}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
move-result-object v3
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
check-cast v3, Ljava/util/TreeMap;
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
if-eqz v3, :cond_0
|
2020-08-04 06:02:43 +00:00
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
2020-09-08 08:16:32 +00:00
|
|
|
new-instance v3, Ljava/util/TreeMap;
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-direct {v3}, Ljava/util/TreeMap;-><init>()V
|
2020-08-04 06:02:43 +00:00
|
|
|
|
|
|
|
:goto_0
|
2020-09-08 08:16:32 +00:00
|
|
|
const-string v4, "messages[channelId] ?: TreeMap()"
|
|
|
|
|
|
|
|
invoke-static {v3, v4}, Lk0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
|
2020-08-04 06:02:43 +00:00
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessage;->getId()J
|
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
move-result-wide v4
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-static {v4, v5}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
move-result-object v4
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-interface {v3, v4, p1}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
2020-08-04 06:02:43 +00:00
|
|
|
|
|
|
|
iget-object p1, p0, Lcom/discord/stores/StoreLocalMessagesHolder;->messages:Ljava/util/HashMap;
|
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
move-result-object v4
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-interface {p1, v4, v3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
2020-08-04 06:02:43 +00:00
|
|
|
|
|
|
|
iget-object p1, p0, Lcom/discord/stores/StoreLocalMessagesHolder;->updatedChannels:Ljava/util/Set;
|
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
move-result-object v1
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-interface {p1, v1}, Ljava/util/Set;->add(Ljava/lang/Object;)Z
|
2020-08-04 06:02:43 +00:00
|
|
|
|
|
|
|
const/4 p1, 0x0
|
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
const/4 v1, 0x1
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-static {p0, p1, v1, v0}, Lcom/discord/stores/StoreLocalMessagesHolder;->publishIfUpdated$default(Lcom/discord/stores/StoreLocalMessagesHolder;ZILjava/lang/Object;)V
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-02 04:07:20 +00:00
|
|
|
return-void
|
2020-09-08 08:16:32 +00:00
|
|
|
|
|
|
|
:cond_1
|
|
|
|
const-string p1, "message"
|
|
|
|
|
|
|
|
invoke-static {p1}, Lk0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
throw v0
|
2020-08-04 06:02:43 +00:00
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final clearCache()V
|
|
|
|
.locals 5
|
|
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreLocalMessagesHolder;->messages:Ljava/util/HashMap;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Ljava/util/HashMap;->entrySet()Ljava/util/Set;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-interface {v0}, Ljava/util/Set;->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, Ljava/util/Map$Entry;
|
|
|
|
|
|
|
|
invoke-interface {v1}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
check-cast v2, Ljava/lang/Long;
|
|
|
|
|
|
|
|
invoke-interface {v1}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
check-cast v1, Ljava/util/TreeMap;
|
|
|
|
|
|
|
|
iget-object v3, p0, Lcom/discord/stores/StoreLocalMessagesHolder;->updatedChannels:Ljava/util/Set;
|
|
|
|
|
|
|
|
const-string v4, "channelId"
|
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-static {v2, v4}, Lk0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-08-04 06:02:43 +00:00
|
|
|
|
|
|
|
invoke-interface {v3, v2}, Ljava/util/Set;->add(Ljava/lang/Object;)Z
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Ljava/util/TreeMap;->clear()V
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
const/4 v1, 0x1
|
|
|
|
|
|
|
|
const/4 v2, 0x0
|
|
|
|
|
|
|
|
invoke-static {p0, v0, v1, v2}, Lcom/discord/stores/StoreLocalMessagesHolder;->publishIfUpdated$default(Lcom/discord/stores/StoreLocalMessagesHolder;ZILjava/lang/Object;)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
2020-08-26 03:44:38 +00:00
|
|
|
.method public final deleteMessage(JLjava/lang/String;)V
|
2020-09-08 08:16:32 +00:00
|
|
|
.locals 3
|
2020-08-26 03:44:38 +00:00
|
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
|
|
.end annotation
|
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
const/4 v0, 0x0
|
2020-08-26 03:44:38 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
if-eqz p3, :cond_3
|
2020-08-26 03:44:38 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
iget-object v1, p0, Lcom/discord/stores/StoreLocalMessagesHolder;->messages:Ljava/util/HashMap;
|
2020-08-26 03:44:38 +00:00
|
|
|
|
|
|
|
invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-virtual {v1, p1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
2020-08-26 03:44:38 +00:00
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
check-cast p1, Ljava/util/TreeMap;
|
|
|
|
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
|
|
|
|
const-string p2, "messages[channelId] ?: return"
|
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-static {p1, p2}, Lk0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-08-26 03:44:38 +00:00
|
|
|
|
|
|
|
invoke-virtual {p1}, Ljava/util/TreeMap;->values()Ljava/util/Collection;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
const-string p2, "messagesForChannel.values"
|
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-static {p1, p2}, Lk0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-08-26 03:44:38 +00:00
|
|
|
|
|
|
|
invoke-interface {p1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
|
|
|
|
move-result p2
|
|
|
|
|
|
|
|
if-eqz p2, :cond_1
|
|
|
|
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object p2
|
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
move-object v1, p2
|
2020-08-26 03:44:38 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
check-cast v1, Lcom/discord/models/domain/ModelMessage;
|
2020-08-26 03:44:38 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
const-string v2, "message"
|
2020-08-26 03:44:38 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-static {v1, v2}, Lk0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-08-26 03:44:38 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-virtual {v1}, Lcom/discord/models/domain/ModelMessage;->getNonce()Ljava/lang/String;
|
2020-08-26 03:44:38 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
move-result-object v1
|
2020-08-26 03:44:38 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-static {v1, p3}, Lk0/n/c/h;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
|
2020-08-26 03:44:38 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
move-result v1
|
2020-08-26 03:44:38 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
if-eqz v1, :cond_0
|
2020-08-26 03:44:38 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
move-object v0, p2
|
2020-08-26 03:44:38 +00:00
|
|
|
|
|
|
|
:cond_1
|
2020-09-08 08:16:32 +00:00
|
|
|
check-cast v0, Lcom/discord/models/domain/ModelMessage;
|
2020-09-02 04:07:20 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
if-eqz v0, :cond_2
|
2020-08-26 03:44:38 +00:00
|
|
|
|
|
|
|
const-string p1, "messagesForChannel.value\u2026once == nonce } ?: return"
|
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-static {v0, p1}, Lk0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-08-26 03:44:38 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-virtual {p0, v0}, Lcom/discord/stores/StoreLocalMessagesHolder;->deleteMessage(Lcom/discord/models/domain/ModelMessage;)V
|
2020-08-26 03:44:38 +00:00
|
|
|
|
|
|
|
:cond_2
|
|
|
|
return-void
|
2020-09-08 08:16:32 +00:00
|
|
|
|
|
|
|
:cond_3
|
|
|
|
const-string p1, "nonce"
|
|
|
|
|
|
|
|
invoke-static {p1}, Lk0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
throw v0
|
2020-08-26 03:44:38 +00:00
|
|
|
.end method
|
|
|
|
|
2020-08-04 06:02:43 +00:00
|
|
|
.method public final deleteMessage(Lcom/discord/models/domain/ModelMessage;)V
|
2020-09-08 08:16:32 +00:00
|
|
|
.locals 6
|
2020-08-04 06:02:43 +00:00
|
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
|
|
.end annotation
|
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
const/4 v0, 0x0
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
if-eqz p1, :cond_2
|
2020-08-04 06:02:43 +00:00
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessage;->getId()J
|
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
move-result-wide v1
|
2020-08-04 06:02:43 +00:00
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessage;->getChannelId()J
|
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
move-result-wide v3
|
2020-08-04 06:02:43 +00:00
|
|
|
|
|
|
|
iget-object p1, p0, Lcom/discord/stores/StoreLocalMessagesHolder;->messages:Ljava/util/HashMap;
|
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-static {v3, v4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
move-result-object v5
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-virtual {p1, v5}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
2020-08-04 06:02:43 +00:00
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
check-cast p1, Ljava/util/TreeMap;
|
|
|
|
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
const-string v5, "messages[channelId] ?: return"
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-static {p1, v5}, Lk0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
move-result-object v5
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-virtual {p1, v5}, Ljava/util/TreeMap;->containsKey(Ljava/lang/Object;)Z
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
move-result v5
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
if-eqz v5, :cond_0
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
move-result-object v1
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-virtual {p1, v1}, Ljava/util/TreeMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
iget-object v1, p0, Lcom/discord/stores/StoreLocalMessagesHolder;->updatedChannels:Ljava/util/Set;
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-static {v3, v4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
move-result-object v2
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-interface {v1, v2}, Ljava/util/Set;->add(Ljava/lang/Object;)Z
|
2020-08-04 06:02:43 +00:00
|
|
|
|
|
|
|
invoke-virtual {p1}, Ljava/util/TreeMap;->isEmpty()Z
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
|
|
|
|
iget-object p1, p0, Lcom/discord/stores/StoreLocalMessagesHolder;->messages:Ljava/util/HashMap;
|
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-static {v3, v4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
move-result-object v1
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-virtual {p1, v1}, Ljava/util/HashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;
|
2020-08-04 06:02:43 +00:00
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const/4 p1, 0x0
|
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
const/4 v1, 0x1
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-static {p0, p1, v1, v0}, Lcom/discord/stores/StoreLocalMessagesHolder;->publishIfUpdated$default(Lcom/discord/stores/StoreLocalMessagesHolder;ZILjava/lang/Object;)V
|
2020-08-04 06:02:43 +00:00
|
|
|
|
|
|
|
:cond_1
|
|
|
|
return-void
|
2020-09-08 08:16:32 +00:00
|
|
|
|
|
|
|
:cond_2
|
|
|
|
const-string p1, "message"
|
|
|
|
|
|
|
|
invoke-static {p1}, Lk0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
throw v0
|
2020-08-04 06:02:43 +00:00
|
|
|
.end method
|
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
.method public final getFlattenedMessages()Ljava/util/List;
|
|
|
|
.locals 1
|
|
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"()",
|
|
|
|
"Ljava/util/List<",
|
|
|
|
"Lcom/discord/models/domain/ModelMessage;",
|
|
|
|
">;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreLocalMessagesHolder;->messagesSnapshot:Ljava/util/Map;
|
|
|
|
|
|
|
|
invoke-interface {v0}, Ljava/util/Map;->values()Ljava/util/Collection;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-static {v0}, Lf/n/a/k/a;->flatten(Ljava/lang/Iterable;)Ljava/util/List;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
2020-08-04 06:02:43 +00:00
|
|
|
.method public final getMessagesPublisher()Lrx/Observable;
|
|
|
|
.locals 1
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"()",
|
|
|
|
"Lrx/Observable<",
|
|
|
|
"Ljava/util/Map<",
|
|
|
|
"Ljava/lang/Long;",
|
|
|
|
"Ljava/util/List<",
|
|
|
|
"Lcom/discord/models/domain/ModelMessage;",
|
|
|
|
">;>;>;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreLocalMessagesHolder;->messagesPublisher:Lrx/subjects/Subject;
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final init(Z)V
|
|
|
|
.locals 8
|
|
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
|
|
.end annotation
|
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
if-eqz p1, :cond_4
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
sget-object v0, Lcom/discord/utilities/cache/SharedPreferencesProvider;->INSTANCE:Lcom/discord/utilities/cache/SharedPreferencesProvider;
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
invoke-virtual {v0}, Lcom/discord/utilities/cache/SharedPreferencesProvider;->get()Landroid/content/SharedPreferences;
|
2020-08-18 03:20:31 +00:00
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
iput-object v0, p0, Lcom/discord/stores/StoreLocalMessagesHolder;->sharedPreferences:Landroid/content/SharedPreferences;
|
|
|
|
|
|
|
|
const/4 v1, 0x0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_3
|
2020-08-04 06:02:43 +00:00
|
|
|
|
|
|
|
const-string v2, "STORE_LOCAL_MESSAGES_CACHE"
|
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
invoke-interface {v0, v2, v1}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
new-instance v1, Lcom/discord/stores/StoreLocalMessagesHolder$init$type$1;
|
|
|
|
|
|
|
|
invoke-direct {v1}, Lcom/discord/stores/StoreLocalMessagesHolder$init$type$1;-><init>()V
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
invoke-virtual {v1}, Lcom/google/gson/reflect/TypeToken;->getType()Ljava/lang/reflect/Type;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
2020-08-18 03:20:31 +00:00
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
iget-object v2, p0, Lcom/discord/stores/StoreLocalMessagesHolder;->gson:Lcom/google/gson/Gson;
|
2020-08-18 03:20:31 +00:00
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
invoke-virtual {v2, v0, v1}, Lcom/google/gson/Gson;->f(Ljava/lang/String;Ljava/lang/reflect/Type;)Ljava/lang/Object;
|
2020-08-04 06:02:43 +00:00
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
check-cast v0, Ljava/util/Map;
|
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
2020-09-08 08:16:32 +00:00
|
|
|
sget-object v0, Lk0/i/o;->d:Lk0/i/o;
|
2020-08-20 22:29:33 +00:00
|
|
|
|
|
|
|
:goto_0
|
2020-08-04 06:02:43 +00:00
|
|
|
invoke-interface {v0}, Ljava/util/Map;->entrySet()Ljava/util/Set;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-interface {v0}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
:goto_1
|
2020-08-04 06:02:43 +00:00
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
if-eqz v1, :cond_4
|
2020-08-04 06:02:43 +00:00
|
|
|
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
check-cast v1, Ljava/util/Map$Entry;
|
|
|
|
|
|
|
|
invoke-interface {v1}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
check-cast v2, Ljava/lang/Number;
|
|
|
|
|
|
|
|
invoke-virtual {v2}, Ljava/lang/Number;->longValue()J
|
|
|
|
|
|
|
|
move-result-wide v2
|
|
|
|
|
|
|
|
iget-object v4, p0, Lcom/discord/stores/StoreLocalMessagesHolder;->messages:Ljava/util/HashMap;
|
|
|
|
|
|
|
|
invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
|
|
|
|
move-result-object v5
|
|
|
|
|
|
|
|
new-instance v6, Ljava/util/TreeMap;
|
|
|
|
|
|
|
|
invoke-static {}, Lcom/discord/models/domain/ModelMessage;->getSortByIds()Ljava/util/Comparator;
|
|
|
|
|
|
|
|
move-result-object v7
|
|
|
|
|
|
|
|
invoke-direct {v6, v7}, Ljava/util/TreeMap;-><init>(Ljava/util/Comparator;)V
|
|
|
|
|
|
|
|
invoke-interface {v4, v5, v6}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
iget-object v4, p0, Lcom/discord/stores/StoreLocalMessagesHolder;->messages:Ljava/util/HashMap;
|
|
|
|
|
|
|
|
invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
|
|
|
|
move-result-object v5
|
|
|
|
|
|
|
|
invoke-virtual {v4, v5}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v4
|
|
|
|
|
|
|
|
check-cast v4, Ljava/util/TreeMap;
|
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
if-eqz v4, :cond_1
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
goto :goto_2
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
:cond_1
|
2020-08-04 06:02:43 +00:00
|
|
|
new-instance v4, Ljava/util/TreeMap;
|
|
|
|
|
|
|
|
invoke-direct {v4}, Ljava/util/TreeMap;-><init>()V
|
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
:goto_2
|
2020-09-08 08:16:32 +00:00
|
|
|
const-string v5, "messages[channelId] ?: TreeMap()"
|
|
|
|
|
|
|
|
invoke-static {v4, v5}, Lk0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
|
2020-08-04 06:02:43 +00:00
|
|
|
invoke-interface {v1}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
check-cast v1, Ljava/util/List;
|
|
|
|
|
|
|
|
invoke-interface {v1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
:goto_3
|
2020-08-04 06:02:43 +00:00
|
|
|
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
|
|
|
|
move-result v5
|
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
if-eqz v5, :cond_2
|
2020-08-04 06:02:43 +00:00
|
|
|
|
|
|
|
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v5
|
|
|
|
|
|
|
|
check-cast v5, Lcom/discord/models/domain/ModelMessage;
|
|
|
|
|
|
|
|
invoke-virtual {v5}, Lcom/discord/models/domain/ModelMessage;->getId()J
|
|
|
|
|
|
|
|
move-result-wide v6
|
|
|
|
|
|
|
|
invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
|
|
|
|
move-result-object v6
|
|
|
|
|
|
|
|
invoke-interface {v4, v6, v5}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
goto :goto_3
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
:cond_2
|
2020-08-04 06:02:43 +00:00
|
|
|
iget-object v1, p0, Lcom/discord/stores/StoreLocalMessagesHolder;->messages:Ljava/util/HashMap;
|
|
|
|
|
|
|
|
invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
|
|
|
|
move-result-object v5
|
|
|
|
|
|
|
|
invoke-interface {v1, v5, v4}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
iget-object v1, p0, Lcom/discord/stores/StoreLocalMessagesHolder;->updatedChannels:Ljava/util/Set;
|
|
|
|
|
|
|
|
invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
invoke-interface {v1, v2}, Ljava/util/Set;->add(Ljava/lang/Object;)Z
|
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
goto :goto_1
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
:cond_3
|
|
|
|
const-string p1, "sharedPreferences"
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-09-08 08:16:32 +00:00
|
|
|
invoke-static {p1}, Lk0/n/c/h;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
throw v1
|
2020-08-04 06:02:43 +00:00
|
|
|
|
2020-08-20 22:29:33 +00:00
|
|
|
:cond_4
|
2020-08-04 06:02:43 +00:00
|
|
|
iput-boolean p1, p0, Lcom/discord/stores/StoreLocalMessagesHolder;->cacheEnabled:Z
|
|
|
|
|
|
|
|
const/4 p1, 0x1
|
|
|
|
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/stores/StoreLocalMessagesHolder;->publishIfUpdated(Z)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|