464 lines
14 KiB
Smali
464 lines
14 KiB
Smali
.class public final Lcom/discord/widgets/channels/list/WidgetChannelListModel$VoiceStates;
|
|
.super Ljava/lang/Object;
|
|
.source "WidgetChannelListModel.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lcom/discord/widgets/channels/list/WidgetChannelListModel;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x19
|
|
name = "VoiceStates"
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final INSTANCE:Lcom/discord/widgets/channels/list/WidgetChannelListModel$VoiceStates;
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
new-instance v0, Lcom/discord/widgets/channels/list/WidgetChannelListModel$VoiceStates;
|
|
|
|
invoke-direct {v0}, Lcom/discord/widgets/channels/list/WidgetChannelListModel$VoiceStates;-><init>()V
|
|
|
|
sput-object v0, Lcom/discord/widgets/channels/list/WidgetChannelListModel$VoiceStates;->INSTANCE:Lcom/discord/widgets/channels/list/WidgetChannelListModel$VoiceStates;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$createVoiceStates(Lcom/discord/widgets/channels/list/WidgetChannelListModel$VoiceStates;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Comparator;)Ljava/util/Map;
|
|
.locals 0
|
|
|
|
invoke-direct/range {p0 .. p7}, Lcom/discord/widgets/channels/list/WidgetChannelListModel$VoiceStates;->createVoiceStates(Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Comparator;)Ljava/util/Map;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private final createVoiceStates(Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Comparator;)Ljava/util/Map;
|
|
.locals 16
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/Long;",
|
|
"+",
|
|
"Lcom/discord/models/domain/ModelVoice$State;",
|
|
">;",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/Long;",
|
|
"+",
|
|
"Lcom/discord/models/domain/ModelUser;",
|
|
">;",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/Long;",
|
|
"+",
|
|
"Lcom/discord/models/domain/ModelGuildMember$Computed;",
|
|
">;",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/Long;",
|
|
"+",
|
|
"Lcom/discord/models/domain/ModelChannel;",
|
|
">;",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/Long;",
|
|
"+",
|
|
"Lcom/discord/models/domain/ModelApplicationStream;",
|
|
">;",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/Long;",
|
|
"Ljava/lang/Long;",
|
|
">;",
|
|
"Ljava/util/Comparator<",
|
|
"Lcom/discord/widgets/channels/list/items/ChannelListItemVoiceUser;",
|
|
">;)",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/Long;",
|
|
"Ljava/util/List<",
|
|
"Lcom/discord/widgets/channels/list/items/ChannelListItemVoiceUser;",
|
|
">;>;"
|
|
}
|
|
.end annotation
|
|
|
|
new-instance v0, Ljava/util/HashMap;
|
|
|
|
invoke-direct {v0}, Ljava/util/HashMap;-><init>()V
|
|
|
|
invoke-interface/range {p1 .. p1}, Ljava/util/Map;->values()Ljava/util/Collection;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-interface {v1}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v1
|
|
|
|
:cond_0
|
|
:goto_0
|
|
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_4
|
|
|
|
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
move-object v5, v2
|
|
|
|
check-cast v5, Lcom/discord/models/domain/ModelVoice$State;
|
|
|
|
invoke-virtual {v5}, Lcom/discord/models/domain/ModelVoice$State;->getUserId()J
|
|
|
|
move-result-wide v2
|
|
|
|
invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v4
|
|
|
|
move-object/from16 v10, p2
|
|
|
|
invoke-interface {v10, v4}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v4
|
|
|
|
move-object v6, v4
|
|
|
|
check-cast v6, Lcom/discord/models/domain/ModelUser;
|
|
|
|
if-eqz v6, :cond_3
|
|
|
|
invoke-virtual {v5}, Lcom/discord/models/domain/ModelVoice$State;->getChannelId()Ljava/lang/Long;
|
|
|
|
move-result-object v4
|
|
|
|
if-eqz v4, :cond_3
|
|
|
|
const-string/jumbo v7, "voiceState.channelId ?: continue"
|
|
|
|
invoke-static {v4, v7}, Lb0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v4}, Ljava/lang/Long;->longValue()J
|
|
|
|
move-result-wide v7
|
|
|
|
const-wide/32 v11, 0x100000
|
|
|
|
invoke-static {v7, v8}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v4
|
|
|
|
move-object/from16 v13, p6
|
|
|
|
invoke-interface {v13, v4}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v4
|
|
|
|
check-cast v4, Ljava/lang/Long;
|
|
|
|
invoke-static {v11, v12, v4}, Lcom/discord/utilities/permissions/PermissionUtils;->can(JLjava/lang/Long;)Z
|
|
|
|
move-result v9
|
|
|
|
invoke-static {v7, v8}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-interface {v0, v4}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v11
|
|
|
|
if-nez v11, :cond_1
|
|
|
|
new-instance v11, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v11}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
invoke-interface {v0, v4, v11}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
:cond_1
|
|
check-cast v11, Ljava/util/List;
|
|
|
|
invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v4
|
|
|
|
move-object/from16 v12, p3
|
|
|
|
invoke-interface {v12, v4}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v4
|
|
|
|
move-object v14, v4
|
|
|
|
check-cast v14, Lcom/discord/models/domain/ModelGuildMember$Computed;
|
|
|
|
if-eqz v14, :cond_2
|
|
|
|
invoke-static {v7, v8}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v4
|
|
|
|
move-object/from16 v15, p4
|
|
|
|
invoke-interface {v15, v4}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v4
|
|
|
|
check-cast v4, Lcom/discord/models/domain/ModelChannel;
|
|
|
|
if-eqz v4, :cond_0
|
|
|
|
new-instance v8, Lcom/discord/widgets/channels/list/items/ChannelListItemVoiceUser;
|
|
|
|
invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v2
|
|
|
|
move-object/from16 v7, p5
|
|
|
|
invoke-interface {v7, v2}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z
|
|
|
|
move-result v2
|
|
|
|
move-object v3, v8
|
|
|
|
move-object v7, v14
|
|
|
|
move-object v14, v8
|
|
|
|
move v8, v2
|
|
|
|
invoke-direct/range {v3 .. v9}, Lcom/discord/widgets/channels/list/items/ChannelListItemVoiceUser;-><init>(Lcom/discord/models/domain/ModelChannel;Lcom/discord/models/domain/ModelVoice$State;Lcom/discord/models/domain/ModelUser;Lcom/discord/models/domain/ModelGuildMember$Computed;ZZ)V
|
|
|
|
invoke-interface {v11, v14}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
|
|
|
goto/16 :goto_0
|
|
|
|
:cond_2
|
|
move-object/from16 v15, p4
|
|
|
|
goto/16 :goto_0
|
|
|
|
:cond_3
|
|
move-object/from16 v12, p3
|
|
|
|
move-object/from16 v15, p4
|
|
|
|
move-object/from16 v13, p6
|
|
|
|
goto/16 :goto_0
|
|
|
|
:cond_4
|
|
invoke-interface {v0}, Ljava/util/Map;->entrySet()Ljava/util/Set;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-interface {v1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v1
|
|
|
|
:goto_1
|
|
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_5
|
|
|
|
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Ljava/util/Map$Entry;
|
|
|
|
invoke-interface {v2}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Ljava/util/List;
|
|
|
|
move-object/from16 v3, p7
|
|
|
|
invoke-static {v2, v3}, Lf/h/a/f/e/n/f;->sortWith(Ljava/util/List;Ljava/util/Comparator;)V
|
|
|
|
goto :goto_1
|
|
|
|
:cond_5
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private final createVoiceUserComparator()Ljava/util/Comparator;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Ljava/util/Comparator<",
|
|
"Lcom/discord/widgets/channels/list/items/ChannelListItemVoiceUser;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
sget-object v0, Lcom/discord/widgets/channels/list/WidgetChannelListModel$VoiceStates$createVoiceUserComparator$1;->INSTANCE:Lcom/discord/widgets/channels/list/WidgetChannelListModel$VoiceStates$createVoiceUserComparator$1;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static synthetic get$default(Lcom/discord/widgets/channels/list/WidgetChannelListModel$VoiceStates;JLjava/util/Comparator;ILjava/lang/Object;)Lrx/Observable;
|
|
.locals 0
|
|
|
|
and-int/lit8 p4, p4, 0x2
|
|
|
|
if-eqz p4, :cond_0
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/channels/list/WidgetChannelListModel$VoiceStates;->createVoiceUserComparator()Ljava/util/Comparator;
|
|
|
|
move-result-object p3
|
|
|
|
:cond_0
|
|
invoke-virtual {p0, p1, p2, p3}, Lcom/discord/widgets/channels/list/WidgetChannelListModel$VoiceStates;->get(JLjava/util/Comparator;)Lrx/Observable;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final get(JLjava/util/Comparator;)Lrx/Observable;
|
|
.locals 11
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(J",
|
|
"Ljava/util/Comparator<",
|
|
"Lcom/discord/widgets/channels/list/items/ChannelListItemVoiceUser;",
|
|
">;)",
|
|
"Lrx/Observable<",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/Long;",
|
|
"Ljava/util/List<",
|
|
"Lcom/discord/widgets/channels/list/items/ChannelListItemVoiceUser;",
|
|
">;>;>;"
|
|
}
|
|
.end annotation
|
|
|
|
const-string/jumbo v0, "voiceUserComparator"
|
|
|
|
invoke-static {p3, v0}, Lb0/n/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;->getApplicationStreaming()Lcom/discord/stores/StoreApplicationStreaming;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0, p1, p2}, Lcom/discord/stores/StoreApplicationStreaming;->getStreamsForGuild(J)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;->getVoiceStates()Lcom/discord/stores/StoreVoiceStates;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0, p1, p2}, Lcom/discord/stores/StoreVoiceStates;->get(J)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v2, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
const-wide/16 v3, 0xc8
|
|
|
|
invoke-static {v0, v3, v4, v2}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->leadingEdgeThrottle(Lrx/Observable;JLjava/util/concurrent/TimeUnit;)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;->getUsers()Lcom/discord/stores/StoreUser;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreUser;->observeAllUsers()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;->getGuilds()Lcom/discord/stores/StoreGuilds;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0, p1, p2}, Lcom/discord/stores/StoreGuilds;->observeComputed(J)Lrx/Observable;
|
|
|
|
move-result-object v4
|
|
|
|
sget-object v0, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreStream$Companion;->getChannels()Lcom/discord/stores/StoreChannels;
|
|
|
|
move-result-object v5
|
|
|
|
const/4 v8, 0x0
|
|
|
|
const/4 v9, 0x2
|
|
|
|
const/4 v10, 0x0
|
|
|
|
move-wide v6, p1
|
|
|
|
invoke-static/range {v5 .. v10}, Lcom/discord/stores/StoreChannels;->getForGuild$default(Lcom/discord/stores/StoreChannels;JLjava/lang/Integer;ILjava/lang/Object;)Lrx/Observable;
|
|
|
|
move-result-object v5
|
|
|
|
sget-object v0, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreStream$Companion;->getPermissions()Lcom/discord/stores/StorePermissions;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0, p1, p2}, Lcom/discord/stores/StorePermissions;->getForChannels(J)Lrx/Observable;
|
|
|
|
move-result-object v6
|
|
|
|
new-instance v7, Lcom/discord/widgets/channels/list/WidgetChannelListModel$VoiceStates$get$1;
|
|
|
|
invoke-direct {v7, p3}, Lcom/discord/widgets/channels/list/WidgetChannelListModel$VoiceStates$get$1;-><init>(Ljava/util/Comparator;)V
|
|
|
|
invoke-static/range {v1 .. v7}, Lrx/Observable;->f(Lrx/Observable;Lrx/Observable;Lrx/Observable;Lrx/Observable;Lrx/Observable;Lrx/Observable;Lrx/functions/Func6;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "Observable\n .co\u2026 )\n }"
|
|
|
|
invoke-static {p1, p2}, Lb0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-static {p1}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->computationLatest(Lrx/Observable;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Lrx/Observable;->q()Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "Observable\n .co\u2026 .distinctUntilChanged()"
|
|
|
|
invoke-static {p1, p2}, Lb0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
.end method
|