433 lines
14 KiB
Smali
433 lines
14 KiB
Smali
.class public final Lcom/discord/widgets/servers/WidgetServerSettingsIntegrations$Model$Companion;
|
|
.super Ljava/lang/Object;
|
|
.source "WidgetServerSettingsIntegrations.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lcom/discord/widgets/servers/WidgetServerSettingsIntegrations$Model;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x19
|
|
name = "Companion"
|
|
.end annotation
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public synthetic constructor <init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/servers/WidgetServerSettingsIntegrations$Model$Companion;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$canManage(Lcom/discord/widgets/servers/WidgetServerSettingsIntegrations$Model$Companion;Lcom/discord/models/domain/ModelUser;Ljava/lang/Long;Lcom/discord/models/domain/ModelGuild;)Z
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1, p2, p3}, Lcom/discord/widgets/servers/WidgetServerSettingsIntegrations$Model$Companion;->canManage(Lcom/discord/models/domain/ModelUser;Ljava/lang/Long;Lcom/discord/models/domain/ModelGuild;)Z
|
|
|
|
move-result p0
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method public static final synthetic access$create(Lcom/discord/widgets/servers/WidgetServerSettingsIntegrations$Model$Companion;Ljava/util/Map;Ljava/util/Map;Lcom/discord/models/domain/ModelGuild;)Lcom/discord/widgets/servers/WidgetServerSettingsIntegrations$Model;
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1, p2, p3}, Lcom/discord/widgets/servers/WidgetServerSettingsIntegrations$Model$Companion;->create(Ljava/util/Map;Ljava/util/Map;Lcom/discord/models/domain/ModelGuild;)Lcom/discord/widgets/servers/WidgetServerSettingsIntegrations$Model;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static final synthetic access$getIntegrations(Lcom/discord/widgets/servers/WidgetServerSettingsIntegrations$Model$Companion;J)Lrx/Observable;
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1, p2}, Lcom/discord/widgets/servers/WidgetServerSettingsIntegrations$Model$Companion;->getIntegrations(J)Lrx/Observable;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private final canManage(Lcom/discord/models/domain/ModelUser;Ljava/lang/Long;Lcom/discord/models/domain/ModelGuild;)Z
|
|
.locals 3
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p2, :cond_2
|
|
|
|
if-nez p3, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelUser;->getId()J
|
|
|
|
move-result-wide v1
|
|
|
|
invoke-virtual {p3, v1, v2}, Lcom/discord/models/domain/ModelGuild;->isOwner(J)Z
|
|
|
|
move-result v1
|
|
|
|
if-nez v1, :cond_1
|
|
|
|
const-wide/16 v1, 0x20
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelUser;->isMfaEnabled()Z
|
|
|
|
move-result p1
|
|
|
|
invoke-virtual {p3}, Lcom/discord/models/domain/ModelGuild;->getMfaLevel()I
|
|
|
|
move-result p3
|
|
|
|
invoke-static {v1, v2, p2, p1, p3}, Lcom/discord/utilities/permissions/PermissionUtils;->canAndIsElevated(JLjava/lang/Long;ZI)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
:cond_1
|
|
const/4 v0, 0x1
|
|
|
|
:cond_2
|
|
:goto_0
|
|
return v0
|
|
.end method
|
|
|
|
.method private final canManageIntegrations(J)Lrx/Observable;
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(J)",
|
|
"Lrx/Observable<",
|
|
"Ljava/lang/Boolean;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
sget-object v0, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreStream$Companion;->getUsers()Lcom/discord/stores/StoreUser;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreUser;->observeMe()Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v1, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/stores/StoreStream$Companion;->getPermissions()Lcom/discord/stores/StorePermissions;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1, p1, p2}, Lcom/discord/stores/StorePermissions;->getForGuild(J)Lrx/Observable;
|
|
|
|
move-result-object v1
|
|
|
|
sget-object v2, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v2}, Lcom/discord/stores/StoreStream$Companion;->getGuilds()Lcom/discord/stores/StoreGuilds;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v2, p1, p2}, Lcom/discord/stores/StoreGuilds;->observeGuild(J)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
sget-object p2, Lcom/discord/widgets/servers/WidgetServerSettingsIntegrations$Model$Companion$canManageIntegrations$1;->INSTANCE:Lcom/discord/widgets/servers/WidgetServerSettingsIntegrations$Model$Companion$canManageIntegrations$1;
|
|
|
|
invoke-static {v0, v1, p1, p2}, Lrx/Observable;->i(Lrx/Observable;Lrx/Observable;Lrx/Observable;Lrx/functions/Func3;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "Observable\n \u2026s, guild)\n }"
|
|
|
|
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, "Observable\n \u2026 .distinctUntilChanged()"
|
|
|
|
invoke-static {p1, p2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method private final create(Ljava/util/Map;Ljava/util/Map;Lcom/discord/models/domain/ModelGuild;)Lcom/discord/widgets/servers/WidgetServerSettingsIntegrations$Model;
|
|
.locals 6
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/Long;",
|
|
"+",
|
|
"Lcom/discord/models/domain/ModelGuildIntegration;",
|
|
">;",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/Long;",
|
|
"+",
|
|
"Lcom/discord/models/domain/ModelGuildRole;",
|
|
">;",
|
|
"Lcom/discord/models/domain/ModelGuild;",
|
|
")",
|
|
"Lcom/discord/widgets/servers/WidgetServerSettingsIntegrations$Model;"
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_5
|
|
|
|
if-eqz p2, :cond_5
|
|
|
|
if-nez p3, :cond_0
|
|
|
|
goto :goto_3
|
|
|
|
:cond_0
|
|
new-instance p2, Ljava/util/ArrayList;
|
|
|
|
invoke-interface {p1}, Ljava/util/Map;->size()I
|
|
|
|
move-result v1
|
|
|
|
invoke-direct {p2, v1}, Ljava/util/ArrayList;-><init>(I)V
|
|
|
|
invoke-interface {p1}, Ljava/util/Map;->values()Ljava/util/Collection;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-interface {p1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p1
|
|
|
|
:goto_0
|
|
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Lcom/discord/models/domain/ModelGuildIntegration;
|
|
|
|
new-instance v2, Lcom/discord/widgets/servers/WidgetServerSettingsIntegrations$Model$IntegrationItem;
|
|
|
|
invoke-virtual {p3}, Lcom/discord/models/domain/ModelGuild;->getId()J
|
|
|
|
move-result-wide v3
|
|
|
|
invoke-direct {v2, v1, v3, v4}, Lcom/discord/widgets/servers/WidgetServerSettingsIntegrations$Model$IntegrationItem;-><init>(Lcom/discord/models/domain/ModelGuildIntegration;J)V
|
|
|
|
invoke-interface {p2, v2}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
new-instance p1, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {p1}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
invoke-interface {p2}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v1
|
|
|
|
:cond_2
|
|
:goto_1
|
|
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_4
|
|
|
|
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
move-object v3, v2
|
|
|
|
check-cast v3, Lcom/discord/widgets/servers/WidgetServerSettingsIntegrations$Model$IntegrationItem;
|
|
|
|
sget-object v4, Lcom/discord/models/domain/ModelGuildIntegration;->SUPPORTED_TYPES:[Ljava/lang/String;
|
|
|
|
const-string v5, "ModelGuildIntegration.SUPPORTED_TYPES"
|
|
|
|
invoke-static {v4, v5}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v3}, Lcom/discord/widgets/servers/WidgetServerSettingsIntegrations$Model$IntegrationItem;->getIntegration()Lcom/discord/models/domain/ModelGuildIntegration;
|
|
|
|
move-result-object v3
|
|
|
|
if-eqz v3, :cond_3
|
|
|
|
invoke-virtual {v3}, Lcom/discord/models/domain/ModelGuildIntegration;->getType()Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
goto :goto_2
|
|
|
|
:cond_3
|
|
move-object v3, v0
|
|
|
|
:goto_2
|
|
invoke-static {v4, v3}, Lf/n/a/k/a;->contains([Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_2
|
|
|
|
invoke-interface {p1, v2}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_1
|
|
|
|
:cond_4
|
|
new-instance p1, Lcom/discord/widgets/servers/WidgetServerSettingsIntegrations$Model;
|
|
|
|
invoke-virtual {p3}, Lcom/discord/models/domain/ModelGuild;->getId()J
|
|
|
|
move-result-wide v0
|
|
|
|
invoke-virtual {p3}, Lcom/discord/models/domain/ModelGuild;->getName()Ljava/lang/String;
|
|
|
|
move-result-object p3
|
|
|
|
const-string v2, "guild.name"
|
|
|
|
invoke-static {p3, v2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-direct {p1, v0, v1, p3, p2}, Lcom/discord/widgets/servers/WidgetServerSettingsIntegrations$Model;-><init>(JLjava/lang/String;Ljava/util/List;)V
|
|
|
|
return-object p1
|
|
|
|
:cond_5
|
|
:goto_3
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private final getIntegrations(J)Lrx/Observable;
|
|
.locals 3
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(J)",
|
|
"Lrx/Observable<",
|
|
"Lcom/discord/widgets/servers/WidgetServerSettingsIntegrations$Model;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
sget-object v0, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreStream$Companion;->getGuildIntegrations()Lcom/discord/stores/StoreGuildIntegrations;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0, p1, p2}, Lcom/discord/stores/StoreGuildIntegrations;->get(J)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object v1, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/stores/StoreStream$Companion;->getGuilds()Lcom/discord/stores/StoreGuilds;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1, p1, p2}, Lcom/discord/stores/StoreGuilds;->observeRoles(J)Lrx/Observable;
|
|
|
|
move-result-object v1
|
|
|
|
sget-object v2, Lcom/discord/stores/StoreStream;->Companion:Lcom/discord/stores/StoreStream$Companion;
|
|
|
|
invoke-virtual {v2}, Lcom/discord/stores/StoreStream$Companion;->getGuilds()Lcom/discord/stores/StoreGuilds;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v2, p1, p2}, Lcom/discord/stores/StoreGuilds;->observeGuild(J)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance p2, Lcom/discord/widgets/servers/WidgetServerSettingsIntegrations$Model$Companion$getIntegrations$1;
|
|
|
|
invoke-direct {p2, p0}, Lcom/discord/widgets/servers/WidgetServerSettingsIntegrations$Model$Companion$getIntegrations$1;-><init>(Lcom/discord/widgets/servers/WidgetServerSettingsIntegrations$Model$Companion;)V
|
|
|
|
new-instance v2, Lcom/discord/widgets/servers/WidgetServerSettingsIntegrations$sam$rx_functions_Func3$0;
|
|
|
|
invoke-direct {v2, p2}, Lcom/discord/widgets/servers/WidgetServerSettingsIntegrations$sam$rx_functions_Func3$0;-><init>(Lkotlin/jvm/functions/Function3;)V
|
|
|
|
invoke-static {v0, v1, p1, v2}, Lrx/Observable;->i(Lrx/Observable;Lrx/Observable;Lrx/Observable;Lrx/functions/Func3;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "Observable\n \u2026 ::create\n )"
|
|
|
|
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, "Observable\n \u2026 .distinctUntilChanged()"
|
|
|
|
invoke-static {p1, p2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final get(J)Lrx/Observable;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(J)",
|
|
"Lrx/Observable<",
|
|
"Lcom/discord/widgets/servers/WidgetServerSettingsIntegrations$Model;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
invoke-direct {p0, p1, p2}, Lcom/discord/widgets/servers/WidgetServerSettingsIntegrations$Model$Companion;->canManageIntegrations(J)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v1, Lcom/discord/widgets/servers/WidgetServerSettingsIntegrations$Model$Companion$get$1;
|
|
|
|
invoke-direct {v1, p1, p2}, Lcom/discord/widgets/servers/WidgetServerSettingsIntegrations$Model$Companion$get$1;-><init>(J)V
|
|
|
|
invoke-virtual {v0, v1}, Lrx/Observable;->U(Lr0/k/b;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "canManageIntegrations(gu\u2026ust(null)\n }"
|
|
|
|
invoke-static {p1, p2}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object p1
|
|
.end method
|