121 lines
5.5 KiB
Java
121 lines
5.5 KiB
Java
package com.discord.stores;
|
|
|
|
import android.content.SharedPreferences;
|
|
import c.d.b.a.a;
|
|
import com.discord.api.premium.OutboundPromotion;
|
|
import d0.c0.c;
|
|
import d0.d0.f;
|
|
import d0.z.d.m;
|
|
import j0.k.b;
|
|
import j0.l.e.j;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.concurrent.Callable;
|
|
import java.util.concurrent.TimeUnit;
|
|
import kotlin.ranges.LongRange;
|
|
import rx.Observable;
|
|
import rx.functions.Action1;
|
|
/* compiled from: StoreOutboundPromotions.kt */
|
|
public final class StoreOutboundPromotions$handleConnectionOpen$2<T, R> implements b<List<? extends OutboundPromotion>, Observable<? extends List<? extends OutboundPromotion>>> {
|
|
public final /* synthetic */ StoreOutboundPromotions this$0;
|
|
|
|
/* compiled from: StoreOutboundPromotions.kt */
|
|
/* renamed from: com.discord.stores.StoreOutboundPromotions$handleConnectionOpen$2$1 reason: invalid class name */
|
|
public static final class AnonymousClass1<V> implements Callable<List<? extends OutboundPromotion>> {
|
|
public final /* synthetic */ List $activePromos;
|
|
public final /* synthetic */ StoreOutboundPromotions$handleConnectionOpen$2 this$0;
|
|
|
|
public AnonymousClass1(StoreOutboundPromotions$handleConnectionOpen$2 storeOutboundPromotions$handleConnectionOpen$2, List list) {
|
|
this.this$0 = storeOutboundPromotions$handleConnectionOpen$2;
|
|
this.$activePromos = list;
|
|
}
|
|
|
|
/* Return type fixed from 'java.util.List<com.discord.api.premium.OutboundPromotion>' to match base method */
|
|
@Override // java.util.concurrent.Callable
|
|
public final List<? extends OutboundPromotion> call() {
|
|
long j = this.this$0.this$0.getPrefs().getLong("CONSUMED_ENTITLEMENT_CODE", -1);
|
|
List list = this.$activePromos;
|
|
ArrayList S = a.S(list, "activePromos");
|
|
for (T t : list) {
|
|
if (t.b() != j) {
|
|
S.add(t);
|
|
}
|
|
}
|
|
return S;
|
|
}
|
|
}
|
|
|
|
/* compiled from: StoreOutboundPromotions.kt */
|
|
/* renamed from: com.discord.stores.StoreOutboundPromotions$handleConnectionOpen$2$2 reason: invalid class name */
|
|
public static final class AnonymousClass2<V> implements Callable<Long> {
|
|
public final /* synthetic */ StoreOutboundPromotions$handleConnectionOpen$2 this$0;
|
|
|
|
public AnonymousClass2(StoreOutboundPromotions$handleConnectionOpen$2 storeOutboundPromotions$handleConnectionOpen$2) {
|
|
this.this$0 = storeOutboundPromotions$handleConnectionOpen$2;
|
|
}
|
|
|
|
@Override // java.util.concurrent.Callable
|
|
public final Long call() {
|
|
return Long.valueOf(StoreOutboundPromotions.access$getStubConsumedPromoId$p(this.this$0.this$0));
|
|
}
|
|
}
|
|
|
|
/* compiled from: StoreOutboundPromotions.kt */
|
|
/* renamed from: com.discord.stores.StoreOutboundPromotions$handleConnectionOpen$2$3 reason: invalid class name */
|
|
public static final class AnonymousClass3<T> implements Action1<Long> {
|
|
public final /* synthetic */ StoreOutboundPromotions$handleConnectionOpen$2 this$0;
|
|
|
|
public AnonymousClass3(StoreOutboundPromotions$handleConnectionOpen$2 storeOutboundPromotions$handleConnectionOpen$2) {
|
|
this.this$0 = storeOutboundPromotions$handleConnectionOpen$2;
|
|
}
|
|
|
|
public final void call(Long l) {
|
|
SharedPreferences.Editor edit = this.this$0.this$0.getPrefs().edit();
|
|
m.checkExpressionValueIsNotNull(edit, "editor");
|
|
m.checkNotNullExpressionValue(l, "consumedPromoId");
|
|
edit.putLong("CONSUMED_ENTITLEMENT_CODE", l.longValue());
|
|
edit.apply();
|
|
}
|
|
}
|
|
|
|
/* compiled from: StoreOutboundPromotions.kt */
|
|
/* renamed from: com.discord.stores.StoreOutboundPromotions$handleConnectionOpen$2$4 reason: invalid class name */
|
|
public static final class AnonymousClass4<T, R> implements b<Long, List<? extends OutboundPromotion>> {
|
|
public final /* synthetic */ List $activePromos;
|
|
|
|
public AnonymousClass4(List list) {
|
|
this.$activePromos = list;
|
|
}
|
|
|
|
public final List<OutboundPromotion> call(Long l) {
|
|
List list = this.$activePromos;
|
|
ArrayList S = a.S(list, "activePromos");
|
|
for (T t : list) {
|
|
if (l == null || t.b() != l.longValue()) {
|
|
S.add(t);
|
|
}
|
|
}
|
|
return S;
|
|
}
|
|
}
|
|
|
|
public StoreOutboundPromotions$handleConnectionOpen$2(StoreOutboundPromotions storeOutboundPromotions) {
|
|
this.this$0 = storeOutboundPromotions;
|
|
}
|
|
|
|
/* 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<? extends List<? extends OutboundPromotion>> call(List<? extends OutboundPromotion> list) {
|
|
return call((List<OutboundPromotion>) list);
|
|
}
|
|
|
|
public final Observable<? extends List<OutboundPromotion>> call(List<OutboundPromotion> list) {
|
|
if (this.this$0.getPrefs().contains("CONSUMED_ENTITLEMENT_CODE")) {
|
|
return Observable.D(new AnonymousClass1(this, list));
|
|
}
|
|
m.checkNotNullExpressionValue(list, "activePromos");
|
|
return list.isEmpty() ^ true ? Observable.D(new AnonymousClass2(this)).r(f.random(new LongRange(0, 2000), c.b), TimeUnit.MILLISECONDS, j0.p.a.a()).Y(j0.p.a.a()).u(new AnonymousClass3(this)).G(new AnonymousClass4(list)) : new j(list);
|
|
}
|
|
}
|