1132 lines
32 KiB
Smali
1132 lines
32 KiB
Smali
.class public final Lcom/discord/stores/StoreVoiceChannelSelected;
|
|
.super Lcom/discord/stores/Store;
|
|
.source "StoreVoiceChannelSelected.kt"
|
|
|
|
# interfaces
|
|
.implements Lcom/discord/stores/DispatchHandler;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/discord/stores/StoreVoiceChannelSelected$JoinVoiceChannelResult;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field public final clock:Lcom/discord/utilities/time/Clock;
|
|
|
|
.field public final dispatcher:Lcom/discord/stores/Dispatcher;
|
|
|
|
.field public final id:Lrx/Observable;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lrx/Observable<",
|
|
"Ljava/lang/Long;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public isDirty:Z
|
|
|
|
.field public lastSelectedVoiceChannelId:J
|
|
|
|
.field public preselectedVoiceChannelId:Ljava/lang/Long;
|
|
|
|
.field public selectedVoiceChannelId:J
|
|
|
|
.field public final selectedVoiceChannelIdPublisher:Lrx/subjects/BehaviorSubject;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lrx/subjects/BehaviorSubject<",
|
|
"Ljava/lang/Long;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public sessionId:Ljava/lang/String;
|
|
|
|
.field public final stream:Lcom/discord/stores/StoreStream;
|
|
|
|
.field public final timeChannelSelected:Lrx/Observable;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lrx/Observable<",
|
|
"Ljava/lang/Long;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public final timeSelectedPublisher:Lrx/subjects/BehaviorSubject;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lrx/subjects/BehaviorSubject<",
|
|
"Ljava/lang/Long;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# 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/StoreVoiceChannelSelected;->stream:Lcom/discord/stores/StoreStream;
|
|
|
|
iput-object p2, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->dispatcher:Lcom/discord/stores/Dispatcher;
|
|
|
|
iput-object p3, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->clock:Lcom/discord/utilities/time/Clock;
|
|
|
|
const-wide/16 p1, 0x0
|
|
|
|
invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object p3
|
|
|
|
invoke-static {p3}, Lrx/subjects/BehaviorSubject;->h0(Ljava/lang/Object;)Lrx/subjects/BehaviorSubject;
|
|
|
|
move-result-object p3
|
|
|
|
iput-object p3, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->selectedVoiceChannelIdPublisher:Lrx/subjects/BehaviorSubject;
|
|
|
|
invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-static {p1}, Lrx/subjects/BehaviorSubject;->h0(Ljava/lang/Object;)Lrx/subjects/BehaviorSubject;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->timeSelectedPublisher:Lrx/subjects/BehaviorSubject;
|
|
|
|
iget-object p1, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->selectedVoiceChannelIdPublisher:Lrx/subjects/BehaviorSubject;
|
|
|
|
const-string p2, "selectedVoiceChannelIdPublisher"
|
|
|
|
invoke-static {p1, p2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(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, "selectedVoiceChannelIdPu\u2026 .distinctUntilChanged()"
|
|
|
|
invoke-static {p1, p2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->id:Lrx/Observable;
|
|
|
|
iget-object p1, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->timeSelectedPublisher:Lrx/subjects/BehaviorSubject;
|
|
|
|
const-string p2, "timeSelectedPublisher"
|
|
|
|
invoke-static {p1, p2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(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, "timeSelectedPublisher\n \u2026 .distinctUntilChanged()"
|
|
|
|
invoke-static {p1, p2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->timeChannelSelected:Lrx/Observable;
|
|
|
|
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$clearInternal(Lcom/discord/stores/StoreVoiceChannelSelected;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Lcom/discord/stores/StoreVoiceChannelSelected;->clearInternal()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$getStream$p(Lcom/discord/stores/StoreVoiceChannelSelected;)Lcom/discord/stores/StoreStream;
|
|
.locals 0
|
|
|
|
iget-object p0, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->stream:Lcom/discord/stores/StoreStream;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private final clearInternal()V
|
|
.locals 6
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
const-wide/16 v1, 0x0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x2
|
|
|
|
const/4 v5, 0x0
|
|
|
|
move-object v0, p0
|
|
|
|
invoke-static/range {v0 .. v5}, Lcom/discord/stores/StoreVoiceChannelSelected;->selectVoiceChannel$default(Lcom/discord/stores/StoreVoiceChannelSelected;JZILjava/lang/Object;)Lcom/discord/stores/StoreVoiceChannelSelected$JoinVoiceChannelResult;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final getJoinability(J)Lcom/discord/utilities/voice/VoiceChannelJoinability;
|
|
.locals 5
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->stream:Lcom/discord/stores/StoreStream;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreStream;->getChannels$app_productionDiscordExternalRelease()Lcom/discord/stores/StoreChannels;
|
|
|
|
move-result-object v0
|
|
|
|
iget-object v1, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->stream:Lcom/discord/stores/StoreStream;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/stores/StoreStream;->getGuilds$app_productionDiscordExternalRelease()Lcom/discord/stores/StoreGuilds;
|
|
|
|
move-result-object v1
|
|
|
|
iget-object v2, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->stream:Lcom/discord/stores/StoreStream;
|
|
|
|
invoke-virtual {v2}, Lcom/discord/stores/StoreStream;->getPermissions$app_productionDiscordExternalRelease()Lcom/discord/stores/StorePermissions;
|
|
|
|
move-result-object v2
|
|
|
|
iget-object v3, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->stream:Lcom/discord/stores/StoreStream;
|
|
|
|
invoke-virtual {v3}, Lcom/discord/stores/StoreStream;->getVoiceStates$app_productionDiscordExternalRelease()Lcom/discord/stores/StoreVoiceStates;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v0, p1, p2}, Lcom/discord/stores/StoreChannels;->getBlocking$app_productionDiscordExternalRelease(J)Lcom/discord/models/domain/ModelChannel;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
invoke-virtual {v3}, Lcom/discord/stores/StoreVoiceStates;->getMediaStatesBlocking()Ljava/util/Map;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelChannel;->getGuildId()Ljava/lang/Long;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-interface {v3, v4}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
check-cast v3, Ljava/util/Map;
|
|
|
|
if-eqz v3, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
sget-object v3, Lj0/i/o;->d:Lj0/i/o;
|
|
|
|
:goto_0
|
|
invoke-virtual {v2}, Lcom/discord/stores/StorePermissions;->getPermissionsForChannels$app_productionDiscordExternalRelease()Ljava/util/Map;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-interface {v2, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Ljava/lang/Long;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/stores/StoreGuilds;->getGuilds()Ljava/util/Map;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelChannel;->getGuildId()Ljava/lang/Long;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-interface {p2, v1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p2
|
|
|
|
check-cast p2, Lcom/discord/models/domain/ModelGuild;
|
|
|
|
sget-object v1, Lcom/discord/utilities/voice/VoiceChannelJoinabilityUtils;->INSTANCE:Lcom/discord/utilities/voice/VoiceChannelJoinabilityUtils;
|
|
|
|
invoke-interface {v3}, Ljava/util/Map;->values()Ljava/util/Collection;
|
|
|
|
move-result-object v2
|
|
|
|
if-eqz p2, :cond_1
|
|
|
|
invoke-virtual {p2}, Lcom/discord/models/domain/ModelGuild;->getMaxVideoChannelUsers()Ljava/lang/Integer;
|
|
|
|
move-result-object p2
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
const/4 p2, 0x0
|
|
|
|
:goto_1
|
|
invoke-virtual {v1, v0, v2, p1, p2}, Lcom/discord/utilities/voice/VoiceChannelJoinabilityUtils;->getJoinability(Lcom/discord/models/domain/ModelChannel;Ljava/util/Collection;Ljava/lang/Long;Ljava/lang/Integer;)Lcom/discord/utilities/voice/VoiceChannelJoinability;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
|
|
:cond_2
|
|
sget-object p1, Lcom/discord/utilities/voice/VoiceChannelJoinability;->CHANNEL_DOES_NOT_EXIST:Lcom/discord/utilities/voice/VoiceChannelJoinability;
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method private final selectVoiceChannel(JZ)Lcom/discord/stores/StoreVoiceChannelSelected$JoinVoiceChannelResult;
|
|
.locals 11
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->sessionId:Ljava/lang/String;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->preselectedVoiceChannelId:Ljava/lang/Long;
|
|
|
|
sget-object p1, Lcom/discord/stores/StoreVoiceChannelSelected$JoinVoiceChannelResult;->DEFERRED_UNTIL_SESSION_START:Lcom/discord/stores/StoreVoiceChannelSelected$JoinVoiceChannelResult;
|
|
|
|
return-object p1
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
iput-object v0, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->preselectedVoiceChannelId:Ljava/lang/Long;
|
|
|
|
iget-wide v0, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->selectedVoiceChannelId:J
|
|
|
|
cmp-long v2, p1, v0
|
|
|
|
if-nez v2, :cond_1
|
|
|
|
sget-object p1, Lcom/discord/stores/StoreVoiceChannelSelected$JoinVoiceChannelResult;->ALREADY_CONNECTED:Lcom/discord/stores/StoreVoiceChannelSelected$JoinVoiceChannelResult;
|
|
|
|
return-object p1
|
|
|
|
:cond_1
|
|
invoke-direct {p0, p1, p2}, Lcom/discord/stores/StoreVoiceChannelSelected;->getJoinability(J)Lcom/discord/utilities/voice/VoiceChannelJoinability;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Enum;->ordinal()I
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x4
|
|
|
|
const/4 v4, 0x3
|
|
|
|
const/4 v5, 0x2
|
|
|
|
const/4 v6, 0x1
|
|
|
|
if-eqz v1, :cond_4
|
|
|
|
if-eq v1, v6, :cond_5
|
|
|
|
if-eq v1, v5, :cond_3
|
|
|
|
if-eq v1, v4, :cond_5
|
|
|
|
if-ne v1, v3, :cond_2
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
new-instance p1, Lkotlin/NoWhenBranchMatchedException;
|
|
|
|
invoke-direct {p1}, Lkotlin/NoWhenBranchMatchedException;-><init>()V
|
|
|
|
throw p1
|
|
|
|
:cond_3
|
|
:goto_0
|
|
const/4 p3, 0x0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_4
|
|
const/4 p3, 0x1
|
|
|
|
:cond_5
|
|
:goto_1
|
|
iget-wide v7, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->selectedVoiceChannelId:J
|
|
|
|
const-wide/16 v9, 0x0
|
|
|
|
if-eqz p3, :cond_6
|
|
|
|
iput-wide p1, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->selectedVoiceChannelId:J
|
|
|
|
cmp-long v1, p1, v9
|
|
|
|
if-lez v1, :cond_7
|
|
|
|
iput-wide p1, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->lastSelectedVoiceChannelId:J
|
|
|
|
goto :goto_2
|
|
|
|
:cond_6
|
|
iput-wide v9, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->selectedVoiceChannelId:J
|
|
|
|
:cond_7
|
|
:goto_2
|
|
iget-wide p1, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->selectedVoiceChannelId:J
|
|
|
|
cmp-long v1, v7, p1
|
|
|
|
if-eqz v1, :cond_8
|
|
|
|
const/4 v2, 0x1
|
|
|
|
:cond_8
|
|
iput-boolean v2, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->isDirty:Z
|
|
|
|
if-eqz p3, :cond_9
|
|
|
|
sget-object p1, Lcom/discord/stores/StoreVoiceChannelSelected$JoinVoiceChannelResult;->SUCCESS:Lcom/discord/stores/StoreVoiceChannelSelected$JoinVoiceChannelResult;
|
|
|
|
goto :goto_3
|
|
|
|
:cond_9
|
|
invoke-virtual {v0}, Ljava/lang/Enum;->ordinal()I
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_e
|
|
|
|
if-eq p1, v6, :cond_d
|
|
|
|
if-eq p1, v5, :cond_c
|
|
|
|
if-eq p1, v4, :cond_b
|
|
|
|
if-ne p1, v3, :cond_a
|
|
|
|
sget-object p1, Lcom/discord/stores/StoreVoiceChannelSelected$JoinVoiceChannelResult;->FAILED_CHANNEL_DOES_NOT_EXIST:Lcom/discord/stores/StoreVoiceChannelSelected$JoinVoiceChannelResult;
|
|
|
|
goto :goto_3
|
|
|
|
:cond_a
|
|
new-instance p1, Lkotlin/NoWhenBranchMatchedException;
|
|
|
|
invoke-direct {p1}, Lkotlin/NoWhenBranchMatchedException;-><init>()V
|
|
|
|
throw p1
|
|
|
|
:cond_b
|
|
sget-object p1, Lcom/discord/stores/StoreVoiceChannelSelected$JoinVoiceChannelResult;->FAILED_CHANNEL_FULL:Lcom/discord/stores/StoreVoiceChannelSelected$JoinVoiceChannelResult;
|
|
|
|
goto :goto_3
|
|
|
|
:cond_c
|
|
sget-object p1, Lcom/discord/stores/StoreVoiceChannelSelected$JoinVoiceChannelResult;->FAILED_GUILD_VIDEO_AT_CAPACITY:Lcom/discord/stores/StoreVoiceChannelSelected$JoinVoiceChannelResult;
|
|
|
|
goto :goto_3
|
|
|
|
:cond_d
|
|
sget-object p1, Lcom/discord/stores/StoreVoiceChannelSelected$JoinVoiceChannelResult;->FAILED_PERMISSIONS_MISSING:Lcom/discord/stores/StoreVoiceChannelSelected$JoinVoiceChannelResult;
|
|
|
|
goto :goto_3
|
|
|
|
:cond_e
|
|
sget-object p1, Lcom/discord/stores/StoreVoiceChannelSelected$JoinVoiceChannelResult;->SUCCESS:Lcom/discord/stores/StoreVoiceChannelSelected$JoinVoiceChannelResult;
|
|
|
|
:goto_3
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public static synthetic selectVoiceChannel$default(Lcom/discord/stores/StoreVoiceChannelSelected;JZILjava/lang/Object;)Lcom/discord/stores/StoreVoiceChannelSelected$JoinVoiceChannelResult;
|
|
.locals 0
|
|
|
|
and-int/lit8 p4, p4, 0x2
|
|
|
|
if-eqz p4, :cond_0
|
|
|
|
const/4 p3, 0x0
|
|
|
|
:cond_0
|
|
invoke-direct {p0, p1, p2, p3}, Lcom/discord/stores/StoreVoiceChannelSelected;->selectVoiceChannel(JZ)Lcom/discord/stores/StoreVoiceChannelSelected$JoinVoiceChannelResult;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private final validateSelectedVoiceChannel()V
|
|
.locals 5
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
iget-wide v0, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->selectedVoiceChannelId:J
|
|
|
|
const-wide/16 v2, 0x0
|
|
|
|
cmp-long v4, v0, v2
|
|
|
|
if-nez v4, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
iget-object v2, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->stream:Lcom/discord/stores/StoreStream;
|
|
|
|
invoke-virtual {v2}, Lcom/discord/stores/StoreStream;->getChannels$app_productionDiscordExternalRelease()Lcom/discord/stores/StoreChannels;
|
|
|
|
move-result-object v2
|
|
|
|
iget-wide v3, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->selectedVoiceChannelId:J
|
|
|
|
invoke-virtual {v2, v3, v4}, Lcom/discord/stores/StoreChannels;->getChannel$app_productionDiscordExternalRelease(J)Lcom/discord/models/domain/ModelChannel;
|
|
|
|
move-result-object v2
|
|
|
|
if-nez v2, :cond_1
|
|
|
|
invoke-direct {p0}, Lcom/discord/stores/StoreVoiceChannelSelected;->clearInternal()V
|
|
|
|
:cond_1
|
|
iget-wide v2, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->selectedVoiceChannelId:J
|
|
|
|
cmp-long v4, v2, v0
|
|
|
|
if-eqz v4, :cond_2
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
iput-boolean v0, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->isDirty:Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final clear()V
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->dispatcher:Lcom/discord/stores/Dispatcher;
|
|
|
|
new-instance v1, Lcom/discord/stores/StoreVoiceChannelSelected$clear$1;
|
|
|
|
invoke-direct {v1, p0}, Lcom/discord/stores/StoreVoiceChannelSelected$clear$1;-><init>(Lcom/discord/stores/StoreVoiceChannelSelected;)V
|
|
|
|
invoke-virtual {v0, v1}, Lcom/discord/stores/Dispatcher;->schedule(Lkotlin/jvm/functions/Function0;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final get()Lrx/Observable;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Lrx/Observable<",
|
|
"Lcom/discord/models/domain/ModelChannel;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->id:Lrx/Observable;
|
|
|
|
new-instance v1, Lcom/discord/stores/StoreVoiceChannelSelected$get$1;
|
|
|
|
invoke-direct {v1, p0}, Lcom/discord/stores/StoreVoiceChannelSelected$get$1;-><init>(Lcom/discord/stores/StoreVoiceChannelSelected;)V
|
|
|
|
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 v0
|
|
|
|
const-string v1, "id\n .switchMap \u2026 .distinctUntilChanged()"
|
|
|
|
invoke-static {v0, v1}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final getId()Lrx/Observable;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Lrx/Observable<",
|
|
"Ljava/lang/Long;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->id:Lrx/Observable;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final getLastSelectedVoiceChannelId$app_productionDiscordExternalRelease()J
|
|
.locals 2
|
|
|
|
iget-wide v0, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->lastSelectedVoiceChannelId:J
|
|
|
|
return-wide v0
|
|
.end method
|
|
|
|
.method public final getSelectedVoiceChannelId$app_productionDiscordExternalRelease()J
|
|
.locals 2
|
|
|
|
iget-wide v0, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->selectedVoiceChannelId:J
|
|
|
|
return-wide v0
|
|
.end method
|
|
|
|
.method public final getTimeChannelSelected()Lrx/Observable;
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Lrx/Observable<",
|
|
"Ljava/lang/Long;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->timeChannelSelected:Lrx/Observable;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final handleAuthToken(Ljava/lang/String;)V
|
|
.locals 0
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
invoke-direct {p0}, Lcom/discord/stores/StoreVoiceChannelSelected;->clearInternal()V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public final handleChannelCreated()V
|
|
.locals 0
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
invoke-direct {p0}, Lcom/discord/stores/StoreVoiceChannelSelected;->validateSelectedVoiceChannel()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final handleChannelDeleted()V
|
|
.locals 0
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
invoke-direct {p0}, Lcom/discord/stores/StoreVoiceChannelSelected;->validateSelectedVoiceChannel()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final handleConnectionOpen(Lcom/discord/models/domain/ModelPayload;)V
|
|
.locals 2
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelPayload;->getSessionId()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->sessionId:Ljava/lang/String;
|
|
|
|
iget-object p1, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->preselectedVoiceChannelId:Ljava/lang/Long;
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Number;->longValue()J
|
|
|
|
move-result-wide v0
|
|
|
|
invoke-virtual {p0, v0, v1}, Lcom/discord/stores/StoreVoiceChannelSelected;->set(J)Lrx/Observable;
|
|
|
|
:cond_0
|
|
return-void
|
|
|
|
:cond_1
|
|
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 handleGuildMemberAdd(Lcom/discord/models/domain/ModelGuildMember;)V
|
|
.locals 3
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelGuildMember;->getUser()Lcom/discord/models/domain/ModelUser;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelUser;->getId()J
|
|
|
|
move-result-wide v1
|
|
|
|
invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object p1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
move-object p1, v0
|
|
|
|
:goto_0
|
|
iget-object v1, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->stream:Lcom/discord/stores/StoreStream;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/stores/StoreStream;->getUsers$app_productionDiscordExternalRelease()Lcom/discord/stores/StoreUser;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Lcom/discord/stores/StoreUser;->getMeInternal$app_productionDiscordExternalRelease()Lcom/discord/models/domain/ModelUser$Me;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
invoke-virtual {v1}, Lcom/discord/models/domain/ModelUser;->getId()J
|
|
|
|
move-result-wide v0
|
|
|
|
invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v0
|
|
|
|
:cond_1
|
|
invoke-static {p1, v0}, Lj0/n/c/h;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
invoke-direct {p0}, Lcom/discord/stores/StoreVoiceChannelSelected;->validateSelectedVoiceChannel()V
|
|
|
|
:cond_2
|
|
return-void
|
|
|
|
:cond_3
|
|
const-string p1, "member"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public final handleGuildRemove()V
|
|
.locals 0
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
invoke-direct {p0}, Lcom/discord/stores/StoreVoiceChannelSelected;->validateSelectedVoiceChannel()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final handleGuildRoleAdd()V
|
|
.locals 0
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
invoke-direct {p0}, Lcom/discord/stores/StoreVoiceChannelSelected;->validateSelectedVoiceChannel()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final handleGuildRoleRemove()V
|
|
.locals 0
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
invoke-direct {p0}, Lcom/discord/stores/StoreVoiceChannelSelected;->validateSelectedVoiceChannel()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final handleStreamTargeted(Ljava/lang/String;)V
|
|
.locals 6
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
sget-object v0, Lcom/discord/models/domain/ModelApplicationStream;->Companion:Lcom/discord/models/domain/ModelApplicationStream$Companion;
|
|
|
|
invoke-virtual {v0, p1}, Lcom/discord/models/domain/ModelApplicationStream$Companion;->decodeStreamKey(Ljava/lang/String;)Lcom/discord/models/domain/ModelApplicationStream;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelApplicationStream;->getChannelId()J
|
|
|
|
move-result-wide v1
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x2
|
|
|
|
const/4 v5, 0x0
|
|
|
|
move-object v0, p0
|
|
|
|
invoke-static/range {v0 .. v5}, Lcom/discord/stores/StoreVoiceChannelSelected;->selectVoiceChannel$default(Lcom/discord/stores/StoreVoiceChannelSelected;JZILjava/lang/Object;)Lcom/discord/stores/StoreVoiceChannelSelected$JoinVoiceChannelResult;
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "streamKey"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final handleVoiceStateUpdates(Lcom/discord/models/domain/ModelVoice$State;)V
|
|
.locals 7
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_8
|
|
|
|
iget-object v1, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->stream:Lcom/discord/stores/StoreStream;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/stores/StoreStream;->getUsers$app_productionDiscordExternalRelease()Lcom/discord/stores/StoreUser;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Lcom/discord/stores/StoreUser;->getMeInternal$app_productionDiscordExternalRelease()Lcom/discord/models/domain/ModelUser$Me;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
invoke-virtual {v1}, Lcom/discord/models/domain/ModelUser;->getId()J
|
|
|
|
move-result-wide v0
|
|
|
|
invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v0
|
|
|
|
:cond_0
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelVoice$State;->getUserId()J
|
|
|
|
move-result-wide v1
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
invoke-virtual {v0}, Ljava/lang/Long;->longValue()J
|
|
|
|
move-result-wide v3
|
|
|
|
cmp-long v0, v1, v3
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
:goto_0
|
|
return-void
|
|
|
|
:cond_2
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelVoice$State;->getChannelId()Ljava/lang/Long;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelVoice$State;->getSessionId()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
iget-object v2, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->sessionId:Ljava/lang/String;
|
|
|
|
invoke-static {v1, v2}, Lj0/n/c/h;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x1
|
|
|
|
if-eqz v1, :cond_5
|
|
|
|
iget-wide v3, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->selectedVoiceChannelId:J
|
|
|
|
if-nez v0, :cond_3
|
|
|
|
goto :goto_1
|
|
|
|
:cond_3
|
|
invoke-virtual {v0}, Ljava/lang/Long;->longValue()J
|
|
|
|
move-result-wide v5
|
|
|
|
cmp-long v1, v5, v3
|
|
|
|
if-eqz v1, :cond_5
|
|
|
|
:goto_1
|
|
if-eqz v0, :cond_4
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Long;->longValue()J
|
|
|
|
move-result-wide v0
|
|
|
|
invoke-direct {p0, v0, v1, v2}, Lcom/discord/stores/StoreVoiceChannelSelected;->selectVoiceChannel(JZ)Lcom/discord/stores/StoreVoiceChannelSelected$JoinVoiceChannelResult;
|
|
|
|
goto :goto_2
|
|
|
|
:cond_4
|
|
invoke-direct {p0}, Lcom/discord/stores/StoreVoiceChannelSelected;->clearInternal()V
|
|
|
|
goto :goto_2
|
|
|
|
:cond_5
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelVoice$State;->getSessionId()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
iget-object v1, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->sessionId:Ljava/lang/String;
|
|
|
|
invoke-static {v0, v1}, Lj0/n/c/h;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
xor-int/2addr v0, v2
|
|
|
|
if-eqz v0, :cond_7
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->stream:Lcom/discord/stores/StoreStream;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreStream;->getChannels$app_productionDiscordExternalRelease()Lcom/discord/stores/StoreChannels;
|
|
|
|
move-result-object v0
|
|
|
|
iget-wide v1, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->selectedVoiceChannelId:J
|
|
|
|
invoke-virtual {v0, v1, v2}, Lcom/discord/stores/StoreChannels;->getChannel$app_productionDiscordExternalRelease(J)Lcom/discord/models/domain/ModelChannel;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_7
|
|
|
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelChannel;->getGuildId()Ljava/lang/Long;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelVoice$State;->getGuildId()J
|
|
|
|
move-result-wide v1
|
|
|
|
if-nez v0, :cond_6
|
|
|
|
goto :goto_2
|
|
|
|
:cond_6
|
|
invoke-virtual {v0}, Ljava/lang/Long;->longValue()J
|
|
|
|
move-result-wide v3
|
|
|
|
cmp-long p1, v3, v1
|
|
|
|
if-nez p1, :cond_7
|
|
|
|
invoke-direct {p0}, Lcom/discord/stores/StoreVoiceChannelSelected;->clearInternal()V
|
|
|
|
:cond_7
|
|
:goto_2
|
|
return-void
|
|
|
|
:cond_8
|
|
const-string/jumbo p1, "voiceState"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public onDispatchEnded()V
|
|
.locals 6
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
iget-boolean v0, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->isDirty:Z
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->selectedVoiceChannelIdPublisher:Lrx/subjects/BehaviorSubject;
|
|
|
|
iget-wide v1, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->selectedVoiceChannelId:J
|
|
|
|
invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Lrx/subjects/BehaviorSubject;->onNext(Ljava/lang/Object;)V
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->timeSelectedPublisher:Lrx/subjects/BehaviorSubject;
|
|
|
|
iget-wide v1, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->selectedVoiceChannelId:J
|
|
|
|
const-wide/16 v3, 0x0
|
|
|
|
cmp-long v5, v1, v3
|
|
|
|
if-lez v5, :cond_0
|
|
|
|
iget-object v1, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->clock:Lcom/discord/utilities/time/Clock;
|
|
|
|
invoke-interface {v1}, Lcom/discord/utilities/time/Clock;->currentTimeMillis()J
|
|
|
|
move-result-wide v3
|
|
|
|
:cond_0
|
|
invoke-static {v3, v4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Lrx/subjects/BehaviorSubject;->onNext(Ljava/lang/Object;)V
|
|
|
|
:cond_1
|
|
const/4 v0, 0x0
|
|
|
|
iput-boolean v0, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->isDirty:Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final set(J)Lrx/Observable;
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(J)",
|
|
"Lrx/Observable<",
|
|
"Lcom/discord/stores/StoreVoiceChannelSelected$JoinVoiceChannelResult;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
invoke-static {}, Lrx/subjects/PublishSubject;->g0()Lrx/subjects/PublishSubject;
|
|
|
|
move-result-object v0
|
|
|
|
iget-object v1, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->dispatcher:Lcom/discord/stores/Dispatcher;
|
|
|
|
new-instance v2, Lcom/discord/stores/StoreVoiceChannelSelected$set$1;
|
|
|
|
invoke-direct {v2, p0, p1, p2, v0}, Lcom/discord/stores/StoreVoiceChannelSelected$set$1;-><init>(Lcom/discord/stores/StoreVoiceChannelSelected;JLrx/subjects/PublishSubject;)V
|
|
|
|
invoke-virtual {v1, v2}, Lcom/discord/stores/Dispatcher;->schedule(Lkotlin/jvm/functions/Function0;)V
|
|
|
|
const-string p1, "resultSubject"
|
|
|
|
invoke-static {v0, p1}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final setLastSelectedVoiceChannelId$app_productionDiscordExternalRelease(J)V
|
|
.locals 0
|
|
|
|
iput-wide p1, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->lastSelectedVoiceChannelId:J
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final setSelectedVoiceChannelId$app_productionDiscordExternalRelease(J)V
|
|
.locals 0
|
|
|
|
iput-wide p1, p0, Lcom/discord/stores/StoreVoiceChannelSelected;->selectedVoiceChannelId:J
|
|
|
|
return-void
|
|
.end method
|