.class public final Lcom/discord/stores/StoreUserRelationships; .super Ljava/lang/Object; .source "StoreUserRelationships.kt" # interfaces .implements Lcom/discord/stores/DispatchHandler; # instance fields .field public final dispatcher:Lcom/discord/stores/Dispatcher; .field public isDirty:Z .field public final relationships:Ljava/util/HashMap; .annotation system Ldalvik/annotation/Signature; value = { "Ljava/util/HashMap<", "Ljava/lang/Long;", "Ljava/lang/Integer;", ">;" } .end annotation .end field .field public final relationshipsPersister:Lcom/discord/utilities/persister/Persister; .annotation system Ldalvik/annotation/Signature; value = { "Lcom/discord/utilities/persister/Persister<", "Ljava/util/Map<", "Ljava/lang/Long;", "Ljava/lang/Integer;", ">;>;" } .end annotation .end field .field public final stream:Lcom/discord/stores/StoreStream; # direct methods .method public constructor (Lcom/discord/stores/StoreStream;Lcom/discord/stores/Dispatcher;)V .locals 1 const/4 v0, 0x0 if-eqz p1, :cond_1 if-eqz p2, :cond_0 invoke-direct {p0}, Ljava/lang/Object;->()V iput-object p1, p0, Lcom/discord/stores/StoreUserRelationships;->stream:Lcom/discord/stores/StoreStream; iput-object p2, p0, Lcom/discord/stores/StoreUserRelationships;->dispatcher:Lcom/discord/stores/Dispatcher; new-instance p1, Ljava/util/HashMap; invoke-direct {p1}, Ljava/util/HashMap;->()V iput-object p1, p0, Lcom/discord/stores/StoreUserRelationships;->relationships:Ljava/util/HashMap; new-instance p1, Lcom/discord/utilities/persister/Persister; new-instance p2, Ljava/util/HashMap; invoke-direct {p2}, Ljava/util/HashMap;->()V const-string v0, "STORE_USER_RELATIONSHIPS_V8" invoke-direct {p1, v0, p2}, Lcom/discord/utilities/persister/Persister;->(Ljava/lang/String;Ljava/lang/Object;)V iput-object p1, p0, Lcom/discord/stores/StoreUserRelationships;->relationshipsPersister:Lcom/discord/utilities/persister/Persister; return-void :cond_0 const-string p1, "dispatcher" invoke-static {p1}, Lw/u/b/j;->a(Ljava/lang/String;)V throw v0 :cond_1 const-string p1, "stream" invoke-static {p1}, Lw/u/b/j;->a(Ljava/lang/String;)V throw v0 .end method .method public static final synthetic access$getDispatcher$p(Lcom/discord/stores/StoreUserRelationships;)Lcom/discord/stores/Dispatcher; .locals 0 iget-object p0, p0, Lcom/discord/stores/StoreUserRelationships;->dispatcher:Lcom/discord/stores/Dispatcher; return-object p0 .end method .method public static final synthetic access$getStream$p(Lcom/discord/stores/StoreUserRelationships;)Lcom/discord/stores/StoreStream; .locals 0 iget-object p0, p0, Lcom/discord/stores/StoreUserRelationships;->stream:Lcom/discord/stores/StoreStream; return-object p0 .end method # virtual methods .method public final get()Lrx/Observable; .locals 1 .annotation system Ldalvik/annotation/Signature; value = { "()", "Lrx/Observable<", "Ljava/util/Map<", "Ljava/lang/Long;", "Ljava/lang/Integer;", ">;>;" } .end annotation iget-object v0, p0, Lcom/discord/stores/StoreUserRelationships;->relationshipsPersister:Lcom/discord/utilities/persister/Persister; invoke-virtual {v0}, Lcom/discord/utilities/persister/Persister;->getObservable()Lrx/Observable; move-result-object v0 invoke-static {v0}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->computationBuffered(Lrx/Observable;)Lrx/Observable; move-result-object v0 return-object v0 .end method .method public final get(J)Lrx/Observable; .locals 2 .annotation system Ldalvik/annotation/Signature; value = { "(J)", "Lrx/Observable<", "Ljava/lang/Integer;", ">;" } .end annotation invoke-virtual {p0}, Lcom/discord/stores/StoreUserRelationships;->get()Lrx/Observable; move-result-object v0 new-instance v1, Lcom/discord/stores/StoreUserRelationships$get$2; invoke-direct {v1, p1, p2}, Lcom/discord/stores/StoreUserRelationships$get$2;->(J)V invoke-virtual {v0, v1}, Lrx/Observable;->f(Le0/l/i;)Lrx/Observable; move-result-object p1 const-string p2, "get()\n .map { r\u2026> relationships[userId] }" invoke-static {p1, p2}, Lw/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V return-object p1 .end method .method public final get(Ljava/util/Collection;)Lrx/Observable; .locals 2 .annotation system Ldalvik/annotation/Signature; value = { "(", "Ljava/util/Collection<", "Ljava/lang/Long;", ">;)", "Lrx/Observable<", "Ljava/util/Map<", "Ljava/lang/Long;", "Ljava/lang/Integer;", ">;>;" } .end annotation if-eqz p1, :cond_0 invoke-virtual {p0}, Lcom/discord/stores/StoreUserRelationships;->get()Lrx/Observable; move-result-object v0 new-instance v1, Lcom/discord/stores/StoreUserRelationships$get$1; invoke-direct {v1, p1}, Lcom/discord/stores/StoreUserRelationships$get$1;->(Ljava/util/Collection;)V invoke-virtual {v0, v1}, Lrx/Observable;->f(Le0/l/i;)Lrx/Observable; move-result-object p1 invoke-virtual {p1}, Lrx/Observable;->a()Lrx/Observable; move-result-object p1 const-string v0, "get()\n .map { i\u2026 .distinctUntilChanged()" invoke-static {p1, v0}, Lw/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V return-object p1 :cond_0 const-string p1, "userIds" invoke-static {p1}, Lw/u/b/j;->a(Ljava/lang/String;)V const/4 p1, 0x0 throw p1 .end method .method public final getForType(I)Lrx/Observable; .locals 2 .annotation system Ldalvik/annotation/Signature; value = { "(I)", "Lrx/Observable<", "Ljava/util/Map<", "Ljava/lang/Long;", "Ljava/lang/Integer;", ">;>;" } .end annotation invoke-virtual {p0}, Lcom/discord/stores/StoreUserRelationships;->get()Lrx/Observable; move-result-object v0 new-instance v1, Lcom/discord/stores/StoreUserRelationships$getForType$1; invoke-direct {v1, p1}, Lcom/discord/stores/StoreUserRelationships$getForType$1;->(I)V invoke-virtual {v0, v1}, Lrx/Observable;->f(Le0/l/i;)Lrx/Observable; move-result-object p1 invoke-virtual {p1}, Lrx/Observable;->a()Lrx/Observable; move-result-object p1 const-string v0, "get()\n .map { r\u2026 .distinctUntilChanged()" invoke-static {p1, v0}, Lw/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V return-object p1 .end method .method public final getPendingCount()Lrx/Observable; .locals 2 .annotation system Ldalvik/annotation/Signature; value = { "()", "Lrx/Observable<", "Ljava/lang/Integer;", ">;" } .end annotation invoke-virtual {p0}, Lcom/discord/stores/StoreUserRelationships;->get()Lrx/Observable; move-result-object v0 sget-object v1, Lcom/discord/stores/StoreUserRelationships$getPendingCount$1;->INSTANCE:Lcom/discord/stores/StoreUserRelationships$getPendingCount$1; invoke-virtual {v0, v1}, Lrx/Observable;->f(Le0/l/i;)Lrx/Observable; move-result-object v0 invoke-virtual {v0}, Lrx/Observable;->a()Lrx/Observable; move-result-object v0 const-string v1, "get()\n .map { r\u2026 .distinctUntilChanged()" invoke-static {v0, v1}, Lw/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V return-object v0 .end method .method public final getRelationships$app_productionDiscordExternalRelease()Ljava/util/HashMap; .locals 1 .annotation system Ldalvik/annotation/Signature; value = { "()", "Ljava/util/HashMap<", "Ljava/lang/Long;", "Ljava/lang/Integer;", ">;" } .end annotation iget-object v0, p0, Lcom/discord/stores/StoreUserRelationships;->relationships:Ljava/util/HashMap; return-object v0 .end method .method public final handleConnectionOpen(Lcom/discord/models/domain/ModelPayload;)V .locals 5 .annotation runtime Lcom/discord/stores/StoreThread; .end annotation if-eqz p1, :cond_1 iget-object v0, p0, Lcom/discord/stores/StoreUserRelationships;->relationships:Ljava/util/HashMap; invoke-virtual {v0}, Ljava/util/HashMap;->clear()V invoke-virtual {p1}, Lcom/discord/models/domain/ModelPayload;->getRelationships()Ljava/util/List; move-result-object p1 const-string v0, "payload\n .relationships" invoke-static {p1, v0}, Lw/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V iget-object v0, p0, Lcom/discord/stores/StoreUserRelationships;->relationships:Ljava/util/HashMap; invoke-interface {p1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator; move-result-object p1 :goto_0 invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z move-result v1 if-eqz v1, :cond_0 invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v1 check-cast v1, Lcom/discord/models/domain/ModelUserRelationship; const-string v2, "it" invoke-static {v1, v2}, Lw/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V invoke-virtual {v1}, Lcom/discord/models/domain/ModelUserRelationship;->getId()J move-result-wide v3 invoke-static {v3, v4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long; move-result-object v3 invoke-static {v1, v2}, Lw/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V invoke-virtual {v1}, Lcom/discord/models/domain/ModelUserRelationship;->getType()I move-result v1 invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object v1 invoke-interface {v0, v3, v1}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; goto :goto_0 :cond_0 const/4 p1, 0x1 iput-boolean p1, p0, Lcom/discord/stores/StoreUserRelationships;->isDirty:Z return-void :cond_1 const-string p1, "payload" invoke-static {p1}, Lw/u/b/j;->a(Ljava/lang/String;)V const/4 p1, 0x0 throw p1 .end method .method public final handleRelationshipAdd(Lcom/discord/models/domain/ModelUserRelationship;)V .locals 3 .annotation runtime Lcom/discord/stores/StoreThread; .end annotation if-eqz p1, :cond_2 iget-object v0, p0, Lcom/discord/stores/StoreUserRelationships;->relationships:Ljava/util/HashMap; invoke-virtual {p1}, Lcom/discord/models/domain/ModelUserRelationship;->getId()J move-result-wide v1 invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long; move-result-object v1 invoke-virtual {v0, v1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v0 check-cast v0, Ljava/lang/Integer; invoke-virtual {p1}, Lcom/discord/models/domain/ModelUserRelationship;->getType()I move-result v1 if-nez v0, :cond_0 goto :goto_0 :cond_0 invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I move-result v0 if-eq v0, v1, :cond_1 :goto_0 iget-object v0, p0, Lcom/discord/stores/StoreUserRelationships;->relationships:Ljava/util/HashMap; invoke-virtual {p1}, Lcom/discord/models/domain/ModelUserRelationship;->getId()J move-result-wide v1 invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long; move-result-object v1 invoke-virtual {p1}, Lcom/discord/models/domain/ModelUserRelationship;->getType()I move-result p1 invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer; move-result-object p1 invoke-interface {v0, v1, p1}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; const/4 p1, 0x1 iput-boolean p1, p0, Lcom/discord/stores/StoreUserRelationships;->isDirty:Z :cond_1 return-void :cond_2 const-string p1, "relationship" invoke-static {p1}, Lw/u/b/j;->a(Ljava/lang/String;)V const/4 p1, 0x0 throw p1 .end method .method public final handleRelationshipRemove(Lcom/discord/models/domain/ModelUserRelationship;)V .locals 3 .annotation runtime Lcom/discord/stores/StoreThread; .end annotation if-eqz p1, :cond_2 iget-object v0, p0, Lcom/discord/stores/StoreUserRelationships;->relationships:Ljava/util/HashMap; invoke-virtual {p1}, Lcom/discord/models/domain/ModelUserRelationship;->getId()J move-result-wide v1 invoke-static {v1, v2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long; move-result-object p1 invoke-virtual {v0, p1}, Ljava/util/HashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object; move-result-object p1 if-nez p1, :cond_1 iget-boolean p1, p0, Lcom/discord/stores/StoreUserRelationships;->isDirty:Z if-eqz p1, :cond_0 goto :goto_0 :cond_0 const/4 p1, 0x0 goto :goto_1 :cond_1 :goto_0 const/4 p1, 0x1 :goto_1 iput-boolean p1, p0, Lcom/discord/stores/StoreUserRelationships;->isDirty:Z return-void :cond_2 const-string p1, "relationship" invoke-static {p1}, Lw/u/b/j;->a(Ljava/lang/String;)V const/4 p1, 0x0 throw p1 .end method .method public onDispatchEnded()V .locals 5 iget-boolean v0, p0, Lcom/discord/stores/StoreUserRelationships;->isDirty:Z const/4 v1, 0x0 if-eqz v0, :cond_0 iget-object v0, p0, Lcom/discord/stores/StoreUserRelationships;->relationshipsPersister:Lcom/discord/utilities/persister/Persister; new-instance v2, Ljava/util/HashMap; iget-object v3, p0, Lcom/discord/stores/StoreUserRelationships;->relationships:Ljava/util/HashMap; invoke-direct {v2, v3}, Ljava/util/HashMap;->(Ljava/util/Map;)V const/4 v3, 0x2 const/4 v4, 0x0 invoke-static {v0, v2, v1, v3, v4}, Lcom/discord/utilities/persister/Persister;->set$default(Lcom/discord/utilities/persister/Persister;Ljava/lang/Object;ZILjava/lang/Object;)Ljava/lang/Object; :cond_0 iput-boolean v1, p0, Lcom/discord/stores/StoreUserRelationships;->isDirty:Z return-void .end method .method public final requestAllRelationships()V .locals 9 sget-object v0, Lcom/discord/utilities/rest/RestAPI;->Companion:Lcom/discord/utilities/rest/RestAPI$Companion; invoke-virtual {v0}, Lcom/discord/utilities/rest/RestAPI$Companion;->getApi()Lcom/discord/utilities/rest/RestAPI; move-result-object v0 invoke-virtual {v0}, Lcom/discord/utilities/rest/RestAPI;->getRelationships()Lrx/Observable; move-result-object v0 const/4 v1, 0x0 const/4 v2, 0x1 invoke-static {v1, v2}, Le/a/b/k;->a(ZI)Lrx/Observable$c; move-result-object v1 invoke-virtual {v0, v1}, Lrx/Observable;->a(Lrx/Observable$c;)Lrx/Observable; move-result-object v0 sget-object v1, Lcom/discord/stores/StoreUserRelationships$requestAllRelationships$1;->INSTANCE:Lcom/discord/stores/StoreUserRelationships$requestAllRelationships$1; invoke-virtual {v0, v1}, Lrx/Observable;->g(Le0/l/i;)Lrx/Observable; move-result-object v0 sget-object v1, Le/a/b/k;->a:Le/a/b/k; new-instance v2, Lcom/discord/stores/StoreUserRelationships$requestAllRelationships$2; invoke-direct {v2, p0}, Lcom/discord/stores/StoreUserRelationships$requestAllRelationships$2;->(Lcom/discord/stores/StoreUserRelationships;)V const-string v3, "requestAllRelationships" const/4 v4, 0x0 const/4 v5, 0x0 const/4 v6, 0x0 const/4 v7, 0x0 const/16 v8, 0x3c invoke-static/range {v1 .. v8}, Le/a/b/k;->a(Le/a/b/k;Lkotlin/jvm/functions/Function1;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Landroid/content/Context;Lkotlin/jvm/functions/Function0;I)Lrx/Observable$c; move-result-object v1 invoke-virtual {v0, v1}, Lrx/Observable;->a(Lrx/Observable$c;)Lrx/Observable; return-void .end method