849 lines
23 KiB
Smali
849 lines
23 KiB
Smali
.class public Lcom/discord/stores/StoreUserTyping;
|
|
.super Ljava/lang/Object;
|
|
.source "StoreUserTyping.java"
|
|
|
|
|
|
# static fields
|
|
.field private static final emptySet:Ljava/util/Collection;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/Collection",
|
|
"<",
|
|
"Ljava/lang/Long;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# instance fields
|
|
.field private final $lock:Ljava/lang/Object;
|
|
|
|
.field private final collector:Lcom/discord/stores/StoreStreamCollector;
|
|
|
|
.field private final typingUsers:Ljava/util/Map;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/Map",
|
|
"<",
|
|
"Ljava/lang/Long;",
|
|
"Ljava/util/Set",
|
|
"<",
|
|
"Ljava/lang/Long;",
|
|
">;>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private final typingUsersPublisher:Lrx/subjects/Subject;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lrx/subjects/Subject",
|
|
"<",
|
|
"Ljava/util/Map",
|
|
"<",
|
|
"Ljava/lang/Long;",
|
|
"Ljava/util/Set",
|
|
"<",
|
|
"Ljava/lang/Long;",
|
|
">;>;",
|
|
"Ljava/util/Map",
|
|
"<",
|
|
"Ljava/lang/Long;",
|
|
"Ljava/util/Set",
|
|
"<",
|
|
"Ljava/lang/Long;",
|
|
">;>;>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private final typingUsersRemoveCallbacks:Ljava/util/Map;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/Map",
|
|
"<",
|
|
"Ljava/lang/Long;",
|
|
"Ljava/util/Map",
|
|
"<",
|
|
"Ljava/lang/Long;",
|
|
"Lrx/Subscription;",
|
|
">;>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
.prologue
|
|
new-instance v0, Ljava/util/HashSet;
|
|
|
|
invoke-direct {v0}, Ljava/util/HashSet;-><init>()V
|
|
|
|
sput-object v0, Lcom/discord/stores/StoreUserTyping;->emptySet:Ljava/util/Collection;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method constructor <init>(Lcom/discord/stores/StoreStreamCollector;)V
|
|
.locals 2
|
|
.param p1, "collector" # Lcom/discord/stores/StoreStreamCollector;
|
|
|
|
.prologue
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
new-array v0, v0, [Ljava/lang/Object;
|
|
|
|
iput-object v0, p0, Lcom/discord/stores/StoreUserTyping;->$lock:Ljava/lang/Object;
|
|
|
|
new-instance v0, Ljava/util/concurrent/ConcurrentHashMap;
|
|
|
|
invoke-direct {v0}, Ljava/util/concurrent/ConcurrentHashMap;-><init>()V
|
|
|
|
iput-object v0, p0, Lcom/discord/stores/StoreUserTyping;->typingUsersRemoveCallbacks:Ljava/util/Map;
|
|
|
|
new-instance v0, Ljava/util/HashMap;
|
|
|
|
invoke-direct {v0}, Ljava/util/HashMap;-><init>()V
|
|
|
|
iput-object v0, p0, Lcom/discord/stores/StoreUserTyping;->typingUsers:Ljava/util/Map;
|
|
|
|
new-instance v0, Lrx/subjects/SerializedSubject;
|
|
|
|
invoke-static {}, Lrx/subjects/BehaviorSubject;->create()Lrx/subjects/BehaviorSubject;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-direct {v0, v1}, Lrx/subjects/SerializedSubject;-><init>(Lrx/subjects/Subject;)V
|
|
|
|
iput-object v0, p0, Lcom/discord/stores/StoreUserTyping;->typingUsersPublisher:Lrx/subjects/Subject;
|
|
|
|
iput-object p1, p0, Lcom/discord/stores/StoreUserTyping;->collector:Lcom/discord/stores/StoreStreamCollector;
|
|
|
|
const/4 v0, 0x1
|
|
|
|
invoke-direct {p0, v0}, Lcom/discord/stores/StoreUserTyping;->updateTyping(Z)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method static synthetic access$lambda$0(JLjava/util/Map;)Ljava/util/Collection;
|
|
.locals 2
|
|
|
|
invoke-static {p0, p1, p2}, Lcom/discord/stores/StoreUserTyping;->lambda$get$191(JLjava/util/Map;)Ljava/util/Collection;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method static synthetic access$lambda$1(Lcom/discord/stores/StoreUserTyping;Lcom/discord/models/domain/ModelUser$Typing;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/stores/StoreUserTyping;->handleTypingStop(Lcom/discord/models/domain/ModelUser$Typing;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method static synthetic access$lambda$2(Lcom/discord/stores/StoreUserTyping;JJLrx/Subscription;)V
|
|
.locals 1
|
|
|
|
invoke-direct/range {p0 .. p5}, Lcom/discord/stores/StoreUserTyping;->lambda$handleTypingStart$192(JJLrx/Subscription;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private handleTypingStop(Lcom/discord/models/domain/ModelUser$Typing;)V
|
|
.locals 6
|
|
.param p1, "typing" # Lcom/discord/models/domain/ModelUser$Typing;
|
|
|
|
.prologue
|
|
iget-object v2, p0, Lcom/discord/stores/StoreUserTyping;->$lock:Ljava/lang/Object;
|
|
|
|
monitor-enter v2
|
|
|
|
:try_start_0
|
|
iget-object v1, p0, Lcom/discord/stores/StoreUserTyping;->typingUsers:Ljava/util/Map;
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelUser$Typing;->getChannelId()J
|
|
|
|
move-result-wide v4
|
|
|
|
invoke-static {v4, v5}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-interface {v1, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Ljava/util/Set;
|
|
|
|
.local v0, "userIds":Ljava/util/Set;, "Ljava/util/Set<Ljava/lang/Long;>;"
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelUser$Typing;->getUserId()J
|
|
|
|
move-result-wide v4
|
|
|
|
invoke-static {v4, v5}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-interface {v0, v1}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelUser$Typing;->getUserId()J
|
|
|
|
move-result-wide v4
|
|
|
|
invoke-static {v4, v5}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-interface {v0, v1}, Ljava/util/Set;->remove(Ljava/lang/Object;)Z
|
|
|
|
const/4 v1, 0x1
|
|
|
|
invoke-direct {p0, v1}, Lcom/discord/stores/StoreUserTyping;->updateTyping(Z)V
|
|
|
|
:cond_0
|
|
monitor-exit v2
|
|
|
|
return-void
|
|
|
|
.end local v0 # "userIds":Ljava/util/Set;, "Ljava/util/Set<Ljava/lang/Long;>;"
|
|
:catchall_0
|
|
move-exception v1
|
|
|
|
monitor-exit v2
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
throw v1
|
|
.end method
|
|
|
|
.method private static synthetic lambda$get$191(JLjava/util/Map;)Ljava/util/Collection;
|
|
.locals 2
|
|
.param p2, "typingUsersByChannel" # Ljava/util/Map;
|
|
|
|
.prologue
|
|
invoke-static {p0, p1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {p2, v0}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-static {p0, p1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {p2, v0}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Ljava/util/Collection;
|
|
|
|
:goto_0
|
|
return-object v0
|
|
|
|
:cond_0
|
|
sget-object v0, Lcom/discord/stores/StoreUserTyping;->emptySet:Ljava/util/Collection;
|
|
|
|
goto :goto_0
|
|
.end method
|
|
|
|
.method private synthetic lambda$handleTypingStart$192(JJLrx/Subscription;)V
|
|
.locals 3
|
|
.param p5, "subscription" # Lrx/Subscription;
|
|
|
|
.prologue
|
|
iget-object v0, p0, Lcom/discord/stores/StoreUserTyping;->typingUsersRemoveCallbacks:Ljava/util/Map;
|
|
|
|
invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-interface {v0, v1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Ljava/util/Map;
|
|
|
|
invoke-static {p3, p4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-interface {v0, v1, p5}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lrx/Subscription;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private updateTyping(Z)V
|
|
.locals 6
|
|
.param p1, "updated" # Z
|
|
|
|
.prologue
|
|
if-eqz p1, :cond_1
|
|
|
|
new-instance v1, Ljava/util/HashMap;
|
|
|
|
invoke-direct {v1}, Ljava/util/HashMap;-><init>()V
|
|
|
|
.local v1, "shallowCopy":Ljava/util/Map;, "Ljava/util/Map<Ljava/lang/Long;Ljava/util/Set<Ljava/lang/Long;>;>;"
|
|
iget-object v2, p0, Lcom/discord/stores/StoreUserTyping;->typingUsers:Ljava/util/Map;
|
|
|
|
invoke-interface {v2}, Ljava/util/Map;->entrySet()Ljava/util/Set;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-interface {v2}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v3
|
|
|
|
:goto_0
|
|
invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Ljava/util/Map$Entry;
|
|
|
|
.local v0, "entry":Ljava/util/Map$Entry;, "Ljava/util/Map$Entry<Ljava/lang/Long;Ljava/util/Set<Ljava/lang/Long;>;>;"
|
|
invoke-interface {v0}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;
|
|
|
|
move-result-object v4
|
|
|
|
new-instance v5, Ljava/util/HashSet;
|
|
|
|
invoke-interface {v0}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Ljava/util/Collection;
|
|
|
|
invoke-direct {v5, v2}, Ljava/util/HashSet;-><init>(Ljava/util/Collection;)V
|
|
|
|
invoke-interface {v1, v4, v5}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
goto :goto_0
|
|
|
|
.end local v0 # "entry":Ljava/util/Map$Entry;, "Ljava/util/Map$Entry<Ljava/lang/Long;Ljava/util/Set<Ljava/lang/Long;>;>;"
|
|
:cond_0
|
|
iget-object v2, p0, Lcom/discord/stores/StoreUserTyping;->typingUsersPublisher:Lrx/subjects/Subject;
|
|
|
|
invoke-virtual {v2, v1}, Lrx/subjects/Subject;->onNext(Ljava/lang/Object;)V
|
|
|
|
.end local v1 # "shallowCopy":Ljava/util/Map;, "Ljava/util/Map<Ljava/lang/Long;Ljava/util/Set<Ljava/lang/Long;>;>;"
|
|
:cond_1
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public get(J)Lrx/Observable;
|
|
.locals 3
|
|
.param p1, "channelId" # J
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(J)",
|
|
"Lrx/Observable",
|
|
"<",
|
|
"Ljava/util/Collection",
|
|
"<",
|
|
"Ljava/lang/Long;",
|
|
">;>;"
|
|
}
|
|
.end annotation
|
|
|
|
.prologue
|
|
iget-object v0, p0, Lcom/discord/stores/StoreUserTyping;->typingUsersPublisher:Lrx/subjects/Subject;
|
|
|
|
invoke-static {p1, p2}, Lcom/discord/stores/StoreUserTyping$$Lambda$1;->lambdaFactory$(J)Lrx/functions/Func1;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Lrx/subjects/Subject;->map(Lrx/functions/Func1;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lrx/Observable;->distinctUntilChanged()Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method handleMessageCreate(Ljava/util/List;)V
|
|
.locals 10
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/List",
|
|
"<",
|
|
"Lcom/discord/models/domain/ModelMessage;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
.prologue
|
|
.local p1, "messages":Ljava/util/List;, "Ljava/util/List<Lcom/discord/models/domain/ModelMessage;>;"
|
|
iget-object v6, p0, Lcom/discord/stores/StoreUserTyping;->$lock:Ljava/lang/Object;
|
|
|
|
monitor-enter v6
|
|
|
|
const/4 v3, 0x0
|
|
|
|
.local v3, "updated":Z
|
|
:try_start_0
|
|
invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v5
|
|
|
|
:cond_0
|
|
:goto_0
|
|
invoke-interface {v5}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v7
|
|
|
|
if-eqz v7, :cond_2
|
|
|
|
invoke-interface {v5}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Lcom/discord/models/domain/ModelMessage;
|
|
|
|
.local v2, "message":Lcom/discord/models/domain/ModelMessage;
|
|
invoke-virtual {v2}, Lcom/discord/models/domain/ModelMessage;->getAuthor()Lcom/discord/models/domain/ModelUser;
|
|
|
|
move-result-object v7
|
|
|
|
if-eqz v7, :cond_1
|
|
|
|
invoke-virtual {v2}, Lcom/discord/models/domain/ModelMessage;->getAuthor()Lcom/discord/models/domain/ModelUser;
|
|
|
|
move-result-object v7
|
|
|
|
invoke-virtual {v7}, Lcom/discord/models/domain/ModelUser;->getId()J
|
|
|
|
move-result-wide v0
|
|
|
|
.local v0, "authorId":J
|
|
:goto_1
|
|
iget-object v7, p0, Lcom/discord/stores/StoreUserTyping;->typingUsers:Ljava/util/Map;
|
|
|
|
invoke-virtual {v2}, Lcom/discord/models/domain/ModelMessage;->getChannelId()J
|
|
|
|
move-result-wide v8
|
|
|
|
invoke-static {v8, v9}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v8
|
|
|
|
invoke-interface {v7, v8}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v4
|
|
|
|
check-cast v4, Ljava/util/Set;
|
|
|
|
.local v4, "userIds":Ljava/util/Set;, "Ljava/util/Set<Ljava/lang/Long;>;"
|
|
if-eqz v4, :cond_0
|
|
|
|
invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v7
|
|
|
|
invoke-interface {v4, v7}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z
|
|
|
|
move-result v7
|
|
|
|
if-eqz v7, :cond_0
|
|
|
|
invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v7
|
|
|
|
invoke-interface {v4, v7}, Ljava/util/Set;->remove(Ljava/lang/Object;)Z
|
|
|
|
const/4 v3, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
.end local v0 # "authorId":J
|
|
.end local v4 # "userIds":Ljava/util/Set;, "Ljava/util/Set<Ljava/lang/Long;>;"
|
|
:cond_1
|
|
const-wide/16 v0, 0x0
|
|
|
|
goto :goto_1
|
|
|
|
.end local v2 # "message":Lcom/discord/models/domain/ModelMessage;
|
|
:cond_2
|
|
invoke-direct {p0, v3}, Lcom/discord/stores/StoreUserTyping;->updateTyping(Z)V
|
|
|
|
monitor-exit v6
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception v5
|
|
|
|
monitor-exit v6
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
throw v5
|
|
.end method
|
|
|
|
.method handleTypingStart(Ljava/util/List;)V
|
|
.locals 15
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/List",
|
|
"<",
|
|
"Lcom/discord/models/domain/ModelUser$Typing;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
.prologue
|
|
.local p1, "typingList":Ljava/util/List;, "Ljava/util/List<Lcom/discord/models/domain/ModelUser$Typing;>;"
|
|
iget-object v9, p0, Lcom/discord/stores/StoreUserTyping;->$lock:Ljava/lang/Object;
|
|
|
|
monitor-enter v9
|
|
|
|
const/4 v5, 0x0
|
|
|
|
.local v5, "updated":Z
|
|
:try_start_0
|
|
iget-object v8, p0, Lcom/discord/stores/StoreUserTyping;->collector:Lcom/discord/stores/StoreStreamCollector;
|
|
|
|
iget-object v8, v8, Lcom/discord/stores/StoreStreamCollector;->users:Lcom/discord/stores/StoreUser;
|
|
|
|
iget-object v8, v8, Lcom/discord/stores/StoreUser;->me:Lcom/discord/models/domain/ModelUser$Me;
|
|
|
|
if-eqz v8, :cond_4
|
|
|
|
iget-object v8, p0, Lcom/discord/stores/StoreUserTyping;->collector:Lcom/discord/stores/StoreStreamCollector;
|
|
|
|
iget-object v8, v8, Lcom/discord/stores/StoreStreamCollector;->users:Lcom/discord/stores/StoreUser;
|
|
|
|
iget-object v8, v8, Lcom/discord/stores/StoreUser;->me:Lcom/discord/models/domain/ModelUser$Me;
|
|
|
|
invoke-virtual {v8}, Lcom/discord/models/domain/ModelUser$Me;->getId()J
|
|
|
|
move-result-wide v2
|
|
|
|
.local v2, "me":J
|
|
:goto_0
|
|
invoke-interface/range {p1 .. p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v10
|
|
|
|
:cond_0
|
|
:goto_1
|
|
invoke-interface {v10}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v8
|
|
|
|
if-eqz v8, :cond_5
|
|
|
|
invoke-interface {v10}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v4
|
|
|
|
check-cast v4, Lcom/discord/models/domain/ModelUser$Typing;
|
|
|
|
.local v4, "typing":Lcom/discord/models/domain/ModelUser$Typing;
|
|
invoke-virtual {v4}, Lcom/discord/models/domain/ModelUser$Typing;->getChannelId()J
|
|
|
|
move-result-wide v0
|
|
|
|
.local v0, "channelId":J
|
|
invoke-virtual {v4}, Lcom/discord/models/domain/ModelUser$Typing;->getUserId()J
|
|
|
|
move-result-wide v6
|
|
|
|
.local v6, "userId":J
|
|
cmp-long v8, v2, v6
|
|
|
|
if-eqz v8, :cond_0
|
|
|
|
iget-object v8, p0, Lcom/discord/stores/StoreUserTyping;->typingUsers:Ljava/util/Map;
|
|
|
|
invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v11
|
|
|
|
invoke-interface {v8, v11}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z
|
|
|
|
move-result v8
|
|
|
|
if-nez v8, :cond_1
|
|
|
|
iget-object v8, p0, Lcom/discord/stores/StoreUserTyping;->typingUsers:Ljava/util/Map;
|
|
|
|
invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v11
|
|
|
|
new-instance v12, Ljava/util/HashSet;
|
|
|
|
invoke-direct {v12}, Ljava/util/HashSet;-><init>()V
|
|
|
|
invoke-interface {v8, v11, v12}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
:cond_1
|
|
iget-object v8, p0, Lcom/discord/stores/StoreUserTyping;->typingUsersRemoveCallbacks:Ljava/util/Map;
|
|
|
|
invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v11
|
|
|
|
invoke-interface {v8, v11}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z
|
|
|
|
move-result v8
|
|
|
|
if-nez v8, :cond_2
|
|
|
|
iget-object v8, p0, Lcom/discord/stores/StoreUserTyping;->typingUsersRemoveCallbacks:Ljava/util/Map;
|
|
|
|
invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v11
|
|
|
|
new-instance v12, Ljava/util/HashMap;
|
|
|
|
invoke-direct {v12}, Ljava/util/HashMap;-><init>()V
|
|
|
|
invoke-interface {v8, v11, v12}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
:cond_2
|
|
iget-object v8, p0, Lcom/discord/stores/StoreUserTyping;->typingUsersRemoveCallbacks:Ljava/util/Map;
|
|
|
|
invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v11
|
|
|
|
invoke-interface {v8, v11}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v8
|
|
|
|
check-cast v8, Ljava/util/Map;
|
|
|
|
invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v11
|
|
|
|
invoke-interface {v8, v11}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z
|
|
|
|
move-result v8
|
|
|
|
if-eqz v8, :cond_3
|
|
|
|
iget-object v8, p0, Lcom/discord/stores/StoreUserTyping;->typingUsersRemoveCallbacks:Ljava/util/Map;
|
|
|
|
invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v11
|
|
|
|
invoke-interface {v8, v11}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v8
|
|
|
|
check-cast v8, Ljava/util/Map;
|
|
|
|
invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v11
|
|
|
|
invoke-interface {v8, v11}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v8
|
|
|
|
check-cast v8, Lrx/Subscription;
|
|
|
|
invoke-interface {v8}, Lrx/Subscription;->unsubscribe()V
|
|
|
|
:cond_3
|
|
invoke-static {v4}, Lrx/Observable;->just(Ljava/lang/Object;)Lrx/Observable;
|
|
|
|
move-result-object v8
|
|
|
|
const-wide/16 v12, 0x2710
|
|
|
|
sget-object v11, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
iget-object v14, p0, Lcom/discord/stores/StoreUserTyping;->collector:Lcom/discord/stores/StoreStreamCollector;
|
|
|
|
iget-object v14, v14, Lcom/discord/stores/StoreStreamCollector;->scheduler:Lrx/Scheduler;
|
|
|
|
invoke-virtual {v8, v12, v13, v11, v14}, Lrx/Observable;->delay(JLjava/util/concurrent/TimeUnit;Lrx/Scheduler;)Lrx/Observable;
|
|
|
|
move-result-object v8
|
|
|
|
invoke-static {p0}, Lcom/discord/stores/StoreUserTyping$$Lambda$2;->lambdaFactory$(Lcom/discord/stores/StoreUserTyping;)Lrx/functions/Action1;
|
|
|
|
move-result-object v11
|
|
|
|
const-string v12, "typingRemove"
|
|
|
|
const/4 v13, 0x0
|
|
|
|
invoke-static {p0, v0, v1, v6, v7}, Lcom/discord/stores/StoreUserTyping$$Lambda$3;->lambdaFactory$(Lcom/discord/stores/StoreUserTyping;JJ)Lrx/functions/Action1;
|
|
|
|
move-result-object v14
|
|
|
|
invoke-static {v11, v12, v13, v14}, Lcom/discord/utilities/app/AppTransformers;->subscribe(Lrx/functions/Action1;Ljava/lang/String;Lrx/functions/Action1;Lrx/functions/Action1;)Lrx/Observable$Transformer;
|
|
|
|
move-result-object v11
|
|
|
|
invoke-virtual {v8, v11}, Lrx/Observable;->compose(Lrx/Observable$Transformer;)Lrx/Observable;
|
|
|
|
iget-object v8, p0, Lcom/discord/stores/StoreUserTyping;->typingUsers:Ljava/util/Map;
|
|
|
|
invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v11
|
|
|
|
invoke-interface {v8, v11}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v8
|
|
|
|
check-cast v8, Ljava/util/Set;
|
|
|
|
invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v11
|
|
|
|
invoke-interface {v8, v11}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z
|
|
|
|
move-result v8
|
|
|
|
if-nez v8, :cond_0
|
|
|
|
iget-object v8, p0, Lcom/discord/stores/StoreUserTyping;->typingUsers:Ljava/util/Map;
|
|
|
|
invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v11
|
|
|
|
invoke-interface {v8, v11}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v8
|
|
|
|
check-cast v8, Ljava/util/Set;
|
|
|
|
invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v11
|
|
|
|
invoke-interface {v8, v11}, Ljava/util/Set;->add(Ljava/lang/Object;)Z
|
|
|
|
const/4 v5, 0x1
|
|
|
|
goto/16 :goto_1
|
|
|
|
.end local v0 # "channelId":J
|
|
.end local v2 # "me":J
|
|
.end local v4 # "typing":Lcom/discord/models/domain/ModelUser$Typing;
|
|
.end local v6 # "userId":J
|
|
:cond_4
|
|
const-wide/16 v2, 0x0
|
|
|
|
goto/16 :goto_0
|
|
|
|
.restart local v2 # "me":J
|
|
:cond_5
|
|
invoke-direct {p0, v5}, Lcom/discord/stores/StoreUserTyping;->updateTyping(Z)V
|
|
|
|
monitor-exit v9
|
|
|
|
return-void
|
|
|
|
.end local v2 # "me":J
|
|
:catchall_0
|
|
move-exception v8
|
|
|
|
monitor-exit v9
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
throw v8
|
|
.end method
|
|
|
|
.method public setUserTyping(J)V
|
|
.locals 3
|
|
.param p1, "channelId" # J
|
|
|
|
.prologue
|
|
const-wide/16 v0, 0x0
|
|
|
|
cmp-long v0, p1, v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
:goto_0
|
|
return-void
|
|
|
|
:cond_0
|
|
invoke-static {}, Lcom/discord/utilities/rest/RestAPI;->getApi()Lcom/discord/utilities/rest/RestAPIInterface;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v1, Lcom/discord/utilities/rest/RestAPIParams$EmptyBody;
|
|
|
|
invoke-direct {v1}, Lcom/discord/utilities/rest/RestAPIParams$EmptyBody;-><init>()V
|
|
|
|
invoke-interface {v0, p1, p2, v1}, Lcom/discord/utilities/rest/RestAPIInterface;->setUserTyping(JLcom/discord/utilities/rest/RestAPIParams$EmptyBody;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {}, Lcom/discord/utilities/app/AppTransformers;->restSubscribeOn()Lrx/Observable$Transformer;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Lrx/Observable;->compose(Lrx/Observable$Transformer;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {}, Lcom/discord/utilities/app/AppTransformers;->computation()Lrx/Observable$Transformer;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Lrx/Observable;->compose(Lrx/Observable$Transformer;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "typingEvent"
|
|
|
|
invoke-static {v1}, Lcom/discord/utilities/app/AppTransformers;->subscribeEmpty(Ljava/lang/String;)Lrx/Observable$Transformer;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Lrx/Observable;->compose(Lrx/Observable$Transformer;)Lrx/Observable;
|
|
|
|
goto :goto_0
|
|
.end method
|