119 lines
3.1 KiB
Java
119 lines
3.1 KiB
Java
package com.discord.models.domain;
|
|
|
|
import androidx.annotation.NonNull;
|
|
|
|
import com.discord.models.messages.LocalAttachment;
|
|
import com.discord.models.sticker.dto.ModelSticker;
|
|
import com.discord.utilities.time.Clock;
|
|
|
|
import java.io.IOException;
|
|
import java.util.LinkedHashMap;
|
|
import java.util.List;
|
|
|
|
import lanchon.dexpatcher.annotation.DexAdd;
|
|
import lanchon.dexpatcher.annotation.DexEdit;
|
|
import lanchon.dexpatcher.annotation.DexIgnore;
|
|
import lanchon.dexpatcher.annotation.DexWrap;
|
|
|
|
@DexEdit
|
|
public class ModelMessage implements Model {
|
|
|
|
@DexIgnore
|
|
public static class Call implements Model {
|
|
|
|
@DexIgnore
|
|
@Override
|
|
public void assignField(JsonReader jsonReader) throws IOException {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
@DexIgnore
|
|
public ModelMessage(
|
|
long id,
|
|
String nonce,
|
|
long channelId,
|
|
int type,
|
|
String content,
|
|
@NonNull ModelUser author,
|
|
List<ModelUser> mentions,
|
|
String timestamp,
|
|
String editedTimestamp,
|
|
List<ModelMessageAttachment> attachments,
|
|
List<ModelMessageEmbed> embeds,
|
|
boolean tts,
|
|
Call call,
|
|
boolean mentionEveryone,
|
|
LinkedHashMap<String, ModelMessageReaction> reactions,
|
|
Boolean pinned,
|
|
Long webhookId,
|
|
ModelApplication application,
|
|
Activity activity,
|
|
boolean hit,
|
|
List<Long> mentionRoles,
|
|
boolean hasLocalUploads,
|
|
Long flags,
|
|
MessageReference messageReference,
|
|
ModelAllowedMentions allowedMentions,
|
|
List<LocalAttachment> localAttachments,
|
|
Long lastManualAttemptTimestamp,
|
|
Long initialAttemptTimestamp,
|
|
Integer num,
|
|
List<ModelSticker> stickers) {
|
|
|
|
}
|
|
|
|
@DexAdd
|
|
private boolean isCTCMessage = false;
|
|
|
|
@DexAdd
|
|
public void setCTCMessage(boolean isCTCMessage) {
|
|
this.isCTCMessage = isCTCMessage;
|
|
}
|
|
|
|
@DexWrap
|
|
public boolean canResend() {
|
|
// Prevent resending of messages from commands that are not public.
|
|
return canResend() && !isCTCMessage;
|
|
}
|
|
|
|
|
|
@DexIgnore
|
|
public static ModelMessage createLocalMessage(
|
|
String content,
|
|
long channelId,
|
|
@NonNull ModelUser author,
|
|
List<ModelUser> mentions,
|
|
boolean z2,
|
|
boolean hasLocalUploads,
|
|
ModelApplication application,
|
|
Activity activity,
|
|
Clock clock,
|
|
List<LocalAttachment> localAttachments,
|
|
Long lastManualAttemptTimestamp,
|
|
Long initialAttemptTimestamp,
|
|
Integer num,
|
|
List<ModelSticker> stickers,
|
|
MessageReference messageReference,
|
|
ModelAllowedMentions allowedMentions) {
|
|
return null;
|
|
}
|
|
|
|
@DexIgnore
|
|
@Override
|
|
public void assignField(JsonReader jsonReader) throws IOException {
|
|
|
|
}
|
|
|
|
@DexIgnore
|
|
public static class MessageReference {
|
|
|
|
}
|
|
|
|
@DexIgnore
|
|
public static class Activity {
|
|
}
|
|
}
|