]> nmode's Git Repositories - signal-cli/blobdiff - lib/src/main/java/org/asamk/signal/manager/Manager.java
Output "SharedContacts" field from a SignalDataMessage (#529)
[signal-cli] / lib / src / main / java / org / asamk / signal / manager / Manager.java
index 9661b12c9672011a802fd67561b8b3653be4a036..80ff4e71f622bf8d4b6a69b70dba028a5b8d96a7 100644 (file)
@@ -122,6 +122,7 @@ import org.whispersystems.signalservice.api.messages.multidevice.SentTranscriptM
 import org.whispersystems.signalservice.api.messages.multidevice.SignalServiceSyncMessage;
 import org.whispersystems.signalservice.api.messages.multidevice.StickerPackOperationMessage;
 import org.whispersystems.signalservice.api.messages.multidevice.VerifiedMessage;
+import org.whispersystems.signalservice.api.messages.shared.SharedContact;
 import org.whispersystems.signalservice.api.profiles.ProfileAndCredential;
 import org.whispersystems.signalservice.api.profiles.SignalServiceProfile;
 import org.whispersystems.signalservice.api.push.SignalServiceAddress;
@@ -1553,9 +1554,18 @@ public class Manager implements Closeable {
                 }
             }
         }
-        if (message.getAttachments().isPresent() && !ignoreAttachments) {
-            for (SignalServiceAttachment attachment : message.getAttachments().get()) {
-                downloadAttachment(attachment);
+        if (!ignoreAttachments) {
+            if (message.getAttachments().isPresent()) {
+                for (SignalServiceAttachment attachment : message.getAttachments().get()) {
+                    downloadAttachment(attachment);
+                }
+            }
+            if (message.getSharedContacts().isPresent()) {
+                for (SharedContact contact : message.getSharedContacts().get()) {
+                    if (contact.getAvatar().isPresent()) {
+                        downloadAttachment(contact.getAvatar().get().getAttachment());
+                    }
+                }
             }
         }
         if (message.getProfileKey().isPresent() && message.getProfileKey().get().length == 32) {