]> nmode's Git Repositories - signal-cli/blobdiff - src/main/java/org/asamk/signal/storage/profiles/SignalProfile.java
Update dependencies
[signal-cli] / src / main / java / org / asamk / signal / storage / profiles / SignalProfile.java
index 71ab60e65cef3d5a28b83b24b8ae0bb4cdb0f490..8c3f38b0edf31de106a1299f0de52dc4b6abde4f 100644 (file)
@@ -1,5 +1,6 @@
 package org.asamk.signal.storage.profiles;
 
+import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.annotation.JsonProperty;
 
 import org.whispersystems.signalservice.api.profiles.SignalServiceProfile;
@@ -23,7 +24,7 @@ public class SignalProfile {
     private final boolean unrestrictedUnidentifiedAccess;
 
     @JsonProperty
-    private final SignalServiceProfile.Capabilities capabilities;
+    private final Capabilities capabilities;
 
     public SignalProfile(final String identityKey, final String name, final File avatarFile, final String unidentifiedAccess, final boolean unrestrictedUnidentifiedAccess, final SignalServiceProfile.Capabilities capabilities) {
         this.identityKey = identityKey;
@@ -31,10 +32,13 @@ public class SignalProfile {
         this.avatarFile = avatarFile;
         this.unidentifiedAccess = unidentifiedAccess;
         this.unrestrictedUnidentifiedAccess = unrestrictedUnidentifiedAccess;
-        this.capabilities = capabilities;
+        this.capabilities = new Capabilities();
+        this.capabilities.storage = capabilities.isStorage();
+        this.capabilities.gv1Migration = capabilities.isGv1Migration();
+        this.capabilities.gv2 = capabilities.isGv2();
     }
 
-    public SignalProfile(@JsonProperty("identityKey") final String identityKey, @JsonProperty("name") final String name, @JsonProperty("unidentifiedAccess") final String unidentifiedAccess, @JsonProperty("unrestrictedUnidentifiedAccess") final boolean unrestrictedUnidentifiedAccess, @JsonProperty("capabilities") final SignalServiceProfile.Capabilities capabilities) {
+    public SignalProfile(@JsonProperty("identityKey") final String identityKey, @JsonProperty("name") final String name, @JsonProperty("unidentifiedAccess") final String unidentifiedAccess, @JsonProperty("unrestrictedUnidentifiedAccess") final boolean unrestrictedUnidentifiedAccess, @JsonProperty("capabilities") final Capabilities capabilities) {
         this.identityKey = identityKey;
         this.name = name;
         this.avatarFile = null;
@@ -63,7 +67,7 @@ public class SignalProfile {
         return unrestrictedUnidentifiedAccess;
     }
 
-    public SignalServiceProfile.Capabilities getCapabilities() {
+    public Capabilities getCapabilities() {
         return capabilities;
     }
 
@@ -78,4 +82,19 @@ public class SignalProfile {
                 ", capabilities=" + capabilities +
                 '}';
     }
+
+    public static class Capabilities {
+
+        @JsonIgnore
+        public boolean uuid;
+
+        @JsonProperty
+        public boolean gv2;
+
+        @JsonProperty
+        public boolean storage;
+
+        @JsonProperty
+        public boolean gv1Migration;
+    }
 }