293 lines
7.3 KiB
Smali
293 lines
7.3 KiB
Smali
.class public final Lcom/discord/utilities/textprocessing/MessageUtils;
|
|
.super Ljava/lang/Object;
|
|
.source "MessageUtils.kt"
|
|
|
|
|
|
# static fields
|
|
.field public static final INSTANCE:Lcom/discord/utilities/textprocessing/MessageUtils;
|
|
|
|
.field private static final WELCOME_MESSAGES:[I
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
new-instance v0, Lcom/discord/utilities/textprocessing/MessageUtils;
|
|
|
|
invoke-direct {v0}, Lcom/discord/utilities/textprocessing/MessageUtils;-><init>()V
|
|
|
|
sput-object v0, Lcom/discord/utilities/textprocessing/MessageUtils;->INSTANCE:Lcom/discord/utilities/textprocessing/MessageUtils;
|
|
|
|
const/16 v0, 0x27
|
|
|
|
new-array v0, v0, [I
|
|
|
|
fill-array-data v0, :array_0
|
|
|
|
sput-object v0, Lcom/discord/utilities/textprocessing/MessageUtils;->WELCOME_MESSAGES:[I
|
|
|
|
return-void
|
|
|
|
nop
|
|
|
|
:array_0
|
|
.array-data 4
|
|
0x7f120e31
|
|
0x7f120e32
|
|
0x7f120e33
|
|
0x7f120e34
|
|
0x7f120e35
|
|
0x7f120e36
|
|
0x7f120e37
|
|
0x7f120e38
|
|
0x7f120e39
|
|
0x7f120e3a
|
|
0x7f120e3b
|
|
0x7f120e3c
|
|
0x7f120e3d
|
|
0x7f120e3e
|
|
0x7f120e3f
|
|
0x7f120e40
|
|
0x7f120e41
|
|
0x7f120e42
|
|
0x7f120e43
|
|
0x7f120e44
|
|
0x7f120e45
|
|
0x7f120e46
|
|
0x7f120e47
|
|
0x7f120e48
|
|
0x7f120e49
|
|
0x7f120e4a
|
|
0x7f120e4b
|
|
0x7f120e4c
|
|
0x7f120e4d
|
|
0x7f120e4e
|
|
0x7f120e4f
|
|
0x7f120e50
|
|
0x7f120e51
|
|
0x7f120e52
|
|
0x7f120e53
|
|
0x7f120e54
|
|
0x7f120e55
|
|
0x7f120e56
|
|
0x7f120e57
|
|
.end array-data
|
|
.end method
|
|
|
|
.method private constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final getNickOrUsernames(Lcom/discord/models/domain/ModelMessage;Lcom/discord/models/domain/ModelChannel;Ljava/util/Map;Ljava/util/Map;)Ljava/util/Map;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lcom/discord/models/domain/ModelMessage;",
|
|
"Lcom/discord/models/domain/ModelChannel;",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/Long;",
|
|
"+",
|
|
"Lcom/discord/models/domain/ModelGuildMember$Computed;",
|
|
">;",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/Long;",
|
|
"+",
|
|
"Lcom/discord/models/domain/ModelChannel$RecipientNick;",
|
|
">;)",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/Long;",
|
|
"Ljava/lang/String;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
const-string v0, "message"
|
|
|
|
invoke-static {p0, v0}, Lkotlin/jvm/internal/j;->h(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v0, "channelMembers"
|
|
|
|
invoke-static {p2, v0}, Lkotlin/jvm/internal/j;->h(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v0, "nicks"
|
|
|
|
invoke-static {p3, v0}, Lkotlin/jvm/internal/j;->h(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p0}, Lcom/discord/models/domain/ModelMessage;->getMentions()Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "message.mentions"
|
|
|
|
invoke-static {v0, v1}, Lkotlin/jvm/internal/j;->g(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
check-cast v0, Ljava/util/Collection;
|
|
|
|
invoke-virtual {p0}, Lcom/discord/models/domain/ModelMessage;->getAuthor()Lcom/discord/models/domain/ModelUser;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {v0, p0}, Lkotlin/a/l;->a(Ljava/util/Collection;Ljava/lang/Object;)Ljava/util/List;
|
|
|
|
move-result-object p0
|
|
|
|
check-cast p0, Ljava/lang/Iterable;
|
|
|
|
invoke-static {p0, p1, p2, p3}, Lcom/discord/utilities/channel/ChannelUtils;->getNickOrUsernames(Ljava/lang/Iterable;Lcom/discord/models/domain/ModelChannel;Ljava/util/Map;Ljava/util/Map;)Ljava/util/Map;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static synthetic getNickOrUsernames$default(Lcom/discord/models/domain/ModelMessage;Lcom/discord/models/domain/ModelChannel;Ljava/util/Map;Ljava/util/Map;ILjava/lang/Object;)Ljava/util/Map;
|
|
.locals 0
|
|
|
|
and-int/lit8 p4, p4, 0x8
|
|
|
|
if-eqz p4, :cond_0
|
|
|
|
invoke-static {}, Lkotlin/a/ab;->emptyMap()Ljava/util/Map;
|
|
|
|
move-result-object p3
|
|
|
|
:cond_0
|
|
invoke-static {p0, p1, p2, p3}, Lcom/discord/utilities/textprocessing/MessageUtils;->getNickOrUsernames(Lcom/discord/models/domain/ModelMessage;Lcom/discord/models/domain/ModelChannel;Ljava/util/Map;Ljava/util/Map;)Ljava/util/Map;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static final getSystemMessageUserJoin(Landroid/content/Context;J)I
|
|
.locals 3
|
|
|
|
const-string v0, "context"
|
|
|
|
invoke-static {p0, v0}, Lkotlin/jvm/internal/j;->h(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/16 v2, 0x18
|
|
|
|
if-lt v0, v2, :cond_1
|
|
|
|
invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object p0
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
invoke-virtual {p0}, Landroid/content/res/Resources;->getConfiguration()Landroid/content/res/Configuration;
|
|
|
|
move-result-object p0
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
invoke-virtual {p0}, Landroid/content/res/Configuration;->getLocales()Landroid/os/LocaleList;
|
|
|
|
move-result-object p0
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-virtual {p0, v0}, Landroid/os/LocaleList;->get(I)Ljava/util/Locale;
|
|
|
|
move-result-object p0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
move-object p0, v1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object p0
|
|
|
|
if-eqz p0, :cond_2
|
|
|
|
invoke-virtual {p0}, Landroid/content/res/Resources;->getConfiguration()Landroid/content/res/Configuration;
|
|
|
|
move-result-object p0
|
|
|
|
if-eqz p0, :cond_2
|
|
|
|
iget-object p0, p0, Landroid/content/res/Configuration;->locale:Ljava/util/Locale;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
move-object p0, v1
|
|
|
|
:goto_0
|
|
new-instance v0, Ljava/util/Locale;
|
|
|
|
const-string v2, "en"
|
|
|
|
invoke-direct {v0, v2}, Ljava/util/Locale;-><init>(Ljava/lang/String;)V
|
|
|
|
if-eqz p0, :cond_3
|
|
|
|
invoke-virtual {p0}, Ljava/util/Locale;->getLanguage()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
:cond_3
|
|
invoke-virtual {v0}, Ljava/util/Locale;->getLanguage()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {v1, p0}, Lkotlin/jvm/internal/j;->n(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
move-result p0
|
|
|
|
xor-int/lit8 p0, p0, 0x1
|
|
|
|
if-eqz p0, :cond_4
|
|
|
|
const-wide/16 p0, 0x0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_4
|
|
invoke-static {}, Lcom/miguelgaeta/simple_time/SimpleTime;->getDefault()Lcom/miguelgaeta/simple_time/SimpleTime;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p0, p1}, Lcom/miguelgaeta/simple_time/SimpleTime;->parseSnowflake(Ljava/lang/Long;)J
|
|
|
|
move-result-wide p0
|
|
|
|
sget-object p2, Lcom/discord/utilities/textprocessing/MessageUtils;->WELCOME_MESSAGES:[I
|
|
|
|
array-length p2, p2
|
|
|
|
int-to-long v0, p2
|
|
|
|
rem-long/2addr p0, v0
|
|
|
|
:goto_1
|
|
sget-object p2, Lcom/discord/utilities/textprocessing/MessageUtils;->WELCOME_MESSAGES:[I
|
|
|
|
long-to-int p1, p0
|
|
|
|
aget p0, p2, p1
|
|
|
|
return p0
|
|
.end method
|