2021-06-27 20:44:35 +00:00
|
|
|
package com.discord.utilities.messagesend;
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
import com.discord.utilities.messagesend.MessageResult;
|
|
|
|
import com.discord.utilities.rx.ObservableExtensionsKt;
|
|
|
|
import d0.z.d.m;
|
|
|
|
import d0.z.d.o;
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
import kotlin.Unit;
|
|
|
|
import kotlin.jvm.functions.Function0;
|
|
|
|
import kotlin.jvm.functions.Function1;
|
|
|
|
import rx.Observable;
|
|
|
|
import rx.Subscription;
|
|
|
|
/* compiled from: MessageQueue.kt */
|
|
|
|
public final class MessageQueue$processNextRequest$listener$1 extends o implements Function1<MessageResult, Unit> {
|
|
|
|
public final /* synthetic */ MessageRequest $request;
|
|
|
|
public final /* synthetic */ MessageQueue this$0;
|
|
|
|
|
|
|
|
/* compiled from: MessageQueue.kt */
|
|
|
|
/* renamed from: com.discord.utilities.messagesend.MessageQueue$processNextRequest$listener$1$1 reason: invalid class name */
|
|
|
|
public static final class AnonymousClass1 extends o implements Function1<Long, Unit> {
|
|
|
|
public final /* synthetic */ MessageQueue$processNextRequest$listener$1 this$0;
|
|
|
|
|
|
|
|
/* compiled from: MessageQueue.kt */
|
|
|
|
/* renamed from: com.discord.utilities.messagesend.MessageQueue$processNextRequest$listener$1$1$1 reason: invalid class name */
|
|
|
|
public static final class AnonymousClass1 implements Runnable {
|
|
|
|
public final /* synthetic */ AnonymousClass1 this$0;
|
|
|
|
|
|
|
|
public AnonymousClass1(AnonymousClass1 r1) {
|
|
|
|
this.this$0 = r1;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // java.lang.Runnable
|
|
|
|
public final void run() {
|
|
|
|
MessageQueue.access$getQueue$p(this.this$0.this$0.this$0).addFirst(this.this$0.this$0.$request);
|
|
|
|
MessageQueue.access$setRetrySubscription$p(this.this$0.this$0.this$0, null);
|
|
|
|
MessageQueue.access$onDrainingCompleted(this.this$0.this$0.this$0);
|
|
|
|
MessageQueue.access$processNextRequest(this.this$0.this$0.this$0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
|
|
public AnonymousClass1(MessageQueue$processNextRequest$listener$1 messageQueue$processNextRequest$listener$1) {
|
|
|
|
super(1);
|
|
|
|
this.this$0 = messageQueue$processNextRequest$listener$1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 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 // kotlin.jvm.functions.Function1
|
|
|
|
public /* bridge */ /* synthetic */ Unit invoke(Long l) {
|
|
|
|
invoke(l);
|
|
|
|
return Unit.a;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void invoke(Long l) {
|
|
|
|
MessageQueue.access$getExecutorService$p(this.this$0.this$0).submit(new AnonymousClass1(this));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: MessageQueue.kt */
|
|
|
|
/* renamed from: com.discord.utilities.messagesend.MessageQueue$processNextRequest$listener$1$2 reason: invalid class name */
|
|
|
|
public static final class AnonymousClass2 extends o implements Function1<Subscription, Unit> {
|
|
|
|
public final /* synthetic */ MessageQueue$processNextRequest$listener$1 this$0;
|
|
|
|
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
|
|
public AnonymousClass2(MessageQueue$processNextRequest$listener$1 messageQueue$processNextRequest$listener$1) {
|
|
|
|
super(1);
|
|
|
|
this.this$0 = messageQueue$processNextRequest$listener$1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 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 // kotlin.jvm.functions.Function1
|
|
|
|
public /* bridge */ /* synthetic */ Unit invoke(Subscription subscription) {
|
|
|
|
invoke(subscription);
|
|
|
|
return Unit.a;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void invoke(Subscription subscription) {
|
|
|
|
m.checkNotNullParameter(subscription, "it");
|
|
|
|
MessageQueue.access$setRetrySubscription$p(this.this$0.this$0, subscription);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: MessageQueue.kt */
|
|
|
|
/* renamed from: com.discord.utilities.messagesend.MessageQueue$processNextRequest$listener$1$3 reason: invalid class name */
|
|
|
|
public static final class AnonymousClass3 implements Runnable {
|
|
|
|
public final /* synthetic */ MessageQueue$processNextRequest$listener$1 this$0;
|
|
|
|
|
|
|
|
/* compiled from: MessageQueue.kt */
|
|
|
|
/* renamed from: com.discord.utilities.messagesend.MessageQueue$processNextRequest$listener$1$3$1 reason: invalid class name */
|
|
|
|
public static final class AnonymousClass1 extends o implements Function0<Unit> {
|
|
|
|
public final /* synthetic */ AnonymousClass3 this$0;
|
|
|
|
|
|
|
|
/* compiled from: MessageQueue.kt */
|
|
|
|
/* renamed from: com.discord.utilities.messagesend.MessageQueue$processNextRequest$listener$1$3$1$1 reason: invalid class name */
|
|
|
|
public static final class AnonymousClass1 implements Runnable {
|
|
|
|
public final /* synthetic */ AnonymousClass1 this$0;
|
|
|
|
|
|
|
|
public AnonymousClass1(AnonymousClass1 r1) {
|
|
|
|
this.this$0 = r1;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // java.lang.Runnable
|
|
|
|
public final void run() {
|
|
|
|
MessageQueue.access$processNextRequest(this.this$0.this$0.this$0.this$0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
|
|
public AnonymousClass1(AnonymousClass3 r1) {
|
|
|
|
super(0);
|
|
|
|
this.this$0 = r1;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // kotlin.jvm.functions.Function0
|
|
|
|
/* renamed from: invoke */
|
|
|
|
public final void mo1invoke() {
|
|
|
|
MessageQueue.access$getExecutorService$p(this.this$0.this$0.this$0).submit(new AnonymousClass1(this));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public AnonymousClass3(MessageQueue$processNextRequest$listener$1 messageQueue$processNextRequest$listener$1) {
|
|
|
|
this.this$0 = messageQueue$processNextRequest$listener$1;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // java.lang.Runnable
|
|
|
|
public final void run() {
|
|
|
|
MessageQueue.access$onDrainingCompleted(this.this$0.this$0);
|
|
|
|
MessageQueue.access$getQueue$p(this.this$0.this$0).addFirst(this.this$0.$request);
|
|
|
|
MessageQueue.access$getNetworkBackoff$p(this.this$0.this$0).fail(new AnonymousClass1(this));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: MessageQueue.kt */
|
|
|
|
/* renamed from: com.discord.utilities.messagesend.MessageQueue$processNextRequest$listener$1$4 reason: invalid class name */
|
|
|
|
public static final class AnonymousClass4 implements Runnable {
|
|
|
|
public final /* synthetic */ MessageResult $result;
|
|
|
|
public final /* synthetic */ MessageQueue$processNextRequest$listener$1 this$0;
|
|
|
|
|
|
|
|
public AnonymousClass4(MessageQueue$processNextRequest$listener$1 messageQueue$processNextRequest$listener$1, MessageResult messageResult) {
|
|
|
|
this.this$0 = messageQueue$processNextRequest$listener$1;
|
|
|
|
this.$result = messageResult;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // java.lang.Runnable
|
|
|
|
public final void run() {
|
|
|
|
MessageQueue.access$onDrainingCompleted(this.this$0.this$0);
|
|
|
|
this.this$0.$request.getOnCompleted().invoke(this.$result, Boolean.valueOf(MessageQueue.access$getQueue$p(this.this$0.this$0).isEmpty()));
|
|
|
|
MessageQueue.access$getNetworkBackoff$p(this.this$0.this$0).succeed();
|
|
|
|
MessageQueue.access$processNextRequest(this.this$0.this$0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
|
|
public MessageQueue$processNextRequest$listener$1(MessageQueue messageQueue, MessageRequest messageRequest) {
|
|
|
|
super(1);
|
|
|
|
this.this$0 = messageQueue;
|
|
|
|
this.$request = messageRequest;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 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 // kotlin.jvm.functions.Function1
|
|
|
|
public /* bridge */ /* synthetic */ Unit invoke(MessageResult messageResult) {
|
|
|
|
invoke(messageResult);
|
|
|
|
return Unit.a;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void invoke(MessageResult messageResult) {
|
|
|
|
m.checkNotNullParameter(messageResult, "result");
|
|
|
|
if (messageResult instanceof MessageResult.RateLimited) {
|
2021-07-03 23:36:06 +00:00
|
|
|
Observable<Long> d02 = Observable.d0(((MessageResult.RateLimited) messageResult).getRetryAfterMs(), TimeUnit.MILLISECONDS);
|
|
|
|
m.checkNotNullExpressionValue(d02, "Observable\n …s, TimeUnit.MILLISECONDS)");
|
|
|
|
ObservableExtensionsKt.appSubscribe$default(d02, this.this$0.getClass(), (Context) null, new AnonymousClass2(this), (Function1) null, (Function0) null, (Function0) null, new AnonymousClass1(this), 58, (Object) null);
|
2021-06-27 20:44:35 +00:00
|
|
|
} else if (messageResult instanceof MessageResult.NetworkFailure) {
|
|
|
|
MessageQueue.access$getExecutorService$p(this.this$0).submit(new AnonymousClass3(this));
|
|
|
|
} else {
|
|
|
|
MessageQueue.access$getExecutorService$p(this.this$0).submit(new AnonymousClass4(this, messageResult));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|