package com.discord.utilities.rest; import com.airbnb.lottie.parser.AnimatableValueParser; import com.discord.api.channel.Channel; import com.discord.models.user.User; import com.discord.restapi.RestAPIParams; import com.discord.stores.StoreStream; import com.discord.utilities.rx.ObservableExtensionsKt; import j0.k.b; import j0.l.e.j; import java.util.Iterator; import java.util.Map; import rx.Observable; import rx.functions.Action1; /* compiled from: RestAPI.kt */ public final class RestAPI$createOrFetchDM$1 implements b, Observable> { public final /* synthetic */ long $userId; public final /* synthetic */ RestAPI this$0; /* compiled from: RestAPI.kt */ /* renamed from: com.discord.utilities.rest.RestAPI$createOrFetchDM$1$1 reason: invalid class name */ public static final class AnonymousClass1 implements Action1 { public static final AnonymousClass1 INSTANCE = new AnonymousClass1(); public final void call(Channel channel) { StoreStream.Companion.getGatewaySocket().getChannelCreateOrUpdate().j.onNext(channel); } } public RestAPI$createOrFetchDM$1(RestAPI restAPI, long j) { this.this$0 = restAPI; this.$userId = j; } /* Return type fixed from 'java.lang.Object' to match base method */ /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */ @Override // j0.k.b public /* bridge */ /* synthetic */ Observable call(Map map) { return call((Map) map); } public final Observable call(Map map) { T t; boolean z2; Iterator it = map.values().iterator(); while (true) { if (!it.hasNext()) { t = null; break; } t = it.next(); User v0 = AnimatableValueParser.v0(t); if (v0 == null || v0.getId() != this.$userId) { z2 = false; continue; } else { z2 = true; continue; } if (z2) { break; } } T t2 = t; return t2 != null ? new j(t2) : ObservableExtensionsKt.restSubscribeOn$default(RestAPI.access$get_api$p(this.this$0).userCreateChannel(new RestAPIParams.CreateChannel(this.$userId)), false, 1, null).t(AnonymousClass1.INSTANCE); } }