846 lines
22 KiB
Smali
846 lines
22 KiB
Smali
.class public Lcom/discord/stores/StoreUserTyping;
|
|
.super Ljava/lang/Object;
|
|
|
|
|
|
# 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/StoreStream;
|
|
|
|
.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
|
|
|
|
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/StoreStream;)V
|
|
.locals 2
|
|
|
|
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;->Mj()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/StoreStream;
|
|
|
|
const/4 p1, 0x1
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/stores/StoreUserTyping;->updateTyping(Z)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private handleTypingStop(Lcom/discord/models/domain/ModelUser$Typing;)V
|
|
.locals 4
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreUserTyping;->$lock:Ljava/lang/Object;
|
|
|
|
monitor-enter v0
|
|
|
|
: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 v2
|
|
|
|
invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-interface {v1, v2}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Ljava/util/Set;
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelUser$Typing;->getUserId()J
|
|
|
|
move-result-wide v2
|
|
|
|
invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-interface {v1, v2}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelUser$Typing;->getUserId()J
|
|
|
|
move-result-wide v2
|
|
|
|
invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-interface {v1, p1}, Ljava/util/Set;->remove(Ljava/lang/Object;)Z
|
|
|
|
const/4 p1, 0x1
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/stores/StoreUserTyping;->updateTyping(Z)V
|
|
|
|
:cond_0
|
|
monitor-exit v0
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
monitor-exit v0
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method static synthetic lambda$get$0(JLjava/util/Map;)Ljava/util/Collection;
|
|
.locals 1
|
|
|
|
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 p0
|
|
|
|
invoke-interface {p2, p0}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p0
|
|
|
|
check-cast p0, Ljava/util/Collection;
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
sget-object p0, Lcom/discord/stores/StoreUserTyping;->emptySet:Ljava/util/Collection;
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static synthetic lambda$handleTypingStart$3(Lcom/discord/stores/StoreUserTyping;JJLrx/Subscription;)V
|
|
.locals 1
|
|
|
|
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 p1
|
|
|
|
invoke-interface {v0, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Ljava/util/Map;
|
|
|
|
invoke-static {p3, p4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-interface {p1, p2, p5}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static synthetic lambda$jrTEQQIrtnZU2N7OdeRtwg6bNy0(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 lambda$null$1(JJ)V
|
|
.locals 1
|
|
|
|
invoke-static {}, Lcom/discord/stores/StoreStream;->getSlowMode()Lcom/discord/stores/StoreSlowMode;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0, p0, p1, p2, p3}, Lcom/discord/stores/StoreSlowMode;->onCooldown(JJ)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static synthetic lambda$setUserTyping$2(Lcom/discord/stores/StoreUserTyping;JLcom/discord/models/domain/ModelTypingResponse;)V
|
|
.locals 4
|
|
|
|
if-eqz p3, :cond_0
|
|
|
|
invoke-virtual {p3}, Lcom/discord/models/domain/ModelTypingResponse;->getMessageSendCooldownMs()Ljava/lang/Long;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {p3}, Lcom/discord/models/domain/ModelTypingResponse;->getMessageSendCooldownMs()Ljava/lang/Long;
|
|
|
|
move-result-object p3
|
|
|
|
invoke-virtual {p3}, Ljava/lang/Long;->longValue()J
|
|
|
|
move-result-wide v0
|
|
|
|
const-wide/16 v2, 0x0
|
|
|
|
cmp-long p3, v0, v2
|
|
|
|
if-lez p3, :cond_0
|
|
|
|
iget-object p3, p0, Lcom/discord/stores/StoreUserTyping;->collector:Lcom/discord/stores/StoreStream;
|
|
|
|
new-instance v2, Lcom/discord/stores/-$$Lambda$StoreUserTyping$Kg9nQ8Xv8M1emJEulKbdZmMDecg;
|
|
|
|
invoke-direct {v2, p1, p2, v0, v1}, Lcom/discord/stores/-$$Lambda$StoreUserTyping$Kg9nQ8Xv8M1emJEulKbdZmMDecg;-><init>(JJ)V
|
|
|
|
invoke-virtual {p3, v2}, Lcom/discord/stores/StoreStream;->schedule(Lrx/functions/Action0;)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method private updateTyping(Z)V
|
|
.locals 4
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
new-instance p1, Ljava/util/HashMap;
|
|
|
|
invoke-direct {p1}, Ljava/util/HashMap;-><init>()V
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreUserTyping;->typingUsers:Ljava/util/Map;
|
|
|
|
invoke-interface {v0}, Ljava/util/Map;->entrySet()Ljava/util/Set;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {v0}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v0
|
|
|
|
:goto_0
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Ljava/util/Map$Entry;
|
|
|
|
invoke-interface {v1}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
new-instance v3, Ljava/util/HashSet;
|
|
|
|
invoke-interface {v1}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Ljava/util/Collection;
|
|
|
|
invoke-direct {v3, v1}, Ljava/util/HashSet;-><init>(Ljava/util/Collection;)V
|
|
|
|
invoke-interface {p1, v2, v3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Lcom/discord/stores/StoreUserTyping;->typingUsersPublisher:Lrx/subjects/Subject;
|
|
|
|
invoke-virtual {v0, p1}, Lrx/subjects/Subject;->onNext(Ljava/lang/Object;)V
|
|
|
|
:cond_1
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public get(J)Lrx/Observable;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(J)",
|
|
"Lrx/Observable<",
|
|
"Ljava/util/Collection<",
|
|
"Ljava/lang/Long;",
|
|
">;>;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreUserTyping;->typingUsersPublisher:Lrx/subjects/Subject;
|
|
|
|
new-instance v1, Lcom/discord/stores/-$$Lambda$StoreUserTyping$e4q5fUjajM1Ffj5MQy2vTmG0vWM;
|
|
|
|
invoke-direct {v1, p1, p2}, Lcom/discord/stores/-$$Lambda$StoreUserTyping$e4q5fUjajM1Ffj5MQy2vTmG0vWM;-><init>(J)V
|
|
|
|
invoke-virtual {v0, v1}, Lrx/subjects/Subject;->e(Lrx/functions/b;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Lrx/Observable;->KC()Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method handleMessageCreate(Ljava/util/List;)V
|
|
.locals 8
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/List<",
|
|
"Lcom/discord/models/domain/ModelMessage;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/stores/StoreUserTyping;->$lock:Ljava/lang/Object;
|
|
|
|
monitor-enter v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
:try_start_0
|
|
invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p1
|
|
|
|
:cond_0
|
|
:goto_0
|
|
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Lcom/discord/models/domain/ModelMessage;
|
|
|
|
invoke-virtual {v2}, Lcom/discord/models/domain/ModelMessage;->getAuthor()Lcom/discord/models/domain/ModelUser;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v3}, Lcom/discord/models/domain/ModelUser;->getId()J
|
|
|
|
move-result-wide v3
|
|
|
|
iget-object v5, p0, Lcom/discord/stores/StoreUserTyping;->typingUsers:Ljava/util/Map;
|
|
|
|
invoke-virtual {v2}, Lcom/discord/models/domain/ModelMessage;->getChannelId()J
|
|
|
|
move-result-wide v6
|
|
|
|
invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-interface {v5, v2}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Ljava/util/Set;
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
invoke-static {v3, v4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-interface {v2, v5}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z
|
|
|
|
move-result v5
|
|
|
|
if-eqz v5, :cond_0
|
|
|
|
invoke-static {v3, v4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-interface {v2, v1}, Ljava/util/Set;->remove(Ljava/lang/Object;)Z
|
|
|
|
const/4 v1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
invoke-direct {p0, v1}, Lcom/discord/stores/StoreUserTyping;->updateTyping(Z)V
|
|
|
|
monitor-exit v0
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
monitor-exit v0
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method handleTypingStart(Ljava/util/List;)V
|
|
.locals 20
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/util/List<",
|
|
"Lcom/discord/models/domain/ModelUser$Typing;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
move-object/from16 v7, p0
|
|
|
|
iget-object v8, v7, Lcom/discord/stores/StoreUserTyping;->$lock:Ljava/lang/Object;
|
|
|
|
monitor-enter v8
|
|
|
|
const/4 v0, 0x0
|
|
|
|
:try_start_0
|
|
iget-object v1, v7, Lcom/discord/stores/StoreUserTyping;->collector:Lcom/discord/stores/StoreStream;
|
|
|
|
iget-object v1, v1, Lcom/discord/stores/StoreStream;->users:Lcom/discord/stores/StoreUser;
|
|
|
|
iget-object v1, v1, Lcom/discord/stores/StoreUser;->me:Lcom/discord/models/domain/ModelUser$Me;
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
iget-object v1, v7, Lcom/discord/stores/StoreUserTyping;->collector:Lcom/discord/stores/StoreStream;
|
|
|
|
iget-object v1, v1, Lcom/discord/stores/StoreStream;->users:Lcom/discord/stores/StoreUser;
|
|
|
|
iget-object v1, v1, Lcom/discord/stores/StoreUser;->me:Lcom/discord/models/domain/ModelUser$Me;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/models/domain/ModelUser$Me;->getId()J
|
|
|
|
move-result-wide v1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const-wide/16 v1, 0x0
|
|
|
|
:goto_0
|
|
move-wide v9, v1
|
|
|
|
invoke-interface/range {p1 .. p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v11
|
|
|
|
:goto_1
|
|
invoke-interface {v11}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_6
|
|
|
|
invoke-interface {v11}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Lcom/discord/models/domain/ModelUser$Typing;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/models/domain/ModelUser$Typing;->getChannelId()J
|
|
|
|
move-result-wide v12
|
|
|
|
invoke-virtual {v1}, Lcom/discord/models/domain/ModelUser$Typing;->getUserId()J
|
|
|
|
move-result-wide v14
|
|
|
|
cmp-long v2, v9, v14
|
|
|
|
if-eqz v2, :cond_5
|
|
|
|
iget-object v2, v7, Lcom/discord/stores/StoreUserTyping;->typingUsers:Ljava/util/Map;
|
|
|
|
invoke-static {v12, v13}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-interface {v2, v3}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z
|
|
|
|
move-result v2
|
|
|
|
if-nez v2, :cond_1
|
|
|
|
iget-object v2, v7, Lcom/discord/stores/StoreUserTyping;->typingUsers:Ljava/util/Map;
|
|
|
|
invoke-static {v12, v13}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v3
|
|
|
|
new-instance v4, Ljava/util/HashSet;
|
|
|
|
invoke-direct {v4}, Ljava/util/HashSet;-><init>()V
|
|
|
|
invoke-interface {v2, v3, v4}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
:cond_1
|
|
iget-object v2, v7, Lcom/discord/stores/StoreUserTyping;->typingUsersRemoveCallbacks:Ljava/util/Map;
|
|
|
|
invoke-static {v12, v13}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-interface {v2, v3}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z
|
|
|
|
move-result v2
|
|
|
|
if-nez v2, :cond_2
|
|
|
|
iget-object v2, v7, Lcom/discord/stores/StoreUserTyping;->typingUsersRemoveCallbacks:Ljava/util/Map;
|
|
|
|
invoke-static {v12, v13}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v3
|
|
|
|
new-instance v4, Ljava/util/HashMap;
|
|
|
|
invoke-direct {v4}, Ljava/util/HashMap;-><init>()V
|
|
|
|
invoke-interface {v2, v3, v4}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
:cond_2
|
|
iget-object v2, v7, Lcom/discord/stores/StoreUserTyping;->typingUsersRemoveCallbacks:Ljava/util/Map;
|
|
|
|
invoke-static {v12, v13}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-interface {v2, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Ljava/util/Map;
|
|
|
|
invoke-static {v14, v15}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-interface {v2, v3}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_3
|
|
|
|
iget-object v2, v7, Lcom/discord/stores/StoreUserTyping;->typingUsersRemoveCallbacks:Ljava/util/Map;
|
|
|
|
invoke-static {v12, v13}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-interface {v2, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Ljava/util/Map;
|
|
|
|
invoke-static {v14, v15}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-interface {v2, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Lrx/Subscription;
|
|
|
|
invoke-interface {v2}, Lrx/Subscription;->unsubscribe()V
|
|
|
|
:cond_3
|
|
invoke-static {v1}, Lrx/Observable;->ca(Ljava/lang/Object;)Lrx/Observable;
|
|
|
|
move-result-object v1
|
|
|
|
const-wide/16 v2, 0x2710
|
|
|
|
sget-object v4, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
iget-object v5, v7, Lcom/discord/stores/StoreUserTyping;->collector:Lcom/discord/stores/StoreStream;
|
|
|
|
iget-object v5, v5, Lcom/discord/stores/StoreStream;->scheduler:Lrx/Scheduler;
|
|
|
|
invoke-virtual {v1, v2, v3, v4, v5}, Lrx/Observable;->c(JLjava/util/concurrent/TimeUnit;Lrx/Scheduler;)Lrx/Observable;
|
|
|
|
move-result-object v5
|
|
|
|
new-instance v6, Lcom/discord/stores/-$$Lambda$StoreUserTyping$jrTEQQIrtnZU2N7OdeRtwg6bNy0;
|
|
|
|
invoke-direct {v6, v7}, Lcom/discord/stores/-$$Lambda$StoreUserTyping$jrTEQQIrtnZU2N7OdeRtwg6bNy0;-><init>(Lcom/discord/stores/StoreUserTyping;)V
|
|
|
|
const-string v3, "typingRemove"
|
|
|
|
new-instance v4, Lcom/discord/stores/-$$Lambda$StoreUserTyping$vKQB1L0MP5SYdxkR3wHurv7csFY;
|
|
|
|
move-object v1, v4
|
|
|
|
move-object/from16 v2, p0
|
|
|
|
move-wide/from16 v16, v9
|
|
|
|
move-object v9, v3
|
|
|
|
move-object v10, v4
|
|
|
|
move-wide v3, v12
|
|
|
|
move/from16 v19, v0
|
|
|
|
move-object v0, v6
|
|
|
|
move-object/from16 v18, v11
|
|
|
|
move-object v11, v5
|
|
|
|
move-wide v5, v14
|
|
|
|
invoke-direct/range {v1 .. v6}, Lcom/discord/stores/-$$Lambda$StoreUserTyping$vKQB1L0MP5SYdxkR3wHurv7csFY;-><init>(Lcom/discord/stores/StoreUserTyping;JJ)V
|
|
|
|
invoke-static {v0, v9, v10}, Lcom/discord/app/g;->a(Lrx/functions/Action1;Ljava/lang/String;Lrx/functions/Action1;)Lrx/Observable$Transformer;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v11, v0}, Lrx/Observable;->a(Lrx/Observable$Transformer;)Lrx/Observable;
|
|
|
|
iget-object v0, v7, Lcom/discord/stores/StoreUserTyping;->typingUsers:Ljava/util/Map;
|
|
|
|
invoke-static {v12, v13}, 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/Set;
|
|
|
|
invoke-static {v14, v15}, 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 v0
|
|
|
|
if-nez v0, :cond_4
|
|
|
|
iget-object v0, v7, Lcom/discord/stores/StoreUserTyping;->typingUsers:Ljava/util/Map;
|
|
|
|
invoke-static {v12, v13}, 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/Set;
|
|
|
|
invoke-static {v14, v15}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-interface {v0, v1}, Ljava/util/Set;->add(Ljava/lang/Object;)Z
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_4
|
|
move/from16 v0, v19
|
|
|
|
:goto_2
|
|
move-wide/from16 v9, v16
|
|
|
|
move-object/from16 v11, v18
|
|
|
|
goto/16 :goto_1
|
|
|
|
:cond_5
|
|
move/from16 v19, v0
|
|
|
|
goto/16 :goto_1
|
|
|
|
:cond_6
|
|
invoke-direct {v7, v0}, Lcom/discord/stores/StoreUserTyping;->updateTyping(Z)V
|
|
|
|
monitor-exit v8
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
monitor-exit v8
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public setUserTyping(J)V
|
|
.locals 3
|
|
|
|
const-wide/16 v0, 0x0
|
|
|
|
cmp-long v2, p1, v0
|
|
|
|
if-nez v2, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
invoke-static {}, Lcom/discord/utilities/rest/RestAPI;->getApi()Lcom/discord/utilities/rest/RestAPI;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v1, Lcom/discord/restapi/RestAPIParams$EmptyBody;
|
|
|
|
invoke-direct {v1}, Lcom/discord/restapi/RestAPIParams$EmptyBody;-><init>()V
|
|
|
|
invoke-virtual {v0, p1, p2, v1}, Lcom/discord/utilities/rest/RestAPI;->setUserTyping(JLcom/discord/restapi/RestAPIParams$EmptyBody;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {}, Lcom/discord/app/g;->dx()Lrx/Observable$Transformer;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Lrx/Observable;->a(Lrx/Observable$Transformer;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {}, Lcom/discord/app/g;->dy()Lrx/Observable$Transformer;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0, v1}, Lrx/Observable;->a(Lrx/Observable$Transformer;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v1, Lcom/discord/stores/-$$Lambda$StoreUserTyping$mzI3GYW-KzVB6Xw5bNrc-ueapo4;
|
|
|
|
invoke-direct {v1, p0, p1, p2}, Lcom/discord/stores/-$$Lambda$StoreUserTyping$mzI3GYW-KzVB6Xw5bNrc-ueapo4;-><init>(Lcom/discord/stores/StoreUserTyping;J)V
|
|
|
|
const-string p1, "typingEvent"
|
|
|
|
invoke-static {v1, p1}, Lcom/discord/app/g;->subscribe(Lrx/functions/Action1;Ljava/lang/String;)Lrx/Observable$Transformer;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v0, p1}, Lrx/Observable;->a(Lrx/Observable$Transformer;)Lrx/Observable;
|
|
|
|
return-void
|
|
.end method
|