299 lines
7.8 KiB
Smali
299 lines
7.8 KiB
Smali
.class public final Lcom/discord/widgets/status/WidgetStatus$Model$Companion;
|
|
.super Ljava/lang/Object;
|
|
.source "WidgetStatus.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lcom/discord/widgets/status/WidgetStatus$Model;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x19
|
|
name = "Companion"
|
|
.end annotation
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public synthetic constructor <init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/status/WidgetStatus$Model$Companion;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$createModel(Lcom/discord/widgets/status/WidgetStatus$Model$Companion;IZLjava/util/Set;Lcom/discord/models/application/Unread;)Lcom/discord/widgets/status/WidgetStatus$Model;
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1, p2, p3, p4}, Lcom/discord/widgets/status/WidgetStatus$Model$Companion;->createModel(IZLjava/util/Set;Lcom/discord/models/application/Unread;)Lcom/discord/widgets/status/WidgetStatus$Model;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private final createModel(IZLjava/util/Set;Lcom/discord/models/application/Unread;)Lcom/discord/widgets/status/WidgetStatus$Model;
|
|
.locals 17
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(IZ",
|
|
"Ljava/util/Set<",
|
|
"Ljava/lang/Long;",
|
|
">;",
|
|
"Lcom/discord/models/application/Unread;",
|
|
")",
|
|
"Lcom/discord/widgets/status/WidgetStatus$Model;"
|
|
}
|
|
.end annotation
|
|
|
|
move/from16 v0, p1
|
|
|
|
invoke-virtual/range {p4 .. p4}, Lcom/discord/models/application/Unread;->getMarker()Lcom/discord/models/application/Unread$Marker;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Lcom/discord/models/application/Unread$Marker;->getChannelId()J
|
|
|
|
move-result-wide v2
|
|
|
|
invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v2
|
|
|
|
move-object/from16 v3, p3
|
|
|
|
invoke-interface {v3, v2}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z
|
|
|
|
move-result v2
|
|
|
|
invoke-virtual/range {p4 .. p4}, Lcom/discord/models/application/Unread;->getCount()I
|
|
|
|
move-result v3
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
const/16 v2, 0x19
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/16 v2, 0x32
|
|
|
|
:goto_0
|
|
const/4 v4, 0x2
|
|
|
|
const/4 v5, 0x1
|
|
|
|
const/4 v6, 0x0
|
|
|
|
if-ne v0, v4, :cond_1
|
|
|
|
const/4 v8, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
const/4 v8, 0x0
|
|
|
|
:goto_1
|
|
const/4 v4, 0x3
|
|
|
|
if-ne v0, v4, :cond_2
|
|
|
|
const/4 v9, 0x1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_2
|
|
const/4 v9, 0x0
|
|
|
|
:goto_2
|
|
new-instance v0, Lcom/discord/widgets/status/WidgetStatus$Model;
|
|
|
|
if-nez v8, :cond_4
|
|
|
|
if-nez v9, :cond_4
|
|
|
|
if-eqz p2, :cond_3
|
|
|
|
invoke-virtual/range {p4 .. p4}, Lcom/discord/models/application/Unread;->getCount()I
|
|
|
|
move-result v4
|
|
|
|
if-lez v4, :cond_3
|
|
|
|
goto :goto_3
|
|
|
|
:cond_3
|
|
const/16 v4, 0x8
|
|
|
|
const/16 v10, 0x8
|
|
|
|
goto :goto_4
|
|
|
|
:cond_4
|
|
:goto_3
|
|
const/4 v10, 0x0
|
|
|
|
:goto_4
|
|
invoke-virtual {v1}, Lcom/discord/models/application/Unread$Marker;->getChannelId()J
|
|
|
|
move-result-wide v13
|
|
|
|
invoke-virtual {v1}, Lcom/discord/models/application/Unread$Marker;->getMessageId()Ljava/lang/Long;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_5
|
|
|
|
invoke-virtual {v1}, Ljava/lang/Long;->longValue()J
|
|
|
|
move-result-wide v11
|
|
|
|
goto :goto_5
|
|
|
|
:cond_5
|
|
const-wide/16 v11, 0x0
|
|
|
|
:goto_5
|
|
if-lez v3, :cond_6
|
|
|
|
invoke-static {v3, v2}, Ljava/lang/Math;->min(II)I
|
|
|
|
move-result v1
|
|
|
|
move v15, v1
|
|
|
|
goto :goto_6
|
|
|
|
:cond_6
|
|
const/4 v15, 0x0
|
|
|
|
:goto_6
|
|
if-lt v3, v2, :cond_7
|
|
|
|
const/16 v16, 0x1
|
|
|
|
goto :goto_7
|
|
|
|
:cond_7
|
|
const/16 v16, 0x0
|
|
|
|
:goto_7
|
|
move-object v7, v0
|
|
|
|
invoke-direct/range {v7 .. v16}, Lcom/discord/widgets/status/WidgetStatus$Model;-><init>(ZZIJJIZ)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final get()Lrx/Observable;
|
|
.locals 9
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Lrx/Observable<",
|
|
"Lcom/discord/widgets/status/WidgetStatus$Model;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
sget-object v0, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreStream$Companion;->getChannelsSelected()Lcom/discord/stores/StoreChannelsSelected;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreChannelsSelected;->observeId()Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lrx/Observable;->q()Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v1, Lcom/discord/widgets/status/WidgetStatus$Model$Companion$get$isUnreadValidObs$1;->INSTANCE:Lcom/discord/widgets/status/WidgetStatus$Model$Companion$get$isUnreadValidObs$1;
|
|
|
|
invoke-virtual {v0, v1}, Lrx/Observable;->U(Lr0/k/b;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lrx/Observable;->q()Lrx/Observable;
|
|
|
|
move-result-object v2
|
|
|
|
sget-object v0, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreStream$Companion;->getConnectivity()Lcom/discord/stores/StoreConnectivity;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreConnectivity;->observeState()Lrx/Observable;
|
|
|
|
move-result-object v1
|
|
|
|
sget-object v0, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreStream$Companion;->getMessages()Lcom/discord/stores/StoreMessages;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreMessages;->getAllDetached()Lrx/Observable;
|
|
|
|
move-result-object v3
|
|
|
|
sget-object v0, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreStream$Companion;->getReadStates()Lcom/discord/stores/StoreReadStates;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreReadStates;->getUnreadMarkerForSelectedChannel()Lrx/Observable;
|
|
|
|
move-result-object v4
|
|
|
|
new-instance v0, Lcom/discord/widgets/status/WidgetStatus$Model$Companion$get$1;
|
|
|
|
invoke-direct {v0, p0}, Lcom/discord/widgets/status/WidgetStatus$Model$Companion$get$1;-><init>(Lcom/discord/widgets/status/WidgetStatus$Model$Companion;)V
|
|
|
|
new-instance v5, Lcom/discord/widgets/status/WidgetStatus$sam$rx_functions_Func4$0;
|
|
|
|
invoke-direct {v5, v0}, Lcom/discord/widgets/status/WidgetStatus$sam$rx_functions_Func4$0;-><init>(Lkotlin/jvm/functions/Function4;)V
|
|
|
|
sget-object v8, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
const-wide/16 v6, 0x1f4
|
|
|
|
invoke-static/range {v1 .. v8}, Lcom/discord/utilities/rx/ObservableWithLeadingEdgeThrottle;->combineLatest(Lrx/Observable;Lrx/Observable;Lrx/Observable;Lrx/Observable;Lrx/functions/Func4;JLjava/util/concurrent/TimeUnit;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "ObservableWithLeadingEdg\u2026ILLISECONDS\n )"
|
|
|
|
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
|
|
|
|
invoke-virtual {v0}, Lrx/Observable;->q()Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "ObservableWithLeadingEdg\u2026 .distinctUntilChanged()"
|
|
|
|
invoke-static {v0, v1}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object v0
|
|
.end method
|