198 lines
5.4 KiB
Smali
198 lines
5.4 KiB
Smali
.class public final Lcom/discord/utilities/textprocessing/MessageUnparser$getRoleMentionRule$1;
|
|
.super Lcom/discord/simpleast/core/parser/Rule;
|
|
.source "MessageUnparser.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingMethod;
|
|
value = Lcom/discord/utilities/textprocessing/MessageUnparser;->getRoleMentionRule(Ljava/util/List;)Lcom/discord/simpleast/core/parser/Rule;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x19
|
|
name = null
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lcom/discord/simpleast/core/parser/Rule<",
|
|
"TT;",
|
|
"Lcom/discord/simpleast/core/node/Node<",
|
|
"TT;>;TS;>;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field final synthetic $guildRoles:Ljava/util/List;
|
|
|
|
.field final synthetic this$0:Lcom/discord/utilities/textprocessing/MessageUnparser;
|
|
|
|
|
|
# direct methods
|
|
.method constructor <init>(Lcom/discord/utilities/textprocessing/MessageUnparser;Ljava/util/List;Ljava/util/regex/Pattern;)V
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/List;",
|
|
"Ljava/util/regex/Pattern;",
|
|
")V"
|
|
}
|
|
.end annotation
|
|
|
|
iput-object p1, p0, Lcom/discord/utilities/textprocessing/MessageUnparser$getRoleMentionRule$1;->this$0:Lcom/discord/utilities/textprocessing/MessageUnparser;
|
|
|
|
iput-object p2, p0, Lcom/discord/utilities/textprocessing/MessageUnparser$getRoleMentionRule$1;->$guildRoles:Ljava/util/List;
|
|
|
|
invoke-direct {p0, p3}, Lcom/discord/simpleast/core/parser/Rule;-><init>(Ljava/util/regex/Pattern;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final parse(Ljava/util/regex/Matcher;Lcom/discord/simpleast/core/parser/Parser;Ljava/lang/Object;)Lcom/discord/simpleast/core/parser/ParseSpec;
|
|
.locals 7
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/regex/Matcher;",
|
|
"Lcom/discord/simpleast/core/parser/Parser<",
|
|
"TT;-",
|
|
"Lcom/discord/simpleast/core/node/Node<",
|
|
"TT;>;TS;>;TS;)",
|
|
"Lcom/discord/simpleast/core/parser/ParseSpec<",
|
|
"TT;",
|
|
"Lcom/discord/simpleast/core/node/Node<",
|
|
"TT;>;TS;>;"
|
|
}
|
|
.end annotation
|
|
|
|
const-string v0, "matcher"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/k;->h(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v0, "parser"
|
|
|
|
invoke-static {p2, v0}, Lkotlin/jvm/internal/k;->h(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const/4 p2, 0x1
|
|
|
|
invoke-virtual {p1, p2}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "matcher.group(1)"
|
|
|
|
invoke-static {v0, v1}, Lkotlin/jvm/internal/k;->g(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-static {v0}, Lkotlin/text/l;->dW(Ljava/lang/String;)Ljava/lang/Long;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Long;->longValue()J
|
|
|
|
move-result-wide v0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const-wide/16 v0, -0x1
|
|
|
|
:goto_0
|
|
iget-object v2, p0, Lcom/discord/utilities/textprocessing/MessageUnparser$getRoleMentionRule$1;->$guildRoles:Ljava/util/List;
|
|
|
|
check-cast v2, Ljava/lang/Iterable;
|
|
|
|
invoke-interface {v2}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v2
|
|
|
|
:cond_1
|
|
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_3
|
|
|
|
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
move-object v4, v3
|
|
|
|
check-cast v4, Lcom/discord/models/domain/ModelGuildRole;
|
|
|
|
invoke-virtual {v4}, Lcom/discord/models/domain/ModelGuildRole;->getId()J
|
|
|
|
move-result-wide v4
|
|
|
|
cmp-long v6, v4, v0
|
|
|
|
if-nez v6, :cond_2
|
|
|
|
const/4 v4, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
const/4 v4, 0x0
|
|
|
|
:goto_1
|
|
if-eqz v4, :cond_1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_3
|
|
const/4 v3, 0x0
|
|
|
|
:goto_2
|
|
check-cast v3, Lcom/discord/models/domain/ModelGuildRole;
|
|
|
|
if-eqz v3, :cond_4
|
|
|
|
new-instance p1, Ljava/lang/StringBuilder;
|
|
|
|
const-string p2, "@"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v3}, Lcom/discord/models/domain/ModelGuildRole;->getName()Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {p1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
goto :goto_3
|
|
|
|
:cond_4
|
|
invoke-virtual {p1}, Ljava/util/regex/Matcher;->group()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
:goto_3
|
|
sget-object p2, Lcom/discord/simpleast/core/parser/ParseSpec;->Ab:Lcom/discord/simpleast/core/parser/ParseSpec$a;
|
|
|
|
new-instance p2, Lcom/discord/simpleast/core/node/a;
|
|
|
|
const-string v0, "content"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/k;->g(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-direct {p2, p1}, Lcom/discord/simpleast/core/node/a;-><init>(Ljava/lang/String;)V
|
|
|
|
check-cast p2, Lcom/discord/simpleast/core/node/Node;
|
|
|
|
invoke-static {p2, p3}, Lcom/discord/simpleast/core/parser/ParseSpec$a;->a(Lcom/discord/simpleast/core/node/Node;Ljava/lang/Object;)Lcom/discord/simpleast/core/parser/ParseSpec;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|