package org.asamk.signal.manager.api;
import java.util.List;
+import java.util.Optional;
-public class Message {
+public record Message(
+ String messageText,
+ List<String> attachments,
+ boolean viewOnce,
+ List<Mention> mentions,
+ Optional<Quote> quote,
+ Optional<Sticker> sticker,
+ List<Preview> previews,
+ Optional<StoryReply> storyReply,
+ List<TextStyle> textStyles
+) {
- private final String messageText;
- private final List<String> attachments;
+ public record Mention(RecipientIdentifier.Single recipient, int start, int length) {}
- public Message(final String messageText, final List<String> attachments) {
- this.messageText = messageText;
- this.attachments = attachments;
- }
+ public record Quote(
+ long timestamp,
+ RecipientIdentifier.Single author,
+ String message,
+ List<Mention> mentions,
+ List<TextStyle> textStyles,
+ List<Attachment> attachments
+ ) {
- public String getMessageText() {
- return messageText;
+ public record Attachment(String contentType, String filename, String preview) {}
}
- public List<String> getAttachments() {
- return attachments;
- }
+ public record Sticker(byte[] packId, int stickerId) {}
+
+ public record Preview(String url, String title, String description, Optional<String> image) {}
+
+ public record StoryReply(long timestamp, RecipientIdentifier.Single author) {}
}