423 lines
10 KiB
Smali
423 lines
10 KiB
Smali
.class public final Lcom/discord/widgets/guilds/invite/InviteSuggestionsService$observeInviteSuggestions$2;
|
|
.super Ljava/lang/Object;
|
|
.source "InviteSuggestionsService.kt"
|
|
|
|
# interfaces
|
|
.implements Lrx/functions/Func3;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingMethod;
|
|
value = Lcom/discord/widgets/guilds/invite/InviteSuggestionsService;->observeInviteSuggestions()Lrx/Observable;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x19
|
|
name = null
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"<T1:",
|
|
"Ljava/lang/Object;",
|
|
"T2:",
|
|
"Ljava/lang/Object;",
|
|
"T3:",
|
|
"Ljava/lang/Object;",
|
|
"R:",
|
|
"Ljava/lang/Object;",
|
|
">",
|
|
"Ljava/lang/Object;",
|
|
"Lrx/functions/Func3<",
|
|
"TT1;TT2;TT3;TR;>;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final INSTANCE:Lcom/discord/widgets/guilds/invite/InviteSuggestionsService$observeInviteSuggestions$2;
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
new-instance v0, Lcom/discord/widgets/guilds/invite/InviteSuggestionsService$observeInviteSuggestions$2;
|
|
|
|
invoke-direct {v0}, Lcom/discord/widgets/guilds/invite/InviteSuggestionsService$observeInviteSuggestions$2;-><init>()V
|
|
|
|
sput-object v0, Lcom/discord/widgets/guilds/invite/InviteSuggestionsService$observeInviteSuggestions$2;->INSTANCE:Lcom/discord/widgets/guilds/invite/InviteSuggestionsService$observeInviteSuggestions$2;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public bridge synthetic call(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
.locals 0
|
|
|
|
check-cast p1, Ljava/util/Map;
|
|
|
|
check-cast p2, Ljava/util/Map;
|
|
|
|
check-cast p3, Lcom/discord/widgets/guilds/invite/UserAffinityData;
|
|
|
|
invoke-virtual {p0, p1, p2, p3}, Lcom/discord/widgets/guilds/invite/InviteSuggestionsService$observeInviteSuggestions$2;->call(Ljava/util/Map;Ljava/util/Map;Lcom/discord/widgets/guilds/invite/UserAffinityData;)Ljava/util/List;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public final call(Ljava/util/Map;Ljava/util/Map;Lcom/discord/widgets/guilds/invite/UserAffinityData;)Ljava/util/List;
|
|
.locals 7
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/Long;",
|
|
"+",
|
|
"Lcom/discord/models/domain/ModelChannel;",
|
|
">;",
|
|
"Ljava/util/Map<",
|
|
"Ljava/lang/Long;",
|
|
"Ljava/lang/Long;",
|
|
">;",
|
|
"Lcom/discord/widgets/guilds/invite/UserAffinityData;",
|
|
")",
|
|
"Ljava/util/List<",
|
|
"Lcom/discord/widgets/guilds/invite/InviteSuggestion;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
invoke-interface {p1}, Ljava/util/Map;->values()Ljava/util/Collection;
|
|
|
|
move-result-object p1
|
|
|
|
sget-object v1, Lcom/discord/utilities/channel/ChannelUtils;->INSTANCE:Lcom/discord/utilities/channel/ChannelUtils;
|
|
|
|
const-string v2, "mostRecentMessages"
|
|
|
|
invoke-static {p2, v2}, Lw/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v1, p2}, Lcom/discord/utilities/channel/ChannelUtils;->createMostRecentChannelComparator(Ljava/util/Map;)Ljava/util/Comparator;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-static {p1, p2}, Lw/q/l;->sortedWith(Ljava/lang/Iterable;Ljava/util/Comparator;)Ljava/util/List;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-interface {p1}, Ljava/util/Collection;->isEmpty()Z
|
|
|
|
move-result p2
|
|
|
|
xor-int/lit8 p2, p2, 0x1
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
invoke-interface {p1, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;
|
|
|
|
move-result-object p2
|
|
|
|
check-cast p2, Lcom/discord/models/domain/ModelChannel;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p2, 0x0
|
|
|
|
:goto_0
|
|
if-eqz p2, :cond_1
|
|
|
|
new-instance v1, Lcom/discord/widgets/guilds/invite/InviteSuggestion$Channel;
|
|
|
|
invoke-direct {v1, p2}, Lcom/discord/widgets/guilds/invite/InviteSuggestion$Channel;-><init>(Lcom/discord/models/domain/ModelChannel;)V
|
|
|
|
invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
|
|
|
:cond_1
|
|
invoke-virtual {p3}, Lcom/discord/widgets/guilds/invite/UserAffinityData;->getUserIds()Ljava/util/List;
|
|
|
|
move-result-object v1
|
|
|
|
new-instance v2, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
invoke-interface {v1}, 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 v3
|
|
|
|
if-eqz v3, :cond_3
|
|
|
|
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
check-cast v3, Ljava/lang/Number;
|
|
|
|
invoke-virtual {v3}, Ljava/lang/Number;->longValue()J
|
|
|
|
move-result-wide v3
|
|
|
|
invoke-virtual {p3}, Lcom/discord/widgets/guilds/invite/UserAffinityData;->getUsers()Ljava/util/Map;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-static {v3, v4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-interface {v5, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
check-cast v3, Lcom/discord/models/domain/ModelUser;
|
|
|
|
if-eqz v3, :cond_2
|
|
|
|
invoke-interface {v2, v3}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_1
|
|
|
|
:cond_3
|
|
new-instance v1, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
invoke-interface {v2}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v2
|
|
|
|
:cond_4
|
|
:goto_2
|
|
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_9
|
|
|
|
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/ModelUser;
|
|
|
|
invoke-virtual {p3}, Lcom/discord/widgets/guilds/invite/UserAffinityData;->getRelationships()Ljava/util/Map;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-static {v4, v5}, Le/e/b/a/a;->a(Lcom/discord/models/domain/ModelUser;Ljava/util/Map;)Ljava/lang/Object;
|
|
|
|
move-result-object v5
|
|
|
|
check-cast v5, Ljava/lang/Integer;
|
|
|
|
if-eqz p2, :cond_5
|
|
|
|
invoke-virtual {p2}, Lcom/discord/models/domain/ModelChannel;->getDMRecipient()Lcom/discord/models/domain/ModelUser;
|
|
|
|
move-result-object v6
|
|
|
|
invoke-static {v6, v4}, Lw/u/b/j;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
move-result v4
|
|
|
|
if-nez v4, :cond_7
|
|
|
|
:cond_5
|
|
const/4 v4, 0x2
|
|
|
|
if-nez v5, :cond_6
|
|
|
|
goto :goto_3
|
|
|
|
:cond_6
|
|
invoke-virtual {v5}, Ljava/lang/Integer;->intValue()I
|
|
|
|
move-result v5
|
|
|
|
if-ne v5, v4, :cond_8
|
|
|
|
:cond_7
|
|
const/4 v4, 0x1
|
|
|
|
goto :goto_4
|
|
|
|
:cond_8
|
|
:goto_3
|
|
const/4 v4, 0x0
|
|
|
|
:goto_4
|
|
if-nez v4, :cond_4
|
|
|
|
invoke-interface {v1, v3}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_2
|
|
|
|
:cond_9
|
|
invoke-static {v1}, Lw/q/l;->distinct(Ljava/lang/Iterable;)Ljava/util/List;
|
|
|
|
move-result-object p3
|
|
|
|
invoke-interface {p3}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v1
|
|
|
|
:goto_5
|
|
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_a
|
|
|
|
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Lcom/discord/models/domain/ModelUser;
|
|
|
|
new-instance v3, Lcom/discord/widgets/guilds/invite/InviteSuggestion$User;
|
|
|
|
invoke-direct {v3, v2}, Lcom/discord/widgets/guilds/invite/InviteSuggestion$User;-><init>(Lcom/discord/models/domain/ModelUser;)V
|
|
|
|
invoke-interface {v0, v3}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_5
|
|
|
|
:cond_a
|
|
new-instance v1, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
invoke-interface {p1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p1
|
|
|
|
:cond_b
|
|
:goto_6
|
|
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_e
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
move-object v3, v2
|
|
|
|
check-cast v3, Lcom/discord/models/domain/ModelChannel;
|
|
|
|
invoke-static {p2, v3}, Lw/u/b/j;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
move-result v4
|
|
|
|
xor-int/lit8 v4, v4, 0x1
|
|
|
|
if-eqz v4, :cond_d
|
|
|
|
invoke-virtual {v3}, Lcom/discord/models/domain/ModelChannel;->getDMRecipient()Lcom/discord/models/domain/ModelUser;
|
|
|
|
move-result-object v4
|
|
|
|
if-eqz v4, :cond_c
|
|
|
|
invoke-virtual {v3}, Lcom/discord/models/domain/ModelChannel;->getDMRecipient()Lcom/discord/models/domain/ModelUser;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-interface {p3, v3}, Ljava/util/List;->contains(Ljava/lang/Object;)Z
|
|
|
|
move-result v3
|
|
|
|
if-nez v3, :cond_d
|
|
|
|
:cond_c
|
|
const/4 v3, 0x1
|
|
|
|
goto :goto_7
|
|
|
|
:cond_d
|
|
const/4 v3, 0x0
|
|
|
|
:goto_7
|
|
if-eqz v3, :cond_b
|
|
|
|
invoke-interface {v1, v2}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_6
|
|
|
|
:cond_e
|
|
new-instance p1, Ljava/util/ArrayList;
|
|
|
|
const/16 p2, 0xa
|
|
|
|
invoke-static {v1, p2}, Le/k/a/c/e/p/g;->collectionSizeOrDefault(Ljava/lang/Iterable;I)I
|
|
|
|
move-result p2
|
|
|
|
invoke-direct {p1, p2}, Ljava/util/ArrayList;-><init>(I)V
|
|
|
|
invoke-interface {v1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p2
|
|
|
|
:goto_8
|
|
invoke-interface {p2}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result p3
|
|
|
|
if-eqz p3, :cond_f
|
|
|
|
invoke-interface {p2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object p3
|
|
|
|
check-cast p3, Lcom/discord/models/domain/ModelChannel;
|
|
|
|
new-instance v1, Lcom/discord/widgets/guilds/invite/InviteSuggestion$Channel;
|
|
|
|
invoke-direct {v1, p3}, Lcom/discord/widgets/guilds/invite/InviteSuggestion$Channel;-><init>(Lcom/discord/models/domain/ModelChannel;)V
|
|
|
|
invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
|
|
|
move-result p3
|
|
|
|
invoke-static {p3}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
|
|
|
|
move-result-object p3
|
|
|
|
invoke-interface {p1, p3}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
|
|
|
|
goto :goto_8
|
|
|
|
:cond_f
|
|
return-object v0
|
|
.end method
|