]> nmode's Git Repositories - signal-cli/blobdiff - lib/src/main/java/org/asamk/signal/manager/api/MessageEnvelope.java
Reformat files
[signal-cli] / lib / src / main / java / org / asamk / signal / manager / api / MessageEnvelope.java
index c964281fa2592210853816aedea54559fca4e72c..5598d438523503b74711a2fe3dc18849817dac18 100644 (file)
@@ -338,7 +338,8 @@ public record MessageEnvelope(
             }
 
             static Attachment from(
-                    SignalServiceDataMessage.Quote.QuotedAttachment a, final AttachmentFileProvider fileProvider
+                    SignalServiceDataMessage.Quote.QuotedAttachment a,
+                    final AttachmentFileProvider fileProvider
             ) {
                 return new Attachment(Optional.empty(),
                         Optional.empty(),
@@ -390,7 +391,7 @@ public record MessageEnvelope(
             }
 
             public record Name(
-                    Optional<String> display,
+                    Optional<String> nickname,
                     Optional<String> given,
                     Optional<String> family,
                     Optional<String> prefix,
@@ -399,7 +400,7 @@ public record MessageEnvelope(
             ) {
 
                 static Name from(org.whispersystems.signalservice.api.messages.shared.SharedContact.Name name) {
-                    return new Name(name.getDisplay(),
+                    return new Name(name.getNickname(),
                             name.getGiven(),
                             name.getFamily(),
                             name.getPrefix(),
@@ -481,7 +482,7 @@ public record MessageEnvelope(
             ) {
 
                 static Address from(org.whispersystems.signalservice.api.messages.shared.SharedContact.PostalAddress address) {
-                    return new Address(Address.Type.from(address.getType()),
+                    return new Address(Type.from(address.getType()),
                             address.getLabel(),
                             address.getStreet(),
                             address.getPobox(),
@@ -510,9 +511,7 @@ public record MessageEnvelope(
 
         public record Preview(String title, String description, long date, String url, Optional<Attachment> image) {
 
-            static Preview from(
-                    SignalServicePreview preview, final AttachmentFileProvider fileProvider
-            ) {
+            static Preview from(SignalServicePreview preview, final AttachmentFileProvider fileProvider) {
                 return new Preview(preview.getTitle(),
                         preview.getDescription(),
                         preview.getDate(),
@@ -690,7 +689,9 @@ public record MessageEnvelope(
                 DELETE,
                 BLOCK,
                 BLOCK_AND_DELETE,
-                UNBLOCK_AND_ACCEPT;
+                UNBLOCK_AND_ACCEPT,
+                SPAM,
+                BLOCK_AND_SPAM;
 
                 static Type from(MessageRequestResponseMessage.Type type) {
                     return switch (type) {
@@ -700,6 +701,8 @@ public record MessageEnvelope(
                         case BLOCK -> BLOCK;
                         case BLOCK_AND_DELETE -> BLOCK_AND_DELETE;
                         case UNBLOCK_AND_ACCEPT -> UNBLOCK_AND_ACCEPT;
+                        case SPAM -> SPAM;
+                        case BLOCK_AND_SPAM -> BLOCK_AND_SPAM;
                     };
                 }
             }
@@ -828,9 +831,7 @@ public record MessageEnvelope(
             Optional<TextAttachment> textAttachment
     ) {
 
-        public static Story from(
-                SignalServiceStoryMessage storyMessage, final AttachmentFileProvider fileProvider
-        ) {
+        public static Story from(SignalServiceStoryMessage storyMessage, final AttachmentFileProvider fileProvider) {
             return new Story(storyMessage.getAllowsReplies().orElse(false),
                     storyMessage.getGroupContext().map(c -> GroupUtils.getGroupIdV2(c.getMasterKey())),
                     storyMessage.getFileAttachment().map(f -> Data.Attachment.from(f, fileProvider)),
@@ -848,7 +849,8 @@ public record MessageEnvelope(
         ) {
 
             static TextAttachment from(
-                    SignalServiceTextAttachment textAttachment, final AttachmentFileProvider fileProvider
+                    SignalServiceTextAttachment textAttachment,
+                    final AttachmentFileProvider fileProvider
             ) {
                 return new TextAttachment(textAttachment.getText(),
                         textAttachment.getStyle().map(Style::from),