187 lines
8.2 KiB
Java
187 lines
8.2 KiB
Java
package com.discord.utilities.messagesend;
|
|
|
|
import com.discord.api.activity.Activity;
|
|
import com.discord.api.message.allowedmentions.MessageAllowedMentions;
|
|
import com.discord.models.commands.ApplicationCommandLocalSendData;
|
|
import com.discord.models.message.Message;
|
|
import com.discord.utilities.messagesend.MessageResult;
|
|
import com.discord.utilities.rest.SendUtils;
|
|
import com.lytefast.flexinput.model.Attachment;
|
|
import d0.z.d.m;
|
|
import d0.z.d.o;
|
|
import java.util.List;
|
|
import kotlin.Unit;
|
|
import kotlin.jvm.functions.Function1;
|
|
import kotlin.jvm.functions.Function2;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
/* compiled from: MessageQueue.kt */
|
|
public abstract class MessageRequest {
|
|
private final long attemptTimestamp;
|
|
private final Function2<MessageResult, Boolean, Unit> onCompleted;
|
|
private final String requestId;
|
|
|
|
/* compiled from: MessageQueue.kt */
|
|
public static final class Edit extends MessageRequest {
|
|
private final MessageAllowedMentions allowedMentions;
|
|
private final long channelId;
|
|
private final String content;
|
|
private final long messageId;
|
|
|
|
/* compiled from: MessageQueue.kt */
|
|
/* renamed from: com.discord.utilities.messagesend.MessageRequest$Edit$1 reason: invalid class name */
|
|
public static final class AnonymousClass1 extends o implements Function2<MessageResult, Boolean, Unit> {
|
|
public static final AnonymousClass1 INSTANCE = new AnonymousClass1();
|
|
|
|
public AnonymousClass1() {
|
|
super(2);
|
|
}
|
|
|
|
/* 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, java.lang.Object] */
|
|
@Override // kotlin.jvm.functions.Function2
|
|
public /* bridge */ /* synthetic */ Unit invoke(MessageResult messageResult, Boolean bool) {
|
|
invoke(messageResult, bool.booleanValue());
|
|
return Unit.a;
|
|
}
|
|
|
|
public final void invoke(MessageResult messageResult, boolean z2) {
|
|
m.checkNotNullParameter(messageResult, "<anonymous parameter 0>");
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public Edit(long j, String str, long j2, MessageAllowedMentions messageAllowedMentions, long j3) {
|
|
super(String.valueOf(j2), AnonymousClass1.INSTANCE, j3, null);
|
|
m.checkNotNullParameter(str, "content");
|
|
this.channelId = j;
|
|
this.content = str;
|
|
this.messageId = j2;
|
|
this.allowedMentions = messageAllowedMentions;
|
|
}
|
|
|
|
public final MessageAllowedMentions getAllowedMentions() {
|
|
return this.allowedMentions;
|
|
}
|
|
|
|
public final long getChannelId() {
|
|
return this.channelId;
|
|
}
|
|
|
|
public final String getContent() {
|
|
return this.content;
|
|
}
|
|
|
|
public final long getMessageId() {
|
|
return this.messageId;
|
|
}
|
|
}
|
|
|
|
/* compiled from: MessageQueue.kt */
|
|
public static final class Send extends MessageRequest {
|
|
private final Activity activity;
|
|
private final List<Attachment<?>> attachments;
|
|
private final Message message;
|
|
private final Function1<SendUtils.SendPayload.Preprocessing, Unit> onPreprocessing;
|
|
private final Function1<List<SendUtils.FileUpload>, Unit> onProgress;
|
|
|
|
/* JADX DEBUG: Multi-variable search result rejected for r10v0, resolved type: java.util.List<? extends com.lytefast.flexinput.model.Attachment<?>> */
|
|
/* JADX DEBUG: Multi-variable search result rejected for r12v0, resolved type: kotlin.jvm.functions.Function1<? super com.discord.utilities.rest.SendUtils$SendPayload$Preprocessing, kotlin.Unit> */
|
|
/* JADX DEBUG: Multi-variable search result rejected for r13v0, resolved type: kotlin.jvm.functions.Function1<? super java.util.List<com.discord.utilities.rest.SendUtils$FileUpload>, kotlin.Unit> */
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
/* JADX WARNING: Illegal instructions before constructor call */
|
|
public Send(Message message, Activity activity, List<? extends Attachment<?>> list, Function2<? super MessageResult, ? super Boolean, Unit> function2, Function1<? super SendUtils.SendPayload.Preprocessing, Unit> function1, Function1<? super List<SendUtils.FileUpload>, Unit> function12, long j) {
|
|
super(r2, function2, j, null);
|
|
m.checkNotNullParameter(message, "message");
|
|
m.checkNotNullParameter(function2, "onCompleted");
|
|
m.checkNotNullParameter(function1, "onPreprocessing");
|
|
m.checkNotNullParameter(function12, "onProgress");
|
|
String nonce = message.getNonce();
|
|
m.checkNotNull(nonce);
|
|
this.message = message;
|
|
this.activity = activity;
|
|
this.attachments = list;
|
|
this.onPreprocessing = function1;
|
|
this.onProgress = function12;
|
|
}
|
|
|
|
public final Activity getActivity() {
|
|
return this.activity;
|
|
}
|
|
|
|
public final List<Attachment<?>> getAttachments() {
|
|
return this.attachments;
|
|
}
|
|
|
|
public final Message getMessage() {
|
|
return this.message;
|
|
}
|
|
|
|
public final Function1<SendUtils.SendPayload.Preprocessing, Unit> getOnPreprocessing() {
|
|
return this.onPreprocessing;
|
|
}
|
|
|
|
public final Function1<List<SendUtils.FileUpload>, Unit> getOnProgress() {
|
|
return this.onProgress;
|
|
}
|
|
|
|
public final MessageResult.ValidationError validateMessage() {
|
|
if (this.message.getActivity() != null) {
|
|
List<Attachment<?>> list = this.attachments;
|
|
if (!(list == null || list.isEmpty())) {
|
|
return new MessageResult.ValidationError("Cannot send attachments with activity action");
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
}
|
|
|
|
/* compiled from: MessageQueue.kt */
|
|
public static final class SendApplicationCommand extends MessageRequest {
|
|
private final ApplicationCommandLocalSendData applicationCommandSendData;
|
|
private final com.discord.api.message.Message message;
|
|
|
|
/* JADX WARNING: Illegal instructions before constructor call */
|
|
public SendApplicationCommand(com.discord.api.message.Message message, ApplicationCommandLocalSendData applicationCommandLocalSendData, Function2<? super MessageResult, ? super Boolean, Unit> function2, long j) {
|
|
super(r0 == null ? String.valueOf(applicationCommandLocalSendData.getNonce()) : r0, function2, j, null);
|
|
m.checkNotNullParameter(message, "message");
|
|
m.checkNotNullParameter(applicationCommandLocalSendData, "applicationCommandSendData");
|
|
m.checkNotNullParameter(function2, "onCompleted");
|
|
String v = message.v();
|
|
this.message = message;
|
|
this.applicationCommandSendData = applicationCommandLocalSendData;
|
|
}
|
|
|
|
public final ApplicationCommandLocalSendData getApplicationCommandSendData() {
|
|
return this.applicationCommandSendData;
|
|
}
|
|
|
|
public final com.discord.api.message.Message getMessage() {
|
|
return this.message;
|
|
}
|
|
}
|
|
|
|
/* JADX DEBUG: Multi-variable search result rejected for r2v0, resolved type: kotlin.jvm.functions.Function2<? super com.discord.utilities.messagesend.MessageResult, ? super java.lang.Boolean, kotlin.Unit> */
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
private MessageRequest(String str, Function2<? super MessageResult, ? super Boolean, Unit> function2, long j) {
|
|
this.requestId = str;
|
|
this.onCompleted = function2;
|
|
this.attemptTimestamp = j;
|
|
}
|
|
|
|
public /* synthetic */ MessageRequest(String str, Function2 function2, long j, DefaultConstructorMarker defaultConstructorMarker) {
|
|
this(str, function2, j);
|
|
}
|
|
|
|
public final long getAttemptTimestamp() {
|
|
return this.attemptTimestamp;
|
|
}
|
|
|
|
public final Function2<MessageResult, Boolean, Unit> getOnCompleted() {
|
|
return this.onCompleted;
|
|
}
|
|
|
|
public final String getRequestId() {
|
|
return this.requestId;
|
|
}
|
|
}
|