apkfuckery/com.discord/smali/com/discord/widgets/user/usersheet/WidgetUserSheetViewModel.smali
2019-10-18 01:49:31 +02:00

2188 lines
66 KiB
Smali

.class public final Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;
.super Lcom/discord/app/k;
.source "WidgetUserSheetViewModel.kt"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState;,
Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$Event;,
Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$StoreState;,
Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$Companion;
}
.end annotation
# static fields
.field public static final Companion:Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$Companion;
.field public static final LOCATION:Ljava/lang/String; = "User Profile"
# instance fields
.field private final channelId:J
.field private final eventSubject:Lrx/subjects/PublishSubject;
.annotation system Ldalvik/annotation/Signature;
value = {
"Lrx/subjects/PublishSubject<",
"Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$Event;",
">;"
}
.end annotation
.end field
.field private final isVoiceContext:Z
.field private final restAPI:Lcom/discord/utilities/rest/RestAPI;
.field private final storeChannels:Lcom/discord/stores/StoreChannels;
.field private final storeMediaSettings:Lcom/discord/stores/StoreMediaSettings;
.field private final storeStateObservable:Lrx/Observable;
.annotation system Ldalvik/annotation/Signature;
value = {
"Lrx/Observable<",
"Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$StoreState;",
">;"
}
.end annotation
.end field
.field private final userId:J
.field private final viewStateSubject:Lrx/subjects/BehaviorSubject;
.annotation system Ldalvik/annotation/Signature;
value = {
"Lrx/subjects/BehaviorSubject<",
"Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState;",
">;"
}
.end annotation
.end field
# direct methods
.method static constructor <clinit>()V
.locals 2
new-instance v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$Companion;
const/4 v1, 0x0
invoke-direct {v0, v1}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$Companion;-><init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
sput-object v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->Companion:Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$Companion;
return-void
.end method
.method public constructor <init>(JJZLcom/discord/stores/StoreMediaSettings;Lcom/discord/stores/StoreChannels;Lcom/discord/utilities/rest/RestAPI;Lrx/Observable;)V
.locals 10
.annotation system Ldalvik/annotation/Signature;
value = {
"(JJZ",
"Lcom/discord/stores/StoreMediaSettings;",
"Lcom/discord/stores/StoreChannels;",
"Lcom/discord/utilities/rest/RestAPI;",
"Lrx/Observable<",
"Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$StoreState;",
">;)V"
}
.end annotation
move-object v0, p0
move-object/from16 v1, p6
move-object/from16 v2, p7
move-object/from16 v3, p8
move-object/from16 v4, p9
const-string v5, "storeMediaSettings"
invoke-static {v1, v5}, Lkotlin/jvm/internal/l;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
const-string v5, "storeChannels"
invoke-static {v2, v5}, Lkotlin/jvm/internal/l;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
const-string v5, "restAPI"
invoke-static {v3, v5}, Lkotlin/jvm/internal/l;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
const-string v5, "storeStateObservable"
invoke-static {v4, v5}, Lkotlin/jvm/internal/l;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
invoke-direct {p0}, Lcom/discord/app/k;-><init>()V
move-wide v5, p1
iput-wide v5, v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->userId:J
move-wide v5, p3
iput-wide v5, v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->channelId:J
move v5, p5
iput-boolean v5, v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->isVoiceContext:Z
iput-object v1, v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->storeMediaSettings:Lcom/discord/stores/StoreMediaSettings;
iput-object v2, v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->storeChannels:Lcom/discord/stores/StoreChannels;
iput-object v3, v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->restAPI:Lcom/discord/utilities/rest/RestAPI;
iput-object v4, v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->storeStateObservable:Lrx/Observable;
sget-object v1, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Uninitialized;->INSTANCE:Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Uninitialized;
invoke-static {v1}, Lrx/subjects/BehaviorSubject;->bD(Ljava/lang/Object;)Lrx/subjects/BehaviorSubject;
move-result-object v1
iput-object v1, v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->viewStateSubject:Lrx/subjects/BehaviorSubject;
invoke-static {}, Lrx/subjects/PublishSubject;->Kx()Lrx/subjects/PublishSubject;
move-result-object v1
iput-object v1, v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->eventSubject:Lrx/subjects/PublishSubject;
iget-object v1, v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->storeStateObservable:Lrx/Observable;
invoke-static {v1}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->computationLatest(Lrx/Observable;)Lrx/Observable;
move-result-object v1
invoke-static {}, Lrx/internal/a/ae;->Jl()Lrx/internal/a/ae;
move-result-object v2
invoke-virtual {v1, v2}, Lrx/Observable;->a(Lrx/Observable$b;)Lrx/Observable;
move-result-object v1
const-string v2, "storeStateObservable\n \u2026 .distinctUntilChanged()"
invoke-static {v1, v2}, Lkotlin/jvm/internal/l;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
move-object v2, v0
check-cast v2, Lcom/discord/app/AppComponent;
const/4 v3, 0x0
const/4 v4, 0x2
invoke-static {v1, v2, v3, v4, v3}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->ui$default(Lrx/Observable;Lcom/discord/app/AppComponent;Lcom/discord/utilities/mg_recycler/MGRecyclerAdapterSimple;ILjava/lang/Object;)Lrx/Observable;
move-result-object v1
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
move-result-object v2
new-instance v3, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$1;
move-object v4, v0
check-cast v4, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;
invoke-direct {v3, v4}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$1;-><init>(Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;)V
check-cast v3, Lkotlin/jvm/functions/Function1;
const/4 v4, 0x0
const/4 v5, 0x0
const/4 v6, 0x0
const/4 v7, 0x0
const/16 v8, 0x1e
const/4 v9, 0x0
move-object p1, v1
move-object p2, v2
move-object p3, v4
move-object p4, v5
move-object p5, v6
move-object/from16 p6, v7
move-object/from16 p7, v3
move/from16 p8, v8
move-object/from16 p9, v9
invoke-static/range {p1 .. p9}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->appSubscribe$default(Lrx/Observable;Ljava/lang/Class;Landroid/content/Context;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
return-void
.end method
.method public static final synthetic access$emitDismissSheetEvent(Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;)V
.locals 0
invoke-direct {p0}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->emitDismissSheetEvent()V
return-void
.end method
.method public static final synthetic access$emitLaunchVideoCallEvent(Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;J)V
.locals 0
invoke-direct {p0, p1, p2}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->emitLaunchVideoCallEvent(J)V
return-void
.end method
.method public static final synthetic access$emitLaunchVoiceCallEvent(Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;J)V
.locals 0
invoke-direct {p0, p1, p2}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->emitLaunchVoiceCallEvent(J)V
return-void
.end method
.method public static final synthetic access$emitShowToastEvent(Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;I)V
.locals 0
invoke-direct {p0, p1}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->emitShowToastEvent(I)V
return-void
.end method
.method public static final synthetic access$handleStoreState(Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$StoreState;)V
.locals 0
invoke-direct {p0, p1}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->handleStoreState(Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$StoreState;)V
return-void
.end method
.method private final createAdminViewState(Lcom/discord/models/domain/ModelChannel;ZZLcom/discord/utilities/permissions/ManageUserContext;Lcom/discord/models/domain/ModelVoice$State;)Lcom/discord/widgets/user/profile/UserProfileAdminView$ViewState;
.locals 15
const/4 v0, 0x0
const/4 v1, 0x1
if-eqz p4, :cond_1
invoke-virtual/range {p4 .. p4}, Lcom/discord/utilities/permissions/ManageUserContext;->getCanChangeNickname()Z
move-result v2
if-nez v2, :cond_0
invoke-virtual/range {p4 .. p4}, Lcom/discord/utilities/permissions/ManageUserContext;->getCanManageRoles()Z
move-result v2
if-eqz v2, :cond_1
:cond_0
const/4 v4, 0x1
goto :goto_0
:cond_1
const/4 v4, 0x0
:goto_0
invoke-virtual/range {p1 .. p1}, Lcom/discord/models/domain/ModelChannel;->isMultiUserDM()Z
move-result v2
if-eqz v2, :cond_3
invoke-virtual/range {p1 .. p1}, Lcom/discord/models/domain/ModelChannel;->isManaged()Z
move-result v2
if-nez v2, :cond_2
if-eqz p2, :cond_2
if-nez p3, :cond_2
goto :goto_1
:cond_2
const/4 v5, 0x0
goto :goto_2
:cond_3
if-eqz p4, :cond_2
invoke-virtual/range {p4 .. p4}, Lcom/discord/utilities/permissions/ManageUserContext;->getCanKick()Z
move-result v2
if-ne v2, v1, :cond_2
:goto_1
const/4 v5, 0x1
:goto_2
invoke-virtual/range {p1 .. p1}, Lcom/discord/models/domain/ModelChannel;->isMultiUserDM()Z
move-result v6
if-eqz p4, :cond_4
invoke-virtual/range {p4 .. p4}, Lcom/discord/utilities/permissions/ManageUserContext;->getCanBan()Z
move-result v2
if-ne v2, v1, :cond_4
const/4 v7, 0x1
goto :goto_3
:cond_4
const/4 v7, 0x0
:goto_3
if-eqz p5, :cond_5
if-eqz p4, :cond_5
invoke-virtual/range {p4 .. p4}, Lcom/discord/utilities/permissions/ManageUserContext;->getCanMute()Z
move-result v2
if-ne v2, v1, :cond_5
const/4 v8, 0x1
goto :goto_4
:cond_5
const/4 v8, 0x0
:goto_4
if-eqz p5, :cond_6
invoke-virtual/range {p5 .. p5}, Lcom/discord/models/domain/ModelVoice$State;->isMute()Z
move-result v2
if-ne v2, v1, :cond_6
const/4 v9, 0x1
goto :goto_5
:cond_6
const/4 v9, 0x0
:goto_5
if-eqz p5, :cond_7
if-eqz p4, :cond_7
invoke-virtual/range {p4 .. p4}, Lcom/discord/utilities/permissions/ManageUserContext;->getCanDeafen()Z
move-result v2
if-ne v2, v1, :cond_7
const/4 v10, 0x1
goto :goto_6
:cond_7
const/4 v10, 0x0
:goto_6
if-eqz p5, :cond_8
invoke-virtual/range {p5 .. p5}, Lcom/discord/models/domain/ModelVoice$State;->isDeaf()Z
move-result v2
if-ne v2, v1, :cond_8
const/4 v11, 0x1
goto :goto_7
:cond_8
const/4 v11, 0x0
:goto_7
if-eqz p5, :cond_9
if-eqz p4, :cond_9
invoke-virtual/range {p4 .. p4}, Lcom/discord/utilities/permissions/ManageUserContext;->getCanMove()Z
move-result v2
if-ne v2, v1, :cond_9
const/4 v12, 0x1
goto :goto_8
:cond_9
const/4 v12, 0x0
:goto_8
const/4 v2, 0x6
new-array v3, v2, [Ljava/lang/Boolean;
invoke-static {v4}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
move-result-object v13
aput-object v13, v3, v0
invoke-static {v5}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
move-result-object v13
aput-object v13, v3, v1
const/4 v13, 0x2
invoke-static {v7}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
move-result-object v14
aput-object v14, v3, v13
const/4 v13, 0x3
invoke-static {v8}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
move-result-object v14
aput-object v14, v3, v13
const/4 v13, 0x4
invoke-static {v10}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
move-result-object v14
aput-object v14, v3, v13
const/4 v13, 0x5
invoke-static {v12}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
move-result-object v14
aput-object v14, v3, v13
const/4 v13, 0x0
:goto_9
if-ge v13, v2, :cond_b
aget-object v14, v3, v13
invoke-virtual {v14}, Ljava/lang/Boolean;->booleanValue()Z
move-result v14
if-eqz v14, :cond_a
const/4 v13, 0x1
goto :goto_a
:cond_a
add-int/lit8 v13, v13, 0x1
goto :goto_9
:cond_b
const/4 v13, 0x0
:goto_a
new-instance v0, Lcom/discord/widgets/user/profile/UserProfileAdminView$ViewState;
move-object v3, v0
invoke-direct/range {v3 .. v13}, Lcom/discord/widgets/user/profile/UserProfileAdminView$ViewState;-><init>(ZZZZZZZZZZ)V
return-object v0
.end method
.method private final createPrivateChannelWithUser(J)Lrx/Observable;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(J)",
"Lrx/Observable<",
"Ljava/lang/Long;",
">;"
}
.end annotation
iget-object v0, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->storeChannels:Lcom/discord/stores/StoreChannels;
invoke-virtual {v0, p1, p2}, Lcom/discord/stores/StoreChannels;->createPrivateChannel(J)Lrx/Observable;
move-result-object p1
return-object p1
.end method
.method private final emitDismissSheetEvent()V
.locals 2
iget-object v0, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->eventSubject:Lrx/subjects/PublishSubject;
sget-object v1, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$Event$DismissSheet;->INSTANCE:Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$Event$DismissSheet;
invoke-virtual {v0, v1}, Lrx/subjects/PublishSubject;->onNext(Ljava/lang/Object;)V
return-void
.end method
.method private final emitLaunchVideoCallEvent(J)V
.locals 2
iget-object v0, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->eventSubject:Lrx/subjects/PublishSubject;
new-instance v1, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$Event$LaunchVideoCall;
invoke-direct {v1, p1, p2}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$Event$LaunchVideoCall;-><init>(J)V
invoke-virtual {v0, v1}, Lrx/subjects/PublishSubject;->onNext(Ljava/lang/Object;)V
return-void
.end method
.method private final emitLaunchVoiceCallEvent(J)V
.locals 2
iget-object v0, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->eventSubject:Lrx/subjects/PublishSubject;
new-instance v1, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$Event$LaunchVoiceCall;
invoke-direct {v1, p1, p2}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$Event$LaunchVoiceCall;-><init>(J)V
invoke-virtual {v0, v1}, Lrx/subjects/PublishSubject;->onNext(Ljava/lang/Object;)V
return-void
.end method
.method private final emitShowToastEvent(I)V
.locals 2
iget-object v0, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->eventSubject:Lrx/subjects/PublishSubject;
new-instance v1, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$Event$ShowToast;
invoke-direct {v1, p1}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$Event$ShowToast;-><init>(I)V
invoke-virtual {v0, v1}, Lrx/subjects/PublishSubject;->onNext(Ljava/lang/Object;)V
return-void
.end method
.method private final handleStoreState(Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$StoreState;)V
.locals 24
move-object/from16 v6, p0
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$StoreState;->getUser()Lcom/discord/models/domain/ModelUser;
move-result-object v15
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$StoreState;->getMe()Lcom/discord/models/domain/ModelUser;
move-result-object v0
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$StoreState;->getChannel()Lcom/discord/models/domain/ModelChannel;
move-result-object v17
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$StoreState;->getComputedMembers()Ljava/util/Map;
move-result-object v1
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$StoreState;->getGuildRoles()Ljava/util/Map;
move-result-object v14
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$StoreState;->getGuild()Lcom/discord/models/domain/ModelGuild;
move-result-object v16
invoke-virtual {v0}, Lcom/discord/models/domain/ModelUser;->getId()J
move-result-wide v2
invoke-virtual {v15}, Lcom/discord/models/domain/ModelUser;->getId()J
move-result-wide v4
const/16 v18, 0x1
const/16 v19, 0x0
cmp-long v7, v2, v4
if-nez v7, :cond_0
const/16 v20, 0x1
goto :goto_0
:cond_0
const/16 v20, 0x0
:goto_0
invoke-virtual {v15}, Lcom/discord/models/domain/ModelUser;->getId()J
move-result-wide v2
invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
move-result-object v2
invoke-interface {v1, v2}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v2
check-cast v2, Lcom/discord/models/domain/ModelGuildMember$Computed;
invoke-virtual {v0}, Lcom/discord/models/domain/ModelUser;->getId()J
move-result-wide v3
invoke-static {v3, v4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
move-result-object v3
invoke-interface {v1, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v1
check-cast v1, Lcom/discord/models/domain/ModelGuildMember$Computed;
if-eqz v2, :cond_3
invoke-virtual {v2}, Lcom/discord/models/domain/ModelGuildMember$Computed;->getRoles()Ljava/util/List;
move-result-object v3
if-eqz v3, :cond_3
check-cast v3, Ljava/lang/Iterable;
new-instance v4, Ljava/util/ArrayList;
invoke-direct {v4}, Ljava/util/ArrayList;-><init>()V
check-cast v4, Ljava/util/Collection;
invoke-interface {v3}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
move-result-object v3
:cond_1
:goto_1
invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z
move-result v5
if-eqz v5, :cond_2
invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v5
check-cast v5, Ljava/lang/Long;
invoke-interface {v14, v5}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v5
check-cast v5, Lcom/discord/models/domain/ModelGuildRole;
if-eqz v5, :cond_1
invoke-interface {v4, v5}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
goto :goto_1
:cond_2
check-cast v4, Ljava/util/List;
check-cast v4, Ljava/lang/Iterable;
invoke-static {v4}, Lkotlin/a/m;->sorted(Ljava/lang/Iterable;)Ljava/util/List;
move-result-object v3
if-nez v3, :cond_4
:cond_3
invoke-static {}, Lkotlin/a/m;->emptyList()Ljava/util/List;
move-result-object v3
:cond_4
move-object/from16 v21, v3
const/16 v22, 0x0
if-eqz v2, :cond_6
if-eqz v1, :cond_6
if-nez v16, :cond_5
goto :goto_2
:cond_5
sget-object v7, Lcom/discord/utilities/permissions/ManageUserContext;->Companion:Lcom/discord/utilities/permissions/ManageUserContext$Companion;
invoke-virtual {v1}, Lcom/discord/models/domain/ModelGuildMember$Computed;->getRoles()Ljava/util/List;
move-result-object v1
const-string v3, "memberMe.roles"
invoke-static {v1, v3}, Lkotlin/jvm/internal/l;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
move-object v11, v1
check-cast v11, Ljava/util/Collection;
invoke-virtual {v2}, Lcom/discord/models/domain/ModelGuildMember$Computed;->getRoles()Ljava/util/List;
move-result-object v1
const-string v2, "member.roles"
invoke-static {v1, v2}, Lkotlin/jvm/internal/l;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
move-object v12, v1
check-cast v12, Ljava/util/Collection;
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$StoreState;->getPermissions()Ljava/lang/Integer;
move-result-object v13
move-object/from16 v8, v16
move-object v9, v0
move-object v10, v15
invoke-virtual/range {v7 .. v14}, Lcom/discord/utilities/permissions/ManageUserContext$Companion;->from(Lcom/discord/models/domain/ModelGuild;Lcom/discord/models/domain/ModelUser;Lcom/discord/models/domain/ModelUser;Ljava/util/Collection;Ljava/util/Collection;Ljava/lang/Integer;Ljava/util/Map;)Lcom/discord/utilities/permissions/ManageUserContext;
move-result-object v1
move-object v4, v1
goto :goto_3
:cond_6
:goto_2
move-object/from16 v4, v22
:goto_3
invoke-virtual/range {v17 .. v17}, Lcom/discord/models/domain/ModelChannel;->getOwnerId()J
move-result-wide v1
invoke-virtual {v0}, Lcom/discord/models/domain/ModelUser;->getId()J
move-result-wide v7
cmp-long v3, v1, v7
if-nez v3, :cond_7
const/4 v2, 0x1
goto :goto_4
:cond_7
const/4 v2, 0x0
:goto_4
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$StoreState;->getUserRelationshipType()Ljava/lang/Integer;
move-result-object v1
invoke-static {v1}, Lcom/discord/models/domain/ModelUserRelationship;->getType(Ljava/lang/Integer;)I
move-result v23
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$StoreState;->getMySelectedVoiceChannelVoiceStates()Ljava/util/Map;
move-result-object v1
invoke-virtual {v15}, Lcom/discord/models/domain/ModelUser;->getId()J
move-result-wide v7
invoke-static {v7, v8}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
move-result-object v3
invoke-interface {v1, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v1
check-cast v1, Lcom/discord/models/domain/ModelVoice$State;
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$StoreState;->getMySelectedVoiceChannelVoiceStates()Ljava/util/Map;
move-result-object v3
invoke-virtual {v0}, Lcom/discord/models/domain/ModelUser;->getId()J
move-result-wide v7
invoke-static {v7, v8}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
move-result-object v0
invoke-interface {v3, v0}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Lcom/discord/models/domain/ModelVoice$State;
if-nez v20, :cond_9
iget-boolean v3, v6, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->isVoiceContext:Z
if-nez v3, :cond_8
invoke-direct {v6, v0, v1}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->isInSameVoiceChannel(Lcom/discord/models/domain/ModelVoice$State;Lcom/discord/models/domain/ModelVoice$State;)Z
move-result v0
if-eqz v0, :cond_9
:cond_8
const/4 v10, 0x1
goto :goto_5
:cond_9
const/4 v10, 0x0
:goto_5
new-instance v11, Lcom/discord/widgets/user/usersheet/UserProfileVoiceSettingsView$ViewState;
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$StoreState;->getMuted()Z
move-result v0
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$StoreState;->getOutputVolume()I
move-result v1
invoke-direct {v11, v0, v1}, Lcom/discord/widgets/user/usersheet/UserProfileVoiceSettingsView$ViewState;-><init>(ZI)V
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$StoreState;->getCurrentChannelVoiceStates()Ljava/util/Map;
move-result-object v0
invoke-virtual {v15}, Lcom/discord/models/domain/ModelUser;->getId()J
move-result-wide v7
invoke-static {v7, v8}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
move-result-object v1
invoke-interface {v0, v1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
move-object v12, v0
check-cast v12, Lcom/discord/models/domain/ModelVoice$State;
invoke-virtual/range {v17 .. v17}, Lcom/discord/models/domain/ModelChannel;->isMultiUserDM()Z
move-result v0
if-eqz v0, :cond_a
invoke-virtual/range {v17 .. v17}, Lcom/discord/models/domain/ModelChannel;->getName()Ljava/lang/String;
move-result-object v0
:goto_6
move-object v14, v0
goto :goto_7
:cond_a
if-eqz v16, :cond_b
invoke-virtual/range {v16 .. v16}, Lcom/discord/models/domain/ModelGuild;->getName()Ljava/lang/String;
move-result-object v0
goto :goto_6
:cond_b
move-object/from16 v14, v22
:goto_7
move-object/from16 v0, p0
move-object/from16 v1, v17
move/from16 v3, v20
move-object v5, v12
invoke-direct/range {v0 .. v5}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->createAdminViewState(Lcom/discord/models/domain/ModelChannel;ZZLcom/discord/utilities/permissions/ManageUserContext;Lcom/discord/models/domain/ModelVoice$State;)Lcom/discord/widgets/user/profile/UserProfileAdminView$ViewState;
move-result-object v0
new-instance v1, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Loaded;
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$StoreState;->getRichPresence()Lcom/discord/widgets/user/presence/ModelRichPresence;
move-result-object v13
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$StoreState;->getStreamContext()Lcom/discord/utilities/streams/StreamContext;
move-result-object v18
if-eqz v16, :cond_c
invoke-virtual/range {v16 .. v16}, Lcom/discord/models/domain/ModelGuild;->getName()Ljava/lang/String;
move-result-object v2
move-object/from16 v19, v2
goto :goto_8
:cond_c
move-object/from16 v19, v22
:goto_8
move-object v7, v1
move-object v8, v15
move/from16 v9, v20
move-object/from16 v15, v21
move-object/from16 v16, v0
move/from16 v20, v23
invoke-direct/range {v7 .. v20}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Loaded;-><init>(Lcom/discord/models/domain/ModelUser;ZZLcom/discord/widgets/user/usersheet/UserProfileVoiceSettingsView$ViewState;Lcom/discord/models/domain/ModelVoice$State;Lcom/discord/widgets/user/presence/ModelRichPresence;Ljava/lang/String;Ljava/util/List;Lcom/discord/widgets/user/profile/UserProfileAdminView$ViewState;Lcom/discord/models/domain/ModelChannel;Lcom/discord/utilities/streams/StreamContext;Ljava/lang/String;I)V
iget-object v0, v6, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->viewStateSubject:Lrx/subjects/BehaviorSubject;
invoke-virtual {v0, v1}, Lrx/subjects/BehaviorSubject;->onNext(Ljava/lang/Object;)V
return-void
.end method
.method private final isInSameVoiceChannel(Lcom/discord/models/domain/ModelVoice$State;Lcom/discord/models/domain/ModelVoice$State;)Z
.locals 1
const/4 v0, 0x0
if-eqz p2, :cond_0
invoke-virtual {p2}, Lcom/discord/models/domain/ModelVoice$State;->getChannelId()Ljava/lang/Long;
move-result-object p2
goto :goto_0
:cond_0
move-object p2, v0
:goto_0
if-eqz p1, :cond_1
invoke-virtual {p1}, Lcom/discord/models/domain/ModelVoice$State;->getChannelId()Ljava/lang/Long;
move-result-object v0
:cond_1
if-eqz p2, :cond_3
if-nez v0, :cond_2
goto :goto_1
:cond_2
invoke-static {p2, v0}, Lkotlin/jvm/internal/l;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
move-result p1
return p1
:cond_3
:goto_1
const/4 p1, 0x0
return p1
.end method
# virtual methods
.method public final addRelationship(Ljava/lang/Integer;I)V
.locals 12
iget-object v0, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->restAPI:Lcom/discord/utilities/rest/RestAPI;
iget-wide v1, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->userId:J
const-string v3, "User Profile"
invoke-virtual {v0, v3, v1, v2, p1}, Lcom/discord/utilities/rest/RestAPI;->addRelationship(Ljava/lang/String;JLjava/lang/Integer;)Lrx/Observable;
move-result-object p1
const/4 v0, 0x0
const/4 v1, 0x0
const/4 v2, 0x1
invoke-static {p1, v1, v2, v0}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->restSubscribeOn$default(Lrx/Observable;ZILjava/lang/Object;)Lrx/Observable;
move-result-object p1
move-object v1, p0
check-cast v1, Lcom/discord/app/AppComponent;
const/4 v2, 0x2
invoke-static {p1, v1, v0, v2, v0}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->ui$default(Lrx/Observable;Lcom/discord/app/AppComponent;Lcom/discord/utilities/mg_recycler/MGRecyclerAdapterSimple;ILjava/lang/Object;)Lrx/Observable;
move-result-object v3
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
move-result-object v4
new-instance p1, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$addRelationship$1;
invoke-direct {p1, p0, p2}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$addRelationship$1;-><init>(Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;I)V
move-object v9, p1
check-cast v9, Lkotlin/jvm/functions/Function1;
new-instance p1, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$addRelationship$2;
invoke-direct {p1, p0}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$addRelationship$2;-><init>(Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;)V
move-object v7, p1
check-cast v7, Lkotlin/jvm/functions/Function1;
const/4 v5, 0x0
const/4 v6, 0x0
const/4 v8, 0x0
const/16 v10, 0x16
const/4 v11, 0x0
invoke-static/range {v3 .. v11}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->appSubscribe$default(Lrx/Observable;Ljava/lang/Class;Landroid/content/Context;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
return-void
.end method
.method public final banUser()V
.locals 10
iget-object v0, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->viewStateSubject:Lrx/subjects/BehaviorSubject;
const-string v1, "viewStateSubject"
invoke-static {v0, v1}, Lkotlin/jvm/internal/l;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
invoke-virtual {v0}, Lrx/subjects/BehaviorSubject;->getValue()Ljava/lang/Object;
move-result-object v0
instance-of v1, v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Loaded;
if-nez v1, :cond_0
const/4 v0, 0x0
:cond_0
check-cast v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Loaded;
if-nez v0, :cond_1
return-void
:cond_1
invoke-virtual {v0}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Loaded;->getChannel()Lcom/discord/models/domain/ModelChannel;
move-result-object v1
invoke-virtual {v0}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Loaded;->getUser()Lcom/discord/models/domain/ModelUser;
move-result-object v0
iget-object v2, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->eventSubject:Lrx/subjects/PublishSubject;
new-instance v9, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$Event$LaunchBanUser;
invoke-virtual {v0}, Lcom/discord/models/domain/ModelUser;->getUsername()Ljava/lang/String;
move-result-object v4
const-string v3, "user.username"
invoke-static {v4, v3}, Lkotlin/jvm/internal/l;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
invoke-virtual {v1}, Lcom/discord/models/domain/ModelChannel;->getGuildId()Ljava/lang/Long;
move-result-object v1
const-string v3, "channel.guildId"
invoke-static {v1, v3}, Lkotlin/jvm/internal/l;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
invoke-virtual {v1}, Ljava/lang/Long;->longValue()J
move-result-wide v5
invoke-virtual {v0}, Lcom/discord/models/domain/ModelUser;->getId()J
move-result-wide v7
move-object v3, v9
invoke-direct/range {v3 .. v8}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$Event$LaunchBanUser;-><init>(Ljava/lang/String;JJ)V
invoke-virtual {v2, v9}, Lrx/subjects/PublishSubject;->onNext(Ljava/lang/Object;)V
return-void
.end method
.method public final editMember()V
.locals 7
iget-object v0, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->viewStateSubject:Lrx/subjects/BehaviorSubject;
const-string v1, "viewStateSubject"
invoke-static {v0, v1}, Lkotlin/jvm/internal/l;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
invoke-virtual {v0}, Lrx/subjects/BehaviorSubject;->getValue()Ljava/lang/Object;
move-result-object v0
instance-of v1, v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Loaded;
if-nez v1, :cond_0
const/4 v0, 0x0
:cond_0
check-cast v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Loaded;
if-nez v0, :cond_1
return-void
:cond_1
iget-object v1, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->eventSubject:Lrx/subjects/PublishSubject;
new-instance v2, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$Event$LaunchEditMember;
invoke-virtual {v0}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Loaded;->getChannel()Lcom/discord/models/domain/ModelChannel;
move-result-object v0
invoke-virtual {v0}, Lcom/discord/models/domain/ModelChannel;->getGuildId()Ljava/lang/Long;
move-result-object v0
const-string v3, "viewState.channel.guildId"
invoke-static {v0, v3}, Lkotlin/jvm/internal/l;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
invoke-virtual {v0}, Ljava/lang/Long;->longValue()J
move-result-wide v3
iget-wide v5, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->userId:J
invoke-direct {v2, v3, v4, v5, v6}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$Event$LaunchEditMember;-><init>(JJ)V
invoke-virtual {v1, v2}, Lrx/subjects/PublishSubject;->onNext(Ljava/lang/Object;)V
return-void
.end method
.method public final getChannelId()J
.locals 2
iget-wide v0, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->channelId:J
return-wide v0
.end method
.method public final getRestAPI()Lcom/discord/utilities/rest/RestAPI;
.locals 1
iget-object v0, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->restAPI:Lcom/discord/utilities/rest/RestAPI;
return-object v0
.end method
.method public final getStoreChannels()Lcom/discord/stores/StoreChannels;
.locals 1
iget-object v0, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->storeChannels:Lcom/discord/stores/StoreChannels;
return-object v0
.end method
.method public final getStoreMediaSettings()Lcom/discord/stores/StoreMediaSettings;
.locals 1
iget-object v0, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->storeMediaSettings:Lcom/discord/stores/StoreMediaSettings;
return-object v0
.end method
.method public final getStoreStateObservable()Lrx/Observable;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Lrx/Observable<",
"Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$StoreState;",
">;"
}
.end annotation
iget-object v0, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->storeStateObservable:Lrx/Observable;
return-object v0
.end method
.method public final getUserId()J
.locals 2
iget-wide v0, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->userId:J
return-wide v0
.end method
.method public final guildDeafenUser()V
.locals 13
iget-object v0, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->viewStateSubject:Lrx/subjects/BehaviorSubject;
const-string v1, "viewStateSubject"
invoke-static {v0, v1}, Lkotlin/jvm/internal/l;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
invoke-virtual {v0}, Lrx/subjects/BehaviorSubject;->getValue()Ljava/lang/Object;
move-result-object v0
instance-of v1, v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Loaded;
const/4 v2, 0x0
if-nez v1, :cond_0
move-object v0, v2
:cond_0
check-cast v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Loaded;
if-nez v0, :cond_1
return-void
:cond_1
invoke-virtual {v0}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Loaded;->getChannel()Lcom/discord/models/domain/ModelChannel;
move-result-object v1
invoke-virtual {v0}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Loaded;->getUser()Lcom/discord/models/domain/ModelUser;
move-result-object v3
invoke-virtual {v0}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Loaded;->getAdminViewState()Lcom/discord/widgets/user/profile/UserProfileAdminView$ViewState;
move-result-object v0
invoke-virtual {v0}, Lcom/discord/widgets/user/profile/UserProfileAdminView$ViewState;->isServerDeafened()Z
move-result v0
iget-object v4, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->restAPI:Lcom/discord/utilities/rest/RestAPI;
invoke-virtual {v1}, Lcom/discord/models/domain/ModelChannel;->getGuildId()Ljava/lang/Long;
move-result-object v1
const-string v5, "channel.guildId"
invoke-static {v1, v5}, Lkotlin/jvm/internal/l;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
invoke-virtual {v1}, Ljava/lang/Long;->longValue()J
move-result-wide v5
invoke-virtual {v3}, Lcom/discord/models/domain/ModelUser;->getId()J
move-result-wide v7
sget-object v1, Lcom/discord/restapi/RestAPIParams$GuildMember;->Companion:Lcom/discord/restapi/RestAPIParams$GuildMember$Companion;
const/4 v3, 0x1
xor-int/2addr v0, v3
invoke-virtual {v1, v0}, Lcom/discord/restapi/RestAPIParams$GuildMember$Companion;->createWithDeaf(Z)Lcom/discord/restapi/RestAPIParams$GuildMember;
move-result-object v9
invoke-virtual/range {v4 .. v9}, Lcom/discord/utilities/rest/RestAPI;->changeGuildMember(JJLcom/discord/restapi/RestAPIParams$GuildMember;)Lrx/Observable;
move-result-object v0
const/4 v1, 0x0
invoke-static {v0, v1, v3, v2}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->restSubscribeOn$default(Lrx/Observable;ZILjava/lang/Object;)Lrx/Observable;
move-result-object v0
move-object v1, p0
check-cast v1, Lcom/discord/app/AppComponent;
const/4 v3, 0x2
invoke-static {v0, v1, v2, v3, v2}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->ui$default(Lrx/Observable;Lcom/discord/app/AppComponent;Lcom/discord/utilities/mg_recycler/MGRecyclerAdapterSimple;ILjava/lang/Object;)Lrx/Observable;
move-result-object v4
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
move-result-object v5
const/4 v6, 0x0
const/4 v7, 0x0
sget-object v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$guildDeafenUser$1;->INSTANCE:Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$guildDeafenUser$1;
move-object v10, v0
check-cast v10, Lkotlin/jvm/functions/Function1;
new-instance v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$guildDeafenUser$2;
invoke-direct {v0, p0}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$guildDeafenUser$2;-><init>(Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;)V
move-object v8, v0
check-cast v8, Lkotlin/jvm/functions/Function1;
const/4 v9, 0x0
const/16 v11, 0x16
const/4 v12, 0x0
invoke-static/range {v4 .. v12}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->appSubscribe$default(Lrx/Observable;Ljava/lang/Class;Landroid/content/Context;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
return-void
.end method
.method public final guildMoveForUser()V
.locals 5
iget-object v0, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->viewStateSubject:Lrx/subjects/BehaviorSubject;
const-string v1, "viewStateSubject"
invoke-static {v0, v1}, Lkotlin/jvm/internal/l;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
invoke-virtual {v0}, Lrx/subjects/BehaviorSubject;->getValue()Ljava/lang/Object;
move-result-object v0
instance-of v1, v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Loaded;
if-nez v1, :cond_0
const/4 v0, 0x0
:cond_0
check-cast v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Loaded;
if-nez v0, :cond_1
return-void
:cond_1
invoke-virtual {v0}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Loaded;->getChannel()Lcom/discord/models/domain/ModelChannel;
move-result-object v0
iget-object v1, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->eventSubject:Lrx/subjects/PublishSubject;
new-instance v2, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$Event$LaunchMoveUser;
invoke-virtual {v0}, Lcom/discord/models/domain/ModelChannel;->getGuildId()Ljava/lang/Long;
move-result-object v0
const-string v3, "channel.guildId"
invoke-static {v0, v3}, Lkotlin/jvm/internal/l;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
invoke-virtual {v0}, Ljava/lang/Long;->longValue()J
move-result-wide v3
invoke-direct {v2, v3, v4}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$Event$LaunchMoveUser;-><init>(J)V
invoke-virtual {v1, v2}, Lrx/subjects/PublishSubject;->onNext(Ljava/lang/Object;)V
return-void
.end method
.method public final guildMuteUser()V
.locals 13
iget-object v0, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->viewStateSubject:Lrx/subjects/BehaviorSubject;
const-string v1, "viewStateSubject"
invoke-static {v0, v1}, Lkotlin/jvm/internal/l;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
invoke-virtual {v0}, Lrx/subjects/BehaviorSubject;->getValue()Ljava/lang/Object;
move-result-object v0
instance-of v1, v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Loaded;
const/4 v2, 0x0
if-nez v1, :cond_0
move-object v0, v2
:cond_0
check-cast v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Loaded;
if-nez v0, :cond_1
return-void
:cond_1
invoke-virtual {v0}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Loaded;->getChannel()Lcom/discord/models/domain/ModelChannel;
move-result-object v1
invoke-virtual {v0}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Loaded;->getUser()Lcom/discord/models/domain/ModelUser;
move-result-object v3
invoke-virtual {v0}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Loaded;->getAdminViewState()Lcom/discord/widgets/user/profile/UserProfileAdminView$ViewState;
move-result-object v0
invoke-virtual {v0}, Lcom/discord/widgets/user/profile/UserProfileAdminView$ViewState;->isServerMuted()Z
move-result v0
iget-object v4, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->restAPI:Lcom/discord/utilities/rest/RestAPI;
invoke-virtual {v1}, Lcom/discord/models/domain/ModelChannel;->getGuildId()Ljava/lang/Long;
move-result-object v1
const-string v5, "channel.guildId"
invoke-static {v1, v5}, Lkotlin/jvm/internal/l;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
invoke-virtual {v1}, Ljava/lang/Long;->longValue()J
move-result-wide v5
invoke-virtual {v3}, Lcom/discord/models/domain/ModelUser;->getId()J
move-result-wide v7
sget-object v1, Lcom/discord/restapi/RestAPIParams$GuildMember;->Companion:Lcom/discord/restapi/RestAPIParams$GuildMember$Companion;
const/4 v3, 0x1
xor-int/2addr v0, v3
invoke-virtual {v1, v0}, Lcom/discord/restapi/RestAPIParams$GuildMember$Companion;->createWithMute(Z)Lcom/discord/restapi/RestAPIParams$GuildMember;
move-result-object v9
invoke-virtual/range {v4 .. v9}, Lcom/discord/utilities/rest/RestAPI;->changeGuildMember(JJLcom/discord/restapi/RestAPIParams$GuildMember;)Lrx/Observable;
move-result-object v0
const/4 v1, 0x0
invoke-static {v0, v1, v3, v2}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->restSubscribeOn$default(Lrx/Observable;ZILjava/lang/Object;)Lrx/Observable;
move-result-object v0
move-object v1, p0
check-cast v1, Lcom/discord/app/AppComponent;
const/4 v3, 0x2
invoke-static {v0, v1, v2, v3, v2}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->ui$default(Lrx/Observable;Lcom/discord/app/AppComponent;Lcom/discord/utilities/mg_recycler/MGRecyclerAdapterSimple;ILjava/lang/Object;)Lrx/Observable;
move-result-object v4
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
move-result-object v5
const/4 v6, 0x0
const/4 v7, 0x0
sget-object v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$guildMuteUser$1;->INSTANCE:Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$guildMuteUser$1;
move-object v10, v0
check-cast v10, Lkotlin/jvm/functions/Function1;
new-instance v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$guildMuteUser$2;
invoke-direct {v0, p0}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$guildMuteUser$2;-><init>(Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;)V
move-object v8, v0
check-cast v8, Lkotlin/jvm/functions/Function1;
const/4 v9, 0x0
const/16 v11, 0x16
const/4 v12, 0x0
invoke-static/range {v4 .. v12}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->appSubscribe$default(Lrx/Observable;Ljava/lang/Class;Landroid/content/Context;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
return-void
.end method
.method public final isVoiceContext()Z
.locals 1
iget-boolean v0, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->isVoiceContext:Z
return v0
.end method
.method public final kickUser()V
.locals 14
iget-object v0, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->viewStateSubject:Lrx/subjects/BehaviorSubject;
const-string v1, "viewStateSubject"
invoke-static {v0, v1}, Lkotlin/jvm/internal/l;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
invoke-virtual {v0}, Lrx/subjects/BehaviorSubject;->getValue()Ljava/lang/Object;
move-result-object v0
instance-of v1, v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Loaded;
const/4 v2, 0x0
if-nez v1, :cond_0
move-object v0, v2
:cond_0
check-cast v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Loaded;
if-nez v0, :cond_1
return-void
:cond_1
invoke-virtual {v0}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Loaded;->getChannel()Lcom/discord/models/domain/ModelChannel;
move-result-object v1
invoke-virtual {v0}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Loaded;->getUser()Lcom/discord/models/domain/ModelUser;
move-result-object v3
invoke-virtual {v0}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Loaded;->getChannel()Lcom/discord/models/domain/ModelChannel;
move-result-object v0
invoke-virtual {v0}, Lcom/discord/models/domain/ModelChannel;->isMultiUserDM()Z
move-result v0
if-eqz v0, :cond_2
iget-object v0, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->storeChannels:Lcom/discord/stores/StoreChannels;
invoke-virtual {v1}, Lcom/discord/models/domain/ModelChannel;->getId()J
move-result-wide v4
invoke-virtual {v3}, Lcom/discord/models/domain/ModelUser;->getId()J
move-result-wide v6
invoke-virtual {v0, v4, v5, v6, v7}, Lcom/discord/stores/StoreChannels;->removeGroupRecipient(JJ)Lrx/Observable;
move-result-object v8
const-wide/16 v9, 0x0
const/4 v11, 0x0
const/4 v12, 0x1
const/4 v13, 0x0
invoke-static/range {v8 .. v13}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->takeSingleUntilTimeout$default(Lrx/Observable;JZILjava/lang/Object;)Lrx/Observable;
move-result-object v0
move-object v1, p0
check-cast v1, Lcom/discord/app/AppComponent;
const/4 v3, 0x2
invoke-static {v0, v1, v2, v3, v2}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->ui$default(Lrx/Observable;Lcom/discord/app/AppComponent;Lcom/discord/utilities/mg_recycler/MGRecyclerAdapterSimple;ILjava/lang/Object;)Lrx/Observable;
move-result-object v4
const/4 v5, 0x0
const/4 v7, 0x0
new-instance v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$kickUser$1;
invoke-direct {v0, p0}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$kickUser$1;-><init>(Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;)V
move-object v8, v0
check-cast v8, Lkotlin/jvm/functions/Function1;
const/4 v9, 0x0
const/4 v10, 0x0
const/16 v11, 0x35
const/4 v12, 0x0
const-string v6, "REST: remove group member"
invoke-static/range {v4 .. v12}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->appSubscribe$default(Lrx/Observable;Landroid/content/Context;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;ILjava/lang/Object;)V
return-void
:cond_2
iget-object v0, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->eventSubject:Lrx/subjects/PublishSubject;
new-instance v2, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$Event$LaunchKickUser;
invoke-virtual {v3}, Lcom/discord/models/domain/ModelUser;->getUsername()Ljava/lang/String;
move-result-object v5
const-string v4, "user.username"
invoke-static {v5, v4}, Lkotlin/jvm/internal/l;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
invoke-virtual {v1}, Lcom/discord/models/domain/ModelChannel;->getGuildId()Ljava/lang/Long;
move-result-object v1
const-string v4, "channel.guildId"
invoke-static {v1, v4}, Lkotlin/jvm/internal/l;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
invoke-virtual {v1}, Ljava/lang/Long;->longValue()J
move-result-wide v6
invoke-virtual {v3}, Lcom/discord/models/domain/ModelUser;->getId()J
move-result-wide v8
move-object v4, v2
invoke-direct/range {v4 .. v9}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$Event$LaunchKickUser;-><init>(Ljava/lang/String;JJ)V
invoke-virtual {v0, v2}, Lrx/subjects/PublishSubject;->onNext(Ljava/lang/Object;)V
return-void
.end method
.method public final launchVideoCall()V
.locals 13
iget-wide v0, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->userId:J
invoke-direct {p0, v0, v1}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->createPrivateChannelWithUser(J)Lrx/Observable;
move-result-object v0
const/4 v1, 0x0
const/4 v2, 0x0
const/4 v3, 0x1
invoke-static {v0, v2, v3, v1}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->restSubscribeOn$default(Lrx/Observable;ZILjava/lang/Object;)Lrx/Observable;
move-result-object v0
move-object v2, p0
check-cast v2, Lcom/discord/app/AppComponent;
const/4 v3, 0x2
invoke-static {v0, v2, v1, v3, v1}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->ui$default(Lrx/Observable;Lcom/discord/app/AppComponent;Lcom/discord/utilities/mg_recycler/MGRecyclerAdapterSimple;ILjava/lang/Object;)Lrx/Observable;
move-result-object v4
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
move-result-object v5
new-instance v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$launchVideoCall$1;
invoke-direct {v0, p0}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$launchVideoCall$1;-><init>(Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;)V
move-object v10, v0
check-cast v10, Lkotlin/jvm/functions/Function1;
new-instance v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$launchVideoCall$2;
invoke-direct {v0, p0}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$launchVideoCall$2;-><init>(Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;)V
move-object v8, v0
check-cast v8, Lkotlin/jvm/functions/Function1;
const/4 v6, 0x0
const/4 v7, 0x0
const/4 v9, 0x0
const/16 v11, 0x16
const/4 v12, 0x0
invoke-static/range {v4 .. v12}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->appSubscribe$default(Lrx/Observable;Ljava/lang/Class;Landroid/content/Context;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
return-void
.end method
.method public final launchVoiceCall()V
.locals 13
iget-wide v0, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->userId:J
invoke-direct {p0, v0, v1}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->createPrivateChannelWithUser(J)Lrx/Observable;
move-result-object v0
const/4 v1, 0x0
const/4 v2, 0x0
const/4 v3, 0x1
invoke-static {v0, v2, v3, v1}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->restSubscribeOn$default(Lrx/Observable;ZILjava/lang/Object;)Lrx/Observable;
move-result-object v0
move-object v2, p0
check-cast v2, Lcom/discord/app/AppComponent;
const/4 v3, 0x2
invoke-static {v0, v2, v1, v3, v1}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->ui$default(Lrx/Observable;Lcom/discord/app/AppComponent;Lcom/discord/utilities/mg_recycler/MGRecyclerAdapterSimple;ILjava/lang/Object;)Lrx/Observable;
move-result-object v4
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
move-result-object v5
new-instance v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$launchVoiceCall$1;
invoke-direct {v0, p0}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$launchVoiceCall$1;-><init>(Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;)V
move-object v10, v0
check-cast v10, Lkotlin/jvm/functions/Function1;
new-instance v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$launchVoiceCall$2;
invoke-direct {v0, p0}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$launchVoiceCall$2;-><init>(Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;)V
move-object v8, v0
check-cast v8, Lkotlin/jvm/functions/Function1;
const/4 v6, 0x0
const/4 v7, 0x0
const/4 v9, 0x0
const/16 v11, 0x16
const/4 v12, 0x0
invoke-static/range {v4 .. v12}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->appSubscribe$default(Lrx/Observable;Ljava/lang/Class;Landroid/content/Context;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
return-void
.end method
.method public final moveUserToChannel(J)V
.locals 12
iget-object v0, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->viewStateSubject:Lrx/subjects/BehaviorSubject;
const-string v1, "viewStateSubject"
invoke-static {v0, v1}, Lkotlin/jvm/internal/l;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
invoke-virtual {v0}, Lrx/subjects/BehaviorSubject;->getValue()Ljava/lang/Object;
move-result-object v0
instance-of v1, v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Loaded;
const/4 v2, 0x0
if-nez v1, :cond_0
move-object v0, v2
:cond_0
check-cast v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Loaded;
if-nez v0, :cond_1
return-void
:cond_1
invoke-virtual {v0}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Loaded;->getChannel()Lcom/discord/models/domain/ModelChannel;
move-result-object v1
invoke-virtual {v0}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Loaded;->getUser()Lcom/discord/models/domain/ModelUser;
move-result-object v0
iget-object v3, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->restAPI:Lcom/discord/utilities/rest/RestAPI;
invoke-virtual {v1}, Lcom/discord/models/domain/ModelChannel;->getGuildId()Ljava/lang/Long;
move-result-object v1
const-string v4, "channel.guildId"
invoke-static {v1, v4}, Lkotlin/jvm/internal/l;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
invoke-virtual {v1}, Ljava/lang/Long;->longValue()J
move-result-wide v4
invoke-virtual {v0}, Lcom/discord/models/domain/ModelUser;->getId()J
move-result-wide v6
sget-object v0, Lcom/discord/restapi/RestAPIParams$GuildMember;->Companion:Lcom/discord/restapi/RestAPIParams$GuildMember$Companion;
invoke-virtual {v0, p1, p2}, Lcom/discord/restapi/RestAPIParams$GuildMember$Companion;->createWithChannelId(J)Lcom/discord/restapi/RestAPIParams$GuildMember;
move-result-object v8
invoke-virtual/range {v3 .. v8}, Lcom/discord/utilities/rest/RestAPI;->changeGuildMember(JJLcom/discord/restapi/RestAPIParams$GuildMember;)Lrx/Observable;
move-result-object p1
const/4 p2, 0x0
const/4 v0, 0x1
invoke-static {p1, p2, v0, v2}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->restSubscribeOn$default(Lrx/Observable;ZILjava/lang/Object;)Lrx/Observable;
move-result-object p1
move-object p2, p0
check-cast p2, Lcom/discord/app/AppComponent;
const/4 v0, 0x2
invoke-static {p1, p2, v2, v0, v2}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->ui$default(Lrx/Observable;Lcom/discord/app/AppComponent;Lcom/discord/utilities/mg_recycler/MGRecyclerAdapterSimple;ILjava/lang/Object;)Lrx/Observable;
move-result-object v3
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
move-result-object v4
const/4 v5, 0x0
const/4 v6, 0x0
new-instance p1, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$moveUserToChannel$1;
invoke-direct {p1, p0}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$moveUserToChannel$1;-><init>(Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;)V
move-object v9, p1
check-cast v9, Lkotlin/jvm/functions/Function1;
new-instance p1, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$moveUserToChannel$2;
invoke-direct {p1, p0}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$moveUserToChannel$2;-><init>(Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;)V
move-object v7, p1
check-cast v7, Lkotlin/jvm/functions/Function1;
const/4 v8, 0x0
const/16 v10, 0x16
const/4 v11, 0x0
invoke-static/range {v3 .. v11}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->appSubscribe$default(Lrx/Observable;Ljava/lang/Class;Landroid/content/Context;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
return-void
.end method
.method public final observeEvents()Lrx/Observable;
.locals 2
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Lrx/Observable<",
"Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$Event;",
">;"
}
.end annotation
iget-object v0, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->eventSubject:Lrx/subjects/PublishSubject;
const-string v1, "eventSubject"
invoke-static {v0, v1}, Lkotlin/jvm/internal/l;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
check-cast v0, Lrx/Observable;
return-object v0
.end method
.method public final observeViewState()Lrx/Observable;
.locals 2
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Lrx/Observable<",
"Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState;",
">;"
}
.end annotation
iget-object v0, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->viewStateSubject:Lrx/subjects/BehaviorSubject;
const-string v1, "viewStateSubject"
invoke-static {v0, v1}, Lkotlin/jvm/internal/l;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
check-cast v0, Lrx/Observable;
return-object v0
.end method
.method public final removeRelationship(I)V
.locals 13
iget-object v0, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->restAPI:Lcom/discord/utilities/rest/RestAPI;
iget-wide v1, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->userId:J
const-string v3, "User Profile"
invoke-virtual {v0, v3, v1, v2}, Lcom/discord/utilities/rest/RestAPI;->removeRelationship(Ljava/lang/String;J)Lrx/Observable;
move-result-object v0
const/4 v1, 0x0
const/4 v2, 0x0
const/4 v3, 0x1
invoke-static {v0, v2, v3, v1}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->restSubscribeOn$default(Lrx/Observable;ZILjava/lang/Object;)Lrx/Observable;
move-result-object v0
move-object v2, p0
check-cast v2, Lcom/discord/app/AppComponent;
const/4 v3, 0x2
invoke-static {v0, v2, v1, v3, v1}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->ui$default(Lrx/Observable;Lcom/discord/app/AppComponent;Lcom/discord/utilities/mg_recycler/MGRecyclerAdapterSimple;ILjava/lang/Object;)Lrx/Observable;
move-result-object v4
invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
move-result-object v5
new-instance v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$removeRelationship$1;
invoke-direct {v0, p0, p1}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$removeRelationship$1;-><init>(Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;I)V
move-object v10, v0
check-cast v10, Lkotlin/jvm/functions/Function1;
new-instance p1, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$removeRelationship$2;
invoke-direct {p1, p0}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$removeRelationship$2;-><init>(Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;)V
move-object v8, p1
check-cast v8, Lkotlin/jvm/functions/Function1;
const/4 v6, 0x0
const/4 v7, 0x0
const/4 v9, 0x0
const/16 v11, 0x16
const/4 v12, 0x0
invoke-static/range {v4 .. v12}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->appSubscribe$default(Lrx/Observable;Ljava/lang/Class;Landroid/content/Context;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
return-void
.end method
.method public final setUserOutputVolume(I)V
.locals 3
iget-object v0, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->storeMediaSettings:Lcom/discord/stores/StoreMediaSettings;
iget-wide v1, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->userId:J
invoke-virtual {v0, v1, v2, p1}, Lcom/discord/stores/StoreMediaSettings;->setUserOutputVolume(JI)V
return-void
.end method
.method public final toggleMute(Z)V
.locals 2
iget-object v0, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->viewStateSubject:Lrx/subjects/BehaviorSubject;
const-string v1, "viewStateSubject"
invoke-static {v0, v1}, Lkotlin/jvm/internal/l;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
invoke-virtual {v0}, Lrx/subjects/BehaviorSubject;->getValue()Ljava/lang/Object;
move-result-object v0
instance-of v1, v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Loaded;
if-nez v1, :cond_0
const/4 v0, 0x0
:cond_0
check-cast v0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Loaded;
if-nez v0, :cond_1
return-void
:cond_1
invoke-virtual {v0}, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel$ViewState$Loaded;->getVoiceSettingsViewState()Lcom/discord/widgets/user/usersheet/UserProfileVoiceSettingsView$ViewState;
move-result-object v0
invoke-virtual {v0}, Lcom/discord/widgets/user/usersheet/UserProfileVoiceSettingsView$ViewState;->isUserMuted()Z
move-result v0
if-eq p1, v0, :cond_2
iget-object p1, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->storeMediaSettings:Lcom/discord/stores/StoreMediaSettings;
iget-wide v0, p0, Lcom/discord/widgets/user/usersheet/WidgetUserSheetViewModel;->userId:J
invoke-virtual {p1, v0, v1}, Lcom/discord/stores/StoreMediaSettings;->toggleUserMuted(J)V
:cond_2
return-void
.end method