2019-12-06 03:29:40 +00:00
|
|
|
.class public final Lcom/discord/utilities/messagesend/MessageQueue$doSend$2;
|
2019-07-24 11:27:29 +00:00
|
|
|
.super Ljava/lang/Object;
|
|
|
|
.source "MessageQueue.kt"
|
|
|
|
|
|
|
|
# interfaces
|
2020-04-27 20:53:11 +00:00
|
|
|
.implements Lf0/l/i;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
# annotations
|
|
|
|
.annotation system Ldalvik/annotation/EnclosingMethod;
|
|
|
|
value = Lcom/discord/utilities/messagesend/MessageQueue;->doSend(Lcom/discord/utilities/messagesend/MessageRequest$Send;Lcom/discord/utilities/messagesend/MessageQueue$DrainListener;)V
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
2019-12-06 03:29:40 +00:00
|
|
|
accessFlags = 0x19
|
2019-07-24 11:27:29 +00:00
|
|
|
name = null
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"<T:",
|
|
|
|
"Ljava/lang/Object;",
|
|
|
|
"R:",
|
|
|
|
"Ljava/lang/Object;",
|
|
|
|
">",
|
|
|
|
"Ljava/lang/Object;",
|
2020-04-27 20:53:11 +00:00
|
|
|
"Lf0/l/i<",
|
2019-07-24 11:27:29 +00:00
|
|
|
"TT;",
|
|
|
|
"Lrx/Observable<",
|
|
|
|
"+TR;>;>;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
|
|
|
|
# instance fields
|
2019-12-06 03:29:40 +00:00
|
|
|
.field public final synthetic $message:Lcom/discord/models/domain/ModelMessage;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
# direct methods
|
2019-12-06 03:29:40 +00:00
|
|
|
.method public constructor <init>(Lcom/discord/models/domain/ModelMessage;)V
|
2019-07-24 11:27:29 +00:00
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iput-object p1, p0, Lcom/discord/utilities/messagesend/MessageQueue$doSend$2;->$message:Lcom/discord/models/domain/ModelMessage;
|
|
|
|
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
|
|
|
|
# virtual methods
|
2019-12-06 03:29:40 +00:00
|
|
|
.method public bridge synthetic call(Ljava/lang/Object;)Ljava/lang/Object;
|
2019-07-24 11:27:29 +00:00
|
|
|
.locals 0
|
|
|
|
|
|
|
|
check-cast p1, Lcom/discord/utilities/rest/SendUtils$SendPayload$ReadyToSend;
|
|
|
|
|
|
|
|
invoke-virtual {p0, p1}, Lcom/discord/utilities/messagesend/MessageQueue$doSend$2;->call(Lcom/discord/utilities/rest/SendUtils$SendPayload$ReadyToSend;)Lrx/Observable;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
return-object p1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final call(Lcom/discord/utilities/rest/SendUtils$SendPayload$ReadyToSend;)Lrx/Observable;
|
|
|
|
.locals 8
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"(",
|
|
|
|
"Lcom/discord/utilities/rest/SendUtils$SendPayload$ReadyToSend;",
|
|
|
|
")",
|
|
|
|
"Lrx/Observable<",
|
|
|
|
"Lcom/discord/models/domain/ModelMessage;",
|
|
|
|
">;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/utilities/rest/SendUtils$SendPayload$ReadyToSend;->getUploads()Ljava/util/List;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
new-instance v1, Ljava/util/ArrayList;
|
|
|
|
|
|
|
|
const/16 v2, 0xa
|
|
|
|
|
2020-04-27 20:53:11 +00:00
|
|
|
invoke-static {v0, v2}, Le/n/a/j/a;->collectionSizeOrDefault(Ljava/lang/Iterable;I)I
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
move-result v2
|
|
|
|
|
|
|
|
invoke-direct {v1, v2}, Ljava/util/ArrayList;-><init>(I)V
|
|
|
|
|
|
|
|
invoke-interface {v0}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
|
|
|
|
move-result v2
|
|
|
|
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
check-cast v2, Lcom/discord/utilities/rest/SendUtils$FileUpload;
|
|
|
|
|
|
|
|
invoke-virtual {v2}, Lcom/discord/utilities/rest/SendUtils$FileUpload;->getPart()Lokhttp3/MultipartBody$Part;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
invoke-interface {v1, v2}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
2019-10-17 03:51:45 +00:00
|
|
|
invoke-interface {v1}, Ljava/util/Collection;->isEmpty()Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
xor-int/lit8 v0, v0, 0x1
|
|
|
|
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
|
2019-07-24 11:27:29 +00:00
|
|
|
sget-object v0, Lcom/discord/utilities/rest/RestAPI;->Companion:Lcom/discord/utilities/rest/RestAPI$Companion;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Lcom/discord/utilities/rest/RestAPI$Companion;->getApi()Lcom/discord/utilities/rest/RestAPI;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/utilities/messagesend/MessageQueue$doSend$2;->$message:Lcom/discord/models/domain/ModelMessage;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelMessage;->getChannelId()J
|
|
|
|
|
|
|
|
move-result-wide v3
|
|
|
|
|
2019-10-17 03:51:45 +00:00
|
|
|
invoke-virtual {p1}, Lcom/discord/utilities/rest/SendUtils$SendPayload$ReadyToSend;->getMessage()Lcom/discord/restapi/RestAPIParams$Message;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Lcom/discord/restapi/RestAPIParams$Message;->getContent()Ljava/lang/String;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
move-result-object v5
|
|
|
|
|
2019-10-17 03:51:45 +00:00
|
|
|
invoke-virtual {p1}, Lcom/discord/utilities/rest/SendUtils$SendPayload$ReadyToSend;->getMessage()Lcom/discord/restapi/RestAPIParams$Message;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-10-17 03:51:45 +00:00
|
|
|
move-result-object p1
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-10-17 03:51:45 +00:00
|
|
|
invoke-virtual {p1}, Lcom/discord/restapi/RestAPIParams$Message;->getNonce()Ljava/lang/String;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
2019-10-17 03:51:45 +00:00
|
|
|
move-result-object v6
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
const/4 p1, 0x0
|
|
|
|
|
|
|
|
new-array p1, p1, [Lokhttp3/MultipartBody$Part;
|
|
|
|
|
|
|
|
invoke-interface {v1, p1}, Ljava/util/Collection;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
|
|
|
|
move-object v7, p1
|
|
|
|
|
|
|
|
check-cast v7, [Lokhttp3/MultipartBody$Part;
|
|
|
|
|
|
|
|
invoke-virtual/range {v2 .. v7}, Lcom/discord/utilities/rest/RestAPI;->sendMessage(JLjava/lang/String;Ljava/lang/String;[Lokhttp3/MultipartBody$Part;)Lrx/Observable;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
goto :goto_1
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
:cond_1
|
2020-04-27 20:53:11 +00:00
|
|
|
new-instance p1, Lx/l;
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
const-string v0, "null cannot be cast to non-null type kotlin.Array<T>"
|
|
|
|
|
2020-04-27 20:53:11 +00:00
|
|
|
invoke-direct {p1, v0}, Lx/l;-><init>(Ljava/lang/String;)V
|
2019-07-24 11:27:29 +00:00
|
|
|
|
|
|
|
throw p1
|
|
|
|
|
2019-10-17 03:51:45 +00:00
|
|
|
:cond_2
|
|
|
|
sget-object v0, Lcom/discord/utilities/rest/RestAPI;->Companion:Lcom/discord/utilities/rest/RestAPI$Companion;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Lcom/discord/utilities/rest/RestAPI$Companion;->getApi()Lcom/discord/utilities/rest/RestAPI;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
iget-object v1, p0, Lcom/discord/utilities/messagesend/MessageQueue$doSend$2;->$message:Lcom/discord/models/domain/ModelMessage;
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Lcom/discord/models/domain/ModelMessage;->getChannelId()J
|
|
|
|
|
|
|
|
move-result-wide v1
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/utilities/rest/SendUtils$SendPayload$ReadyToSend;->getMessage()Lcom/discord/restapi/RestAPIParams$Message;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1, v2, p1}, Lcom/discord/utilities/rest/RestAPI;->sendMessage(JLcom/discord/restapi/RestAPIParams$Message;)Lrx/Observable;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
2019-12-06 03:29:40 +00:00
|
|
|
:goto_1
|
2019-10-17 03:51:45 +00:00
|
|
|
return-object p1
|
2019-07-24 11:27:29 +00:00
|
|
|
.end method
|