501 lines
16 KiB
Smali
501 lines
16 KiB
Smali
.class public final Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$ModelProvider;
|
|
.super Ljava/lang/Object;
|
|
.source "WidgetChatListAdapterItemUploadProgress.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x19
|
|
name = "ModelProvider"
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final INSTANCE:Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$ModelProvider;
|
|
|
|
.field private static final MAX_DETAILED_UPLOADS:I = 0x3
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
new-instance v0, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$ModelProvider;
|
|
|
|
invoke-direct {v0}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$ModelProvider;-><init>()V
|
|
|
|
sput-object v0, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$ModelProvider;->INSTANCE:Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$ModelProvider;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$getFewUploadsObservable(Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$ModelProvider;Ljava/util/List;J)Lrx/Observable;
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1, p2, p3}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$ModelProvider;->getFewUploadsObservable(Ljava/util/List;J)Lrx/Observable;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static final synthetic access$getManyUploadsObservable(Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$ModelProvider;Ljava/util/List;J)Lrx/Observable;
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1, p2, p3}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$ModelProvider;->getManyUploadsObservable(Ljava/util/List;J)Lrx/Observable;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static final synthetic access$getPercentage(Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$ModelProvider;JJ)I
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1, p2, p3, p4}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$ModelProvider;->getPercentage(JJ)I
|
|
|
|
move-result p0
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method public static final synthetic access$getSingleUploadObservable(Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$ModelProvider;Lcom/discord/utilities/rest/SendUtils$FileUpload;J)Lrx/Observable;
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1, p2, p3}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$ModelProvider;->getSingleUploadObservable(Lcom/discord/utilities/rest/SendUtils$FileUpload;J)Lrx/Observable;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private final getFewUploadsObservable(Ljava/util/List;J)Lrx/Observable;
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/List<",
|
|
"Lcom/discord/utilities/rest/SendUtils$FileUpload;",
|
|
">;J)",
|
|
"Lrx/Observable<",
|
|
"Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$Model$Few;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
const/16 v1, 0xa
|
|
|
|
invoke-static {p1, v1}, Lf/h/a/f/f/n/f;->collectionSizeOrDefault(Ljava/lang/Iterable;I)I
|
|
|
|
move-result v1
|
|
|
|
invoke-direct {v0, v1}, Ljava/util/ArrayList;-><init>(I)V
|
|
|
|
invoke-interface {p1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p1
|
|
|
|
:goto_0
|
|
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Lcom/discord/utilities/rest/SendUtils$FileUpload;
|
|
|
|
sget-object v2, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$ModelProvider;->INSTANCE:Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$ModelProvider;
|
|
|
|
invoke-direct {v2, v1, p2, p3}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$ModelProvider;->getSingleUploadObservable(Lcom/discord/utilities/rest/SendUtils$FileUpload;J)Lrx/Observable;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-interface {v0, v1}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
sget-object p1, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$ModelProvider$getFewUploadsObservable$2;->INSTANCE:Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$ModelProvider$getFewUploadsObservable$2;
|
|
|
|
invoke-static {v0, p1}, Lrx/Observable;->b(Ljava/util/List;Lrx/functions/FuncN;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "Observable\n .co\u2026{ it as Model.Single }) }"
|
|
|
|
invoke-static {p1, p2}, Ly/m/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method private final getManyUploadsObservable(Ljava/util/List;J)Lrx/Observable;
|
|
.locals 10
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/List<",
|
|
"Lcom/discord/utilities/rest/SendUtils$FileUpload;",
|
|
">;J)",
|
|
"Lrx/Observable<",
|
|
"Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$Model$Many;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
new-instance v0, Lkotlin/jvm/internal/Ref$LongRef;
|
|
|
|
invoke-direct {v0}, Lkotlin/jvm/internal/Ref$LongRef;-><init>()V
|
|
|
|
const-wide/16 v1, 0x0
|
|
|
|
iput-wide v1, v0, Lkotlin/jvm/internal/Ref$LongRef;->element:J
|
|
|
|
invoke-interface {p1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v3
|
|
|
|
:goto_0
|
|
invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v4
|
|
|
|
const-wide/16 v5, -0x1
|
|
|
|
if-eqz v4, :cond_1
|
|
|
|
invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v4
|
|
|
|
check-cast v4, Lcom/discord/utilities/rest/SendUtils$FileUpload;
|
|
|
|
invoke-virtual {v4}, Lcom/discord/utilities/rest/SendUtils$FileUpload;->getContentLength()J
|
|
|
|
move-result-wide v7
|
|
|
|
cmp-long v9, v7, v1
|
|
|
|
if-gtz v9, :cond_0
|
|
|
|
iput-wide v5, v0, Lkotlin/jvm/internal/Ref$LongRef;->element:J
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget-wide v5, v0, Lkotlin/jvm/internal/Ref$LongRef;->element:J
|
|
|
|
invoke-virtual {v4}, Lcom/discord/utilities/rest/SendUtils$FileUpload;->getContentLength()J
|
|
|
|
move-result-wide v7
|
|
|
|
add-long/2addr v7, v5
|
|
|
|
iput-wide v7, v0, Lkotlin/jvm/internal/Ref$LongRef;->element:J
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
iget-wide v3, v0, Lkotlin/jvm/internal/Ref$LongRef;->element:J
|
|
|
|
cmp-long v7, v3, v1
|
|
|
|
if-gtz v7, :cond_2
|
|
|
|
new-instance p2, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$Model$Many;
|
|
|
|
invoke-interface {p1}, Ljava/util/List;->size()I
|
|
|
|
move-result p1
|
|
|
|
const/4 p3, -0x1
|
|
|
|
invoke-direct {p2, p1, v5, v6, p3}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$Model$Many;-><init>(IJI)V
|
|
|
|
new-instance p1, Lh0/l/e/j;
|
|
|
|
invoke-direct {p1, p2}, Lh0/l/e/j;-><init>(Ljava/lang/Object;)V
|
|
|
|
const-string p2, "Observable\n .\u2026 )\n )"
|
|
|
|
invoke-static {p1, p2}, Ly/m/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
goto :goto_2
|
|
|
|
:cond_2
|
|
new-instance v1, Ljava/util/ArrayList;
|
|
|
|
const/16 v2, 0xa
|
|
|
|
invoke-static {p1, v2}, Lf/h/a/f/f/n/f;->collectionSizeOrDefault(Ljava/lang/Iterable;I)I
|
|
|
|
move-result v2
|
|
|
|
invoke-direct {v1, v2}, Ljava/util/ArrayList;-><init>(I)V
|
|
|
|
invoke-interface {p1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v2
|
|
|
|
:goto_1
|
|
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_3
|
|
|
|
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
check-cast v3, Lcom/discord/utilities/rest/SendUtils$FileUpload;
|
|
|
|
invoke-virtual {v3}, Lcom/discord/utilities/rest/SendUtils$FileUpload;->getBytesWrittenObservable()Lrx/Observable;
|
|
|
|
move-result-object v3
|
|
|
|
sget-object v4, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
invoke-static {v3, p2, p3, v4}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->leadingEdgeThrottle(Lrx/Observable;JLjava/util/concurrent/TimeUnit;)Lrx/Observable;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-interface {v1, v3}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_1
|
|
|
|
:cond_3
|
|
sget-object p2, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$ModelProvider$getManyUploadsObservable$3;->INSTANCE:Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$ModelProvider$getManyUploadsObservable$3;
|
|
|
|
invoke-static {v1, p2}, Lrx/Observable;->b(Ljava/util/List;Lrx/functions/FuncN;)Lrx/Observable;
|
|
|
|
move-result-object p2
|
|
|
|
new-instance p3, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$ModelProvider$getManyUploadsObservable$4;
|
|
|
|
invoke-direct {p3, v0}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$ModelProvider$getManyUploadsObservable$4;-><init>(Lkotlin/jvm/internal/Ref$LongRef;)V
|
|
|
|
invoke-virtual {p2, p3}, Lrx/Observable;->C(Lh0/k/b;)Lrx/Observable;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {p2}, Lrx/Observable;->q()Lrx/Observable;
|
|
|
|
move-result-object p2
|
|
|
|
new-instance p3, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$ModelProvider$getManyUploadsObservable$5;
|
|
|
|
invoke-direct {p3, p1, v0}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$ModelProvider$getManyUploadsObservable$5;-><init>(Ljava/util/List;Lkotlin/jvm/internal/Ref$LongRef;)V
|
|
|
|
invoke-virtual {p2, p3}, Lrx/Observable;->C(Lh0/k/b;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "Observable\n .\u2026essPercent)\n }"
|
|
|
|
invoke-static {p1, p2}, Ly/m/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
:goto_2
|
|
return-object p1
|
|
.end method
|
|
|
|
.method private final getPercentage(JJ)I
|
|
.locals 6
|
|
|
|
long-to-float p1, p1
|
|
|
|
const-wide/16 v0, 0x0
|
|
|
|
cmp-long p2, p3, v0
|
|
|
|
if-lez p2, :cond_0
|
|
|
|
long-to-float p2, p3
|
|
|
|
div-float/2addr p1, p2
|
|
|
|
const/16 p2, 0x64
|
|
|
|
int-to-float p2, p2
|
|
|
|
mul-float p1, p1, p2
|
|
|
|
float-to-int p1, p1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
sget-object v0, Lcom/discord/app/AppLog;->e:Lcom/discord/app/AppLog;
|
|
|
|
new-instance v2, Ljava/lang/Exception;
|
|
|
|
invoke-direct {v2}, Ljava/lang/Exception;-><init>()V
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x4
|
|
|
|
const/4 v5, 0x0
|
|
|
|
const-string v1, "contentLengthBytes was not positive"
|
|
|
|
invoke-static/range {v0 .. v5}, Lcom/discord/utilities/logging/Logger;->e$default(Lcom/discord/utilities/logging/Logger;Ljava/lang/String;Ljava/lang/Throwable;Ljava/util/Map;ILjava/lang/Object;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
:goto_0
|
|
return p1
|
|
.end method
|
|
|
|
.method private final getSingleUploadObservable(Lcom/discord/utilities/rest/SendUtils$FileUpload;J)Lrx/Observable;
|
|
.locals 11
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lcom/discord/utilities/rest/SendUtils$FileUpload;",
|
|
"J)",
|
|
"Lrx/Observable<",
|
|
"Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$Model$Single;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
invoke-virtual {p1}, Lcom/discord/utilities/rest/SendUtils$FileUpload;->getContentLength()J
|
|
|
|
move-result-wide v0
|
|
|
|
const-wide/16 v2, 0x0
|
|
|
|
cmp-long v4, v0, v2
|
|
|
|
if-gtz v4, :cond_0
|
|
|
|
new-instance p2, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$Model$Single;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/utilities/rest/SendUtils$FileUpload;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v6
|
|
|
|
invoke-virtual {p1}, Lcom/discord/utilities/rest/SendUtils$FileUpload;->getMimeType()Ljava/lang/String;
|
|
|
|
move-result-object v7
|
|
|
|
const-wide/16 v8, -0x1
|
|
|
|
const/4 v10, -0x1
|
|
|
|
move-object v5, p2
|
|
|
|
invoke-direct/range {v5 .. v10}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$Model$Single;-><init>(Ljava/lang/String;Ljava/lang/String;JI)V
|
|
|
|
new-instance p1, Lh0/l/e/j;
|
|
|
|
invoke-direct {p1, p2}, Lh0/l/e/j;-><init>(Ljava/lang/Object;)V
|
|
|
|
const-string p2, "Observable.just(\n \u2026E\n )\n )"
|
|
|
|
invoke-static {p1, p2}, Ly/m/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-virtual {p1}, Lcom/discord/utilities/rest/SendUtils$FileUpload;->getBytesWrittenObservable()Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v1, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
invoke-static {v0, p2, p3, v1}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->leadingEdgeThrottle(Lrx/Observable;JLjava/util/concurrent/TimeUnit;)Lrx/Observable;
|
|
|
|
move-result-object p2
|
|
|
|
new-instance p3, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$ModelProvider$getSingleUploadObservable$1;
|
|
|
|
invoke-direct {p3, p1}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$ModelProvider$getSingleUploadObservable$1;-><init>(Lcom/discord/utilities/rest/SendUtils$FileUpload;)V
|
|
|
|
invoke-virtual {p2, p3}, Lrx/Observable;->C(Lh0/k/b;)Lrx/Observable;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {p2}, Lrx/Observable;->q()Lrx/Observable;
|
|
|
|
move-result-object p2
|
|
|
|
new-instance p3, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$ModelProvider$getSingleUploadObservable$2;
|
|
|
|
invoke-direct {p3, p1}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$ModelProvider$getSingleUploadObservable$2;-><init>(Lcom/discord/utilities/rest/SendUtils$FileUpload;)V
|
|
|
|
invoke-virtual {p2, p3}, Lrx/Observable;->C(Lh0/k/b;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const-string/jumbo p2, "upload\n .byte\u2026 )\n }"
|
|
|
|
invoke-static {p1, p2}, Ly/m/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
:goto_0
|
|
return-object p1
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final get(Ljava/lang/String;J)Lrx/Observable;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/lang/String;",
|
|
"J)",
|
|
"Lrx/Observable<",
|
|
"+",
|
|
"Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$Model;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
const-string v0, "nonce"
|
|
|
|
invoke-static {p1, v0}, Ly/m/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
sget-object v0, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreStream$Companion;->getMessageUploads()Lcom/discord/stores/StoreMessageUploads;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0, p1}, Lcom/discord/stores/StoreMessageUploads;->getUploadProgress(Ljava/lang/String;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance v0, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$ModelProvider$get$1;
|
|
|
|
invoke-direct {v0, p2, p3}, Lcom/discord/widgets/chat/list/WidgetChatListAdapterItemUploadProgress$ModelProvider$get$1;-><init>(J)V
|
|
|
|
invoke-virtual {p1, v0}, Lrx/Observable;->T(Lh0/k/b;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "StoreStream\n .g\u2026 }\n }"
|
|
|
|
invoke-static {p1, p2}, Ly/m/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
.end method
|