243 lines
4.1 KiB
Smali
243 lines
4.1 KiB
Smali
.class public final Lcom/discord/utilities/permissions/ManageMessageContext$Companion;
|
|
.super Ljava/lang/Object;
|
|
.source "PermissionsContexts.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lcom/discord/utilities/permissions/ManageMessageContext;
|
|
.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/utilities/permissions/ManageMessageContext$Companion;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final from(Lcom/discord/models/domain/ModelMessage;Ljava/lang/Integer;Lcom/discord/models/domain/ModelUser;Ljava/lang/Integer;ZZ)Lcom/discord/utilities/permissions/ManageMessageContext;
|
|
.locals 10
|
|
|
|
move-object v0, p2
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz p1, :cond_d
|
|
|
|
if-eqz p3, :cond_c
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessage;->getType()I
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x1
|
|
|
|
const/4 v3, 0x0
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v1, 0x0
|
|
|
|
:goto_0
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessage;->getAuthor()Lcom/discord/models/domain/ModelUser;
|
|
|
|
move-result-object v4
|
|
|
|
const-string v5, "message.author"
|
|
|
|
invoke-static {v4, v5}, Ly/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v4}, Lcom/discord/models/domain/ModelUser;->getId()J
|
|
|
|
move-result-wide v4
|
|
|
|
invoke-virtual {p3}, Lcom/discord/models/domain/ModelUser;->getId()J
|
|
|
|
move-result-wide v6
|
|
|
|
cmp-long v8, v4, v6
|
|
|
|
if-nez v8, :cond_1
|
|
|
|
const/4 v4, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
const/4 v4, 0x0
|
|
|
|
:goto_1
|
|
if-eqz p5, :cond_2
|
|
|
|
if-nez p6, :cond_2
|
|
|
|
const/4 v5, 0x1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_2
|
|
const/4 v5, 0x0
|
|
|
|
:goto_2
|
|
if-eqz p4, :cond_3
|
|
|
|
const/16 v6, 0x2000
|
|
|
|
invoke-virtual {p3}, Lcom/discord/models/domain/ModelUser;->isMfaEnabled()Z
|
|
|
|
move-result v7
|
|
|
|
invoke-virtual {p4}, Ljava/lang/Integer;->intValue()I
|
|
|
|
move-result v8
|
|
|
|
invoke-static {v6, p2, v7, v8}, Lcom/discord/utilities/permissions/PermissionUtils;->canAndIsElevated(ILjava/lang/Integer;ZI)Z
|
|
|
|
move-result v6
|
|
|
|
if-eqz v6, :cond_3
|
|
|
|
const/4 v6, 0x1
|
|
|
|
goto :goto_3
|
|
|
|
:cond_3
|
|
const/4 v6, 0x0
|
|
|
|
:goto_3
|
|
if-nez v6, :cond_5
|
|
|
|
if-eqz v5, :cond_4
|
|
|
|
goto :goto_4
|
|
|
|
:cond_4
|
|
const/4 v7, 0x0
|
|
|
|
goto :goto_5
|
|
|
|
:cond_5
|
|
:goto_4
|
|
const/4 v7, 0x1
|
|
|
|
:goto_5
|
|
if-eqz v4, :cond_6
|
|
|
|
if-eqz v1, :cond_6
|
|
|
|
const/4 v8, 0x1
|
|
|
|
goto :goto_6
|
|
|
|
:cond_6
|
|
const/4 v8, 0x0
|
|
|
|
:goto_6
|
|
if-nez v6, :cond_8
|
|
|
|
if-eqz v4, :cond_7
|
|
|
|
goto :goto_7
|
|
|
|
:cond_7
|
|
const/4 v4, 0x0
|
|
|
|
goto :goto_8
|
|
|
|
:cond_8
|
|
:goto_7
|
|
const/4 v4, 0x1
|
|
|
|
:goto_8
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessage;->isLocal()Z
|
|
|
|
move-result v9
|
|
|
|
if-nez v9, :cond_a
|
|
|
|
if-nez v5, :cond_9
|
|
|
|
const/16 v5, 0x40
|
|
|
|
invoke-static {v5, p2}, Lcom/discord/utilities/permissions/PermissionUtils;->can(ILjava/lang/Integer;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_a
|
|
|
|
:cond_9
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_9
|
|
|
|
:cond_a
|
|
const/4 v0, 0x0
|
|
|
|
:goto_9
|
|
if-eqz v7, :cond_b
|
|
|
|
if-eqz v1, :cond_b
|
|
|
|
if-nez p6, :cond_b
|
|
|
|
goto :goto_a
|
|
|
|
:cond_b
|
|
const/4 v2, 0x0
|
|
|
|
:goto_a
|
|
new-instance v1, Lcom/discord/utilities/permissions/ManageMessageContext;
|
|
|
|
move-object p1, v1
|
|
|
|
move p2, v6
|
|
|
|
move p3, v8
|
|
|
|
move p4, v4
|
|
|
|
move p5, v0
|
|
|
|
move/from16 p6, v2
|
|
|
|
invoke-direct/range {p1 .. p6}, Lcom/discord/utilities/permissions/ManageMessageContext;-><init>(ZZZZZ)V
|
|
|
|
return-object v1
|
|
|
|
:cond_c
|
|
const-string v0, "meUser"
|
|
|
|
invoke-static {v0}, Ly/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v1
|
|
|
|
:cond_d
|
|
const-string v0, "message"
|
|
|
|
invoke-static {v0}, Ly/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v1
|
|
.end method
|