2137 lines
60 KiB
Smali
2137 lines
60 KiB
Smali
.class public final Lcom/discord/stores/StoreMessages;
|
|
.super Lcom/discord/stores/Store;
|
|
.source "StoreMessages.kt"
|
|
|
|
|
|
# instance fields
|
|
.field public final clock:Lcom/discord/utilities/time/Clock;
|
|
|
|
.field public context:Landroid/content/Context;
|
|
|
|
.field public final dispatcher:Lcom/discord/stores/Dispatcher;
|
|
|
|
.field public final holder:Lcom/discord/stores/StoreMessagesHolder;
|
|
|
|
.field public final localMessagesHolder:Lcom/discord/stores/StoreLocalMessagesHolder;
|
|
|
|
.field public final messageQueues:Ljava/util/HashMap;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/HashMap<",
|
|
"Ljava/lang/Long;",
|
|
"Lcom/discord/utilities/messagesend/MessageQueue;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public final queueExecutor:Ljava/util/concurrent/ExecutorService;
|
|
|
|
.field public final stream:Lcom/discord/stores/StoreStream;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Lcom/discord/stores/StoreStream;Lcom/discord/stores/Dispatcher;Lcom/discord/utilities/time/Clock;)V
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
if-eqz p2, :cond_1
|
|
|
|
if-eqz p3, :cond_0
|
|
|
|
invoke-direct {p0}, Lcom/discord/stores/Store;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreMessages;->stream:Lcom/discord/stores/StoreStream;
|
|
|
|
iput-object p2, p0, Lcom/discord/stores/StoreMessages;->dispatcher:Lcom/discord/stores/Dispatcher;
|
|
|
|
iput-object p3, p0, Lcom/discord/stores/StoreMessages;->clock:Lcom/discord/utilities/time/Clock;
|
|
|
|
new-instance p1, Lcom/discord/stores/StoreMessagesHolder;
|
|
|
|
invoke-direct {p1}, Lcom/discord/stores/StoreMessagesHolder;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreMessages;->holder:Lcom/discord/stores/StoreMessagesHolder;
|
|
|
|
new-instance p1, Lcom/discord/stores/StoreLocalMessagesHolder;
|
|
|
|
invoke-direct {p1}, Lcom/discord/stores/StoreLocalMessagesHolder;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreMessages;->localMessagesHolder:Lcom/discord/stores/StoreLocalMessagesHolder;
|
|
|
|
invoke-static {}, Ljava/util/concurrent/Executors;->newSingleThreadExecutor()Ljava/util/concurrent/ExecutorService;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreMessages;->queueExecutor:Ljava/util/concurrent/ExecutorService;
|
|
|
|
new-instance p1, Ljava/util/HashMap;
|
|
|
|
invoke-direct {p1}, Ljava/util/HashMap;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreMessages;->messageQueues:Ljava/util/HashMap;
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "clock"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_1
|
|
const-string p1, "dispatcher"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_2
|
|
const-string p1, "stream"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public static final synthetic access$getContext$p(Lcom/discord/stores/StoreMessages;)Landroid/content/Context;
|
|
.locals 0
|
|
|
|
iget-object p0, p0, Lcom/discord/stores/StoreMessages;->context:Landroid/content/Context;
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
const-string p0, "context"
|
|
|
|
invoke-static {p0}, Lj0/n/c/h;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
const/4 p0, 0x0
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
.method public static final synthetic access$getDispatcher$p(Lcom/discord/stores/StoreMessages;)Lcom/discord/stores/Dispatcher;
|
|
.locals 0
|
|
|
|
iget-object p0, p0, Lcom/discord/stores/StoreMessages;->dispatcher:Lcom/discord/stores/Dispatcher;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static final synthetic access$getMessageQueue(Lcom/discord/stores/StoreMessages;J)Lcom/discord/utilities/messagesend/MessageQueue;
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1, p2}, Lcom/discord/stores/StoreMessages;->getMessageQueue(J)Lcom/discord/utilities/messagesend/MessageQueue;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static final synthetic access$getStream$p(Lcom/discord/stores/StoreMessages;)Lcom/discord/stores/StoreStream;
|
|
.locals 0
|
|
|
|
iget-object p0, p0, Lcom/discord/stores/StoreMessages;->stream:Lcom/discord/stores/StoreStream;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static final synthetic access$handleLocalMessageCreate(Lcom/discord/stores/StoreMessages;Lcom/discord/models/domain/ModelMessage;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/stores/StoreMessages;->handleLocalMessageCreate(Lcom/discord/models/domain/ModelMessage;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$handleLocalMessageDelete(Lcom/discord/stores/StoreMessages;Lcom/discord/models/domain/ModelMessage;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/stores/StoreMessages;->handleLocalMessageDelete(Lcom/discord/models/domain/ModelMessage;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$handleSendMessageFailure(Lcom/discord/stores/StoreMessages;Lcom/discord/models/domain/ModelMessage;Ljava/lang/String;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1, p2}, Lcom/discord/stores/StoreMessages;->handleSendMessageFailure(Lcom/discord/models/domain/ModelMessage;Ljava/lang/String;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$handleSendMessageValidationError(Lcom/discord/stores/StoreMessages;Lcom/discord/models/domain/ModelMessage;Ljava/lang/String;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1, p2}, Lcom/discord/stores/StoreMessages;->handleSendMessageValidationError(Lcom/discord/models/domain/ModelMessage;Ljava/lang/String;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$setContext$p(Lcom/discord/stores/StoreMessages;Landroid/content/Context;)V
|
|
.locals 0
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreMessages;->context:Landroid/content/Context;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final getLocalMessages(J)Lrx/Observable;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(J)",
|
|
"Lrx/Observable<",
|
|
"Ljava/util/List<",
|
|
"Lcom/discord/models/domain/ModelMessage;",
|
|
">;>;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMessages;->localMessagesHolder:Lcom/discord/stores/StoreLocalMessagesHolder;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreLocalMessagesHolder;->getMessagesPublisher()Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v1, Lcom/discord/stores/StoreMessages$getLocalMessages$1;
|
|
|
|
invoke-direct {v1, p1, p2}, Lcom/discord/stores/StoreMessages$getLocalMessages$1;-><init>(J)V
|
|
|
|
invoke-virtual {v0, v1}, Lrx/Observable;->E(Lr0/k/b;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "localMessagesHolder\n \u2026annelId] ?: emptyList() }"
|
|
|
|
invoke-static {p1, p2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-static {p1}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->computationBuffered(Lrx/Observable;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
sget-object p2, Lcom/discord/stores/StoreMessages$getLocalMessages$2;->INSTANCE:Lcom/discord/stores/StoreMessages$getLocalMessages$2;
|
|
|
|
invoke-virtual {p1, p2}, Lrx/Observable;->r(Lrx/functions/Func2;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "localMessagesHolder\n \u2026messages1 === messages2 }"
|
|
|
|
invoke-static {p1, p2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method private final declared-synchronized getMessageQueue(J)Lcom/discord/utilities/messagesend/MessageQueue;
|
|
.locals 5
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMessages;->messageQueues:Ljava/util/HashMap;
|
|
|
|
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/utilities/messagesend/MessageQueue;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
new-instance v0, Lcom/discord/utilities/messagesend/MessageQueue;
|
|
|
|
iget-object v1, p0, Lcom/discord/stores/StoreMessages;->context:Landroid/content/Context;
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "context.contentResolver"
|
|
|
|
invoke-static {v1, v2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
iget-object v2, p0, Lcom/discord/stores/StoreMessages;->queueExecutor:Ljava/util/concurrent/ExecutorService;
|
|
|
|
const-string v3, "queueExecutor"
|
|
|
|
invoke-static {v2, v3}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
iget-object v3, p0, Lcom/discord/stores/StoreMessages;->clock:Lcom/discord/utilities/time/Clock;
|
|
|
|
sget-object v4, Lcom/discord/stores/PersistLocalMessagesFeatureFlag;->Companion:Lcom/discord/stores/PersistLocalMessagesFeatureFlag$Companion;
|
|
|
|
invoke-virtual {v4}, Lcom/discord/stores/PersistLocalMessagesFeatureFlag$Companion;->getINSTANCE()Lcom/discord/stores/PersistLocalMessagesFeatureFlag;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-virtual {v4}, Lcom/discord/stores/PersistLocalMessagesFeatureFlag;->isEnabled()Z
|
|
|
|
move-result v4
|
|
|
|
invoke-direct {v0, v1, v2, v3, v4}, Lcom/discord/utilities/messagesend/MessageQueue;-><init>(Landroid/content/ContentResolver;Ljava/util/concurrent/ExecutorService;Lcom/discord/utilities/time/Clock;Z)V
|
|
|
|
iget-object v1, p0, Lcom/discord/stores/StoreMessages;->messageQueues:Ljava/util/HashMap;
|
|
|
|
invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-interface {v1, p1, v0}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
:goto_0
|
|
monitor-exit p0
|
|
|
|
return-object v0
|
|
|
|
:cond_1
|
|
:try_start_1
|
|
const-string p1, "context"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method private final getSyncedMessages(J)Lrx/Observable;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(J)",
|
|
"Lrx/Observable<",
|
|
"Ljava/util/List<",
|
|
"Lcom/discord/models/domain/ModelMessage;",
|
|
">;>;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMessages;->holder:Lcom/discord/stores/StoreMessagesHolder;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreMessagesHolder;->getMessagesPublisher()Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v1, Lcom/discord/stores/StoreMessages$getSyncedMessages$1;
|
|
|
|
invoke-direct {v1, p1, p2}, Lcom/discord/stores/StoreMessages$getSyncedMessages$1;-><init>(J)V
|
|
|
|
invoke-virtual {v0, v1}, Lrx/Observable;->E(Lr0/k/b;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "holder\n .messag\u2026annelId] ?: emptyList() }"
|
|
|
|
invoke-static {p1, p2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-static {p1}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->computationBuffered(Lrx/Observable;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
sget-object p2, Lcom/discord/stores/StoreMessages$getSyncedMessages$2;->INSTANCE:Lcom/discord/stores/StoreMessages$getSyncedMessages$2;
|
|
|
|
invoke-virtual {p1, p2}, Lrx/Observable;->r(Lrx/functions/Func2;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "holder\n .messag\u2026messages1 === messages2 }"
|
|
|
|
invoke-static {p1, p2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method private final handleLocalMessageCreate(Lcom/discord/models/domain/ModelMessage;)V
|
|
.locals 1
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
sget-object v0, Lcom/discord/stores/PersistLocalMessagesFeatureFlag;->Companion:Lcom/discord/stores/PersistLocalMessagesFeatureFlag$Companion;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/PersistLocalMessagesFeatureFlag$Companion;->getINSTANCE()Lcom/discord/stores/PersistLocalMessagesFeatureFlag;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/PersistLocalMessagesFeatureFlag;->isEnabled()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMessages;->localMessagesHolder:Lcom/discord/stores/StoreLocalMessagesHolder;
|
|
|
|
invoke-virtual {v0, p1}, Lcom/discord/stores/StoreLocalMessagesHolder;->addMessage(Lcom/discord/models/domain/ModelMessage;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-static {p1}, Lf/n/a/k/a;->listOf(Ljava/lang/Object;)Ljava/util/List;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p0, p1}, Lcom/discord/stores/StoreMessages;->handleMessageCreate(Ljava/util/List;)V
|
|
|
|
:goto_0
|
|
return-void
|
|
.end method
|
|
|
|
.method private final handleLocalMessageDelete(Lcom/discord/models/domain/ModelMessage;)V
|
|
.locals 5
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
sget-object v0, Lcom/discord/stores/PersistLocalMessagesFeatureFlag;->Companion:Lcom/discord/stores/PersistLocalMessagesFeatureFlag$Companion;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/PersistLocalMessagesFeatureFlag$Companion;->getINSTANCE()Lcom/discord/stores/PersistLocalMessagesFeatureFlag;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/PersistLocalMessagesFeatureFlag;->isEnabled()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMessages;->localMessagesHolder:Lcom/discord/stores/StoreLocalMessagesHolder;
|
|
|
|
invoke-virtual {v0, p1}, Lcom/discord/stores/StoreLocalMessagesHolder;->deleteMessage(Lcom/discord/models/domain/ModelMessage;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
new-instance v0, Lcom/discord/models/domain/ModelMessageDelete;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessage;->getChannelId()J
|
|
|
|
move-result-wide v1
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessage;->getId()J
|
|
|
|
move-result-wide v3
|
|
|
|
invoke-direct {v0, v1, v2, v3, v4}, Lcom/discord/models/domain/ModelMessageDelete;-><init>(JJ)V
|
|
|
|
invoke-virtual {p0, v0}, Lcom/discord/stores/StoreMessages;->handleMessageDelete(Lcom/discord/models/domain/ModelMessageDelete;)V
|
|
|
|
:goto_0
|
|
return-void
|
|
.end method
|
|
|
|
.method private final handleMessageDelete(JLjava/util/List;)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(J",
|
|
"Ljava/util/List<",
|
|
"Ljava/lang/Long;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMessages;->holder:Lcom/discord/stores/StoreMessagesHolder;
|
|
|
|
invoke-virtual {v0, p1, p2, p3}, Lcom/discord/stores/StoreMessagesHolder;->deleteMessages(JLjava/util/List;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final handleSendMessageFailure(Lcom/discord/models/domain/ModelMessage;Ljava/lang/String;)V
|
|
.locals 17
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
move-object/from16 v0, p0
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/models/domain/ModelMessage;->getNonce()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
iget-object v2, v0, Lcom/discord/stores/StoreMessages;->stream:Lcom/discord/stores/StoreStream;
|
|
|
|
invoke-virtual {v2}, Lcom/discord/stores/StoreStream;->getMessageUploads$app_productionDiscordExternalRelease()Lcom/discord/stores/StoreMessageUploads;
|
|
|
|
move-result-object v2
|
|
|
|
const-string v3, "nonce"
|
|
|
|
invoke-static {v1, v3}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v2, v1}, Lcom/discord/stores/StoreMessageUploads;->handleMessageCreateFailure(Ljava/lang/String;)V
|
|
|
|
:cond_0
|
|
invoke-virtual/range {p0 .. p1}, Lcom/discord/stores/StoreMessages;->deleteMessage(Lcom/discord/models/domain/ModelMessage;)V
|
|
|
|
sget-object v1, Lcom/discord/stores/PersistLocalMessagesFeatureFlag;->Companion:Lcom/discord/stores/PersistLocalMessagesFeatureFlag$Companion;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/stores/PersistLocalMessagesFeatureFlag$Companion;->getINSTANCE()Lcom/discord/stores/PersistLocalMessagesFeatureFlag;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Lcom/discord/stores/PersistLocalMessagesFeatureFlag;->isEnabled()Z
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-nez v1, :cond_2
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/models/domain/ModelMessage;->isHasLocalUploads()Z
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
move-object/from16 v1, p1
|
|
|
|
move-object v3, v2
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
:goto_0
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/models/domain/ModelMessage;->getContent()Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/models/domain/ModelMessage;->getChannelId()J
|
|
|
|
move-result-wide v4
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/models/domain/ModelMessage;->getAuthor()Lcom/discord/models/domain/ModelUser;
|
|
|
|
move-result-object v6
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/models/domain/ModelMessage;->getMentions()Ljava/util/List;
|
|
|
|
move-result-object v7
|
|
|
|
const/4 v8, 0x1
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/models/domain/ModelMessage;->isHasLocalUploads()Z
|
|
|
|
move-result v9
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/models/domain/ModelMessage;->getApplication()Lcom/discord/models/domain/ModelApplication;
|
|
|
|
move-result-object v10
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/models/domain/ModelMessage;->getActivity()Lcom/discord/models/domain/ModelMessage$Activity;
|
|
|
|
move-result-object v11
|
|
|
|
iget-object v12, v0, Lcom/discord/stores/StoreMessages;->clock:Lcom/discord/utilities/time/Clock;
|
|
|
|
move-object/from16 v1, p1
|
|
|
|
iget-object v13, v1, Lcom/discord/models/domain/ModelMessage;->localAttachments:Ljava/util/List;
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/models/domain/ModelMessage;->getLastManualAttemptTimestamp()J
|
|
|
|
move-result-wide v14
|
|
|
|
invoke-static/range {v3 .. v15}, Lcom/discord/models/domain/ModelMessage;->createLocalMessage(Ljava/lang/String;JLcom/discord/models/domain/ModelUser;Ljava/util/List;ZZLcom/discord/models/domain/ModelApplication;Lcom/discord/models/domain/ModelMessage$Activity;Lcom/discord/utilities/time/Clock;Ljava/util/List;J)Lcom/discord/models/domain/ModelMessage;
|
|
|
|
move-result-object v3
|
|
|
|
:goto_1
|
|
if-eqz p2, :cond_3
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/models/domain/ModelMessage;->getChannelId()J
|
|
|
|
move-result-wide v5
|
|
|
|
sget-object v7, Lcom/discord/models/domain/ModelUser;->CLYDE_BOT:Lcom/discord/models/domain/ModelUser;
|
|
|
|
const/4 v8, 0x0
|
|
|
|
const/4 v9, 0x0
|
|
|
|
const/4 v10, 0x0
|
|
|
|
const/4 v11, 0x0
|
|
|
|
const/4 v12, 0x0
|
|
|
|
iget-object v13, v0, Lcom/discord/stores/StoreMessages;->clock:Lcom/discord/utilities/time/Clock;
|
|
|
|
const/4 v14, 0x0
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/models/domain/ModelMessage;->getLastManualAttemptTimestamp()J
|
|
|
|
move-result-wide v15
|
|
|
|
move-object/from16 v4, p2
|
|
|
|
invoke-static/range {v4 .. v16}, Lcom/discord/models/domain/ModelMessage;->createLocalMessage(Ljava/lang/String;JLcom/discord/models/domain/ModelUser;Ljava/util/List;ZZLcom/discord/models/domain/ModelApplication;Lcom/discord/models/domain/ModelMessage$Activity;Lcom/discord/utilities/time/Clock;Ljava/util/List;J)Lcom/discord/models/domain/ModelMessage;
|
|
|
|
move-result-object v2
|
|
|
|
:cond_3
|
|
sget-object v1, Lcom/discord/stores/PersistLocalMessagesFeatureFlag;->Companion:Lcom/discord/stores/PersistLocalMessagesFeatureFlag$Companion;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/stores/PersistLocalMessagesFeatureFlag$Companion;->getINSTANCE()Lcom/discord/stores/PersistLocalMessagesFeatureFlag;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Lcom/discord/stores/PersistLocalMessagesFeatureFlag;->isEnabled()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_4
|
|
|
|
if-eqz v3, :cond_4
|
|
|
|
invoke-direct {v0, v3}, Lcom/discord/stores/StoreMessages;->handleLocalMessageCreate(Lcom/discord/models/domain/ModelMessage;)V
|
|
|
|
goto :goto_2
|
|
|
|
:cond_4
|
|
const/4 v1, 0x2
|
|
|
|
new-array v1, v1, [Lcom/discord/models/domain/ModelMessage;
|
|
|
|
const/4 v4, 0x0
|
|
|
|
aput-object v3, v1, v4
|
|
|
|
const/4 v3, 0x1
|
|
|
|
aput-object v2, v1, v3
|
|
|
|
invoke-static {v1}, Lf/n/a/k/a;->listOfNotNull([Ljava/lang/Object;)Ljava/util/List;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-interface {v1}, Ljava/util/Collection;->isEmpty()Z
|
|
|
|
move-result v2
|
|
|
|
xor-int/2addr v2, v3
|
|
|
|
if-eqz v2, :cond_5
|
|
|
|
invoke-virtual {v0, v1}, Lcom/discord/stores/StoreMessages;->handleMessageCreate(Ljava/util/List;)V
|
|
|
|
:cond_5
|
|
:goto_2
|
|
return-void
|
|
.end method
|
|
|
|
.method public static synthetic handleSendMessageFailure$default(Lcom/discord/stores/StoreMessages;Lcom/discord/models/domain/ModelMessage;Ljava/lang/String;ILjava/lang/Object;)V
|
|
.locals 0
|
|
|
|
and-int/lit8 p3, p3, 0x2
|
|
|
|
if-eqz p3, :cond_0
|
|
|
|
const/4 p2, 0x0
|
|
|
|
:cond_0
|
|
invoke-direct {p0, p1, p2}, Lcom/discord/stores/StoreMessages;->handleSendMessageFailure(Lcom/discord/models/domain/ModelMessage;Ljava/lang/String;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final handleSendMessageValidationError(Lcom/discord/models/domain/ModelMessage;Ljava/lang/String;)V
|
|
.locals 7
|
|
|
|
sget-object v0, Lcom/discord/app/AppLog;->d:Lcom/discord/app/AppLog;
|
|
|
|
const-string v1, "ValidationError"
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/16 v5, 0xc
|
|
|
|
const/4 v6, 0x0
|
|
|
|
move-object v2, p2
|
|
|
|
invoke-static/range {v0 .. v6}, Lcom/discord/utilities/logging/Logger;->e$default(Lcom/discord/utilities/logging/Logger;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;Ljava/util/Map;ILjava/lang/Object;)V
|
|
|
|
invoke-virtual {p0, p1}, Lcom/discord/stores/StoreMessages;->deleteMessage(Lcom/discord/models/domain/ModelMessage;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final resendAllLocalMessages()V
|
|
.locals 6
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMessages;->localMessagesHolder:Lcom/discord/stores/StoreLocalMessagesHolder;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreLocalMessagesHolder;->getFlattenedMessages()Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v1, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
invoke-interface {v0}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v0
|
|
|
|
:cond_0
|
|
:goto_0
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
const/4 v3, 0x1
|
|
|
|
if-eqz v2, :cond_2
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
move-object v4, v2
|
|
|
|
check-cast v4, Lcom/discord/models/domain/ModelMessage;
|
|
|
|
invoke-virtual {v4}, Lcom/discord/models/domain/ModelMessage;->getType()I
|
|
|
|
move-result v4
|
|
|
|
const/4 v5, -0x1
|
|
|
|
if-ne v4, v5, :cond_1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
const/4 v3, 0x0
|
|
|
|
:goto_1
|
|
if-eqz v3, :cond_0
|
|
|
|
invoke-interface {v1, v2}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
invoke-interface {v1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v0
|
|
|
|
:goto_2
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_3
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Lcom/discord/models/domain/ModelMessage;
|
|
|
|
invoke-virtual {p0, v1, v3}, Lcom/discord/stores/StoreMessages;->resendMessage(Lcom/discord/models/domain/ModelMessage;Z)V
|
|
|
|
goto :goto_2
|
|
|
|
:cond_3
|
|
return-void
|
|
.end method
|
|
|
|
.method public static synthetic resendMessage$default(Lcom/discord/stores/StoreMessages;Lcom/discord/models/domain/ModelMessage;ZILjava/lang/Object;)V
|
|
.locals 0
|
|
|
|
and-int/lit8 p3, p3, 0x2
|
|
|
|
if-eqz p3, :cond_0
|
|
|
|
const/4 p2, 0x0
|
|
|
|
:cond_0
|
|
invoke-virtual {p0, p1, p2}, Lcom/discord/stores/StoreMessages;->resendMessage(Lcom/discord/models/domain/ModelMessage;Z)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static synthetic sendMessage$default(Lcom/discord/stores/StoreMessages;JLcom/discord/models/domain/ModelUser;Ljava/lang/String;Ljava/util/List;Ljava/util/List;Lcom/discord/models/domain/ModelApplication;Lcom/discord/models/domain/activity/ModelActivity;Lcom/discord/models/domain/ModelMessage$Activity;Ljava/lang/Long;ILjava/lang/Object;)Lrx/Observable;
|
|
.locals 14
|
|
|
|
move/from16 v0, p11
|
|
|
|
and-int/lit8 v1, v0, 0x20
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
move-object v10, v2
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
move-object/from16 v10, p7
|
|
|
|
:goto_0
|
|
and-int/lit8 v1, v0, 0x40
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
move-object v11, v2
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
move-object/from16 v11, p8
|
|
|
|
:goto_1
|
|
and-int/lit16 v1, v0, 0x80
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
move-object v12, v2
|
|
|
|
goto :goto_2
|
|
|
|
:cond_2
|
|
move-object/from16 v12, p9
|
|
|
|
:goto_2
|
|
and-int/lit16 v0, v0, 0x100
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
move-object v13, v2
|
|
|
|
goto :goto_3
|
|
|
|
:cond_3
|
|
move-object/from16 v13, p10
|
|
|
|
:goto_3
|
|
move-object v3, p0
|
|
|
|
move-wide v4, p1
|
|
|
|
move-object/from16 v6, p3
|
|
|
|
move-object/from16 v7, p4
|
|
|
|
move-object/from16 v8, p5
|
|
|
|
move-object/from16 v9, p6
|
|
|
|
invoke-virtual/range {v3 .. v13}, Lcom/discord/stores/StoreMessages;->sendMessage(JLcom/discord/models/domain/ModelUser;Ljava/lang/String;Ljava/util/List;Ljava/util/List;Lcom/discord/models/domain/ModelApplication;Lcom/discord/models/domain/activity/ModelActivity;Lcom/discord/models/domain/ModelMessage$Activity;Ljava/lang/Long;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final cancelMessageSend(JLjava/lang/String;)V
|
|
.locals 0
|
|
|
|
if-eqz p3, :cond_0
|
|
|
|
invoke-direct {p0, p1, p2}, Lcom/discord/stores/StoreMessages;->getMessageQueue(J)Lcom/discord/utilities/messagesend/MessageQueue;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1, p3}, Lcom/discord/utilities/messagesend/MessageQueue;->cancel(Ljava/lang/String;)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "requestId"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final deleteMessage(Lcom/discord/models/domain/ModelMessage;)V
|
|
.locals 8
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessage;->getId()J
|
|
|
|
move-result-wide v0
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessage;->getChannelId()J
|
|
|
|
move-result-wide v2
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessage;->isLocal()Z
|
|
|
|
move-result v4
|
|
|
|
if-nez v4, :cond_2
|
|
|
|
sget-object p1, Lcom/discord/utilities/rest/RestAPI;->Companion:Lcom/discord/utilities/rest/RestAPI$Companion;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/utilities/rest/RestAPI$Companion;->getApi()Lcom/discord/utilities/rest/RestAPI;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1, v2, v3, v0, v1}, Lcom/discord/utilities/rest/RestAPI;->deleteMessage(JJ)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
invoke-static {v0, v1}, Lf/a/b/q;->f(ZI)Lrx/Observable$c;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p1, v0}, Lrx/Observable;->k(Lrx/Observable$c;)Lrx/Observable;
|
|
|
|
move-result-object v1
|
|
|
|
sget-object v5, Lf/a/b/d0;->d:Lf/a/b/d0;
|
|
|
|
const/4 v6, 0x0
|
|
|
|
if-eqz v5, :cond_1
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const-string p1, "observable"
|
|
|
|
invoke-static {v1, p1}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
sget-object v7, Lf/a/b/b0;->d:Lf/a/b/b0;
|
|
|
|
const-string v3, "deleteMessage"
|
|
|
|
move-object v2, v4
|
|
|
|
invoke-static/range {v1 .. v7}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->appSubscribe(Lrx/Observable;Landroid/content/Context;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const-string p1, "onNext"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
|
|
:cond_2
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMessages;->dispatcher:Lcom/discord/stores/Dispatcher;
|
|
|
|
new-instance v1, Lcom/discord/stores/StoreMessages$deleteMessage$1;
|
|
|
|
invoke-direct {v1, p0, p1, v2, v3}, Lcom/discord/stores/StoreMessages$deleteMessage$1;-><init>(Lcom/discord/stores/StoreMessages;Lcom/discord/models/domain/ModelMessage;J)V
|
|
|
|
invoke-virtual {v0, v1}, Lcom/discord/stores/Dispatcher;->schedule(Lkotlin/jvm/functions/Function0;)V
|
|
|
|
:goto_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public final editMessage(JJLjava/lang/String;)V
|
|
.locals 10
|
|
|
|
if-eqz p5, :cond_0
|
|
|
|
invoke-direct {p0, p3, p4}, Lcom/discord/stores/StoreMessages;->getMessageQueue(J)Lcom/discord/utilities/messagesend/MessageQueue;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v9, Lcom/discord/utilities/messagesend/MessageRequest$Edit;
|
|
|
|
iget-object v1, p0, Lcom/discord/stores/StoreMessages;->clock:Lcom/discord/utilities/time/Clock;
|
|
|
|
invoke-interface {v1}, Lcom/discord/utilities/time/Clock;->currentTimeMillis()J
|
|
|
|
move-result-wide v7
|
|
|
|
move-object v1, v9
|
|
|
|
move-wide v2, p3
|
|
|
|
move-object v4, p5
|
|
|
|
move-wide v5, p1
|
|
|
|
invoke-direct/range {v1 .. v8}, Lcom/discord/utilities/messagesend/MessageRequest$Edit;-><init>(JLjava/lang/String;JJ)V
|
|
|
|
invoke-virtual {v0, v9}, Lcom/discord/utilities/messagesend/MessageQueue;->enqueue(Lcom/discord/utilities/messagesend/MessageRequest;)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "content"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final get(J)Lrx/Observable;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(J)",
|
|
"Lrx/Observable<",
|
|
"Ljava/util/List<",
|
|
"Lcom/discord/models/domain/ModelMessage;",
|
|
">;>;"
|
|
}
|
|
.end annotation
|
|
|
|
sget-object v0, Lcom/discord/stores/PersistLocalMessagesFeatureFlag;->Companion:Lcom/discord/stores/PersistLocalMessagesFeatureFlag$Companion;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/PersistLocalMessagesFeatureFlag$Companion;->getINSTANCE()Lcom/discord/stores/PersistLocalMessagesFeatureFlag;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/PersistLocalMessagesFeatureFlag;->isEnabled()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-direct {p0, p1, p2}, Lcom/discord/stores/StoreMessages;->getSyncedMessages(J)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {p0, p1, p2}, Lcom/discord/stores/StoreMessages;->getLocalMessages(J)Lrx/Observable;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {p0, p1, p2}, Lcom/discord/stores/StoreMessages;->isDetached(J)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
sget-object p2, Lcom/discord/stores/StoreMessages$get$1;->INSTANCE:Lcom/discord/stores/StoreMessages$get$1;
|
|
|
|
invoke-static {v0, v1, p1, p2}, Lrx/Observable;->i(Lrx/Observable;Lrx/Observable;Lrx/Observable;Lrx/functions/Func3;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "Observable.combineLatest\u2026s + localMessages\n }"
|
|
|
|
invoke-static {p1, p2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-direct {p0, p1, p2}, Lcom/discord/stores/StoreMessages;->getSyncedMessages(J)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
:goto_0
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public final get(JJ)Lrx/Observable;
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(JJ)",
|
|
"Lrx/Observable<",
|
|
"Lcom/discord/models/domain/ModelMessage;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
invoke-virtual {p0, p1, p2}, Lcom/discord/stores/StoreMessages;->get(J)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance p2, Lcom/discord/stores/StoreMessages$get$2;
|
|
|
|
invoke-direct {p2, p3, p4}, Lcom/discord/stores/StoreMessages$get$2;-><init>(J)V
|
|
|
|
invoke-virtual {p1, p2}, Lrx/Observable;->E(Lr0/k/b;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Lrx/Observable;->q()Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "get(channelId)\n \u2026 .distinctUntilChanged()"
|
|
|
|
invoke-static {p1, p2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public final getAllDetached()Lrx/Observable;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Lrx/Observable<",
|
|
"Ljava/util/Set<",
|
|
"Ljava/lang/Long;",
|
|
">;>;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMessages;->holder:Lcom/discord/stores/StoreMessagesHolder;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreMessagesHolder;->getDetachedChannelSubject()Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "holder\n .detachedChannelSubject"
|
|
|
|
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 handleChannelSelected(J)V
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMessages;->holder:Lcom/discord/stores/StoreMessagesHolder;
|
|
|
|
invoke-virtual {v0, p1, p2}, Lcom/discord/stores/StoreMessagesHolder;->setSelectedChannelId(J)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final handleConnected(Z)V
|
|
.locals 1
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
iget-object p1, p0, Lcom/discord/stores/StoreMessages;->holder:Lcom/discord/stores/StoreMessagesHolder;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/stores/StoreMessagesHolder;->invalidate()V
|
|
|
|
goto :goto_1
|
|
|
|
:cond_0
|
|
iget-object p1, p0, Lcom/discord/stores/StoreMessages;->messageQueues:Ljava/util/HashMap;
|
|
|
|
invoke-virtual {p1}, Ljava/util/HashMap;->values()Ljava/util/Collection;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "messageQueues.values"
|
|
|
|
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_1
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/discord/utilities/messagesend/MessageQueue;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/utilities/messagesend/MessageQueue;->handleConnected()V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
:goto_1
|
|
return-void
|
|
.end method
|
|
|
|
.method public final handleConnectionOpen(Lcom/discord/models/domain/ModelPayload;)V
|
|
.locals 3
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMessages;->holder:Lcom/discord/stores/StoreMessagesHolder;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelPayload;->getMe()Lcom/discord/models/domain/ModelUser;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v1, "payload.me"
|
|
|
|
invoke-static {p1, v1}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelUser;->getId()J
|
|
|
|
move-result-wide v1
|
|
|
|
invoke-virtual {v0, v1, v2}, Lcom/discord/stores/StoreMessagesHolder;->setMyUserId(J)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
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 handleMessageCreate(Ljava/util/List;)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/List<",
|
|
"+",
|
|
"Lcom/discord/models/domain/ModelMessage;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMessages;->holder:Lcom/discord/stores/StoreMessagesHolder;
|
|
|
|
invoke-virtual {v0, p1}, Lcom/discord/stores/StoreMessagesHolder;->addMessages(Ljava/util/List;)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "messagesList"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final handleMessageDelete(Lcom/discord/models/domain/ModelMessageDelete;)V
|
|
.locals 3
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessageDelete;->getChannelId()J
|
|
|
|
move-result-wide v0
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessageDelete;->getMessageIds()Ljava/util/List;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v2, "messageDelete.messageIds"
|
|
|
|
invoke-static {p1, v2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-direct {p0, v0, v1, p1}, Lcom/discord/stores/StoreMessages;->handleMessageDelete(JLjava/util/List;)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "messageDelete"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final handleMessageUpdate(Lcom/discord/models/domain/ModelMessage;)V
|
|
.locals 1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMessages;->holder:Lcom/discord/stores/StoreMessagesHolder;
|
|
|
|
invoke-virtual {v0, p1}, Lcom/discord/stores/StoreMessagesHolder;->updateMessages(Lcom/discord/models/domain/ModelMessage;)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
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 handleMessagesLoaded(Lcom/discord/stores/StoreMessagesLoader$ChannelChunk;)V
|
|
.locals 1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMessages;->holder:Lcom/discord/stores/StoreMessagesHolder;
|
|
|
|
invoke-static {p1}, Lf/n/a/k/a;->listOf(Ljava/lang/Object;)Ljava/util/List;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v0, p1}, Lcom/discord/stores/StoreMessagesHolder;->loadMessageChunks(Ljava/util/List;)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "chunk"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final handlePreLogout()V
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMessages;->localMessagesHolder:Lcom/discord/stores/StoreLocalMessagesHolder;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreLocalMessagesHolder;->clearCache()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final handleReactionUpdate(Ljava/util/List;Z)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/List<",
|
|
"+",
|
|
"Lcom/discord/models/domain/ModelMessageReaction$Update;",
|
|
">;Z)V"
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMessages;->holder:Lcom/discord/stores/StoreMessagesHolder;
|
|
|
|
invoke-virtual {v0, p1, p2}, Lcom/discord/stores/StoreMessagesHolder;->updateReactions(Ljava/util/List;Z)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "updates"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final handleReactionsRemoveAll(Lcom/discord/models/domain/ModelMessageReaction$Update;)V
|
|
.locals 1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMessages;->holder:Lcom/discord/stores/StoreMessagesHolder;
|
|
|
|
invoke-virtual {v0, p1}, Lcom/discord/stores/StoreMessagesHolder;->removeAllReactions(Lcom/discord/models/domain/ModelMessageReaction$Update;)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "update"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final handleReactionsRemoveEmoji(Lcom/discord/models/domain/ModelMessageReaction$Update;)V
|
|
.locals 1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMessages;->holder:Lcom/discord/stores/StoreMessagesHolder;
|
|
|
|
invoke-virtual {v0, p1}, Lcom/discord/stores/StoreMessagesHolder;->removeEmojiReactions(Lcom/discord/models/domain/ModelMessageReaction$Update;)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "update"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public init(Landroid/content/Context;)V
|
|
.locals 3
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-super {p0, p1}, Lcom/discord/stores/Store;->init(Landroid/content/Context;)V
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreMessages;->context:Landroid/content/Context;
|
|
|
|
iget-object p1, p0, Lcom/discord/stores/StoreMessages;->holder:Lcom/discord/stores/StoreMessagesHolder;
|
|
|
|
const/4 v1, 0x1
|
|
|
|
invoke-virtual {p1, v1}, Lcom/discord/stores/StoreMessagesHolder;->init(Z)V
|
|
|
|
iget-object p1, p0, Lcom/discord/stores/StoreMessages;->localMessagesHolder:Lcom/discord/stores/StoreLocalMessagesHolder;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
invoke-static {p1, v2, v1, v0}, Lcom/discord/stores/StoreLocalMessagesHolder;->init$default(Lcom/discord/stores/StoreLocalMessagesHolder;ZILjava/lang/Object;)V
|
|
|
|
sget-object p1, Lcom/discord/stores/PersistLocalMessagesFeatureFlag;->Companion:Lcom/discord/stores/PersistLocalMessagesFeatureFlag$Companion;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/stores/PersistLocalMessagesFeatureFlag$Companion;->getINSTANCE()Lcom/discord/stores/PersistLocalMessagesFeatureFlag;
|
|
|
|
move-result-object p1
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreMessages;->stream:Lcom/discord/stores/StoreStream;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreStream;->getExperiments$app_productionDiscordExternalRelease()Lcom/discord/stores/StoreExperiments;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p1, v0}, Lcom/discord/stores/PersistLocalMessagesFeatureFlag;->fetchExperiment(Lcom/discord/stores/StoreExperiments;)V
|
|
|
|
invoke-direct {p0}, Lcom/discord/stores/StoreMessages;->resendAllLocalMessages()V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "context"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public final isDetached(J)Lrx/Observable;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(J)",
|
|
"Lrx/Observable<",
|
|
"Ljava/lang/Boolean;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
invoke-virtual {p0}, Lcom/discord/stores/StoreMessages;->getAllDetached()Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v1, Lcom/discord/stores/StoreMessages$isDetached$1;
|
|
|
|
invoke-direct {v1, p1, p2}, Lcom/discord/stores/StoreMessages$isDetached$1;-><init>(J)V
|
|
|
|
invoke-virtual {v0, v1}, Lrx/Observable;->E(Lr0/k/b;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Lrx/Observable;->q()Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "allDetached\n .m\u2026 .distinctUntilChanged()"
|
|
|
|
invoke-static {p1, p2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public final resendMessage(Lcom/discord/models/domain/ModelMessage;Z)V
|
|
.locals 21
|
|
|
|
move-object/from16 v13, p0
|
|
|
|
move-object/from16 v0, p1
|
|
|
|
move/from16 v1, p2
|
|
|
|
const/4 v14, 0x0
|
|
|
|
if-eqz v0, :cond_6
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/models/domain/ModelMessage;->getType()I
|
|
|
|
move-result v2
|
|
|
|
const/4 v3, -0x1
|
|
|
|
if-ne v2, v3, :cond_1
|
|
|
|
:cond_0
|
|
if-nez v1, :cond_2
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/models/domain/ModelMessage;->getType()I
|
|
|
|
move-result v2
|
|
|
|
const/4 v3, -0x2
|
|
|
|
if-ne v2, v3, :cond_1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
new-instance v2, Ljava/lang/IllegalArgumentException;
|
|
|
|
new-instance v3, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v4, "Incorrect "
|
|
|
|
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, " auto attempt and message type "
|
|
|
|
invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/models/domain/ModelMessage;->getType()I
|
|
|
|
move-result v0
|
|
|
|
invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {v2, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v2
|
|
|
|
:cond_2
|
|
:goto_0
|
|
iget-object v2, v13, Lcom/discord/stores/StoreMessages;->dispatcher:Lcom/discord/stores/Dispatcher;
|
|
|
|
new-instance v3, Lcom/discord/stores/StoreMessages$resendMessage$1;
|
|
|
|
invoke-direct {v3, v13, v0}, Lcom/discord/stores/StoreMessages$resendMessage$1;-><init>(Lcom/discord/stores/StoreMessages;Lcom/discord/models/domain/ModelMessage;)V
|
|
|
|
invoke-virtual {v2, v3}, Lcom/discord/stores/Dispatcher;->schedule(Lkotlin/jvm/functions/Function0;)V
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/models/domain/ModelMessage;->getChannelId()J
|
|
|
|
move-result-wide v2
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/models/domain/ModelMessage;->getAuthor()Lcom/discord/models/domain/ModelUser;
|
|
|
|
move-result-object v4
|
|
|
|
const-string v5, "message.author"
|
|
|
|
invoke-static {v4, v5}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/models/domain/ModelMessage;->getContent()Ljava/lang/String;
|
|
|
|
move-result-object v5
|
|
|
|
const-string v6, "message.content"
|
|
|
|
invoke-static {v5, v6}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/models/domain/ModelMessage;->getMentions()Ljava/util/List;
|
|
|
|
move-result-object v6
|
|
|
|
iget-object v7, v0, Lcom/discord/models/domain/ModelMessage;->localAttachments:Ljava/util/List;
|
|
|
|
if-eqz v7, :cond_3
|
|
|
|
new-instance v8, Ljava/util/ArrayList;
|
|
|
|
const/16 v9, 0xa
|
|
|
|
invoke-static {v7, v9}, Lf/n/a/k/a;->collectionSizeOrDefault(Ljava/lang/Iterable;I)I
|
|
|
|
move-result v9
|
|
|
|
invoke-direct {v8, v9}, Ljava/util/ArrayList;-><init>(I)V
|
|
|
|
invoke-interface {v7}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v7
|
|
|
|
:goto_1
|
|
invoke-interface {v7}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v9
|
|
|
|
if-eqz v9, :cond_4
|
|
|
|
invoke-interface {v7}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v9
|
|
|
|
check-cast v9, Lcom/discord/models/messages/LocalAttachment;
|
|
|
|
invoke-virtual {v9}, Lcom/discord/models/messages/LocalAttachment;->getUriString()Ljava/lang/String;
|
|
|
|
move-result-object v10
|
|
|
|
invoke-static {v10}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;
|
|
|
|
move-result-object v10
|
|
|
|
new-instance v11, Lcom/lytefast/flexinput/model/Attachment;
|
|
|
|
invoke-virtual {v9}, Lcom/discord/models/messages/LocalAttachment;->getId()J
|
|
|
|
move-result-wide v16
|
|
|
|
const-string v12, "contentUri"
|
|
|
|
invoke-static {v10, v12}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v9}, Lcom/discord/models/messages/LocalAttachment;->getDisplayName()Ljava/lang/String;
|
|
|
|
move-result-object v19
|
|
|
|
const/16 v20, 0x0
|
|
|
|
move-object v15, v11
|
|
|
|
move-object/from16 v18, v10
|
|
|
|
invoke-direct/range {v15 .. v20}, Lcom/lytefast/flexinput/model/Attachment;-><init>(JLandroid/net/Uri;Ljava/lang/String;Ljava/lang/Object;)V
|
|
|
|
invoke-interface {v8, v11}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_1
|
|
|
|
:cond_3
|
|
move-object v8, v14
|
|
|
|
:cond_4
|
|
const/4 v7, 0x0
|
|
|
|
const/4 v9, 0x0
|
|
|
|
const/4 v10, 0x0
|
|
|
|
if-eqz v1, :cond_5
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/models/domain/ModelMessage;->getLastManualAttemptTimestamp()J
|
|
|
|
move-result-wide v0
|
|
|
|
invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v0
|
|
|
|
move-object v11, v0
|
|
|
|
goto :goto_2
|
|
|
|
:cond_5
|
|
move-object v11, v14
|
|
|
|
:goto_2
|
|
const/16 v12, 0xe0
|
|
|
|
const/4 v15, 0x0
|
|
|
|
move-object/from16 v0, p0
|
|
|
|
move-wide v1, v2
|
|
|
|
move-object v3, v4
|
|
|
|
move-object v4, v5
|
|
|
|
move-object v5, v6
|
|
|
|
move-object v6, v8
|
|
|
|
move-object v8, v9
|
|
|
|
move-object v9, v10
|
|
|
|
move-object v10, v11
|
|
|
|
move v11, v12
|
|
|
|
move-object v12, v15
|
|
|
|
invoke-static/range {v0 .. v12}, Lcom/discord/stores/StoreMessages;->sendMessage$default(Lcom/discord/stores/StoreMessages;JLcom/discord/models/domain/ModelUser;Ljava/lang/String;Ljava/util/List;Ljava/util/List;Lcom/discord/models/domain/ModelApplication;Lcom/discord/models/domain/activity/ModelActivity;Lcom/discord/models/domain/ModelMessage$Activity;Ljava/lang/Long;ILjava/lang/Object;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->ui(Lrx/Observable;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
const-class v1, Lcom/discord/stores/StoreMessages;
|
|
|
|
const/4 v2, 0x2
|
|
|
|
invoke-static {v1, v14, v2}, Lf/a/b/q;->j(Ljava/lang/Class;Lrx/functions/Action1;I)Lrx/Observable$c;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Lrx/Observable;->k(Lrx/Observable$c;)Lrx/Observable;
|
|
|
|
return-void
|
|
|
|
:cond_6
|
|
const-string v0, "message"
|
|
|
|
invoke-static {v0}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v14
|
|
.end method
|
|
|
|
.method public final sendMessage(JLcom/discord/models/domain/ModelUser;Ljava/lang/String;Ljava/util/List;Ljava/util/List;Lcom/discord/models/domain/ModelApplication;Lcom/discord/models/domain/activity/ModelActivity;Lcom/discord/models/domain/ModelMessage$Activity;Ljava/lang/Long;)Lrx/Observable;
|
|
.locals 20
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(J",
|
|
"Lcom/discord/models/domain/ModelUser;",
|
|
"Ljava/lang/String;",
|
|
"Ljava/util/List<",
|
|
"+",
|
|
"Lcom/discord/models/domain/ModelUser;",
|
|
">;",
|
|
"Ljava/util/List<",
|
|
"+",
|
|
"Lcom/lytefast/flexinput/model/Attachment<",
|
|
"*>;>;",
|
|
"Lcom/discord/models/domain/ModelApplication;",
|
|
"Lcom/discord/models/domain/activity/ModelActivity;",
|
|
"Lcom/discord/models/domain/ModelMessage$Activity;",
|
|
"Ljava/lang/Long;",
|
|
")",
|
|
"Lrx/Observable<",
|
|
"+",
|
|
"Lcom/discord/utilities/messagesend/MessageResult;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
move-object/from16 v0, p0
|
|
|
|
move-wide/from16 v14, p1
|
|
|
|
move-object/from16 v4, p3
|
|
|
|
move-object/from16 v1, p4
|
|
|
|
move-object/from16 v2, p6
|
|
|
|
sget-object v12, Lrx/Emitter$BackpressureMode;->e:Lrx/Emitter$BackpressureMode;
|
|
|
|
const/4 v3, 0x0
|
|
|
|
if-eqz v4, :cond_f
|
|
|
|
if-eqz v1, :cond_e
|
|
|
|
new-instance v13, Lkotlin/jvm/internal/Ref$ObjectRef;
|
|
|
|
invoke-direct {v13}, Lkotlin/jvm/internal/Ref$ObjectRef;-><init>()V
|
|
|
|
iput-object v2, v13, Lkotlin/jvm/internal/Ref$ObjectRef;->element:Ljava/lang/Object;
|
|
|
|
sget-object v5, Lcom/discord/stores/PersistLocalMessagesFeatureFlag;->Companion:Lcom/discord/stores/PersistLocalMessagesFeatureFlag$Companion;
|
|
|
|
invoke-virtual {v5}, Lcom/discord/stores/PersistLocalMessagesFeatureFlag$Companion;->getINSTANCE()Lcom/discord/stores/PersistLocalMessagesFeatureFlag;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-virtual {v5}, Lcom/discord/stores/PersistLocalMessagesFeatureFlag;->isEnabled()Z
|
|
|
|
move-result v5
|
|
|
|
const-string v11, "Observable.create({ emit\u2026r.BackpressureMode.ERROR)"
|
|
|
|
const/16 v6, 0xa
|
|
|
|
const/4 v7, 0x0
|
|
|
|
const/4 v8, 0x1
|
|
|
|
if-eqz v5, :cond_8
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
invoke-interface/range {p6 .. p6}, Ljava/util/Collection;->isEmpty()Z
|
|
|
|
move-result v5
|
|
|
|
if-eqz v5, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v5, 0x0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
:goto_0
|
|
const/4 v5, 0x1
|
|
|
|
:goto_1
|
|
if-nez v5, :cond_8
|
|
|
|
sget-object v5, Lcom/discord/utilities/rest/ProcessedMessageContent;->Companion:Lcom/discord/utilities/rest/ProcessedMessageContent$Companion;
|
|
|
|
iget-object v9, v0, Lcom/discord/stores/StoreMessages;->context:Landroid/content/Context;
|
|
|
|
if-eqz v9, :cond_7
|
|
|
|
invoke-virtual {v5, v2, v1, v9}, Lcom/discord/utilities/rest/ProcessedMessageContent$Companion;->fromAttachments(Ljava/util/List;Ljava/lang/String;Landroid/content/Context;)Lcom/discord/utilities/rest/ProcessedMessageContent;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Lcom/discord/utilities/rest/ProcessedMessageContent;->getInvalidAttachments()Ljava/util/List;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-interface {v2}, Ljava/util/Collection;->isEmpty()Z
|
|
|
|
move-result v5
|
|
|
|
xor-int/2addr v5, v8
|
|
|
|
if-eqz v5, :cond_3
|
|
|
|
iget-object v5, v0, Lcom/discord/stores/StoreMessages;->clock:Lcom/discord/utilities/time/Clock;
|
|
|
|
new-instance v9, Ljava/util/ArrayList;
|
|
|
|
invoke-static {v2, v6}, Lf/n/a/k/a;->collectionSizeOrDefault(Ljava/lang/Iterable;I)I
|
|
|
|
move-result v10
|
|
|
|
invoke-direct {v9, v10}, 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 v10
|
|
|
|
if-eqz v10, :cond_2
|
|
|
|
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v10
|
|
|
|
check-cast v10, Lcom/lytefast/flexinput/model/Attachment;
|
|
|
|
invoke-static {v10}, Lcom/discord/utilities/attachments/AttachmentUtilsKt;->toLocalAttachment(Lcom/lytefast/flexinput/model/Attachment;)Lcom/discord/models/messages/LocalAttachment;
|
|
|
|
move-result-object v10
|
|
|
|
invoke-interface {v9, v10}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_2
|
|
|
|
:cond_2
|
|
invoke-static {v14, v15, v4, v5, v9}, Lcom/discord/models/domain/ModelMessage;->createInvalidAttachmentsMessage(JLcom/discord/models/domain/ModelUser;Lcom/discord/utilities/time/Clock;Ljava/util/List;)Lcom/discord/models/domain/ModelMessage;
|
|
|
|
move-result-object v2
|
|
|
|
iget-object v5, v0, Lcom/discord/stores/StoreMessages;->dispatcher:Lcom/discord/stores/Dispatcher;
|
|
|
|
new-instance v9, Lcom/discord/stores/StoreMessages$sendMessage$1;
|
|
|
|
invoke-direct {v9, v0, v2}, Lcom/discord/stores/StoreMessages$sendMessage$1;-><init>(Lcom/discord/stores/StoreMessages;Lcom/discord/models/domain/ModelMessage;)V
|
|
|
|
invoke-virtual {v5, v9}, Lcom/discord/stores/Dispatcher;->schedule(Lkotlin/jvm/functions/Function0;)V
|
|
|
|
:cond_3
|
|
invoke-virtual {v1}, Lcom/discord/utilities/rest/ProcessedMessageContent;->getValidAttachments()Ljava/util/List;
|
|
|
|
move-result-object v2
|
|
|
|
iput-object v2, v13, Lkotlin/jvm/internal/Ref$ObjectRef;->element:Ljava/lang/Object;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/utilities/rest/ProcessedMessageContent;->getContent()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
iget-object v2, v13, Lkotlin/jvm/internal/Ref$ObjectRef;->element:Ljava/lang/Object;
|
|
|
|
check-cast v2, Ljava/util/List;
|
|
|
|
if-eqz v2, :cond_5
|
|
|
|
invoke-interface {v2}, Ljava/util/Collection;->isEmpty()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_4
|
|
|
|
goto :goto_3
|
|
|
|
:cond_4
|
|
const/4 v2, 0x0
|
|
|
|
goto :goto_4
|
|
|
|
:cond_5
|
|
:goto_3
|
|
const/4 v2, 0x1
|
|
|
|
:goto_4
|
|
if-eqz v2, :cond_8
|
|
|
|
invoke-interface {v1}, Ljava/lang/CharSequence;->length()I
|
|
|
|
move-result v2
|
|
|
|
if-nez v2, :cond_6
|
|
|
|
const/4 v2, 0x1
|
|
|
|
goto :goto_5
|
|
|
|
:cond_6
|
|
const/4 v2, 0x0
|
|
|
|
:goto_5
|
|
if-eqz v2, :cond_8
|
|
|
|
sget-object v1, Lcom/discord/stores/StoreMessages$sendMessage$2;->INSTANCE:Lcom/discord/stores/StoreMessages$sendMessage$2;
|
|
|
|
invoke-static {v1, v12}, Lrx/Observable;->n(Lrx/functions/Action1;Lrx/Emitter$BackpressureMode;)Lrx/Observable;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v1, v11}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object v1
|
|
|
|
:cond_7
|
|
const-string v1, "context"
|
|
|
|
invoke-static {v1}, Lj0/n/c/h;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
|
|
|
throw v3
|
|
|
|
:cond_8
|
|
const/4 v9, 0x0
|
|
|
|
iget-object v2, v13, Lkotlin/jvm/internal/Ref$ObjectRef;->element:Ljava/lang/Object;
|
|
|
|
check-cast v2, Ljava/util/List;
|
|
|
|
if-eqz v2, :cond_9
|
|
|
|
invoke-interface {v2}, Ljava/util/Collection;->isEmpty()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_a
|
|
|
|
:cond_9
|
|
const/4 v7, 0x1
|
|
|
|
:cond_a
|
|
xor-int/2addr v7, v8
|
|
|
|
iget-object v10, v0, Lcom/discord/stores/StoreMessages;->clock:Lcom/discord/utilities/time/Clock;
|
|
|
|
iget-object v2, v13, Lkotlin/jvm/internal/Ref$ObjectRef;->element:Ljava/lang/Object;
|
|
|
|
check-cast v2, Ljava/util/List;
|
|
|
|
if-eqz v2, :cond_b
|
|
|
|
new-instance v3, Ljava/util/ArrayList;
|
|
|
|
invoke-static {v2, v6}, Lf/n/a/k/a;->collectionSizeOrDefault(Ljava/lang/Iterable;I)I
|
|
|
|
move-result v5
|
|
|
|
invoke-direct {v3, v5}, Ljava/util/ArrayList;-><init>(I)V
|
|
|
|
invoke-interface {v2}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v2
|
|
|
|
:goto_6
|
|
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v5
|
|
|
|
if-eqz v5, :cond_b
|
|
|
|
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v5
|
|
|
|
check-cast v5, Lcom/lytefast/flexinput/model/Attachment;
|
|
|
|
invoke-static {v5}, Lcom/discord/utilities/attachments/AttachmentUtilsKt;->toLocalAttachment(Lcom/lytefast/flexinput/model/Attachment;)Lcom/discord/models/messages/LocalAttachment;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-interface {v3, v5}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_6
|
|
|
|
:cond_b
|
|
move-object/from16 v16, v3
|
|
|
|
if-eqz p10, :cond_c
|
|
|
|
invoke-virtual/range {p10 .. p10}, Ljava/lang/Long;->longValue()J
|
|
|
|
move-result-wide v2
|
|
|
|
goto :goto_7
|
|
|
|
:cond_c
|
|
iget-object v2, v0, Lcom/discord/stores/StoreMessages;->clock:Lcom/discord/utilities/time/Clock;
|
|
|
|
invoke-interface {v2}, Lcom/discord/utilities/time/Clock;->currentTimeMillis()J
|
|
|
|
move-result-wide v2
|
|
|
|
:goto_7
|
|
move-wide/from16 v17, v2
|
|
|
|
move-wide/from16 v2, p1
|
|
|
|
move-object/from16 v4, p3
|
|
|
|
move-object/from16 v5, p5
|
|
|
|
move v6, v9
|
|
|
|
move-object/from16 v8, p7
|
|
|
|
move-object/from16 v9, p9
|
|
|
|
move-object/from16 v19, v11
|
|
|
|
move-object/from16 v11, v16
|
|
|
|
move-object v15, v12
|
|
|
|
move-object v14, v13
|
|
|
|
move-wide/from16 v12, v17
|
|
|
|
invoke-static/range {v1 .. v13}, Lcom/discord/models/domain/ModelMessage;->createLocalMessage(Ljava/lang/String;JLcom/discord/models/domain/ModelUser;Ljava/util/List;ZZLcom/discord/models/domain/ModelApplication;Lcom/discord/models/domain/ModelMessage$Activity;Lcom/discord/utilities/time/Clock;Ljava/util/List;J)Lcom/discord/models/domain/ModelMessage;
|
|
|
|
move-result-object v1
|
|
|
|
if-nez p9, :cond_d
|
|
|
|
iget-object v2, v0, Lcom/discord/stores/StoreMessages;->dispatcher:Lcom/discord/stores/Dispatcher;
|
|
|
|
new-instance v3, Lcom/discord/stores/StoreMessages$sendMessage$3;
|
|
|
|
invoke-direct {v3, v0, v1}, Lcom/discord/stores/StoreMessages$sendMessage$3;-><init>(Lcom/discord/stores/StoreMessages;Lcom/discord/models/domain/ModelMessage;)V
|
|
|
|
invoke-virtual {v2, v3}, Lcom/discord/stores/Dispatcher;->schedule(Lkotlin/jvm/functions/Function0;)V
|
|
|
|
:cond_d
|
|
new-instance v2, Lcom/discord/stores/StoreMessages$sendMessage$request$1;
|
|
|
|
move-object/from16 v3, p8
|
|
|
|
invoke-direct {v2, v0, v1, v14, v3}, Lcom/discord/stores/StoreMessages$sendMessage$request$1;-><init>(Lcom/discord/stores/StoreMessages;Lcom/discord/models/domain/ModelMessage;Lkotlin/jvm/internal/Ref$ObjectRef;Lcom/discord/models/domain/activity/ModelActivity;)V
|
|
|
|
new-instance v1, Lcom/discord/stores/StoreMessages$sendMessage$4;
|
|
|
|
move-wide/from16 v3, p1
|
|
|
|
invoke-direct {v1, v0, v3, v4, v2}, Lcom/discord/stores/StoreMessages$sendMessage$4;-><init>(Lcom/discord/stores/StoreMessages;JLkotlin/jvm/functions/Function1;)V
|
|
|
|
invoke-static {v1, v15}, Lrx/Observable;->n(Lrx/functions/Action1;Lrx/Emitter$BackpressureMode;)Lrx/Observable;
|
|
|
|
move-result-object v1
|
|
|
|
move-object/from16 v2, v19
|
|
|
|
invoke-static {v1, v2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object v1
|
|
|
|
:cond_e
|
|
const-string v1, "content"
|
|
|
|
invoke-static {v1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v3
|
|
|
|
:cond_f
|
|
const-string v1, "author"
|
|
|
|
invoke-static {v1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v3
|
|
.end method
|