251 lines
6.9 KiB
Smali
251 lines
6.9 KiB
Smali
.class public final Lcom/discord/widgets/guilds/invite/WidgetInviteModel$Companion;
|
|
.super Ljava/lang/Object;
|
|
.source "WidgetInviteModel.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lcom/discord/widgets/guilds/invite/WidgetInviteModel;
|
|
.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/guilds/invite/WidgetInviteModel$Companion;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final create(Lcom/discord/models/domain/ModelInvite$Settings;Ljava/util/Map;Lcom/discord/widgets/guilds/invite/InviteGenerator$InviteGenerationState;Ljava/lang/Long;Lcom/discord/models/domain/ModelUser;Ljava/util/List;Lcom/discord/models/domain/ModelGuild;)Lcom/discord/widgets/guilds/invite/WidgetInviteModel;
|
|
.locals 16
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lcom/discord/models/domain/ModelInvite$Settings;",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/Long;",
|
|
"+",
|
|
"Lcom/discord/models/domain/ModelChannel;",
|
|
">;",
|
|
"Lcom/discord/widgets/guilds/invite/InviteGenerator$InviteGenerationState;",
|
|
"Ljava/lang/Long;",
|
|
"Lcom/discord/models/domain/ModelUser;",
|
|
"Ljava/util/List<",
|
|
"+",
|
|
"Lcom/discord/models/domain/ModelChannel;",
|
|
">;",
|
|
"Lcom/discord/models/domain/ModelGuild;",
|
|
")",
|
|
"Lcom/discord/widgets/guilds/invite/WidgetInviteModel;"
|
|
}
|
|
.end annotation
|
|
|
|
move-object/from16 v0, p2
|
|
|
|
move-object/from16 v1, p4
|
|
|
|
const-string v2, "settings"
|
|
|
|
move-object/from16 v5, p1
|
|
|
|
invoke-static {v5, v2}, Ly/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v2, "invitableChannels"
|
|
|
|
invoke-static {v0, v2}, Ly/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v2, "inviteGenerationState"
|
|
|
|
move-object/from16 v3, p3
|
|
|
|
invoke-static {v3, v2}, Ly/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v2, "me"
|
|
|
|
move-object/from16 v10, p5
|
|
|
|
invoke-static {v10, v2}, Ly/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v2, "dms"
|
|
|
|
move-object/from16 v11, p6
|
|
|
|
invoke-static {v11, v2}, Ly/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual/range {p3 .. p3}, Lcom/discord/widgets/guilds/invite/InviteGenerator$InviteGenerationState;->getLastGeneratedInvite()Lcom/discord/models/domain/ModelInvite;
|
|
|
|
move-result-object v2
|
|
|
|
new-instance v9, Ljava/util/ArrayList;
|
|
|
|
invoke-interface/range {p2 .. p2}, Ljava/util/Map;->values()Ljava/util/Collection;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-direct {v9, v4}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V
|
|
|
|
invoke-static {}, Lcom/discord/models/domain/ModelChannel;->getSortByNameAndType()Ljava/util/Comparator;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-static {v9, v4}, Ljava/util/Collections;->sort(Ljava/util/List;Ljava/util/Comparator;)V
|
|
|
|
invoke-interface {v0, v1}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z
|
|
|
|
move-result v4
|
|
|
|
const/4 v6, 0x0
|
|
|
|
const/4 v7, 0x0
|
|
|
|
if-eqz v4, :cond_0
|
|
|
|
invoke-interface {v0, v1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/discord/models/domain/ModelChannel;
|
|
|
|
:goto_0
|
|
move-object v4, v0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_0
|
|
invoke-virtual {v9}, Ljava/util/ArrayList;->isEmpty()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
invoke-virtual {v9, v7}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/discord/models/domain/ModelChannel;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
move-object v4, v6
|
|
|
|
:goto_1
|
|
const/4 v0, 0x1
|
|
|
|
if-eqz v2, :cond_2
|
|
|
|
if-eqz v4, :cond_2
|
|
|
|
invoke-virtual {v2}, Lcom/discord/models/domain/ModelInvite;->getChannel()Lcom/discord/models/domain/ModelChannel;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
invoke-virtual {v2}, Lcom/discord/models/domain/ModelInvite;->getChannel()Lcom/discord/models/domain/ModelChannel;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v8, "generatedInvite.channel"
|
|
|
|
invoke-static {v1, v8}, Ly/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v1}, Lcom/discord/models/domain/ModelChannel;->getId()J
|
|
|
|
move-result-wide v12
|
|
|
|
invoke-virtual {v4}, Lcom/discord/models/domain/ModelChannel;->getId()J
|
|
|
|
move-result-wide v14
|
|
|
|
cmp-long v1, v12, v14
|
|
|
|
if-nez v1, :cond_2
|
|
|
|
const/4 v1, 0x1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_2
|
|
const/4 v1, 0x0
|
|
|
|
:goto_2
|
|
if-eqz p7, :cond_3
|
|
|
|
invoke-virtual/range {p7 .. p7}, Lcom/discord/models/domain/ModelGuild;->getVanityUrlCode()Ljava/lang/String;
|
|
|
|
move-result-object v6
|
|
|
|
:cond_3
|
|
if-eqz v4, :cond_4
|
|
|
|
invoke-virtual/range {p3 .. p3}, Lcom/discord/widgets/guilds/invite/InviteGenerator$InviteGenerationState;->getState()Lcom/discord/widgets/guilds/invite/InviteGenerator$GenerationState;
|
|
|
|
move-result-object v8
|
|
|
|
sget-object v12, Lcom/discord/widgets/guilds/invite/InviteGenerator$GenerationState;->FAILURE:Lcom/discord/widgets/guilds/invite/InviteGenerator$GenerationState;
|
|
|
|
if-ne v8, v12, :cond_5
|
|
|
|
:cond_4
|
|
if-eqz v6, :cond_5
|
|
|
|
invoke-static {v6}, Lcom/discord/models/domain/ModelInvite;->createForVanityUrl(Ljava/lang/String;)Lcom/discord/models/domain/ModelInvite;
|
|
|
|
move-result-object v1
|
|
|
|
move-object v6, v1
|
|
|
|
const/4 v8, 0x1
|
|
|
|
goto :goto_3
|
|
|
|
:cond_5
|
|
move v8, v1
|
|
|
|
move-object v6, v2
|
|
|
|
:goto_3
|
|
new-instance v1, Lcom/discord/widgets/guilds/invite/WidgetInviteModel;
|
|
|
|
invoke-virtual/range {p3 .. p3}, Lcom/discord/widgets/guilds/invite/InviteGenerator$InviteGenerationState;->getState()Lcom/discord/widgets/guilds/invite/InviteGenerator$GenerationState;
|
|
|
|
move-result-object v2
|
|
|
|
sget-object v3, Lcom/discord/widgets/guilds/invite/InviteGenerator$GenerationState;->GENERATING:Lcom/discord/widgets/guilds/invite/InviteGenerator$GenerationState;
|
|
|
|
if-ne v2, v3, :cond_6
|
|
|
|
const/4 v7, 0x1
|
|
|
|
:cond_6
|
|
move-object v3, v1
|
|
|
|
move-object/from16 v5, p1
|
|
|
|
move-object/from16 v10, p5
|
|
|
|
move-object/from16 v11, p6
|
|
|
|
invoke-direct/range {v3 .. v11}, Lcom/discord/widgets/guilds/invite/WidgetInviteModel;-><init>(Lcom/discord/models/domain/ModelChannel;Lcom/discord/models/domain/ModelInvite$Settings;Lcom/discord/models/domain/ModelInvite;ZZLjava/util/List;Lcom/discord/models/domain/ModelUser;Ljava/util/List;)V
|
|
|
|
return-object v1
|
|
.end method
|