.class public final Lcom/discord/stores/StoreMessageState; .super Ljava/lang/Object; .source "StoreMessageState.kt" # annotations .annotation system Ldalvik/annotation/MemberClasses; value = { Lcom/discord/stores/StoreMessageState$State; } .end annotation # instance fields .field public final dispatcher:Lcom/discord/stores/Dispatcher; .field public final messageStateSubject:Lrx/subjects/BehaviorSubject; .annotation system Ldalvik/annotation/Signature; value = { "Lrx/subjects/BehaviorSubject<", "Ljava/util/Map<", "Ljava/lang/Long;", "Lcom/discord/stores/StoreMessageState$State;", ">;>;" } .end annotation .end field # direct methods .method public constructor (Lcom/discord/stores/Dispatcher;)V .locals 1 const-string v0, "dispatcher" invoke-static {p1, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V invoke-direct {p0}, Ljava/lang/Object;->()V iput-object p1, p0, Lcom/discord/stores/StoreMessageState;->dispatcher:Lcom/discord/stores/Dispatcher; sget-object p1, Lc0/i/m;->d:Lc0/i/m; invoke-static {p1}, Lrx/subjects/BehaviorSubject;->i0(Ljava/lang/Object;)Lrx/subjects/BehaviorSubject; move-result-object p1 const-string v0, "BehaviorSubject.create(emptyMap())" invoke-static {p1, v0}, Lc0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V iput-object p1, p0, Lcom/discord/stores/StoreMessageState;->messageStateSubject:Lrx/subjects/BehaviorSubject; return-void .end method .method public static final synthetic access$updateState(Lcom/discord/stores/StoreMessageState;JLkotlin/jvm/functions/Function1;)V .locals 0 invoke-direct {p0, p1, p2, p3}, Lcom/discord/stores/StoreMessageState;->updateState(JLkotlin/jvm/functions/Function1;)V return-void .end method .method private final resetState(Ljava/util/List;)V .locals 6 .annotation runtime Lcom/discord/stores/StoreThread; .end annotation .annotation system Ldalvik/annotation/Signature; value = { "(", "Ljava/util/List<", "Ljava/lang/Long;", ">;)V" } .end annotation iget-object v0, p0, Lcom/discord/stores/StoreMessageState;->messageStateSubject:Lrx/subjects/BehaviorSubject; invoke-virtual {v0}, Lrx/subjects/BehaviorSubject;->k0()Ljava/lang/Object; move-result-object v0 check-cast v0, Ljava/util/Map; new-instance v1, Ljava/util/ArrayList; invoke-direct {v1}, Ljava/util/ArrayList;->()V invoke-interface {p1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator; move-result-object p1 :cond_0 :goto_0 invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z move-result v2 const-string v3, "messageStateMap" if-eqz v2, :cond_1 invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v2 move-object v4, v2 check-cast v4, Ljava/lang/Number; invoke-virtual {v4}, Ljava/lang/Number;->longValue()J move-result-wide v4 invoke-static {v0, v3}, Lc0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V invoke-static {v4, v5}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long; move-result-object v3 invoke-interface {v0, v3}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z move-result v3 if-eqz v3, :cond_0 invoke-interface {v1, v2}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z goto :goto_0 :cond_1 invoke-interface {v1}, Ljava/util/List;->isEmpty()Z move-result p1 if-eqz p1, :cond_2 return-void :cond_2 iget-object p1, p0, Lcom/discord/stores/StoreMessageState;->messageStateSubject:Lrx/subjects/BehaviorSubject; invoke-static {v0, v3}, Lc0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V invoke-static {v0, v1}, Lf/h/a/f/e/n/f;->minus(Ljava/util/Map;Ljava/lang/Iterable;)Ljava/util/Map; move-result-object v0 invoke-virtual {p1, v0}, Lrx/subjects/BehaviorSubject;->onNext(Ljava/lang/Object;)V return-void .end method .method private final updateState(JLkotlin/jvm/functions/Function1;)V .locals 4 .annotation runtime Lcom/discord/stores/StoreThread; .end annotation .annotation system Ldalvik/annotation/Signature; value = { "(J", "Lkotlin/jvm/functions/Function1<", "-", "Lcom/discord/stores/StoreMessageState$State;", "Lcom/discord/stores/StoreMessageState$State;", ">;)V" } .end annotation iget-object v0, p0, Lcom/discord/stores/StoreMessageState;->messageStateSubject:Lrx/subjects/BehaviorSubject; invoke-virtual {v0}, Lrx/subjects/BehaviorSubject;->k0()Ljava/lang/Object; move-result-object v0 check-cast v0, 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 v1 check-cast v1, Lcom/discord/stores/StoreMessageState$State; if-eqz v1, :cond_0 goto :goto_0 :cond_0 new-instance v1, Lcom/discord/stores/StoreMessageState$State; const/4 v2, 0x3 const/4 v3, 0x0 invoke-direct {v1, v3, v3, v2, v3}, Lcom/discord/stores/StoreMessageState$State;->(Ljava/util/Set;Ljava/util/Map;ILkotlin/jvm/internal/DefaultConstructorMarker;)V :goto_0 invoke-interface {p3, v1}, Lkotlin/jvm/functions/Function1;->invoke(Ljava/lang/Object;)Ljava/lang/Object; move-result-object p3 check-cast p3, Lcom/discord/stores/StoreMessageState$State; iget-object v1, p0, Lcom/discord/stores/StoreMessageState;->messageStateSubject:Lrx/subjects/BehaviorSubject; const-string v2, "messageStateMap" invoke-static {v0, v2}, Lc0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long; move-result-object p1 new-instance p2, Lkotlin/Pair; invoke-direct {p2, p1, p3}, Lkotlin/Pair;->(Ljava/lang/Object;Ljava/lang/Object;)V invoke-static {v0, p2}, Lf/h/a/f/e/n/f;->plus(Ljava/util/Map;Lkotlin/Pair;)Ljava/util/Map; move-result-object p1 invoke-virtual {v1, p1}, Lrx/subjects/BehaviorSubject;->onNext(Ljava/lang/Object;)V return-void .end method # virtual methods .method public final getMessageState()Lrx/Observable; .locals 2 .annotation system Ldalvik/annotation/Signature; value = { "()", "Lrx/Observable<", "Ljava/util/Map<", "Ljava/lang/Long;", "Lcom/discord/stores/StoreMessageState$State;", ">;>;" } .end annotation iget-object v0, p0, Lcom/discord/stores/StoreMessageState;->messageStateSubject:Lrx/subjects/BehaviorSubject; invoke-virtual {v0}, Lrx/Observable;->q()Lrx/Observable; move-result-object v0 const-string v1, "messageStateSubject.distinctUntilChanged()" invoke-static {v0, v1}, Lc0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V return-object v0 .end method .method public final handleChannelSelected()V .locals 2 .annotation runtime Lcom/discord/stores/StoreThread; .end annotation iget-object v0, p0, Lcom/discord/stores/StoreMessageState;->messageStateSubject:Lrx/subjects/BehaviorSubject; sget-object v1, Lc0/i/m;->d:Lc0/i/m; invoke-virtual {v0, v1}, Lrx/subjects/BehaviorSubject;->onNext(Ljava/lang/Object;)V return-void .end method .method public final handleMessageDelete(Lcom/discord/models/domain/ModelMessageDelete;)V .locals 1 .annotation runtime Lcom/discord/stores/StoreThread; .end annotation const-string v0, "messageDelete" invoke-static {p1, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessageDelete;->getMessageIds()Ljava/util/List; move-result-object p1 const-string v0, "messageDelete.messageIds" invoke-static {p1, v0}, Lc0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V invoke-direct {p0, p1}, Lcom/discord/stores/StoreMessageState;->resetState(Ljava/util/List;)V return-void .end method .method public final handleMessageUpdate(Lcom/discord/models/domain/ModelMessage;)V .locals 2 .annotation runtime Lcom/discord/stores/StoreThread; .end annotation const-string v0, "message" invoke-static {p1, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V invoke-virtual {p1}, Lcom/discord/models/domain/ModelMessage;->getId()J move-result-wide v0 invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long; move-result-object p1 invoke-static {p1}, Lf/h/a/f/e/n/f;->listOf(Ljava/lang/Object;)Ljava/util/List; move-result-object p1 invoke-direct {p0, p1}, Lcom/discord/stores/StoreMessageState;->resetState(Ljava/util/List;)V return-void .end method .method public final revealSpoiler(JI)V .locals 2 if-gez p3, :cond_0 return-void :cond_0 iget-object v0, p0, Lcom/discord/stores/StoreMessageState;->dispatcher:Lcom/discord/stores/Dispatcher; new-instance v1, Lcom/discord/stores/StoreMessageState$revealSpoiler$1; invoke-direct {v1, p0, p1, p2, p3}, Lcom/discord/stores/StoreMessageState$revealSpoiler$1;->(Lcom/discord/stores/StoreMessageState;JI)V invoke-virtual {v0, v1}, Lcom/discord/stores/Dispatcher;->schedule(Lkotlin/jvm/functions/Function0;)V return-void .end method .method public final revealSpoilerEmbed(JI)V .locals 2 if-gez p3, :cond_0 return-void :cond_0 iget-object v0, p0, Lcom/discord/stores/StoreMessageState;->dispatcher:Lcom/discord/stores/Dispatcher; new-instance v1, Lcom/discord/stores/StoreMessageState$revealSpoilerEmbed$1; invoke-direct {v1, p0, p1, p2, p3}, Lcom/discord/stores/StoreMessageState$revealSpoilerEmbed$1;->(Lcom/discord/stores/StoreMessageState;JI)V invoke-virtual {v0, v1}, Lcom/discord/stores/Dispatcher;->schedule(Lkotlin/jvm/functions/Function0;)V return-void .end method .method public final revealSpoilerEmbedData(JILjava/lang/String;)V .locals 8 const-string v0, "key" invoke-static {p4, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V if-gez p3, :cond_0 return-void :cond_0 iget-object v0, p0, Lcom/discord/stores/StoreMessageState;->dispatcher:Lcom/discord/stores/Dispatcher; new-instance v7, Lcom/discord/stores/StoreMessageState$revealSpoilerEmbedData$1; move-object v1, v7 move-object v2, p0 move-wide v3, p1 move v5, p3 move-object v6, p4 invoke-direct/range {v1 .. v6}, Lcom/discord/stores/StoreMessageState$revealSpoilerEmbedData$1;->(Lcom/discord/stores/StoreMessageState;JILjava/lang/String;)V invoke-virtual {v0, v7}, Lcom/discord/stores/Dispatcher;->schedule(Lkotlin/jvm/functions/Function0;)V return-void .end method