338 lines
8.5 KiB
Smali
338 lines
8.5 KiB
Smali
.class public final Lcom/discord/stores/StoreVideoStreams;
|
|
.super Ljava/lang/Object;
|
|
.source "StoreVideoStreams.kt"
|
|
|
|
# interfaces
|
|
.implements Lcom/discord/stores/DispatchHandler;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/discord/stores/StoreVideoStreams$UserStreams;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field public isDirty:Z
|
|
|
|
.field public final userStreams:Ljava/util/HashMap;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/HashMap<",
|
|
"Ljava/lang/Long;",
|
|
"Lcom/discord/stores/StoreVideoStreams$UserStreams;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public final userStreamsSubject:Lrx/subjects/BehaviorSubject;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lrx/subjects/BehaviorSubject<",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/Long;",
|
|
"Lcom/discord/stores/StoreVideoStreams$UserStreams;",
|
|
">;>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 1
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
new-instance v0, Ljava/util/HashMap;
|
|
|
|
invoke-direct {v0}, Ljava/util/HashMap;-><init>()V
|
|
|
|
iput-object v0, p0, Lcom/discord/stores/StoreVideoStreams;->userStreams:Ljava/util/HashMap;
|
|
|
|
invoke-static {}, Lw/q/l;->emptyMap()Ljava/util/Map;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Lrx/subjects/BehaviorSubject;->a(Ljava/lang/Object;)Lrx/subjects/BehaviorSubject;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Lcom/discord/stores/StoreVideoStreams;->userStreamsSubject:Lrx/subjects/BehaviorSubject;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final updateUserStream(JLjava/lang/Integer;Ljava/lang/Integer;)V
|
|
.locals 2
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreVideoStreams;->userStreams:Ljava/util/HashMap;
|
|
|
|
invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/discord/stores/StoreVideoStreams$UserStreams;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
new-instance v0, Lcom/discord/stores/StoreVideoStreams$UserStreams;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-direct {v0, v1, v1}, Lcom/discord/stores/StoreVideoStreams$UserStreams;-><init>(Ljava/lang/Integer;Ljava/lang/Integer;)V
|
|
|
|
:goto_0
|
|
const-string v1, "userStreams[userId] ?: U\u2026plicationStreamId = null)"
|
|
|
|
invoke-static {v0, v1}, Lw/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
if-eqz p3, :cond_1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreVideoStreams$UserStreams;->getCallStreamId()Ljava/lang/Integer;
|
|
|
|
move-result-object p3
|
|
|
|
:goto_1
|
|
if-eqz p4, :cond_2
|
|
|
|
goto :goto_2
|
|
|
|
:cond_2
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreVideoStreams$UserStreams;->getApplicationStreamId()Ljava/lang/Integer;
|
|
|
|
move-result-object p4
|
|
|
|
:goto_2
|
|
invoke-virtual {v0, p3, p4}, Lcom/discord/stores/StoreVideoStreams$UserStreams;->copy(Ljava/lang/Integer;Ljava/lang/Integer;)Lcom/discord/stores/StoreVideoStreams$UserStreams;
|
|
|
|
move-result-object p3
|
|
|
|
invoke-virtual {p3}, Lcom/discord/stores/StoreVideoStreams$UserStreams;->isEmpty()Z
|
|
|
|
move-result p4
|
|
|
|
if-nez p4, :cond_3
|
|
|
|
iget-object p4, p0, Lcom/discord/stores/StoreVideoStreams;->userStreams:Ljava/util/HashMap;
|
|
|
|
invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-interface {p4, p1, p3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
goto :goto_3
|
|
|
|
:cond_3
|
|
iget-object p3, p0, Lcom/discord/stores/StoreVideoStreams;->userStreams:Ljava/util/HashMap;
|
|
|
|
invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p3, p1}, Ljava/util/HashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
:goto_3
|
|
const/4 p1, 0x1
|
|
|
|
iput-boolean p1, p0, Lcom/discord/stores/StoreVideoStreams;->isDirty:Z
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static synthetic updateUserStream$default(Lcom/discord/stores/StoreVideoStreams;JLjava/lang/Integer;Ljava/lang/Integer;ILjava/lang/Object;)V
|
|
.locals 1
|
|
|
|
and-int/lit8 p6, p5, 0x2
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p6, :cond_0
|
|
|
|
move-object p3, v0
|
|
|
|
:cond_0
|
|
and-int/lit8 p5, p5, 0x4
|
|
|
|
if-eqz p5, :cond_1
|
|
|
|
move-object p4, v0
|
|
|
|
:cond_1
|
|
invoke-direct {p0, p1, p2, p3, p4}, Lcom/discord/stores/StoreVideoStreams;->updateUserStream(JLjava/lang/Integer;Ljava/lang/Integer;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final getUserStreams()Lrx/Observable;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Lrx/Observable<",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/Long;",
|
|
"Lcom/discord/stores/StoreVideoStreams$UserStreams;",
|
|
">;>;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreVideoStreams;->userStreamsSubject:Lrx/subjects/BehaviorSubject;
|
|
|
|
const-string v1, "userStreamsSubject"
|
|
|
|
invoke-static {v0, v1}, Lw/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final handleApplicationStreamUpdate(JLjava/lang/Integer;)V
|
|
.locals 7
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v5, 0x2
|
|
|
|
const/4 v6, 0x0
|
|
|
|
move-object v0, p0
|
|
|
|
move-wide v1, p1
|
|
|
|
move-object v4, p3
|
|
|
|
invoke-static/range {v0 .. v6}, Lcom/discord/stores/StoreVideoStreams;->updateUserStream$default(Lcom/discord/stores/StoreVideoStreams;JLjava/lang/Integer;Ljava/lang/Integer;ILjava/lang/Object;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final handleVideoStreamUpdate(JLjava/lang/Integer;)V
|
|
.locals 7
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x4
|
|
|
|
const/4 v6, 0x0
|
|
|
|
move-object v0, p0
|
|
|
|
move-wide v1, p1
|
|
|
|
move-object v3, p3
|
|
|
|
invoke-static/range {v0 .. v6}, Lcom/discord/stores/StoreVideoStreams;->updateUserStream$default(Lcom/discord/stores/StoreVideoStreams;JLjava/lang/Integer;Ljava/lang/Integer;ILjava/lang/Object;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final handleVoiceStateUpdates(Lcom/discord/models/domain/ModelVoice$State;)V
|
|
.locals 3
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelVoice$State;->isRemoveSignal()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreVideoStreams;->userStreams:Ljava/util/HashMap;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelVoice$State;->getUserId()J
|
|
|
|
move-result-wide v1
|
|
|
|
invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v0, p1}, Ljava/util/HashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
if-nez p1, :cond_1
|
|
|
|
iget-boolean p1, p0, Lcom/discord/stores/StoreVideoStreams;->isDirty:Z
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p1, 0x0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
:goto_0
|
|
const/4 p1, 0x1
|
|
|
|
:goto_1
|
|
iput-boolean p1, p0, Lcom/discord/stores/StoreVideoStreams;->isDirty:Z
|
|
|
|
:cond_2
|
|
return-void
|
|
|
|
:cond_3
|
|
const-string p1, "voiceState"
|
|
|
|
invoke-static {p1}, Lw/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public onDispatchEnded()V
|
|
.locals 3
|
|
.annotation runtime Lcom/discord/stores/StoreThread;
|
|
.end annotation
|
|
|
|
iget-boolean v0, p0, Lcom/discord/stores/StoreVideoStreams;->isDirty:Z
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Lcom/discord/stores/StoreVideoStreams;->userStreamsSubject:Lrx/subjects/BehaviorSubject;
|
|
|
|
new-instance v1, Ljava/util/HashMap;
|
|
|
|
iget-object v2, p0, Lcom/discord/stores/StoreVideoStreams;->userStreams:Ljava/util/HashMap;
|
|
|
|
invoke-direct {v1, v2}, Ljava/util/HashMap;-><init>(Ljava/util/Map;)V
|
|
|
|
invoke-virtual {v0, v1}, Lrx/subjects/BehaviorSubject;->onNext(Ljava/lang/Object;)V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
iput-boolean v0, p0, Lcom/discord/stores/StoreVideoStreams;->isDirty:Z
|
|
|
|
return-void
|
|
.end method
|